Reputation: 482
When you photograph a bookshelf, the spines of the books appear as rectangles (more or less). I am trying to segment images of books in a bookshelf(, and later compare them to my dataset of book images.)
As can be seen in the above image, the individual book spines can be separated by their different color, shadows (between two books), and sometimes texture. The books in the provided image are set rather tidy, but books can sometimes lean on other books; so their spine "rectangles" may have any orientation. Also, some books have rectangles printed on their spine! So they may be segmented as little books by mistake.
What is the best approach to segmenting the books? In other words, how can I detect rectangles of various size, color and texture?
Upvotes: 1
Views: 892
Reputation: 492
You could segment your image in superpixels (I recommend using SLIC [1] which is available in OpenCV), extract superpixel information and classify them based on this to obtain the final segmentation.
The superpixel should adhere to the books border, creating the desired rectangles.
The superpixel coordinates and texture/color is going to help you merge superpixels, for distinct books this might do the trick of segmenting them completely.
Upvotes: 1