opencv/modules
definitelyuncertain a1028efdcf
Merge pull request #24333 from definitelyuncertain:CvtRGB2YUV422
Implement color conversion from RGB to YUV422 family #24333

Related PR for extra: https://github.com/opencv/opencv_extra/pull/1104

Hi,

This patch provides CPU and OpenCL implementations of color conversions from RGB/BGR to YUV422 family (such as UYVY and YUY2).

These features would come in useful for enabling standard RGB images to be supplied as input to algorithms or networks that make use of images in YUV422 format directly (for example, on resource constrained devices working with camera images captured in YUV422).

The code, tests and perf tests are all written following the existing pattern. There is also an example `bin/example_cpp_cvtColor_RGB2YUV422` that loads an image from disk, converts it from BGR to UYVY and then back to BGR, and displays the result as a visual check that the conversion works.

The OpenCL performance for the forward conversion implemented here is the same as the existing backward conversion on my hardware. The CPU implementation, unfortunately, isn't very optimized as I am not yet familiar with the SIMD code.

Please let me know if I need to fix something or can make other modifications.

Thanks!

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
- [x] The feature is well documented and sample code can be built with the project CMake
2023-10-12 10:18:24 +03:00
..
calib3d Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
core Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
dnn dnn: hotfixes for fast gemm (#24315) 2023-10-07 21:48:44 +03:00
features2d Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
flann Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
gapi Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
highgui Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
imgcodecs Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
imgproc Merge pull request #24333 from definitelyuncertain:CvtRGB2YUV422 2023-10-12 10:18:24 +03:00
java Fail Java test suite, execution, if one of test failed. 2023-10-01 18:31:04 +03:00
js Merge pull request #24288 from tailsu:sd/emscripten-3.1.45-fixes 2023-09-19 08:09:18 +03:00
ml Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
objc Backport 5.x: Support for module names that start from digit in ObjC bindings generator. 2023-05-25 11:45:59 +03:00
objdetect Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
photo Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
python Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
stitching Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
ts Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
video Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
videoio Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
world cmake: VERSION_GREATER_EQUAL is not supported in CMake 3.5.1 2022-12-26 17:41:53 +00:00