When I use from OpenCV 2.4.2 :
cv::findContours()
This is the output :
How can I get rid of all these irregular shapes and leave only straight lines ?
For this case you can use cvMinAreaRect2. this function gives you a CvBox2D, since the contour you want has the biggest Bounding box the larger box is your goal. also this function can help you to find contours around long lines.
您应该使用HoughLines
而不是findContours
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.