GAPI: Addition new Color conversion kernels to CPU backend.#18516
GAPI: Addition new Color conversion kernels to CPU backend.#18516alalek merged 3 commits intoopencv:masterfrom
Conversation
1c99c39 to
e93ac18
Compare
24105f9 to
c228da1
Compare
c228da1 to
34900c5
Compare
0b51266 to
86766e9
Compare
|
@dmatveev please take a look |
dmatveev
left a comment
There was a problem hiding this comment.
Looks good but please fix comments
| The function converts an input image from I420 color space to BGR. | ||
| The conventional ranges for B, G, and R channel values are 0 to 255. | ||
|
|
||
| Output image must be 8-bit unsigned 3-channel image input_height*2/3 @ref CV_8UC3. |
There was a problem hiding this comment.
I'd rephrase text here and above on the image height. Currently it doesn't read good.
86766e9 to
5f1addb
Compare
|
@dmatveev please take a look. Comment was applied. |
|
@alalek please merge |
| The function converts an input image from BGR color space to RGB. | ||
| The conventional ranges for B, G, and R channel values are 0 to 255. | ||
|
|
||
| Output image must be 8-bit unsigned 3-channel image @ref CV_8UC3. |
There was a problem hiding this comment.
must be
probably this description is not accurate, because output format is defined by "implementation" instead of caller.
There was a problem hiding this comment.
+1, probably simple is is enough
There was a problem hiding this comment.
@alalek Half of the comments in this file phrased as "Output image must be 8-bit unsigned 3-channel image ". For example for YUV2RGB kernel:
/** @brief Converts an image from YUV color space to RGB.
The function converts an input image from YUV color space to RGB.
The conventional ranges for Y, U, and V channel values are 0 to 255.
Output image must be 8-bit unsigned 3-channel image @ref CV_8UC3.
@note Function textual ID is "org.opencv.imgproc.colorconvert.yuv2rgb"
@param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.
@sa RGB2Lab, RGB2YUV
*/
GAPI_EXPORTS GMat YUV2RGB(const GMat& src);
However, for some reason, attention was paid only to my comment. The remaining 14 color conversion kernels will remain with comments formulated as "Output image must be 8-bit unsigned ...". I thought we were fighting for uniformity in the comments. But apparently I was wrong.
|
|
||
| Output image must be 8-bit unsigned 1-channel image. @ref CV_8UC1. | ||
| Width of I420 output image must be the same as width of input image. | ||
| Height of I420 output image must be equal 3/2 from height of input image. |
There was a problem hiding this comment.
3/2 from height
Why is not tuple of Y and UV?
/cc @TolyaTalamanov (implemented drawing over NV12 frames)
There was a problem hiding this comment.
@alalek tuple of Y and UV is what we'll do next, but the current request is to provide a cvtColor-based counterpart.
There was a problem hiding this comment.
Please note that there is no C++ overloads for return type only. So it will be hard to improve that without breaking of existed code.
Just keep in mind.
5f1addb to
45fceee
Compare
GAPI: Addition new Color conversion kernels to CPU backend. * Add BGR2RGB kernel to CPU backend * Add BGR2I420 and RGB2I420 kernels to CPU backend * Add I4202BGR and I4202RGB kernels to CPU backend
Color conversion kernels were added:
Published for review on 7th of October.
@dmatveev please take a look.