Skip to content

Check for empty vector to avoid throwing an exception in LineSegmentDetectorImpl::drawSegments() #27476

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

Merged

Conversation

s-trinh
Copy link
Contributor

@s-trinh s-trinh commented Jun 24, 2025

Check for empty vector to avoid throwing an exception in LineSegmentDetectorImpl::drawSegments() function.
Otherwise it throws:

Exception message: OpenCV(4.12.0-pre) <>/opencv/modules/imgproc/src/lsd.cpp:1081: error: (-215:Assertion failed) _lines.depth() == CV_32F || _lines.depth() == CV_32S in function 'drawSegments'

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov added this to the 4.12.0 milestone Jun 24, 2025
@asmorkalov asmorkalov self-requested a review June 24, 2025 05:12
@asmorkalov asmorkalov self-assigned this Jun 24, 2025
@asmorkalov asmorkalov merged commit e392b38 into opencv:4.x Jun 24, 2025
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy