@@ -124,6 +124,12 @@ namespace imgproc {
124
124
}
125
125
};
126
126
127
+ G_TYPED_KERNEL (GBGR2RGB, <GMat(GMat)>, " org.opencv.imgproc.colorconvert.bgr2rgb" ) {
128
+ static GMatDesc outMeta (GMatDesc in) {
129
+ return in; // type still remains CV_8UC3;
130
+ }
131
+ };
132
+
127
133
G_TYPED_KERNEL (GRGB2YUV, <GMat(GMat)>, " org.opencv.imgproc.colorconvert.rgb2yuv" ) {
128
134
static GMatDesc outMeta (GMatDesc in) {
129
135
return in; // type still remains CV_8UC3;
@@ -136,6 +142,42 @@ namespace imgproc {
136
142
}
137
143
};
138
144
145
+ G_TYPED_KERNEL (GBGR2I420, <GMat(GMat)>, " org.opencv.imgproc.colorconvert.bgr2i420" ) {
146
+ static GMatDesc outMeta (GMatDesc in) {
147
+ GAPI_Assert (in.depth == CV_8U);
148
+ GAPI_Assert (in.chan == 3 );
149
+ GAPI_Assert (in.size .height % 2 == 0 );
150
+ return in.withType (in.depth , 1 ).withSize (Size (in.size .width , in.size .height * 3 / 2 ));
151
+ }
152
+ };
153
+
154
+ G_TYPED_KERNEL (GRGB2I420, <GMat(GMat)>, " org.opencv.imgproc.colorconvert.rgb2i420" ) {
155
+ static GMatDesc outMeta (GMatDesc in) {
156
+ GAPI_Assert (in.depth == CV_8U);
157
+ GAPI_Assert (in.chan == 3 );
158
+ GAPI_Assert (in.size .height % 2 == 0 );
159
+ return in.withType (in.depth , 1 ).withSize (Size (in.size .width , in.size .height * 3 / 2 ));
160
+ }
161
+ };
162
+
163
+ G_TYPED_KERNEL (GI4202BGR, <GMat(GMat)>, " org.opencv.imgproc.colorconvert.i4202bgr" ) {
164
+ static GMatDesc outMeta (GMatDesc in) {
165
+ GAPI_Assert (in.depth == CV_8U);
166
+ GAPI_Assert (in.chan == 1 );
167
+ GAPI_Assert (in.size .height % 3 == 0 );
168
+ return in.withType (in.depth , 3 ).withSize (Size (in.size .width , in.size .height * 2 / 3 ));
169
+ }
170
+ };
171
+
172
+ G_TYPED_KERNEL (GI4202RGB, <GMat(GMat)>, " org.opencv.imgproc.colorconvert.i4202rgb" ) {
173
+ static GMatDesc outMeta (GMatDesc in) {
174
+ GAPI_Assert (in.depth == CV_8U);
175
+ GAPI_Assert (in.chan == 1 );
176
+ GAPI_Assert (in.size .height % 3 == 0 );
177
+ return in.withType (in.depth , 3 ).withSize (Size (in.size .width , in.size .height * 2 / 3 ));
178
+ }
179
+ };
180
+
139
181
G_TYPED_KERNEL (GNV12toRGB, <GMat(GMat, GMat)>, " org.opencv.imgproc.colorconvert.nv12torgb" ) {
140
182
static GMatDesc outMeta (GMatDesc in_y, GMatDesc in_uv) {
141
183
GAPI_Assert (in_y.chan == 1 );
@@ -812,6 +854,20 @@ The algorithm normalizes the brightness and increases the contrast of the image.
812
854
*/
813
855
GAPI_EXPORTS GMat equalizeHist (const GMat& src);
814
856
857
+ /* * @brief Converts an image from BGR color space to RGB color space.
858
+
859
+ The function converts an input image from BGR color space to RGB.
860
+ The conventional ranges for B, G, and R channel values are 0 to 255.
861
+
862
+ Output image is 8-bit unsigned 3-channel image @ref CV_8UC3.
863
+
864
+ @note Function textual ID is "org.opencv.imgproc.colorconvert.bgr2rgb"
865
+
866
+ @param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.
867
+ @sa RGB2BGR
868
+ */
869
+ GAPI_EXPORTS GMat BGR2RGB (const GMat& src);
870
+
815
871
// ! @} gapi_filters
816
872
817
873
// ! @addtogroup gapi_colorconvert
@@ -871,6 +927,70 @@ Output image must be 8-bit unsigned 3-channel image @ref CV_8UC3.
871
927
*/
872
928
GAPI_EXPORTS GMat RGB2YUV (const GMat& src);
873
929
930
+ /* * @brief Converts an image from BGR color space to I420 color space.
931
+
932
+ The function converts an input image from BGR color space to I420.
933
+ The conventional ranges for R, G, and B channel values are 0 to 255.
934
+
935
+ Output image must be 8-bit unsigned 1-channel image. @ref CV_8UC1.
936
+ Width of I420 output image must be the same as width of input image.
937
+ Height of I420 output image must be equal 3/2 from height of input image.
938
+
939
+ @note Function textual ID is "org.opencv.imgproc.colorconvert.bgr2i420"
940
+
941
+ @param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.
942
+ @sa I4202BGR
943
+ */
944
+ GAPI_EXPORTS GMat BGR2I420 (const GMat& src);
945
+
946
+ /* * @brief Converts an image from RGB color space to I420 color space.
947
+
948
+ The function converts an input image from RGB color space to I420.
949
+ The conventional ranges for R, G, and B channel values are 0 to 255.
950
+
951
+ Output image must be 8-bit unsigned 1-channel image. @ref CV_8UC1.
952
+ Width of I420 output image must be the same as width of input image.
953
+ Height of I420 output image must be equal 3/2 from height of input image.
954
+
955
+ @note Function textual ID is "org.opencv.imgproc.colorconvert.rgb2i420"
956
+
957
+ @param src input image: 8-bit unsigned 3-channel image @ref CV_8UC3.
958
+ @sa I4202RGB
959
+ */
960
+ GAPI_EXPORTS GMat RGB2I420 (const GMat& src);
961
+
962
+ /* * @brief Converts an image from I420 color space to BGR color space.
963
+
964
+ The function converts an input image from I420 color space to BGR.
965
+ The conventional ranges for B, G, and R channel values are 0 to 255.
966
+
967
+ Output image must be 8-bit unsigned 3-channel image. @ref CV_8UC3.
968
+ Width of BGR output image must be the same as width of input image.
969
+ Height of BGR output image must be equal 2/3 from height of input image.
970
+
971
+ @note Function textual ID is "org.opencv.imgproc.colorconvert.i4202bgr"
972
+
973
+ @param src input image: 8-bit unsigned 1-channel image @ref CV_8UC1.
974
+ @sa BGR2I420
975
+ */
976
+ GAPI_EXPORTS GMat I4202BGR (const GMat& src);
977
+
978
+ /* * @brief Converts an image from I420 color space to BGR color space.
979
+
980
+ The function converts an input image from I420 color space to BGR.
981
+ The conventional ranges for B, G, and R channel values are 0 to 255.
982
+
983
+ Output image must be 8-bit unsigned 3-channel image. @ref CV_8UC3.
984
+ Width of RGB output image must be the same as width of input image.
985
+ Height of RGB output image must be equal 2/3 from height of input image.
986
+
987
+ @note Function textual ID is "org.opencv.imgproc.colorconvert.i4202rgb"
988
+
989
+ @param src input image: 8-bit unsigned 1-channel image @ref CV_8UC1.
990
+ @sa RGB2I420
991
+ */
992
+ GAPI_EXPORTS GMat I4202RGB (const GMat& src);
993
+
874
994
/* * @brief Converts an image from BGR color space to LUV color space.
875
995
876
996
The function converts an input image from BGR color space to LUV.
0 commit comments