Reputation: 1600
The sample project that is available with openCV SDK named "OpenCV Sample - color-blob-detection" identifies the area according to the color of the object you select. It then draws contours around that object. It is possible to extract/highlight that particular area? Since there may also be some other object in the background with the same color, however that is not my desired object.
I know this maybe tricky and involves lot of processing, but some guidance on this will help. How can this be achieved?
Note :- The reason I am asking this, is later we want to model a temporary 3D object on the selected real time object. So differentiating it from the background objects is necessary.
Upvotes: 3
Views: 4472
Reputation: 1408
You should use pointPolygonTest(). In the process() function you should add to mContours only one contour, the one that pointPolygonTest returns true, using the coordinates of the touch.
You will need to pass the coordinates to the process() method.
Upvotes: 2