# Revision history [back]

### Line segment detector crashes when no keylines found?

For a particularly small .png image (i.e 200x200) which does not have any keylines, the algorith used to detect them crashes. Both v::line_descriptor::BinaryDescriptor::createBinaryDescriptor(); and LSDdet = cv::line_descriptor::LSDDetector::createLSDDetector(); detectors. I expected a more graceful behavior, if the only problem is that no keylines are detected. The code fails at line 2475 of binary_descriptor.cpp, with an

Access violation writing location 0x0000000000000000

error. The image producing the error is the following: Note that this is not the only image that produces the exact same error. Can please someone please reproduce the problem, and confirm that it is not just mine? Is there something i missed about how to handle the descriptor, or a requirement it might have about image sizes?

Pasting a minimal example that reproduces the error here:

cv::Mat Image = cv::imread("Image filename here", CV_LOAD_IMAGE_COLOR);
std::vector<cv::line_descriptor::KeyLine> keylines;
Ptr<cv::line_descriptor::BinaryDescriptor> LINES = cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor();
LINES->detect(Image, keylines);


### Line segment detector crashes when no keylines found?

For a particularly small .png image (i.e 200x200) which does not have any keylines, the algorith used to detect them crashes. Both v::line_descriptor::BinaryDescriptor::createBinaryDescriptor();cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor(); and LSDdet = cv::line_descriptor::LSDDetector::createLSDDetector(); detectors. I expected a more graceful behavior, if the only problem is that no keylines are detected. The code fails at line 2475 of binary_descriptor.cpp, with an

Access violation writing location 0x0000000000000000

error. The image producing the error is the following: Note that this is not the only image that produces the exact same error. Can please someone please reproduce the problem, and confirm that it is not just mine? Is there something i missed about how to handle the descriptor, or a requirement it might have about image sizes?

Pasting a minimal example that reproduces the error here:

cv::Mat Image = cv::imread("Image filename here", CV_LOAD_IMAGE_COLOR);
std::vector<cv::line_descriptor::KeyLine> keylines;
Ptr<cv::line_descriptor::BinaryDescriptor> LINES = cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor();
LINES->detect(Image, keylines);


### Line segment detector crashes when no keylines found?

For a particularly small .png image (i.e 200x200) which does not have any keylines, the algorith used to detect them crashes. Both cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor(); and LSDdet = cv::line_descriptor::LSDDetector::createLSDDetector(); detectors. I expected a more graceful behavior, if the only problem is that no keylines are detected. The code fails at line 2475 of binary_descriptor.cpp, with an

Access violation writing location 0x0000000000000000

error. The image producing the error is the following: Note that this is not the only image that produces the exact same error. Can please someone please reproduce the problem, and confirm that it is not just mine? Is there something i missed about how to handle the descriptor, or a requirement it might have about image sizes?

Pasting a minimal example that reproduces the error here:

cv::Mat Image = cv::imread("Image filename here", CV_LOAD_IMAGE_COLOR);
std::vector<cv::line_descriptor::KeyLine> keylines;
Ptr<cv::line_descriptor::BinaryDescriptor> LINES = cv::line_descriptor::BinaryDescriptor::createBinaryDescriptor();
LINES->detect(Image, keylines);