1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Implementation of bit-exact resize. Internal calls to linear resize updated to use bit-exact version. (#9468)

This commit is contained in:
Vitaly Tuzov
2017-12-13 15:00:38 +03:00
committed by Vadim Pisarevsky
parent 84ee4d701a
commit 51cb56ef2c
57 changed files with 1300 additions and 112 deletions
+2 -2
View File
@@ -1060,10 +1060,10 @@ void ORB_Impl::detectAndCompute( InputArray _image, InputArray _mask,
// Compute the resized image
if( level != firstLevel )
{
resize(prevImg, currImg, sz, 0, 0, INTER_LINEAR);
resize(prevImg, currImg, sz, 0, 0, INTER_LINEAR_EXACT);
if( !mask.empty() )
{
resize(prevMask, currMask, sz, 0, 0, INTER_LINEAR);
resize(prevMask, currMask, sz, 0, 0, INTER_LINEAR_EXACT);
if( level > firstLevel )
threshold(currMask, currMask, 254, 0, THRESH_TOZERO);
}
@@ -132,7 +132,7 @@ TEST_P(DescriptorScaleInvariance, scale)
float scale = 1.f + scaleIdx * 0.5f;
Mat image1;
resize(image0, image1, Size(), 1./scale, 1./scale);
resize(image0, image1, Size(), 1./scale, 1./scale, INTER_LINEAR_EXACT);
vector<KeyPoint> keypoints1;
scaleKeyPoints(keypoints0, keypoints1, 1.0f/scale);
@@ -166,7 +166,7 @@ TEST_P(DetectorScaleInvariance, scale)
{
float scale = 1.f + scaleIdx * 0.5f;
Mat image1;
resize(image0, image1, Size(), 1./scale, 1./scale);
resize(image0, image1, Size(), 1./scale, 1./scale, INTER_LINEAR_EXACT);
vector<KeyPoint> keypoints1, osiKeypoints1; // osi - original size image
featureDetector->detect(image1, keypoints1);