ximgproc: move LineSegmentDetector (LSD) from imgproc - #4158
Open
JArmandoAnaya wants to merge 1 commit into
Open
ximgproc: move LineSegmentDetector (LSD) from imgproc#4158JArmandoAnaya wants to merge 1 commit into
JArmandoAnaya wants to merge 1 commit into
Conversation
As part of the imgproc cleanup in opencv/opencv#25001, this adds the Line Segment Detector moved out of opencv core's imgproc: the LineSegmentDetector class, the createLineSegmentDetector factory and the LineSegmentDetectorModes enum, alongside the existing FastLineDetector. This is the opencv_contrib side of the change. A companion pull request on the main repository removes LSD from imgproc, and the two are meant to be merged together so the functions are never defined in both modules at once. The public interface is unchanged apart from the namespace, so callers reach the detector through cv::ximgproc now. The implementation, the public header and the accuracy test move across unchanged apart from the cv::ximgproc namespace, so it reads as a straight move. The lsd_lines sample is included as well.
This was referenced Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As part of the imgproc cleanup in opencv/opencv #25001, this moves the Line
Segment Detector (
LineSegmentDetector) from imgproc into ximgproc. LSD is aself-contained, rarely used detector with no callers elsewhere in the library,
and ximgproc already provides a sibling FastLineDetector, so the extended module
is a more natural home for it.
This is the opencv_contrib side of the change. A companion pull request on the
main repository removes LSD from imgproc, and the two are meant to be merged
together so the detector is never defined in both modules at once. The public
interface is unchanged apart from the namespace, so callers reach the detector
through
cv::ximgprocnow.The implementation, the public header (the
LineSegmentDetectorclass, thecreateLineSegmentDetectorfactory and theLineSegmentDetectorModesenum) andthe accuracy test move across unchanged apart from the
cv::ximgprocnamespace,so it reads as a straight move. The
lsd_linessample is included as well.The accuracy test moved with the function and still passes (18 cases across the
NONE / STD / ADV refinement modes and the common draw/compare paths).
Pull Request Readiness Checklist
Patch to opencv_extra has the same branch name.