Ask Your Question

Revision history [back]

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:

  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.

I only made it in MS paint. The green rectangles would show the contours of the books and the red triangle, the space.

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 :).

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:

  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.

I only made it in MS paint. The green rectangles would show the contours of the books and the red triangle, the space.

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 :).