Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As suggested, you can use the floodfill. For your image, this code will probably work out.

//Use this mouse call back for selecting the seedpoint.

void onMouse( int event, int x, int y, int, void* ) {

if( event != EVENT_LBUTTONDOWN )
    return;

//Floodfill the image with green colour.
floodFill(InputImage, Point(x,y), Scalar(0,255,0), NULL, Scalar::all(10), Scalar::all(10));
imshow("FloodFill",InputImage);

}