cesine / AndroidOpenCVforHackathons

A hackathon ready project with selfdocumenting OpenCV debugging so you can get programming with OpenCV as soon as possible
4 stars 7 forks source link

Draw masks on the image #10

Open cesine opened 12 years ago

cesine commented 12 years ago

This is an exciting one.

Step 1: To draw a mask on the image showing contrasts you should first pick a Matrix to calculate over. In this case we chose yellow since its not a common color for ink.

Step 2: Call the adaptive threshold function

adaptiveThreshold(yellow, thresh, 255, ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY_INV, 31, 11);

Step 3: tweek it

adaptiveThreshold(yellow, thresh, 255, ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY_INV, 21, 11);

For more details on what the adaptiveThreshold is doing, and how to tweek it to suit your needs: http://opencv.itseez.com/modules/imgproc/doc/miscellaneous_transformations.html?highlight=adaptivethreshold