0

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: enter image description here 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!

Andrew
  • 240
  • 1
  • 3
  • 13
  • If you look at the function [HoughLinesP](https://docs.opencv.org/2.4/modules/imgproc/doc/feature_detection.html?highlight=houghlinesp#houghlinesp), the last parameter _maxLineGap_ might be what you are looking for. – Rick M. Aug 01 '19 at 09:02
  • @RickM. Thank you for your reply! I have tried to play around with the maxLineGap parameter and this has helped me connect segments to form long lines. However, I would like to remove the long lines formed from the text on the spine of the books as shown in the picture which I don't think maxLineGap can do. – Andrew Aug 01 '19 at 14:45

0 Answers0