In this post, we will see how to resolve How do you detect the largest set of parallel lines in an image?
Question:
I have images with multiple line in them and I’m looking to detect the largest set of lines which are (approximately) parallel using Python and OpenCV. For example give:
The green lines are the best set:

Best Answer:
you can follow the following steps- Apply the Hough Line Transform to detect all line segments in the image.
- Group the line segments based on their orientation using a clustering
- Identify the largest cluster of lines. These will be the set of lines that are approximately parallel.
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com