Skip to content

Commit cb495d9

Browse files
Merge pull request #3967 from gursimarsingh:fastcv_cvtcolor_addition
Added fastcv color conversions #3967 This pull request introduces FastCV-based color conversions: ``` COLOR_YUV2YUV444sp_NV12 //!< FastCV: YCbCr420PseudoPlanar to YCbCr444PseudoPlanar COLOR_YUV2YUV422sp_NV12 //!< FastCV: YCbCr420PseudoPlanar to YCbCr422PseudoPlanar COLOR_YUV422sp2YUV444sp //!< FastCV: YCbCr422PseudoPlanar to YCbCr444PseudoPlanar COLOR_YUV422sp2YUV_NV12 //!< FastCV: YCbCr422PseudoPlanar to YCbCr420PseudoPlanar COLOR_YUV444sp2YUV422sp //!< FastCV: YCbCr444PseudoPlanar to YCbCr422PseudoPlanar COLOR_YUV444sp2YUV_NV12 //!< FastCV: YCbCr444PseudoPlanar to YCbCr420PseudoPlanar COLOR_YUV2RGB565_NV12 //!< FastCV: YCbCr420PseudoPlanar to RGB565 COLOR_YUV422sp2RGB565 //!< FastCV: YCbCr422PseudoPlanar to RGB565 COLOR_YUV422sp2RGB //!< FastCV: YCbCr422PseudoPlanar to RGB888 COLOR_YUV422sp2RGBA //!< FastCV: YCbCr422PseudoPlanar to RGBA8888 COLOR_YUV444sp2RGB565 //!< FastCV: YCbCr444PseudoPlanar to RGB565 COLOR_YUV444sp2RGB //!< FastCV: YCbCr444PseudoPlanar to RGB888 COLOR_YUV444sp2RGBA //!< FastCV: YCbCr444PseudoPlanar to RGBA8888 COLOR_RGB2YUV_NV12 //!< FastCV: RGB888 to YCbCr420PseudoPlanar COLOR_RGB5652YUV444sp //!< FastCV: RGB565 to YCbCr444PseudoPlanar COLOR_RGB5652YUV422sp //!< FastCV: RGB565 to YCbCr422PseudoPlanar COLOR_RGB5652YUV_NV12 //!< FastCV: RGB565 to YCbCr420PseudoPlanar COLOR_RGB2YUV444sp //!< FastCV: RGB888 to YCbCr444PseudoPlanar COLOR_RGB2YUV422sp //!< FastCV: RGB888 to YCbCr422PseudoPlanar ``` ### 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 Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
1 parent ab4d3dc commit cb495d9

File tree

4 files changed

+552
-0
lines changed

4 files changed

+552
-0
lines changed

modules/fastcv/include/opencv2/fastcv.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "opencv2/fastcv/fft_dsp.hpp"
3838
#include "opencv2/fastcv/edges_dsp.hpp"
3939
#include "opencv2/fastcv/blur_dsp.hpp"
40+
#include "opencv2/fastcv/color.hpp"
4041

4142
/**
4243
* @defgroup fastcv Module-wrapper for FastCV hardware accelerated functions
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// This file is part of OpenCV project.
2+
// It is subject to the license terms in the LICENSE file found in the top-level directory
3+
// of this distribution and at http://opencv.org/license.html.
4+
5+
6+
#ifndef OPENCV_FASTCV_COLOR_HPP
7+
#define OPENCV_FASTCV_COLOR_HPP
8+
9+
#include <opencv2/core.hpp>
10+
11+
namespace cv
12+
{
13+
namespace fastcv
14+
{
15+
16+
enum ColorConversionCodes {
17+
// FastCV-specific color conversion codes (avoid collision with OpenCV core)
18+
COLOR_YUV2YUV444sp_NV12 = 156, //!< FastCV: YCbCr420PseudoPlanar to YCbCr444PseudoPlanar
19+
COLOR_YUV2YUV422sp_NV12 = 157, //!< FastCV: YCbCr420PseudoPlanar to YCbCr422PseudoPlanar
20+
COLOR_YUV422sp2YUV444sp = 158, //!< FastCV: YCbCr422PseudoPlanar to YCbCr444PseudoPlanar
21+
COLOR_YUV422sp2YUV_NV12 = 159, //!< FastCV: YCbCr422PseudoPlanar to YCbCr420PseudoPlanar
22+
COLOR_YUV444sp2YUV422sp = 160, //!< FastCV: YCbCr444PseudoPlanar to YCbCr422PseudoPlanar
23+
COLOR_YUV444sp2YUV_NV12 = 161, //!< FastCV: YCbCr444PseudoPlanar to YCbCr420PseudoPlanar
24+
COLOR_YUV2RGB565_NV12 = 162, //!< FastCV: YCbCr420PseudoPlanar to RGB565
25+
COLOR_YUV422sp2RGB565 = 163, //!< FastCV: YCbCr422PseudoPlanar to RGB565
26+
COLOR_YUV422sp2RGB = 164, //!< FastCV: YCbCr422PseudoPlanar to RGB888
27+
COLOR_YUV422sp2RGBA = 165, //!< FastCV: YCbCr422PseudoPlanar to RGBA8888
28+
COLOR_YUV444sp2RGB565 = 166, //!< FastCV: YCbCr444PseudoPlanar to RGB565
29+
COLOR_YUV444sp2RGB = 167, //!< FastCV: YCbCr444PseudoPlanar to RGB888
30+
COLOR_YUV444sp2RGBA = 168, //!< FastCV: YCbCr444PseudoPlanar to RGBA8888
31+
COLOR_RGB2YUV_NV12 = 169, //!< FastCV: RGB888 to YCbCr420PseudoPlanar
32+
COLOR_RGB5652YUV444sp = 170, //!< FastCV: RGB565 to YCbCr444PseudoPlanar
33+
COLOR_RGB5652YUV422sp = 171, //!< FastCV: RGB565 to YCbCr422PseudoPlanar
34+
COLOR_RGB5652YUV_NV12 = 172, //!< FastCV: RGB565 to YCbCr420PseudoPlanar
35+
COLOR_RGB2YUV444sp = 173, //!< FastCV: RGB888 to YCbCr444PseudoPlanar
36+
COLOR_RGB2YUV422sp = 174, //!< FastCV: RGB888 to YCbCr422PseudoPlanar
37+
};
38+
39+
CV_EXPORTS_W void cvtColor(InputArray src, OutputArray dst, int code);
40+
41+
}}; //cv::fastcv namespace end
42+
43+
#endif // OPENCV_FASTCV_COLOR_HPP

0 commit comments

Comments
 (0)