Detection of Spaces between books using OpenCV 3 C++
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:
- Detect contours of books.
- Find the biggest space between two books.
- 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 :).
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?
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?