mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
fixed segfault at ORB::compute() near image's border
This commit is contained in:
committed by
Alexander Alekhin
parent
53f72f18f5
commit
13b9dd3963
@@ -90,3 +90,36 @@ TEST(Features2D_ORB, _1996)
|
||||
|
||||
ASSERT_EQ(0, roiViolations);
|
||||
}
|
||||
|
||||
TEST(Features2D_ORB, crash)
|
||||
{
|
||||
cv::Mat image = cv::Mat::zeros(cv::Size(1920, 1080), CV_8UC3);
|
||||
|
||||
int nfeatures = 8000;
|
||||
float orbScaleFactor = 1.2f;
|
||||
int nlevels = 18;
|
||||
int edgeThreshold = 4;
|
||||
int firstLevel = 0;
|
||||
int WTA_K = 2;
|
||||
int scoreType = cv::ORB::HARRIS_SCORE;
|
||||
int patchSize = 47;
|
||||
int fastThreshold = 20;
|
||||
|
||||
Ptr<ORB> orb = cv::ORB::create(nfeatures, orbScaleFactor, nlevels, edgeThreshold, firstLevel, WTA_K, scoreType, patchSize, fastThreshold);
|
||||
|
||||
std::vector<cv::KeyPoint> keypoints;
|
||||
cv::Mat descriptors;
|
||||
|
||||
cv::KeyPoint kp;
|
||||
kp.pt.x = 443;
|
||||
kp.pt.y = 5;
|
||||
kp.size = 47;
|
||||
kp.angle = 53.4580612f;
|
||||
kp.response = 0.0000470733867f;
|
||||
kp.octave = 0;
|
||||
kp.class_id = -1;
|
||||
|
||||
keypoints.push_back(kp);
|
||||
|
||||
ASSERT_NO_THROW(orb->compute(image, keypoints, descriptors));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user