First time here? Check out the FAQ!
answered 2018-07-30 05:04:12 -0600
Use inrange :
img = imread("g:/lib/opencv/samples/data/lena.jpg",IMREAD_COLOR); Mat mask; inRange(img, Vec3b(0, 0, 100), Vec3b(255, 255, 255), mask); img.copyTo(gray, mask);