OpenCV
5.0.0-pre
Open Source Computer Vision
|
Functions | |
void | cv::cvtColor (InputArray src, OutputArray dst, int code, int dstCn=0, AlgorithmHint hint=cv::ALGO_HINT_DEFAULT) |
Converts an image from one color space to another. | |
void | cv::cvtColorTwoPlane (InputArray src1, InputArray src2, OutputArray dst, int code, AlgorithmHint hint=cv::ALGO_HINT_DEFAULT) |
Converts an image from one color space to another where the source image is stored in two planes. | |
void | cv::demosaicing (InputArray src, OutputArray dst, int code, int dstCn=0) |
main function for all demosaicing processes | |
#include <opencv2/imgproc.hpp>
the color conversion codes
Enumerator | |
---|---|
COLOR_BGR2BGRA Python: cv.COLOR_BGR2BGRA | add alpha channel to RGB or BGR image |
COLOR_RGB2RGBA Python: cv.COLOR_RGB2RGBA | |
COLOR_BGRA2BGR Python: cv.COLOR_BGRA2BGR | remove alpha channel from RGB or BGR image |
COLOR_RGBA2RGB Python: cv.COLOR_RGBA2RGB | |
COLOR_BGR2RGBA Python: cv.COLOR_BGR2RGBA | convert between RGB and BGR color spaces (with or without alpha channel) |
COLOR_RGB2BGRA Python: cv.COLOR_RGB2BGRA | |
COLOR_RGBA2BGR Python: cv.COLOR_RGBA2BGR | |
COLOR_BGRA2RGB Python: cv.COLOR_BGRA2RGB | |
COLOR_BGR2RGB Python: cv.COLOR_BGR2RGB | |
COLOR_RGB2BGR Python: cv.COLOR_RGB2BGR | |
COLOR_BGRA2RGBA Python: cv.COLOR_BGRA2RGBA | |
COLOR_RGBA2BGRA Python: cv.COLOR_RGBA2BGRA | |
COLOR_BGR2GRAY Python: cv.COLOR_BGR2GRAY | convert between RGB/BGR and grayscale, color conversions |
COLOR_RGB2GRAY Python: cv.COLOR_RGB2GRAY | |
COLOR_GRAY2BGR Python: cv.COLOR_GRAY2BGR | |
COLOR_GRAY2RGB Python: cv.COLOR_GRAY2RGB | |
COLOR_GRAY2BGRA Python: cv.COLOR_GRAY2BGRA | |
COLOR_GRAY2RGBA Python: cv.COLOR_GRAY2RGBA | |
COLOR_BGRA2GRAY Python: cv.COLOR_BGRA2GRAY | |
COLOR_RGBA2GRAY Python: cv.COLOR_RGBA2GRAY | |
COLOR_BGR2BGR565 Python: cv.COLOR_BGR2BGR565 | convert between RGB/BGR and BGR565 (16-bit images) |
COLOR_RGB2BGR565 Python: cv.COLOR_RGB2BGR565 | |
COLOR_BGR5652BGR Python: cv.COLOR_BGR5652BGR | |
COLOR_BGR5652RGB Python: cv.COLOR_BGR5652RGB | |
COLOR_BGRA2BGR565 Python: cv.COLOR_BGRA2BGR565 | |
COLOR_RGBA2BGR565 Python: cv.COLOR_RGBA2BGR565 | |
COLOR_BGR5652BGRA Python: cv.COLOR_BGR5652BGRA | |
COLOR_BGR5652RGBA Python: cv.COLOR_BGR5652RGBA | |
COLOR_GRAY2BGR565 Python: cv.COLOR_GRAY2BGR565 | convert between grayscale to BGR565 (16-bit images) |
COLOR_BGR5652GRAY Python: cv.COLOR_BGR5652GRAY | |
COLOR_BGR2BGR555 Python: cv.COLOR_BGR2BGR555 | convert between RGB/BGR and BGR555 (16-bit images) |
COLOR_RGB2BGR555 Python: cv.COLOR_RGB2BGR555 | |
COLOR_BGR5552BGR Python: cv.COLOR_BGR5552BGR | |
COLOR_BGR5552RGB Python: cv.COLOR_BGR5552RGB | |
COLOR_BGRA2BGR555 Python: cv.COLOR_BGRA2BGR555 | |
COLOR_RGBA2BGR555 Python: cv.COLOR_RGBA2BGR555 | |
COLOR_BGR5552BGRA Python: cv.COLOR_BGR5552BGRA | |
COLOR_BGR5552RGBA Python: cv.COLOR_BGR5552RGBA | |
COLOR_GRAY2BGR555 Python: cv.COLOR_GRAY2BGR555 | convert between grayscale and BGR555 (16-bit images) |
COLOR_BGR5552GRAY Python: cv.COLOR_BGR5552GRAY | |
COLOR_BGR2XYZ Python: cv.COLOR_BGR2XYZ | convert RGB/BGR to CIE XYZ, color conversions |
COLOR_RGB2XYZ Python: cv.COLOR_RGB2XYZ | |
COLOR_XYZ2BGR Python: cv.COLOR_XYZ2BGR | |
COLOR_XYZ2RGB Python: cv.COLOR_XYZ2RGB | |
COLOR_BGR2YCrCb Python: cv.COLOR_BGR2YCrCb | convert RGB/BGR to luma-chroma (aka YCC), color conversions |
COLOR_RGB2YCrCb Python: cv.COLOR_RGB2YCrCb | |
COLOR_YCrCb2BGR Python: cv.COLOR_YCrCb2BGR | |
COLOR_YCrCb2RGB Python: cv.COLOR_YCrCb2RGB | |
COLOR_BGR2HSV Python: cv.COLOR_BGR2HSV | convert RGB/BGR to HSV (hue saturation value) with H range 0..180 if 8 bit image, color conversions |
COLOR_RGB2HSV Python: cv.COLOR_RGB2HSV | |
COLOR_BGR2Lab Python: cv.COLOR_BGR2Lab | convert RGB/BGR to CIE Lab, color conversions |
COLOR_RGB2Lab Python: cv.COLOR_RGB2Lab | |
COLOR_BGR2Luv Python: cv.COLOR_BGR2Luv | convert RGB/BGR to CIE Luv, color conversions |
COLOR_RGB2Luv Python: cv.COLOR_RGB2Luv | |
COLOR_BGR2HLS Python: cv.COLOR_BGR2HLS | convert RGB/BGR to HLS (hue lightness saturation) with H range 0..180 if 8 bit image, color conversions |
COLOR_RGB2HLS Python: cv.COLOR_RGB2HLS | |
COLOR_HSV2BGR Python: cv.COLOR_HSV2BGR | backward conversions HSV to RGB/BGR with H range 0..180 if 8 bit image |
COLOR_HSV2RGB Python: cv.COLOR_HSV2RGB | |
COLOR_Lab2BGR Python: cv.COLOR_Lab2BGR | |
COLOR_Lab2RGB Python: cv.COLOR_Lab2RGB | |
COLOR_Luv2BGR Python: cv.COLOR_Luv2BGR | |
COLOR_Luv2RGB Python: cv.COLOR_Luv2RGB | |
COLOR_HLS2BGR Python: cv.COLOR_HLS2BGR | backward conversions HLS to RGB/BGR with H range 0..180 if 8 bit image |
COLOR_HLS2RGB Python: cv.COLOR_HLS2RGB | |
COLOR_BGR2HSV_FULL Python: cv.COLOR_BGR2HSV_FULL | convert RGB/BGR to HSV (hue saturation value) with H range 0..255 if 8 bit image, color conversions |
COLOR_RGB2HSV_FULL Python: cv.COLOR_RGB2HSV_FULL | |
COLOR_BGR2HLS_FULL Python: cv.COLOR_BGR2HLS_FULL | convert RGB/BGR to HLS (hue lightness saturation) with H range 0..255 if 8 bit image, color conversions |
COLOR_RGB2HLS_FULL Python: cv.COLOR_RGB2HLS_FULL | |
COLOR_HSV2BGR_FULL Python: cv.COLOR_HSV2BGR_FULL | backward conversions HSV to RGB/BGR with H range 0..255 if 8 bit image |
COLOR_HSV2RGB_FULL Python: cv.COLOR_HSV2RGB_FULL | |
COLOR_HLS2BGR_FULL Python: cv.COLOR_HLS2BGR_FULL | backward conversions HLS to RGB/BGR with H range 0..255 if 8 bit image |
COLOR_HLS2RGB_FULL Python: cv.COLOR_HLS2RGB_FULL | |
COLOR_LBGR2Lab Python: cv.COLOR_LBGR2Lab | |
COLOR_LRGB2Lab Python: cv.COLOR_LRGB2Lab | |
COLOR_LBGR2Luv Python: cv.COLOR_LBGR2Luv | |
COLOR_LRGB2Luv Python: cv.COLOR_LRGB2Luv | |
COLOR_Lab2LBGR Python: cv.COLOR_Lab2LBGR | |
COLOR_Lab2LRGB Python: cv.COLOR_Lab2LRGB | |
COLOR_Luv2LBGR Python: cv.COLOR_Luv2LBGR | |
COLOR_Luv2LRGB Python: cv.COLOR_Luv2LRGB | |
COLOR_BGR2YUV Python: cv.COLOR_BGR2YUV | convert between RGB/BGR and YUV |
COLOR_RGB2YUV Python: cv.COLOR_RGB2YUV | |
COLOR_YUV2BGR Python: cv.COLOR_YUV2BGR | |
COLOR_YUV2RGB Python: cv.COLOR_YUV2RGB | |
COLOR_YUV2RGB_NV12 Python: cv.COLOR_YUV2RGB_NV12 | convert between 4:2:0-subsampled YUV NV12 and RGB, two planes (in one or separate arrays): Y and U/V interleaved, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGR_NV12 Python: cv.COLOR_YUV2BGR_NV12 | convert between 4:2:0-subsampled YUV NV12 and BGR, two planes (in one or separate arrays): Y and U/V interleaved, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGB_NV21 Python: cv.COLOR_YUV2RGB_NV21 | convert between 4:2:0-subsampled YUV NV21 and RGB, two planes (in one or separate arrays): Y and V/U interleaved, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGR_NV21 Python: cv.COLOR_YUV2BGR_NV21 | convert between 4:2:0-subsampled YUV NV21 and BGR, two planes (in one or separate arrays): Y and V/U interleaved, see color_convert_rgb_yuv_42x |
COLOR_YUV420sp2RGB Python: cv.COLOR_YUV420sp2RGB | synonym to NV21 |
COLOR_YUV420sp2BGR Python: cv.COLOR_YUV420sp2BGR | synonym to NV21 |
COLOR_YUV2RGBA_NV12 Python: cv.COLOR_YUV2RGBA_NV12 | convert between 4:2:0-subsampled YUV NV12 and RGBA, two planes (in one or separate arrays): Y and U/V interleaved, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGRA_NV12 Python: cv.COLOR_YUV2BGRA_NV12 | convert between 4:2:0-subsampled YUV NV12 and BGRA, two planes (in one or separate arrays): Y and U/V interleaved, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGBA_NV21 Python: cv.COLOR_YUV2RGBA_NV21 | convert between 4:2:0-subsampled YUV NV21 and RGBA, two planes (in one or separate arrays): Y and V/U interleaved, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGRA_NV21 Python: cv.COLOR_YUV2BGRA_NV21 | convert between 4:2:0-subsampled YUV NV21 and BGRA, two planes (in one or separate arrays): Y and V/U interleaved, see color_convert_rgb_yuv_42x |
COLOR_YUV420sp2RGBA Python: cv.COLOR_YUV420sp2RGBA | synonym to NV21 |
COLOR_YUV420sp2BGRA Python: cv.COLOR_YUV420sp2BGRA | synonym to NV21 |
COLOR_YUV2RGB_YV12 Python: cv.COLOR_YUV2RGB_YV12 | convert between 4:2:0-subsampled YUV YV12 and RGB, three planes in one array: Y, V and U, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGR_YV12 Python: cv.COLOR_YUV2BGR_YV12 | convert between 4:2:0-subsampled YUV YV12 and BGR, three planes in one array: Y, V and U, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGB_IYUV Python: cv.COLOR_YUV2RGB_IYUV | convert between 4:2:0-subsampled YUV IYUV and RGB, three planes in one array: Y, U and V, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGR_IYUV Python: cv.COLOR_YUV2BGR_IYUV | convert between 4:2:0-subsampled YUV IYUV and BGR, three planes in one array: Y, U and V, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGB_I420 Python: cv.COLOR_YUV2RGB_I420 | synonym to IYUV |
COLOR_YUV2BGR_I420 Python: cv.COLOR_YUV2BGR_I420 | synonym to IYUV |
COLOR_YUV420p2RGB Python: cv.COLOR_YUV420p2RGB | synonym to YV12 |
COLOR_YUV420p2BGR Python: cv.COLOR_YUV420p2BGR | synonym to YV12 |
COLOR_YUV2RGBA_YV12 Python: cv.COLOR_YUV2RGBA_YV12 | convert between 4:2:0-subsampled YUV YV12 and RGBA, three planes in one array: Y, V and U, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGRA_YV12 Python: cv.COLOR_YUV2BGRA_YV12 | convert between 4:2:0-subsampled YUV YV12 and BGRA, three planes in one array: Y, V and U, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGBA_IYUV Python: cv.COLOR_YUV2RGBA_IYUV | convert between 4:2:0-subsampled YUV YV12 and RGBA, three planes in one array: Y, U and V, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGRA_IYUV Python: cv.COLOR_YUV2BGRA_IYUV | convert between 4:2:0-subsampled YUV YV12 and BGRA, three planes in one array: Y, U and V, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGBA_I420 Python: cv.COLOR_YUV2RGBA_I420 | synonym to IYUV |
COLOR_YUV2BGRA_I420 Python: cv.COLOR_YUV2BGRA_I420 | synonym to IYUV |
COLOR_YUV420p2RGBA Python: cv.COLOR_YUV420p2RGBA | synonym to YV12 |
COLOR_YUV420p2BGRA Python: cv.COLOR_YUV420p2BGRA | synonym to YV12 |
COLOR_YUV2GRAY_420 Python: cv.COLOR_YUV2GRAY_420 | extract Y channel from YUV 4:2:0 image |
COLOR_YUV2GRAY_NV21 Python: cv.COLOR_YUV2GRAY_NV21 | synonym to COLOR_YUV2GRAY_420 |
COLOR_YUV2GRAY_NV12 Python: cv.COLOR_YUV2GRAY_NV12 | synonym to COLOR_YUV2GRAY_420 |
COLOR_YUV2GRAY_YV12 Python: cv.COLOR_YUV2GRAY_YV12 | synonym to COLOR_YUV2GRAY_420 |
COLOR_YUV2GRAY_IYUV Python: cv.COLOR_YUV2GRAY_IYUV | synonym to COLOR_YUV2GRAY_420 |
COLOR_YUV2GRAY_I420 Python: cv.COLOR_YUV2GRAY_I420 | synonym to COLOR_YUV2GRAY_420 |
COLOR_YUV420sp2GRAY Python: cv.COLOR_YUV420sp2GRAY | synonym to COLOR_YUV2GRAY_420 |
COLOR_YUV420p2GRAY Python: cv.COLOR_YUV420p2GRAY | synonym to COLOR_YUV2GRAY_420 |
COLOR_YUV2RGB_UYVY Python: cv.COLOR_YUV2RGB_UYVY | convert between YUV UYVY and RGB, YUV is 4:2:2-subsampled and interleaved as U/Y1/V/Y2, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGR_UYVY Python: cv.COLOR_YUV2BGR_UYVY | convert between YUV UYVY and BGR, YUV is 4:2:2-subsampled and interleaved as U/Y1/V/Y2, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGB_Y422 Python: cv.COLOR_YUV2RGB_Y422 | synonym to UYVY |
COLOR_YUV2BGR_Y422 Python: cv.COLOR_YUV2BGR_Y422 | synonym to UYVY |
COLOR_YUV2RGB_UYNV Python: cv.COLOR_YUV2RGB_UYNV | synonym to UYVY |
COLOR_YUV2BGR_UYNV Python: cv.COLOR_YUV2BGR_UYNV | synonym to UYVY |
COLOR_YUV2RGBA_UYVY Python: cv.COLOR_YUV2RGBA_UYVY | convert between YUV UYVY and RGBA, YUV is 4:2:2-subsampled and interleaved as U/Y1/V/Y2, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGRA_UYVY Python: cv.COLOR_YUV2BGRA_UYVY | convert between YUV UYVY and BGRA, YUV is 4:2:2-subsampled and interleaved as U/Y1/V/Y2, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGBA_Y422 Python: cv.COLOR_YUV2RGBA_Y422 | synonym to UYVY |
COLOR_YUV2BGRA_Y422 Python: cv.COLOR_YUV2BGRA_Y422 | synonym to UYVY |
COLOR_YUV2RGBA_UYNV Python: cv.COLOR_YUV2RGBA_UYNV | synonym to UYVY |
COLOR_YUV2BGRA_UYNV Python: cv.COLOR_YUV2BGRA_UYNV | synonym to UYVY |
COLOR_YUV2RGB_YUY2 Python: cv.COLOR_YUV2RGB_YUY2 | convert between YUV YUY2 and RGB, YUV is 4:2:2-subsampled and interleaved as Y1/U/Y2/V, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGR_YUY2 Python: cv.COLOR_YUV2BGR_YUY2 | convert between YUV YUY2 and BGR, YUV is 4:2:2-subsampled and interleaved as Y1/U/Y2/V, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGB_YVYU Python: cv.COLOR_YUV2RGB_YVYU | convert between YUV YVYU and RGB, YUV is 4:2:2-subsampled and interleaved as Y1/V/Y2/U, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGR_YVYU Python: cv.COLOR_YUV2BGR_YVYU | convert between YUV YVYU and BGR, YUV is 4:2:2-subsampled and interleaved as Y1/V/Y2/U, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGB_YUYV Python: cv.COLOR_YUV2RGB_YUYV | synonym to YUY2 |
COLOR_YUV2BGR_YUYV Python: cv.COLOR_YUV2BGR_YUYV | synonym to YUY2 |
COLOR_YUV2RGB_YUNV Python: cv.COLOR_YUV2RGB_YUNV | synonym to YUY2 |
COLOR_YUV2BGR_YUNV Python: cv.COLOR_YUV2BGR_YUNV | synonym to YUY2 |
COLOR_YUV2RGBA_YUY2 Python: cv.COLOR_YUV2RGBA_YUY2 | convert between YUV YUY2 and RGBA, YUV is 4:2:2-subsampled and interleaved as Y1/U/Y2/V, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGRA_YUY2 Python: cv.COLOR_YUV2BGRA_YUY2 | convert between YUV YUY2 and BGRA, YUV is 4:2:2-subsampled and interleaved as Y1/U/Y2/V, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGBA_YVYU Python: cv.COLOR_YUV2RGBA_YVYU | convert between YUV YVYU and RGBA, YUV is 4:2:2-subsampled and interleaved as Y1/V/Y2/U, see color_convert_rgb_yuv_42x |
COLOR_YUV2BGRA_YVYU Python: cv.COLOR_YUV2BGRA_YVYU | convert between YUV YVYU and BGRA, YUV is 4:2:2-subsampled and interleaved as Y1/V/Y2/U, see color_convert_rgb_yuv_42x |
COLOR_YUV2RGBA_YUYV Python: cv.COLOR_YUV2RGBA_YUYV | synonym to YUY2 |
COLOR_YUV2BGRA_YUYV Python: cv.COLOR_YUV2BGRA_YUYV | synonym to YUY2 |
COLOR_YUV2RGBA_YUNV Python: cv.COLOR_YUV2RGBA_YUNV | synonym to YUY2 |
COLOR_YUV2BGRA_YUNV Python: cv.COLOR_YUV2BGRA_YUNV | synonym to YUY2 |
COLOR_YUV2GRAY_UYVY Python: cv.COLOR_YUV2GRAY_UYVY | extract Y channel from YUV 4:2:2 image |
COLOR_YUV2GRAY_YUY2 Python: cv.COLOR_YUV2GRAY_YUY2 | extract Y channel from YUV 4:2:2 image |
COLOR_YUV2GRAY_UYNV Python: cv.COLOR_YUV2GRAY_UYNV | synonym to COLOR_YUV2GRAY_UYVY |
COLOR_YUV2GRAY_YVYU Python: cv.COLOR_YUV2GRAY_YVYU | synonym to COLOR_YUV2GRAY_YUY2 |
COLOR_YUV2GRAY_YUYV Python: cv.COLOR_YUV2GRAY_YUYV | synonym to COLOR_YUV2GRAY_YUY2 |
COLOR_YUV2GRAY_YUNV Python: cv.COLOR_YUV2GRAY_YUNV | synonym to COLOR_YUV2GRAY_YUY2 |
COLOR_RGBA2mRGBA Python: cv.COLOR_RGBA2mRGBA | alpha premultiplication |
COLOR_mRGBA2RGBA Python: cv.COLOR_mRGBA2RGBA | |
COLOR_RGB2YUV_I420 Python: cv.COLOR_RGB2YUV_I420 | convert between RGB and 4:2:0-subsampled YUV I420, three planes in one array: Y, U and V, see color_convert_rgb_yuv_42x |
COLOR_BGR2YUV_I420 Python: cv.COLOR_BGR2YUV_I420 | convert between BGR and 4:2:0-subsampled YUV I420, three planes in one array: Y, U and V, see color_convert_rgb_yuv_42x |
COLOR_RGB2YUV_IYUV Python: cv.COLOR_RGB2YUV_IYUV | synonym to I420 |
COLOR_BGR2YUV_IYUV Python: cv.COLOR_BGR2YUV_IYUV | synonym to I420 |
COLOR_RGBA2YUV_I420 Python: cv.COLOR_RGBA2YUV_I420 | convert between RGBA and 4:2:0-subsampled YUV I420, three planes in one array: Y, U and V, see color_convert_rgb_yuv_42x |
COLOR_BGRA2YUV_I420 Python: cv.COLOR_BGRA2YUV_I420 | convert between BGRA and 4:2:0-subsampled YUV I420, three planes in one array: Y, U and V, see color_convert_rgb_yuv_42x |
COLOR_RGBA2YUV_IYUV Python: cv.COLOR_RGBA2YUV_IYUV | synonym to I420 |
COLOR_BGRA2YUV_IYUV Python: cv.COLOR_BGRA2YUV_IYUV | synonym to I420 |
COLOR_RGB2YUV_YV12 Python: cv.COLOR_RGB2YUV_YV12 | convert between RGB and 4:2:0-subsampled YUV YV12, three planes in one array: Y, V and U, see color_convert_rgb_yuv_42x |
COLOR_BGR2YUV_YV12 Python: cv.COLOR_BGR2YUV_YV12 | convert between BGR and 4:2:0-subsampled YUV YV12, three planes in one array: Y, V and U, see color_convert_rgb_yuv_42x |
COLOR_RGBA2YUV_YV12 Python: cv.COLOR_RGBA2YUV_YV12 | convert between RGBA and 4:2:0-subsampled YUV YV12, three planes in one array: Y, V and U, see color_convert_rgb_yuv_42x |
COLOR_BGRA2YUV_YV12 Python: cv.COLOR_BGRA2YUV_YV12 | convert between BGRA and 4:2:0-subsampled YUV YV12, three planes in one array: Y, V and U, see color_convert_rgb_yuv_42x |
COLOR_BayerBG2BGR Python: cv.COLOR_BayerBG2BGR | Demosaicing, see color conversions for additional information. equivalent to RGGB Bayer pattern |
COLOR_BayerGB2BGR Python: cv.COLOR_BayerGB2BGR | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2BGR Python: cv.COLOR_BayerRG2BGR | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2BGR Python: cv.COLOR_BayerGR2BGR | equivalent to GBRG Bayer pattern |
COLOR_BayerRGGB2BGR Python: cv.COLOR_BayerRGGB2BGR | |
COLOR_BayerGRBG2BGR Python: cv.COLOR_BayerGRBG2BGR | |
COLOR_BayerBGGR2BGR Python: cv.COLOR_BayerBGGR2BGR | |
COLOR_BayerGBRG2BGR Python: cv.COLOR_BayerGBRG2BGR | |
COLOR_BayerRGGB2RGB Python: cv.COLOR_BayerRGGB2RGB | |
COLOR_BayerGRBG2RGB Python: cv.COLOR_BayerGRBG2RGB | |
COLOR_BayerBGGR2RGB Python: cv.COLOR_BayerBGGR2RGB | |
COLOR_BayerGBRG2RGB Python: cv.COLOR_BayerGBRG2RGB | |
COLOR_BayerBG2RGB Python: cv.COLOR_BayerBG2RGB | equivalent to RGGB Bayer pattern |
COLOR_BayerGB2RGB Python: cv.COLOR_BayerGB2RGB | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2RGB Python: cv.COLOR_BayerRG2RGB | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2RGB Python: cv.COLOR_BayerGR2RGB | equivalent to GBRG Bayer pattern |
COLOR_BayerBG2GRAY Python: cv.COLOR_BayerBG2GRAY | equivalent to RGGB Bayer pattern |
COLOR_BayerGB2GRAY Python: cv.COLOR_BayerGB2GRAY | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2GRAY Python: cv.COLOR_BayerRG2GRAY | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2GRAY Python: cv.COLOR_BayerGR2GRAY | equivalent to GBRG Bayer pattern |
COLOR_BayerRGGB2GRAY Python: cv.COLOR_BayerRGGB2GRAY | |
COLOR_BayerGRBG2GRAY Python: cv.COLOR_BayerGRBG2GRAY | |
COLOR_BayerBGGR2GRAY Python: cv.COLOR_BayerBGGR2GRAY | |
COLOR_BayerGBRG2GRAY Python: cv.COLOR_BayerGBRG2GRAY | |
COLOR_BayerBG2BGR_VNG Python: cv.COLOR_BayerBG2BGR_VNG | Demosaicing using Variable Number of Gradients. equivalent to RGGB Bayer pattern |
COLOR_BayerGB2BGR_VNG Python: cv.COLOR_BayerGB2BGR_VNG | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2BGR_VNG Python: cv.COLOR_BayerRG2BGR_VNG | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2BGR_VNG Python: cv.COLOR_BayerGR2BGR_VNG | equivalent to GBRG Bayer pattern |
COLOR_BayerRGGB2BGR_VNG Python: cv.COLOR_BayerRGGB2BGR_VNG | |
COLOR_BayerGRBG2BGR_VNG Python: cv.COLOR_BayerGRBG2BGR_VNG | |
COLOR_BayerBGGR2BGR_VNG Python: cv.COLOR_BayerBGGR2BGR_VNG | |
COLOR_BayerGBRG2BGR_VNG Python: cv.COLOR_BayerGBRG2BGR_VNG | |
COLOR_BayerRGGB2RGB_VNG Python: cv.COLOR_BayerRGGB2RGB_VNG | |
COLOR_BayerGRBG2RGB_VNG Python: cv.COLOR_BayerGRBG2RGB_VNG | |
COLOR_BayerBGGR2RGB_VNG Python: cv.COLOR_BayerBGGR2RGB_VNG | |
COLOR_BayerGBRG2RGB_VNG Python: cv.COLOR_BayerGBRG2RGB_VNG | |
COLOR_BayerBG2RGB_VNG Python: cv.COLOR_BayerBG2RGB_VNG | equivalent to RGGB Bayer pattern |
COLOR_BayerGB2RGB_VNG Python: cv.COLOR_BayerGB2RGB_VNG | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2RGB_VNG Python: cv.COLOR_BayerRG2RGB_VNG | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2RGB_VNG Python: cv.COLOR_BayerGR2RGB_VNG | equivalent to GBRG Bayer pattern |
COLOR_BayerBG2BGR_EA Python: cv.COLOR_BayerBG2BGR_EA | Edge-Aware Demosaicing. equivalent to RGGB Bayer pattern |
COLOR_BayerGB2BGR_EA Python: cv.COLOR_BayerGB2BGR_EA | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2BGR_EA Python: cv.COLOR_BayerRG2BGR_EA | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2BGR_EA Python: cv.COLOR_BayerGR2BGR_EA | equivalent to GBRG Bayer pattern |
COLOR_BayerRGGB2BGR_EA Python: cv.COLOR_BayerRGGB2BGR_EA | |
COLOR_BayerGRBG2BGR_EA Python: cv.COLOR_BayerGRBG2BGR_EA | |
COLOR_BayerBGGR2BGR_EA Python: cv.COLOR_BayerBGGR2BGR_EA | |
COLOR_BayerGBRG2BGR_EA Python: cv.COLOR_BayerGBRG2BGR_EA | |
COLOR_BayerRGGB2RGB_EA Python: cv.COLOR_BayerRGGB2RGB_EA | |
COLOR_BayerGRBG2RGB_EA Python: cv.COLOR_BayerGRBG2RGB_EA | |
COLOR_BayerBGGR2RGB_EA Python: cv.COLOR_BayerBGGR2RGB_EA | |
COLOR_BayerGBRG2RGB_EA Python: cv.COLOR_BayerGBRG2RGB_EA | |
COLOR_BayerBG2RGB_EA Python: cv.COLOR_BayerBG2RGB_EA | equivalent to RGGB Bayer pattern |
COLOR_BayerGB2RGB_EA Python: cv.COLOR_BayerGB2RGB_EA | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2RGB_EA Python: cv.COLOR_BayerRG2RGB_EA | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2RGB_EA Python: cv.COLOR_BayerGR2RGB_EA | equivalent to GBRG Bayer pattern |
COLOR_BayerBG2BGRA Python: cv.COLOR_BayerBG2BGRA | Demosaicing with alpha channel. equivalent to RGGB Bayer pattern |
COLOR_BayerGB2BGRA Python: cv.COLOR_BayerGB2BGRA | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2BGRA Python: cv.COLOR_BayerRG2BGRA | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2BGRA Python: cv.COLOR_BayerGR2BGRA | equivalent to GBRG Bayer pattern |
COLOR_BayerRGGB2BGRA Python: cv.COLOR_BayerRGGB2BGRA | |
COLOR_BayerGRBG2BGRA Python: cv.COLOR_BayerGRBG2BGRA | |
COLOR_BayerBGGR2BGRA Python: cv.COLOR_BayerBGGR2BGRA | |
COLOR_BayerGBRG2BGRA Python: cv.COLOR_BayerGBRG2BGRA | |
COLOR_BayerRGGB2RGBA Python: cv.COLOR_BayerRGGB2RGBA | |
COLOR_BayerGRBG2RGBA Python: cv.COLOR_BayerGRBG2RGBA | |
COLOR_BayerBGGR2RGBA Python: cv.COLOR_BayerBGGR2RGBA | |
COLOR_BayerGBRG2RGBA Python: cv.COLOR_BayerGBRG2RGBA | |
COLOR_BayerBG2RGBA Python: cv.COLOR_BayerBG2RGBA | equivalent to RGGB Bayer pattern |
COLOR_BayerGB2RGBA Python: cv.COLOR_BayerGB2RGBA | equivalent to GRBG Bayer pattern |
COLOR_BayerRG2RGBA Python: cv.COLOR_BayerRG2RGBA | equivalent to BGGR Bayer pattern |
COLOR_BayerGR2RGBA Python: cv.COLOR_BayerGR2RGBA | equivalent to GBRG Bayer pattern |
COLOR_RGB2YUV_UYVY Python: cv.COLOR_RGB2YUV_UYVY | convert between RGB and YUV UYVU, YUV is 4:2:2 and interleaved as U/Y1/V/Y2, see color_convert_rgb_yuv_42x |
COLOR_BGR2YUV_UYVY Python: cv.COLOR_BGR2YUV_UYVY | convert between BGR and YUV UYVU, YUV is 4:2:2 and interleaved as U/Y1/V/Y2, see color_convert_rgb_yuv_42x |
COLOR_RGB2YUV_Y422 Python: cv.COLOR_RGB2YUV_Y422 | synonym to UYVY |
COLOR_BGR2YUV_Y422 Python: cv.COLOR_BGR2YUV_Y422 | synonym to UYVY |
COLOR_RGB2YUV_UYNV Python: cv.COLOR_RGB2YUV_UYNV | synonym to UYVY |
COLOR_BGR2YUV_UYNV Python: cv.COLOR_BGR2YUV_UYNV | synonym to UYVY |
COLOR_RGBA2YUV_UYVY Python: cv.COLOR_RGBA2YUV_UYVY | convert between RGBA and YUV UYVU, YUV is 4:2:2 and interleaved as U/Y1/V/Y2, see color_convert_rgb_yuv_42x |
COLOR_BGRA2YUV_UYVY Python: cv.COLOR_BGRA2YUV_UYVY | convert between BGRA and YUV UYVU, YUV is 4:2:2 and interleaved as U/Y1/V/Y2, see color_convert_rgb_yuv_42x |
COLOR_RGBA2YUV_Y422 Python: cv.COLOR_RGBA2YUV_Y422 | synonym to UYVY |
COLOR_BGRA2YUV_Y422 Python: cv.COLOR_BGRA2YUV_Y422 | synonym to UYVY |
COLOR_RGBA2YUV_UYNV Python: cv.COLOR_RGBA2YUV_UYNV | synonym to UYVY |
COLOR_BGRA2YUV_UYNV Python: cv.COLOR_BGRA2YUV_UYNV | synonym to UYVY |
COLOR_RGB2YUV_YUY2 Python: cv.COLOR_RGB2YUV_YUY2 | convert between RGB and YUV YUY2, YUV is 4:2:2 and interleaved as Y1/U/Y2/V, see color_convert_rgb_yuv_42x |
COLOR_BGR2YUV_YUY2 Python: cv.COLOR_BGR2YUV_YUY2 | convert between BGR and YUV YUY2, YUV is 4:2:2 and interleaved as Y1/U/Y2/V, see color_convert_rgb_yuv_42x |
COLOR_RGB2YUV_YVYU Python: cv.COLOR_RGB2YUV_YVYU | convert between RGB and YUV YVYU, YUV is 4:2:2 and interleaved as Y1/V/Y2/U, see color_convert_rgb_yuv_42x |
COLOR_BGR2YUV_YVYU Python: cv.COLOR_BGR2YUV_YVYU | convert between BGR and YUV YVYU, YUV is 4:2:2 and interleaved as Y1/V/Y2/U, see color_convert_rgb_yuv_42x |
COLOR_RGB2YUV_YUYV Python: cv.COLOR_RGB2YUV_YUYV | synonym to YUY2 |
COLOR_BGR2YUV_YUYV Python: cv.COLOR_BGR2YUV_YUYV | synonym to YUY2 |
COLOR_RGB2YUV_YUNV Python: cv.COLOR_RGB2YUV_YUNV | synonym to YUY2 |
COLOR_BGR2YUV_YUNV Python: cv.COLOR_BGR2YUV_YUNV | synonym to YUY2 |
COLOR_RGBA2YUV_YUY2 Python: cv.COLOR_RGBA2YUV_YUY2 | convert between RGBA and YUV YUY2, YUV is 4:2:2 and interleaved as Y1/U/Y2/V, see color_convert_rgb_yuv_42x |
COLOR_BGRA2YUV_YUY2 Python: cv.COLOR_BGRA2YUV_YUY2 | convert between BGRA and YUV YUY2, YUV is 4:2:2 and interleaved as Y1/U/Y2/V, see color_convert_rgb_yuv_42x |
COLOR_RGBA2YUV_YVYU Python: cv.COLOR_RGBA2YUV_YVYU | convert between RGBA and YUV YVYU, YUV is 4:2:2 and interleaved as Y1/V/Y2/U, see color_convert_rgb_yuv_42x |
COLOR_BGRA2YUV_YVYU Python: cv.COLOR_BGRA2YUV_YVYU | convert between BGRA and YUV YVYU, YUV is 4:2:2 and interleaved as Y1/V/Y2/U, see color_convert_rgb_yuv_42x |
COLOR_RGBA2YUV_YUYV Python: cv.COLOR_RGBA2YUV_YUYV | synonym to YUY2 |
COLOR_BGRA2YUV_YUYV Python: cv.COLOR_BGRA2YUV_YUYV | synonym to YUY2 |
COLOR_RGBA2YUV_YUNV Python: cv.COLOR_RGBA2YUV_YUNV | synonym to YUY2 |
COLOR_BGRA2YUV_YUNV Python: cv.COLOR_BGRA2YUV_YUNV | synonym to YUY2 |
COLOR_COLORCVT_MAX Python: cv.COLOR_COLORCVT_MAX |
void cv::cvtColor | ( | InputArray | src, |
OutputArray | dst, | ||
int | code, | ||
int | dstCn = 0 , |
||
AlgorithmHint | hint = cv::ALGO_HINT_DEFAULT |
||
) |
Python: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cv.cvtColor( | src, code[, dst[, dstCn[, hint]]] | ) -> | dst |
#include <opencv2/imgproc.hpp>
Converts an image from one color space to another.
The function converts an input image from one color space to another. In case of a transformation to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on.
The conventional ranges for R, G, and B channel values are:
In case of linear transformations, the range does not matter. But in case of a non-linear transformation, an input RGB image should be normalized to the proper value range to get the correct results, for example, for RGB \(\rightarrow\) L*u*v* transformation. For example, if you have a 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will have the 0..255 value range instead of 0..1 assumed by the function. So, before calling cvtColor , you need first to scale the image down:
If you use cvtColor with 8-bit images, the conversion will have some information lost. For many applications, this will not be noticeable but it is recommended to use 32-bit images in applications that need the full range of colors or that convert an image before an operation and then convert back.
If conversion adds the alpha channel, its value will set to the maximum of corresponding channel range: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F.
src | input image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision floating-point. |
dst | output image of the same size and depth as src. |
code | color space conversion code (see ColorConversionCodes). |
dstCn | number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from src and code. |
hint | Implementation modfication flags. See AlgorithmHint |
void cv::cvtColorTwoPlane | ( | InputArray | src1, |
InputArray | src2, | ||
OutputArray | dst, | ||
int | code, | ||
AlgorithmHint | hint = cv::ALGO_HINT_DEFAULT |
||
) |
Python: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cv.cvtColorTwoPlane( | src1, src2, code[, dst[, hint]] | ) -> | dst |
#include <opencv2/imgproc.hpp>
Converts an image from one color space to another where the source image is stored in two planes.
This function only supports YUV420 to RGB conversion as of now.
src1 | 8-bit image (CV_8U) of the Y plane. |
src2 | image containing interleaved U/V plane. |
dst | output image. |
code | Specifies the type of conversion. It can take any of the following values: |
hint | Implementation modfication flags. See AlgorithmHint |
void cv::demosaicing | ( | InputArray | src, |
OutputArray | dst, | ||
int | code, | ||
int | dstCn = 0 |
||
) |
Python: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cv.demosaicing( | src, code[, dst[, dstCn]] | ) -> | dst |
#include <opencv2/imgproc.hpp>
main function for all demosaicing processes
src | input image: 8-bit unsigned or 16-bit unsigned. |
dst | output image of the same size and depth as src. |
code | Color space conversion code (see the description below). |
dstCn | number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from src and code. |
The function can do the following transformations:
Demosaicing using bilinear interpolation
COLOR_BayerBG2BGR , COLOR_BayerGB2BGR , COLOR_BayerRG2BGR , COLOR_BayerGR2BGR
COLOR_BayerBG2GRAY , COLOR_BayerGB2GRAY , COLOR_BayerRG2GRAY , COLOR_BayerGR2GRAY
Demosaicing using Variable Number of Gradients.
COLOR_BayerBG2BGR_VNG , COLOR_BayerGB2BGR_VNG , COLOR_BayerRG2BGR_VNG , COLOR_BayerGR2BGR_VNG
Edge-Aware Demosaicing.
COLOR_BayerBG2BGR_EA , COLOR_BayerGB2BGR_EA , COLOR_BayerRG2BGR_EA , COLOR_BayerGR2BGR_EA
Demosaicing with alpha channel
COLOR_BayerBG2BGRA , COLOR_BayerGB2BGRA , COLOR_BayerRG2BGRA , COLOR_BayerGR2BGRA