美文网首页
day-009 cvtColor

day-009 cvtColor

作者: zeem0ny | 来源:发表于2018-12-10 23:07 被阅读0次
#include <opencv2/opencv.hpp>
#include <iostream>

using namespace cv;
using namespace std;
int main(){

    namedWindow("input", WINDOW_AUTOSIZE);

    Mat hsv;//直方图相关算法会常用

    Mat src2 = imread("/Users/yuzhemin/Pictures/test3.png");
    cvtColor(src2, hsv, COLOR_BGR2HSV);
    imshow("src2", src2);

    Mat mask, dst, result, result2;
    inRange(hsv, Scalar(35, 43, 46), Scalar(78, 255, 255), mask);
    imshow("mask", mask);
    bitwise_not(mask, dst);
    //imshow("dst", dst);
    bitwise_and(src2, src2, result, dst);
    imshow("result", result);
   // bitwise_or(result, dst, result2);
  //  imshow("result2", result2);
    waitKey(0);
    return 0;

相关文章

网友评论

      本文标题:day-009 cvtColor

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