When I run cv::findContours()
on my thresholded image I am getting the contours I want but the contours are polygons not polylines.
Is it possible to make cv::findContours()
return contours as polylines not polygons? If not, is there an OpenCV way to convert polygons to polylines?
Below is my threshold image that I use for findContours and also the result - you can see the largest contour I found is a polygon but I am hoping it to be a polyline traversing the mountain ridge.
findContours(thresh, contours, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);