-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
GAPI: Addition new Color conversion kernels to CPU backend. #18516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1c99c39
to
e93ac18
Compare
24105f9
to
c228da1
Compare
c228da1
to
34900c5
Compare
0b51266
to
86766e9
Compare
@dmatveev please take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rephrase text here and above on the image height. Currently it doesn't read good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, probably simple is
is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
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.