c++ - Thresholing a RGB image using inrange (OpenCV) -


i'm filtering rgb image (attached rgb image) inrange function filter out colors in image except orange.

cv::mat output; cv::inrange(image, cv::scalar(255, 140 , 0), cv::scalar(255, 165, 0),output); cv::imshow("output", output); 

however return black output. additionally, saw question using inrange function used values

cv::inrange(image, cv::scalar(0, 125, 0), cv::scalar(255, 200, 255), output); 

and when use these values returns right output. difference here , doing wrong?

the orange color in image (254, 165, 0). more importantly, images in opencv in bgr order, need do:

cv::inrange(image, cv::scalar(0, 140, 254), cv::scalar(0, 165, 254), output); 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -