Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Just,

Convert to GRAY using cvtColor()

Mat src= imread("src.jpg",1); // load source image
Mat gray;
cvtColor(src, gray, CV_BGR2GRAY); //perform gray scale conversion.

Now threshold the image to get the desired result

threshold( gray, thr, 100,255,THRESH_BINARY );

You can start from tutorial page.

Just,

Convert source to GRAY using cvtColor()

Mat src= imread("src.jpg",1); // load source image
Mat gray;
cvtColor(src, gray, CV_BGR2GRAY); //perform gray scale conversion.

Now threshold the image to get the desired result

threshold( gray, thr, 100,255,THRESH_BINARY );

You can start from tutorial page.