1 Mat blue,white,bule_noHalo; 2 inRange(frame, Scalar(230, 0, 0), Scalar(255, 255, 255), white); 3 cvtColor(frame, frame,COLOR_BGR2HSV); 4 //cvtColor(frame, frame, COLOR_HSV2BGR); 5 //inRange(frame, Scalar(100, 43, 46), Scalar(124, 255, 255),blue); 6 inRange(frame, Scalar(80, 40, 100), Scalar(150, 255, 255), blue); 7 8 imshow("blue", blue); 9 imshow("white", white); 10 11 bitwise_and(blue,white, bule_noHalo); 12 imshow("bule_noHalo", bule_noHalo);
将提取出来的蓝色与,限制高蓝色的白色通道做位与