-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Added edge input feature to fast_line_detector #2716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
*/ | ||
CV_WRAP virtual void detect(InputArray _image, OutputArray _lines) = 0; | ||
CV_WRAP virtual void detect(InputArray _image, OutputArray _lines, | ||
bool is_edge = false) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detect()
is not a right place for algorithm parameters tuning. See createFastLineDetector()
Can we check some canny parameters to handle that without touching API?
For example, canny_aperture_size == 0
Deleted is_edge option from detect().
@alalek |
Try to split this assertion check first. BTW, There is no sense to define |
I failed to state the situation correctly.
I agree. |
You should add this check before |
Removed the input_edge option from createFastLineDetector().
Thanks for the kind comments. |
@@ -544,7 +545,8 @@ void FastLineDetectorImpl::lineDetection(const Mat& src, std::vector<SEGMENT>& s | |||
std::vector<Point2i> points; | |||
std::vector<SEGMENT> segments, segments_tmp; | |||
Mat canny; | |||
Canny(src, canny, canny_th1, canny_th2, canny_aperture_size); | |||
if (canny_aperture_size == 0) canny = src; | |||
else Canny(src, canny, canny_th1, canny_th2, canny_aperture_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using dedicated lines for if/else bodies.
It is necessary to see real picture from "code coverage" line-based reports (example of weekly report).
* @param _do_merge false - If true, incremental merging of segments | ||
will be perfomred | ||
* will be perfomred |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be performed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. Fixed it.
I tried, but is this what you mean? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! Thank you 👍
Thank you for accepting it. Thanks for all the kind comments. |
Fixed issue #2667 in opencv/opencv_contrib
Added the
is_edge
option to thedetect
method infast_line_detector
.The Fast Line Detector used to use the canny method for edge detection internally, but
is_edge=true
makes it possible to input the edge image directly. Parameters for the canny method are ignored. The default value isfalse
, so it won't break anyone's code.This feature will provide users with additional flexibility and versatility in FastLineDetector.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.