Detection of Spaces between books using OpenCV 3 C++

asked 2017-02-12 10:17:54 -0500

Libot gravatar image

updated 2017-02-12 11:07:46 -0500

Hello, i was reading about another post about this on this site by @shamshun although I guess it never got resolved. Anyway, my problem is somewhat similar to the other post. I am currently working on a project which is a Library shelving robot, in which I have to detect books (using their spines) and be able to detect spaces in from books (whether they are tilted or in parallel-vertical positions) in order for my robot to know where to return a book to the shelf which is on the space detected. Basically the code would have to do the following:

  1. Detect contours of books.
  2. Find the biggest space between two books.
  3. Retrieve location of the location of the centroid of that space.

It would also help if the code has a training function in order for me to be able to track selected books easily.

Also, these are to be detected via Webcamera in a live stream video.

I just started learning OpenCV and C++ (I just know the basics of C language) and can't seem to make contour detection work on my project so far and have read somewhat a decent amount of resources from opencv's document source so it would really help me a lot if there would be someone to guide me in creating this code.

Thank you for your time :).

edit retag flag offensive close merge delete


Why do you think finding contours is the best path forward? Perhaps you should prototype a variety of approaches? Text detection/recognition? RGB segmentation? Vertical lines?

Der Luftmensch gravatar imageDer Luftmensch ( 2017-02-12 12:22:31 -0500 )edit

I believe using the contour functions in OpenCV 3 is useful as i can get certain data like moment and the bounding box? I don't think text detection would work as there are several fonts in various book spines. Isn't vertical lines the same as contours? Is there a way to create a rectangle bounding the book spine?

Libot gravatar imageLibot ( 2017-02-12 18:30:40 -0500 )edit