-
Notifications
You must be signed in to change notification settings - Fork 0
Description
In our current map classification pipeline, we use cv2.createLineSegmentDetector() for line detection. This method works well for detecting straight lines and achieves a satisfying F1 score on the current dataset. However, it is limited in its ability to detect curved or complex line structures, which are common in geological maps.
An alternative worth exploring is skimage.measure.find_contours(), which uses the Marching Squares algorithm to identify contours in images. This approach has the advantage of detecting arbitrary shapes, including curves, making it potentially more suitable for capturing the nuanced structures in maps. The function returns pixel-based contour chains from a binarized input image and can serve as a foundation for polygonal or B-spline approximation.
That said, this method comes with some challenges. Because it relies on marching squares, interruptions in lines - such as those caused by overlapping text - can prevent it from identifying continuous structures. Furthermore, since the output consists of pixel chains rather than vectorized line segments, additional processing is necessary to make the results usable in our pipeline.
The required preprocessing (binarization and edge detection) has already been implemented. Visualizations of the results using find_contours() can be found in the edge detection notebook. The next step is to test the output with a polygon or B-spline approximation to see how well the curves can be reconstructed. This should then be compared to the current LineSegmentDetector approach, both in terms of F1 score and qualitative accuracy. If the results are promising, it may also be worth exploring a hybrid solution that combines straight and curved line detection.
For reference, see the internal documentation on Datenextraktion.