Hi all, how can I draw a circle around a white space in a image file with OpenCV (C language)?
image example:
thanks a lot!
Hi all, how can I draw a circle around a white space in a image file with OpenCV (C language)?
image example:
thanks a lot!
You don't really need opencv for that, you just loop over your image and calculate the bounding box surrounding the white blob, get the center and the radius of your circle is the length from the center to any corner. Then just use GDI or something to draw your circle.
First you can use FindContours
to find all (in your case 1) contours (blobs/regions) in the image, then you can draw a circle or any other shape you want around the contour.
Edit: To draw a circle you can use Circle
.