OpenCV对比度保持脱色

时间:2015-09-22 11:37:58

标签: opencv colors

OpenCV是否包含(或有贡献)灰色对话的成熟颜色(类似对比度保留脱色)?

1 个答案:

答案 0 :(得分:2)

您可以使用照片 contrib模块的OpenCV decolor功能。

#include <opencv2\opencv.hpp>
#include <opencv2\photo.hpp>
using namespace cv;

int main()
{
    Mat3b img = imread("path_to_image");

    Mat1b grayscale;
    Mat3b color_boost;

    decolor(img, grayscale, color_boost);


    imshow("Original", img);
    imshow("Grayscale", grayscale);
    imshow("Color Boost", color_boost);
    waitKey();

    return 0;
}

原件:

enter image description here

灰度:

enter image description here

Color Boost:

enter image description here