mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
namespace opencv_test { namespace {
|
||||
TEST(Features2d_BlobDetector, bug_6667)
|
||||
{
|
||||
cv::Mat image = cv::Mat(cv::Size(100, 100), CV_8UC1, cv::Scalar(255, 255, 255));
|
||||
cv::circle(image, Point(50, 50), 20, cv::Scalar(0), -1);
|
||||
SimpleBlobDetector::Params params;
|
||||
params.minThreshold = 250;
|
||||
params.maxThreshold = 260;
|
||||
std::vector<KeyPoint> keypoints;
|
||||
|
||||
Ptr<SimpleBlobDetector> detector = SimpleBlobDetector::create(params);
|
||||
detector->detect(image, keypoints);
|
||||
ASSERT_NE((int) keypoints.size(), 0);
|
||||
}
|
||||
}} // namespace
|
||||
@@ -123,7 +123,7 @@ void NearestNeighborTest::run( int /*start_from*/ ) {
|
||||
Mat desc( featuresCount, dims, CV_32FC1 );
|
||||
ts->get_rng().fill( desc, RNG::UNIFORM, minValue, maxValue );
|
||||
|
||||
createModel( desc );
|
||||
createModel( desc.clone() ); // .clone() is used to simulate dangling pointers problem: https://github.com/opencv/opencv/issues/17553
|
||||
|
||||
tempCode = checkGetPoints( desc );
|
||||
if( tempCode != cvtest::TS::OK )
|
||||
|
||||
@@ -90,7 +90,7 @@ TEST(Features2D_ORB, _1996)
|
||||
ASSERT_EQ(0, roiViolations);
|
||||
}
|
||||
|
||||
TEST(Features2D_ORB, crash)
|
||||
TEST(Features2D_ORB, crash_5031)
|
||||
{
|
||||
cv::Mat image = cv::Mat::zeros(cv::Size(1920, 1080), CV_8UC3);
|
||||
|
||||
@@ -123,4 +123,23 @@ TEST(Features2D_ORB, crash)
|
||||
ASSERT_NO_THROW(orb->compute(image, keypoints, descriptors));
|
||||
}
|
||||
|
||||
|
||||
TEST(Features2D_ORB, regression_16197)
|
||||
{
|
||||
Mat img(Size(72, 72), CV_8UC1, Scalar::all(0));
|
||||
Ptr<ORB> orbPtr = ORB::create();
|
||||
orbPtr->setNLevels(5);
|
||||
orbPtr->setFirstLevel(3);
|
||||
orbPtr->setScaleFactor(1.8);
|
||||
orbPtr->setPatchSize(8);
|
||||
orbPtr->setEdgeThreshold(8);
|
||||
|
||||
std::vector<KeyPoint> kps;
|
||||
Mat fv;
|
||||
|
||||
// exception in debug mode, crash in release
|
||||
ASSERT_NO_THROW(orbPtr->detectAndCompute(img, noArray(), kps, fv));
|
||||
}
|
||||
|
||||
|
||||
}} // namespace
|
||||
|
||||
Reference in New Issue
Block a user