美文网首页
OpenCV 教程 07 : 色彩空间缩减

OpenCV 教程 07 : 色彩空间缩减

作者: wjundong | 来源:发表于2020-02-23 23:27 被阅读0次

示例代码

#include <opencv2/opencv.hpp>

using namespace cv;

int main(int argc, char const *argv[])
{

    Mat image = imread("2.jpg"), out;
    Mat table(1, 256, CV_8U);
    for(int i=0; i<256; ++i)
        table.data[i] = i/10*10;

    // 使用官方推荐使用LUT 函数,只要我们提供 table 就可以了
    LUT(image, table, out);

    imshow("原图", image);
    imshow("结果", out);

    waitKey(0);
}

运行结果

原图 结果

相关文章

网友评论

      本文标题:OpenCV 教程 07 : 色彩空间缩减

      本文链接:https://www.haomeiwen.com/subject/rybeqhtx.html