Ask Your Question

Recognize an object from a flat background?

asked 2012-09-21 10:57:38 -0600

yes123 gravatar image

updated 2012-09-21 14:14:27 -0600

Hi Guys,

Consider I have a book (an object) over an uniform background. Which technique within OpenCV would you suggest me to extract only the object? (the ROI)

What I was thinking:

  • extract the interest point of the image (FAST, harris corner etc)
  • get the 4 points at the extrema
  • extract a roi with those 4 points
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-09-21 13:09:03 -0600

unxnut gravatar image

You can compute the mean pixel value in the entire image and then, compute the mean of a small window (say 5x5) at an arbitrary point. A pixel value between those two means will give you a threshold that can be applied to extract the object.

This will work pretty well if you know whether the object is brighter or darker than the background. If you do not have that information, you can still find it but will need more work.

edit flag offensive delete link more

Question Tools



Asked: 2012-09-21 10:57:38 -0600

Seen: 628 times

Last updated: Sep 21 '12