I'm writing a program that takes an image of a bookshelf and tries to separate out the books by using the HoughLinesP method in OpenCV. The method works, and, after some filtering by length and angle, the image below is produced:
The next filter I would like to do is to filter the adjacent lines out as seen in the picture. However, the method doesn't return the lines back in any specfic order so I was wondering if anyone knew of a way to filter out lines that are within 10px of each other. I am using Java (but it shouldn't really matter as OpenCV is universal).
Thanks in advance to anyone who has any information to share!