Question

I need to extract an object from an image where the background is almost flat...

Consider for example a book over a big white desktop.. I need to get the coordinates of the 4 corners of the book to extract a ROI.

Which technique using OpenCV would you suggest? I was thinking to use k Means but I can't know the color of the background a priori (also the colors inside the object can be vary)

Was it helpful?

Solution

If your background is really low contrast, why not try a flood fill from the image borders, then you can obtain bounding box or bounding rect afterwards.

Another option is to apply Hough transform and take intersection of most outer lines as corners. This is, if your object is rectangular.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top