Ask Your Question
0

How to check if pixel is near white color

asked 2014-11-12 01:27:11 -0600

Compvis gravatar image

Hi, I have an color image (BGR)in a Mat. How can i check if pixel near white color?

Thanks

edit retag flag offensive close merge delete

Comments

1

cv::inRange

rwong gravatar imagerwong ( 2014-11-12 23:57:02 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-11-12 04:00:59 -0600

You could convert it to gray-scale (cv::cvtColor) and compare its value to white (which could be 1.0 or 255 depending on your image type). A fast way to do this for all pixels is cv::threshold.

edit flag offensive delete link more
0

answered 2014-11-12 04:07:44 -0600

Hi @Compvis Please check this thread! you may find this useful.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-11-12 01:27:11 -0600

Seen: 1,134 times

Last updated: Nov 12 '14