1 | initial version |
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();
2 | No.2 Revision |
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