Ask Your Question

Revision history [back]

you can use == or inRange

Mat im=imread("lena.jpg",CV_LOAD_IMAGE_GRAYSCALE);
Mat dst;

dst = im==3;
imshow("== 3 ",dst);
inRange(im,120,140,dst);
imshow("inrange [120,1420]",dst);
waitKey();

you can use == or inRange

Mat im=imread("lena.jpg",CV_LOAD_IMAGE_GRAYSCALE);
Mat dst;

dst = im==3;
imshow("== 3 ",dst);
inRange(im,120,140,dst);
imshow("inrange [120,1420]",dst);
waitKey();

mat dst can be used after a mask