Merge pull request #1482 from terfendail:bitexact_resize

pull/1491/head
Vadim Pisarevsky 7 years ago
commit e53977f64b
  1. 2
      modules/bgsegm/test/test_backgroundsubtractor_lsbp.cpp
  2. 2
      modules/ccalib/src/randpattern.cpp
  3. 4
      modules/dpm/src/dpm_feature.cpp
  4. 2
      modules/face/samples/facemark_lbf_fitting.cpp
  5. 2
      modules/face/samples/sampleDetectLandmarks.cpp
  6. 2
      modules/face/samples/sampleDetectLandmarksvideo.cpp
  7. 4
      modules/face/samples/sample_face_swapping.cpp
  8. 2
      modules/face/src/face_alignment.cpp
  9. 2
      modules/face/src/facemarkAAM.cpp
  10. 2
      modules/face/tutorials/face_landmark/face_landmark_detection.markdown
  11. 2
      modules/face/tutorials/face_landmark/face_landmark_video.markdown
  12. 4
      modules/face/tutorials/face_landmark/sample_face_swapping.markdown
  13. 2
      modules/img_hash/src/average_hash.cpp
  14. 2
      modules/img_hash/src/block_mean_hash.cpp
  15. 2
      modules/img_hash/src/phash.cpp
  16. 4
      modules/line_descriptor/samples/matching.cpp
  17. 2
      modules/line_descriptor/src/binary_descriptor.cpp
  18. 4
      modules/optflow/perf/opencl/perf_dis_optflow.cpp
  19. 4
      modules/optflow/perf/perf_disflow.cpp
  20. 2
      modules/saliency/src/BING/objectnessBING.cpp
  21. 4
      modules/saliency/src/motionSaliencyBinWangApr2014.cpp
  22. 6
      modules/saliency/src/staticSaliencySpectralResidual.cpp
  23. 4
      modules/structured_light/samples/cap_pattern.cpp
  24. 4
      modules/structured_light/samples/pointcloud.cpp
  25. 4
      modules/text/samples/end_to_end_recognition.cpp
  26. 2
      modules/text/samples/webcam_demo.cpp
  27. 2
      modules/text/src/ocr_beamsearch_decoder.cpp
  28. 8
      modules/text/src/ocr_hmm_decoder.cpp
  29. 2
      modules/text/src/ocr_holistic.cpp
  30. 4
      modules/tracking/src/gtrTracker.cpp
  31. 2
      modules/tracking/src/tldDetector.hpp
  32. 2
      modules/tracking/src/tldModel.cpp
  33. 2
      modules/tracking/src/tldTracker.cpp
  34. 2
      modules/tracking/src/tldUtils.cpp
  35. 2
      modules/tracking/src/trackerKCF.cpp
  36. 7
      modules/xfeatures2d/src/sift.cpp
  37. 4
      modules/xfeatures2d/test/test_rotation_and_scale_invariance.cpp
  38. 4
      modules/ximgproc/perf/perf_disparity_wls_filter.cpp
  39. 6
      modules/ximgproc/samples/disparity_filtering.cpp
  40. 2
      modules/ximgproc/samples/fast_hough_transform.cpp
  41. 2
      modules/ximgproc/samples/filterdemo.cpp
  42. 2
      modules/ximgproc/samples/thinning.cpp
  43. 4
      modules/ximgproc/test/test_adaptive_manifold.cpp
  44. 4
      modules/ximgproc/test/test_disparity_wls_filter.cpp
  45. 2
      modules/ximgproc/test/test_domain_transform.cpp
  46. 2
      modules/ximgproc/test/test_guided_filter.cpp
  47. 2
      modules/ximgproc/test/test_joint_bilateral_filter.cpp
  48. 2
      modules/ximgproc/test/test_rolling_guidance_filter.cpp
  49. 4
      modules/xobjdetect/src/waldboost.cpp
  50. 2
      modules/xobjdetect/src/wbdetector.cpp
  51. 2
      modules/xphoto/perf/perf_learning_based_color_balance.cpp

@ -91,7 +91,7 @@ template<typename T>
static double evaluateBGSAlgorithm(Ptr<T> bgs) {
Mat background = imread(getDataDir() + "shared/fruits.png");
Mat object = imread(getDataDir() + "shared/baboon.png");
cv::resize(object, object, Size(100, 100));
cv::resize(object, object, Size(100, 100), 0, 0, INTER_LINEAR_EXACT);
Ptr<bgsegm::SyntheticSequenceGenerator> generator = bgsegm::createSyntheticSequenceGenerator(background, object);
double f1_mean = 0;

@ -371,7 +371,7 @@ void RandomPatternGenerator::generatePattern()
Mat r = Mat(n, m, CV_32F);
cv::randn(r, Scalar::all(0), Scalar::all(1));
cv::resize(r, r, Size(_imageWidth ,_imageHeight));
cv::resize(r, r, Size(_imageWidth ,_imageHeight), 0, 0, INTER_LINEAR_EXACT);
double min_r, max_r;
minMaxLoc(r, &min_r, &max_r);

@ -87,7 +87,7 @@ void Feature::computeFeaturePyramid(const Mat &imageM, vector< Mat > &pyramid)
{
const double scale = (double)(1.0f/pow(params.sfactor, i));
Mat imScaled;
resize(imageM, imScaled, imSize * scale);
resize(imageM, imScaled, imSize * scale, 0, 0, INTER_LINEAR_EXACT);
// First octave at twice the image resolution
computeHOG32D(imScaled, pyramid[i], params.binSize/2,
params.padx + 1, params.pady + 1);
@ -106,7 +106,7 @@ void Feature::computeFeaturePyramid(const Mat &imageM, vector< Mat > &pyramid)
{
Mat imScaled2;
Size_<double> imScaledSize = imScaled.size();
resize(imScaled, imScaled2, imScaledSize*0.5);
resize(imScaled, imScaled2, imScaledSize*0.5, 0, 0, INTER_LINEAR_EXACT);
imScaled = imScaled2;
computeHOG32D(imScaled2, pyramid[j+params.interval],
params.binSize, params.padx + 1, params.pady + 1);

@ -104,7 +104,7 @@ int main(int argc, char** argv ){
double __time__ = (double)getTickCount();
float scale = (float)(400.0/frame.cols);
resize(frame, img, Size((int)(frame.cols*scale), (int)(frame.rows*scale)));
resize(frame, img, Size((int)(frame.cols*scale), (int)(frame.rows*scale)), 0, 0, INTER_LINEAR_EXACT);
facemark->getFaces(img, rects);
rects_scaled.clear();

@ -72,7 +72,7 @@ int main(int argc,char** argv){
facemark->loadModel(filename);
cout<<"Loaded model"<<endl;
vector<Rect> faces;
resize(img,img,Size(460,460));
resize(img,img,Size(460,460), 0, 0, INTER_LINEAR_EXACT);
facemark->getFaces(img,faces);
vector< vector<Point2f> > shapes;
if(facemark->fit(img,faces,shapes))

@ -83,7 +83,7 @@ int main(int argc,char** argv){
shapes.clear();
cap>>img;
//Detect faces in the current image
resize(img,img,Size(600,600));
resize(img,img,Size(600,600), 0, 0, INTER_LINEAR_EXACT);
facemark->getFaces(img,faces);
if(faces.size()==0){
cout<<"No faces found in this frame"<<endl;

@ -139,8 +139,8 @@ int main( int argc, char** argv)
//Detect faces in the current image
float ratio1 = (float)img1.cols/(float)img1.rows;
float ratio2 = (float)img2.cols/(float)img2.rows;
resize(img1,img1,Size((int)(640*ratio1),(int)(640*ratio1)));
resize(img2,img2,Size((int)(640*ratio2),(int)(640*ratio2)));
resize(img1,img1,Size((int)(640*ratio1),(int)(640*ratio1)), 0, 0, INTER_LINEAR_EXACT);
resize(img2,img2,Size((int)(640*ratio2),(int)(640*ratio2)), 0, 0, INTER_LINEAR_EXACT);
Mat img1Warped = img2.clone();
facemark->getFaces(img1,faces1);
facemark->getFaces(img2,faces2);

@ -173,7 +173,7 @@ bool FacemarkKazemiImpl::scaleData( vector< vector<Point2f> > & trainlandmarks,
//calculating scale for x and y axis
scalex=float(s.width)/float(trainimages[i].cols);
scaley=float(s.height)/float(trainimages[i].rows);
resize(trainimages[i],trainimages[i],s);
resize(trainimages[i],trainimages[i],s,0,0,INTER_LINEAR_EXACT);
for (vector<Point2f>::iterator it = trainlandmarks[i].begin(); it != trainlandmarks[i].end(); it++) {
Point2f pt = (*it);
pt.x = pt.x*scalex;

@ -374,7 +374,7 @@ bool FacemarkAAMImpl::fitImpl( const Mat image, std::vector<Point2f>& landmarks,
imgray = image;
}
resize(imgray,img,Size(int(image.cols/scale),int(image.rows/scale)));// matlab use bicubic interpolation, the result is float numbers
resize(imgray,img,Size(int(image.cols/scale),int(image.rows/scale)), 0, 0, INTER_LINEAR_EXACT);// matlab use bicubic interpolation, the result is float numbers
/*chop the textures model*/
int maxCol = param_m;

@ -63,7 +63,7 @@ in which landmarks have to be detected.
facemark->loadModel(filename);
cout<<"Loaded model"<<endl;
vector<Rect> faces;
resize(img,img,Size(460,460));
resize(img,img,Size(460,460),0,0,INTER_LINEAR_EXACT);
facemark->getFaces(img,faces);
vector< vector<Point2f> > shapes;

@ -74,7 +74,7 @@ while(1){
faces.clear();
shapes.clear();
cap>>img;
resize(img,img,Size(600,600));
resize(img,img,Size(600,600),0,0,INTER_LINEAR_EXACT);
facemark->getFaces(img,faces);
if(faces.size()==0){
cout<<"No faces found in this frame"<<endl;

@ -54,8 +54,8 @@ vector<Rect> faces1,faces2;
vector< vector<Point2f> > shape1,shape2;
float ratio1 = (float)img1.cols/(float)img1.rows;
float ratio2 = (float)img2.cols/(float)img2.rows;
resize(img1,img1,Size(640*ratio1,640*ratio1));
resize(img2,img2,Size(640*ratio2,640*ratio2));
resize(img1,img1,Size(640*ratio1,640*ratio1),0,0,INTER_LINEAR_EXACT);
resize(img2,img2,Size(640*ratio2,640*ratio2),0,0,INTER_LINEAR_EXACT);
Mat img1Warped = img2.clone();
facemark->getFaces(img1,faces1);
facemark->getFaces(img2,faces2);

@ -26,7 +26,7 @@ public:
input.type() == CV_8UC3 ||
input.type() == CV_8U);
cv::resize(input, resizeImg, cv::Size(8,8));
cv::resize(input, resizeImg, cv::Size(8,8), 0, 0, INTER_LINEAR_EXACT);
if(input.type() == CV_8UC3)
{
cv::cvtColor(resizeImg, grayImg, CV_BGR2GRAY);

@ -39,7 +39,7 @@ public:
input.type() == CV_8UC3 ||
input.type() == CV_8U);
cv::resize(input, resizeImg_, cv::Size(imgWidth,imgHeight));
cv::resize(input, resizeImg_, cv::Size(imgWidth,imgHeight), 0, 0, INTER_LINEAR_EXACT);
if(input.type() == CV_8UC3)
{
cv::cvtColor(resizeImg_, grayImg_, CV_BGR2GRAY);

@ -20,7 +20,7 @@ public:
input.type() == CV_8UC3 ||
input.type() == CV_8U);
cv::resize(input, resizeImg, cv::Size(32,32));
cv::resize(input, resizeImg, cv::Size(32,32), 0, 0, INTER_LINEAR_EXACT);
if(input.type() == CV_8UC3)
{
cv::cvtColor(resizeImg, grayImg, CV_BGR2GRAY);

@ -197,8 +197,8 @@ int main( int argc, char** argv )
/* plot matches */
cv::Mat lsd_outImg;
resize( imageMat1, imageMat1, Size( imageMat1.cols / 2, imageMat1.rows / 2 ) );
resize( imageMat2, imageMat2, Size( imageMat2.cols / 2, imageMat2.rows / 2 ) );
resize( imageMat1, imageMat1, Size( imageMat1.cols / 2, imageMat1.rows / 2 ), 0, 0, INTER_LINEAR_EXACT );
resize( imageMat2, imageMat2, Size( imageMat2.cols / 2, imageMat2.rows / 2 ), 0, 0, INTER_LINEAR_EXACT );
std::vector<char> lsd_mask( matches.size(), 1 );
drawLineMatches( imageMat1, octave0_1, imageMat2, octave0_2, good_matches, lsd_outImg, Scalar::all( -1 ), Scalar::all( -1 ), lsd_mask,
DrawLinesMatchesFlags::DEFAULT );

@ -723,7 +723,7 @@ int BinaryDescriptor::OctaveKeyLines( cv::Mat& image, ScaleLines &keyLines )
numOfFinalLine += edLineVec_[octaveCount]->lines_.numOfLines;
/* resize image for next level of pyramid */
cv::resize( blur, image, cv::Size(), ( 1.f / factor ), ( 1.f / factor ) );
cv::resize( blur, image, cv::Size(), ( 1.f / factor ), ( 1.f / factor ), INTER_LINEAR_EXACT );
/* update sigma values */
preSigma2 = curSigma2;

@ -94,8 +94,8 @@ void MakeArtificialExample(UMat &dst_frame1, UMat &dst_frame2)
UMat tmp(Size(dst_frame1.cols / (1 << src_scale), dst_frame1.rows / (1 << src_scale)), CV_8U);
randu(tmp, 0, 255);
resize(tmp, dst_frame1, dst_frame1.size(), 0.0, 0.0, INTER_LINEAR);
resize(tmp, dst_frame2, dst_frame2.size(), 0.0, 0.0, INTER_LINEAR);
resize(tmp, dst_frame1, dst_frame1.size(), 0.0, 0.0, INTER_LINEAR_EXACT);
resize(tmp, dst_frame2, dst_frame2.size(), 0.0, 0.0, INTER_LINEAR_EXACT);
Mat displacement_field(Size(dst_frame1.cols / (1 << OF_scale), dst_frame1.rows / (1 << OF_scale)),
CV_32FC2);

@ -88,8 +88,8 @@ void MakeArtificialExample(Mat &dst_frame1, Mat &dst_frame2)
Mat tmp(Size(dst_frame1.cols / (1 << src_scale), dst_frame1.rows / (1 << src_scale)), CV_8U);
randu(tmp, 0, 255);
resize(tmp, dst_frame1, dst_frame1.size(), 0.0, 0.0, INTER_LINEAR);
resize(tmp, dst_frame2, dst_frame2.size(), 0.0, 0.0, INTER_LINEAR);
resize(tmp, dst_frame1, dst_frame1.size(), 0.0, 0.0, INTER_LINEAR_EXACT);
resize(tmp, dst_frame2, dst_frame2.size(), 0.0, 0.0, INTER_LINEAR_EXACT);
Mat displacement_field(Size(dst_frame1.cols / (1 << OF_scale), dst_frame1.rows / (1 << OF_scale)),
CV_32FC2);

@ -138,7 +138,7 @@ void ObjectnessBING::predictBBoxSI( Mat &img3u, ValStructVec<float, Vec4i> &valB
height = min( height, imgH ), width = min( width, imgW );
Mat im3u, matchCost1f, mag1u;
resize( img3u, im3u, Size( cvRound( _W * imgW * 1.0 / width ), cvRound( _W * imgH * 1.0 / height ) ) );
resize( img3u, im3u, Size( cvRound( _W * imgW * 1.0 / width ), cvRound( _W * imgH * 1.0 / height ) ), 0, 0, INTER_LINEAR_EXACT );
gradientMag( im3u, mag1u );
matchCost1f = _tigF.matchTemplate( mag1u );

@ -515,8 +515,8 @@ bool MotionSaliencyBinWangApr2014::templateReplacement( const Mat& finalBFMask,
/* Check if the value of current pixel BA in potentialBackground model is already contained in at least one of its neighbors'
* background model
*/
resize( replicateCurrentBAMat, replicateCurrentBAMat, Size( backgroundModelROI.cols, backgroundModelROI.rows ), 0, 0, INTER_LINEAR );
resize( diffResult, diffResult, Size( backgroundModelROI.cols, backgroundModelROI.rows ), 0, 0, INTER_LINEAR );
resize( replicateCurrentBAMat, replicateCurrentBAMat, Size( backgroundModelROI.cols, backgroundModelROI.rows ), 0, 0, INTER_LINEAR_EXACT );
resize( diffResult, diffResult, Size( backgroundModelROI.cols, backgroundModelROI.rows ), 0, 0, INTER_LINEAR_EXACT );
backgroundModelROI.convertTo( backgroundModelROI, CV_8U );

@ -92,11 +92,11 @@ bool StaticSaliencySpectralResidual::computeSaliencyImpl( InputArray image, Outp
if( image.channels() == 3 )
{
cvtColor( image, imageGR, COLOR_BGR2GRAY );
resize( imageGR, grayDown, resizedImageSize, 0, 0, INTER_LINEAR );
resize( imageGR, grayDown, resizedImageSize, 0, 0, INTER_LINEAR_EXACT );
}
else
{
resize( image, grayDown, resizedImageSize, 0, 0, INTER_LINEAR );
resize( image, grayDown, resizedImageSize, 0, 0, INTER_LINEAR_EXACT );
}
grayDown.convertTo( realImage, CV_64F );
@ -130,7 +130,7 @@ bool StaticSaliencySpectralResidual::computeSaliencyImpl( InputArray image, Outp
magnitude = magnitude / maxVal;
magnitude.convertTo( magnitude, CV_32F );
resize( magnitude, saliencyMap, image.size(), 0, 0, INTER_LINEAR );
resize( magnitude, saliencyMap, image.size(), 0, 0, INTER_LINEAR_EXACT );
#ifdef SALIENCY_DEBUG
// visualize saliency map

@ -167,10 +167,10 @@ int main( int argc, char** argv )
moveWindow( "cam2", 640 + 75, 0 );
// Resizing images to avoid issues for high resolution images, visualizing them as grayscale
resize( frame1, tmp, Size( 640, 480 ) );
resize( frame1, tmp, Size( 640, 480 ), 0, 0, INTER_LINEAR_EXACT);
cvtColor( tmp, tmp, COLOR_RGB2GRAY );
imshow( "cam1", tmp );
resize( frame2, tmp, Size( 640, 480 ) );
resize( frame2, tmp, Size( 640, 480 ), 0, 0, INTER_LINEAR_EXACT);
cvtColor( tmp, tmp, COLOR_RGB2GRAY );
imshow( "cam2", tmp );

@ -262,7 +262,7 @@ int main( int argc, char** argv )
applyColorMap( scaledDisparityMap, cm_disp, COLORMAP_JET );
// Show the result
resize( cm_disp, cm_disp, Size( 640, 480 ) );
resize( cm_disp, cm_disp, Size( 640, 480 ), 0, 0, INTER_LINEAR_EXACT );
imshow( "cm disparity m", cm_disp );
// Compute the point cloud
@ -273,7 +273,7 @@ int main( int argc, char** argv )
// Compute a mask to remove background
Mat dst, thresholded_disp;
threshold( scaledDisparityMap, thresholded_disp, 0, 255, THRESH_OTSU + THRESH_BINARY );
resize( thresholded_disp, dst, Size( 640, 480 ) );
resize( thresholded_disp, dst, Size( 640, 480 ), 0, 0, INTER_LINEAR_EXACT );
imshow( "threshold disp otsu", dst );
#ifdef HAVE_OPENCV_VIZ

@ -263,10 +263,10 @@ int main(int argc, char* argv[])
//resize(out_img_detection,out_img_detection,Size(image.cols*scale_img,image.rows*scale_img));
//resize(out_img_detection,out_img_detection,Size(image.cols*scale_img,image.rows*scale_img),0,0,INTER_LINEAR_EXACT);
//imshow("detection", out_img_detection);
//imwrite("detection.jpg", out_img_detection);
//resize(out_img,out_img,Size(image.cols*scale_img,image.rows*scale_img));
//resize(out_img,out_img,Size(image.cols*scale_img,image.rows*scale_img),0,0,INTER_LINEAR_EXACT);
namedWindow("recognition",WINDOW_NORMAL);
imshow("recognition", out_img);
waitKey(0);

@ -193,7 +193,7 @@ int main(int argc, char* argv[])
double t_all = (double)getTickCount();
if (downsize)
resize(frame,frame,Size(320,240));
resize(frame,frame,Size(320,240),0,0,INTER_LINEAR_EXACT);
/*Text Detection*/
cvtColor(frame,gray,COLOR_BGR2GRAY);

@ -603,7 +603,7 @@ void OCRBeamSearchClassifierCNN::eval( InputArray _src, vector< vector<double> >
cvtColor(src,src,COLOR_RGB2GRAY);
}
resize(src,src,Size(window_size*src.cols/src.rows,window_size));
resize(src,src,Size(window_size*src.cols/src.rows,window_size),0,0,INTER_LINEAR_EXACT);
int seg_points = 0;

@ -779,14 +779,14 @@ void OCRHMMClassifierKNN::eval( InputArray _mask, vector<int>& out_class, vector
{
int height = image_width*tmp.rows/tmp.cols;
if(height == 0) height = 1;
resize(tmp,tmp,Size(image_width,height));
resize(tmp,tmp,Size(image_width,height),0,0,INTER_LINEAR_EXACT);
tmp.copyTo(mask(Rect(0,(image_height-height)/2,image_width,height)));
}
else
{
int width = image_height*tmp.cols/tmp.rows;
if(width == 0) width = 1;
resize(tmp,tmp,Size(width,image_height));
resize(tmp,tmp,Size(width,image_height),0,0,INTER_LINEAR_EXACT);
tmp.copyTo(mask(Rect((image_width-width)/2,0,width,image_height)));
}
@ -837,7 +837,7 @@ void OCRHMMClassifierKNN::eval( InputArray _mask, vector<int>& out_class, vector
copyMakeBorder(maps[i],maps[i],7,7,7,7,BORDER_CONSTANT,Scalar(0));
GaussianBlur(maps[i], maps[i], Size(7,7), 2, 2);
normalize(maps[i],maps[i],0,255,NORM_MINMAX);
resize(maps[i],maps[i],Size(image_width,image_height));
resize(maps[i],maps[i],Size(image_width,image_height),0,0,INTER_LINEAR_EXACT);
}
//Generate features for each bitmap
@ -1032,7 +1032,7 @@ void OCRHMMClassifierCNN::eval( InputArray _src, vector<int>& out_class, vector<
}
// shall we resize the input image or make a copy ?
resize(img,img,Size(window_size,window_size));
resize(img,img,Size(window_size,window_size),0,0,INTER_LINEAR_EXACT);
Mat quad;
Mat tmp;

@ -85,7 +85,7 @@ protected:
{
CV_Assert(image.channels() == 1 && image.depth() == CV_8U);
Mat resized;
resize(image, resized, getPerceptiveField());
resize(image, resized, getPerceptiveField(), 0, 0, INTER_LINEAR_EXACT);
Mat blob = dnn::blobFromImage(resized);
net.setInput(blob, "data");
Mat prob = net.forward("prob");

@ -145,8 +145,8 @@ bool TrackerGOTURNImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
//Preprocess
//Resize
resize(targetPatch, targetPatch, Size(INPUT_SIZE, INPUT_SIZE));
resize(searchPatch, searchPatch, Size(INPUT_SIZE, INPUT_SIZE));
resize(targetPatch, targetPatch, Size(INPUT_SIZE, INPUT_SIZE), 0, 0, INTER_LINEAR_EXACT);
resize(searchPatch, searchPatch, Size(INPUT_SIZE, INPUT_SIZE), 0, 0, INTER_LINEAR_EXACT);
//Mean Subtract
targetPatch = targetPatch - 128;

@ -56,7 +56,7 @@ namespace cv
const int MAX_EXAMPLES_IN_MODEL = 500;
const int MEASURES_PER_CLASSIFIER = 13;
const int GRIDSIZE = 15;
const int DOWNSCALE_MODE = cv::INTER_LINEAR;
const int DOWNSCALE_MODE = cv::INTER_LINEAR_EXACT;
const double THETA_NN = 0.5;
const double CORE_THRESHOLD = 0.5;
const double CLASSIFIER_MARGIN = 0.1;

@ -114,7 +114,7 @@ namespace cv
#ifdef BLUR_AS_VADIM
GaussianBlur(standardPatch, blurredPatch, GaussBlurKernelSize, 0.0);
resize(blurredPatch, blurredPatch, minSize);
resize(blurredPatch, blurredPatch, minSize, 0, 0, INTER_LINEAR_EXACT);
#else
resample(blurredImg, RotatedRect(center, size, angle), blurredPatch);
#endif

@ -287,7 +287,7 @@ int TrackerTLDImpl::Pexpert::additionalExamples(std::vector<Mat_<uchar> >& examp
#if defined BLUR_AS_VADIM
GaussianBlur(standardPatch, blurredPatch, GaussBlurKernelSize, 0.0);
resize(blurredPatch, blurredPatch, initSize_);
resize(blurredPatch, blurredPatch, initSize_, 0, 0, INTER_LINEAR_EXACT);
#else
resample(blurredImg, RotatedRect(center, size, angle), blurredPatch);
#endif

@ -103,7 +103,7 @@ double scaleAndBlur(const Mat& originalImg, int scale, Mat& scaledImg, Mat& blur
for( int i = 0; i < scale; i++, dScale *= scaleStep );
Size2d size = originalImg.size();
size.height /= dScale; size.width /= dScale;
resize(originalImg, scaledImg, size);
resize(originalImg, scaledImg, size, 0, 0, INTER_LINEAR_EXACT);
GaussianBlur(scaledImg, blurredImg, GaussBlurKernelSize, 0.0);
return dScale;
}

@ -306,7 +306,7 @@ namespace cv{
CV_Assert(img.channels() == 1 || img.channels() == 3);
// resize the image whenever needed
if(resizeImage)resize(img,img,Size(img.cols/2,img.rows/2));
if(resizeImage)resize(img,img,Size(img.cols/2,img.rows/2),0,0,INTER_LINEAR_EXACT);
// detection part
if(frame>0){

@ -197,7 +197,8 @@ static const float SIFT_DESCR_MAG_THR = 0.2f;
// factor used to convert floating-point descriptor to unsigned char
static const float SIFT_INT_DESCR_FCTR = 512.f;
#if 0
#define DoG_TYPE_SHORT 0
#if DoG_TYPE_SHORT
// intermediate type used for DoG pyramids
typedef short sift_wt;
static const int SIFT_FIXPT_SCALE = 48;
@ -233,7 +234,11 @@ static Mat createInitialImage( const Mat& img, bool doubleImageSize, float sigma
{
sig_diff = sqrtf( std::max(sigma * sigma - SIFT_INIT_SIGMA * SIFT_INIT_SIGMA * 4, 0.01f) );
Mat dbl;
#if DoG_TYPE_SHORT
resize(gray_fpt, dbl, Size(gray_fpt.cols*2, gray_fpt.rows*2), 0, 0, INTER_LINEAR_EXACT);
#else
resize(gray_fpt, dbl, Size(gray_fpt.cols*2, gray_fpt.rows*2), 0, 0, INTER_LINEAR);
#endif
GaussianBlur(dbl, dbl, Size(), sig_diff, sig_diff);
return dbl;
}

@ -438,7 +438,7 @@ protected:
{
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);
@ -563,7 +563,7 @@ protected:
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);

@ -75,9 +75,9 @@ PERF_TEST_P( DisparityWLSFilterPerfTest, perf, Combine(GuideTypes::all(), SrcTyp
MakeArtificialExample(rng,guide,disp_left,disp_right,ROI);
if(use_downscale)
{
resize(disp_left,disp_left,Size(),0.5,0.5);
resize(disp_left,disp_left,Size(),0.5,0.5, INTER_LINEAR_EXACT);
disp_left/=2;
resize(disp_right,disp_right,Size(),0.5,0.5);
resize(disp_right,disp_right,Size(),0.5,0.5, INTER_LINEAR_EXACT);
disp_right/=2;
ROI = Rect(ROI.x/2,ROI.y/2,ROI.width/2,ROI.height/2);
}

@ -135,8 +135,8 @@ int main(int argc, char** argv)
max_disp/=2;
if(max_disp%16!=0)
max_disp += 16-(max_disp%16);
resize(left ,left_for_matcher ,Size(),0.5,0.5);
resize(right,right_for_matcher,Size(),0.5,0.5);
resize(left ,left_for_matcher ,Size(),0.5,0.5, INTER_LINEAR_EXACT);
resize(right,right_for_matcher,Size(),0.5,0.5, INTER_LINEAR_EXACT);
//! [downscale]
}
else
@ -196,7 +196,7 @@ int main(int argc, char** argv)
if(!no_downscale)
{
// upscale raw disparity and ROI back for a proper comparison:
resize(left_disp,left_disp,Size(),2.0,2.0);
resize(left_disp,left_disp,Size(),2.0,2.0,INTER_LINEAR_EXACT);
left_disp = left_disp*2.0;
ROI = Rect(ROI.x*2,ROI.y*2,ROI.width*2,ROI.height*2);
}

@ -233,7 +233,7 @@ static void rescale(Mat const &src, Mat &dst,
{
double scale = min(min(static_cast<double>(maxWidth) / src.cols,
static_cast<double>(maxHeight) / src.rows), 1.0);
resize(src, dst, Size(), scale, scale, INTER_LINEAR);
resize(src, dst, Size(), scale, scale, INTER_LINEAR_EXACT);
}
static void showHumanReadableImg(string const &name, Mat const &img)

@ -87,7 +87,7 @@ int main( int argc, const char** argv)
if( frame.rows <= rows0 )
src = frame;
else
resize(frame, src, Size(cvRound(480.*frame.cols/frame.rows), 480));
resize(frame, src, Size(cvRound(480.*frame.cols/frame.rows), 480), 0, 0, INTER_LINEAR_EXACT);
float t = (float)getTickCount();
ximgproc::anisotropicDiffusion(src, dst, alpha, sigma, niters);

@ -11,7 +11,7 @@ using namespace cv;
int main()
{
Mat img = imread("opencv-logo.png", IMREAD_COLOR);
resize(img, img, Size(), 0.5, 0.5);
resize(img, img, Size(), 0.5, 0.5, INTER_LINEAR_EXACT);
/// Threshold the input image
Mat img_grayscale, img_binary;

@ -185,8 +185,8 @@ TEST_P(AdaptiveManifoldRefImplTest, RefImplAccuracy)
//inconsistent downsample/upsample operations in reference implementation
Size dstSize((guide.cols + 15) & ~15, (guide.rows + 15) & ~15);
resize(guide, guide, dstSize);
resize(src, src, dstSize);
resize(guide, guide, dstSize, 0, 0, INTER_LINEAR_EXACT);
resize(src, src, dstSize, 0, 0, INTER_LINEAR_EXACT);
for (int iter = 0; iter < 4; iter++)
{

@ -124,8 +124,8 @@ TEST_P(DisparityWLSFilterTest, MultiThreadReproducibility)
if(use_downscale)
{
resize(left_disp,left_disp,Size(),0.5,0.5);
resize(right_disp,right_disp,Size(),0.5,0.5);
resize(left_disp,left_disp,Size(),0.5,0.5, INTER_LINEAR_EXACT);
resize(right_disp,right_disp,Size(),0.5,0.5, INTER_LINEAR_EXACT);
ROI = Rect(ROI.x/2,ROI.y/2,ROI.width/2,ROI.height/2);
}

@ -85,7 +85,7 @@ Mat convertTypeAndSize(Mat src, int dstType, Size dstSize)
}
dst.convertTo(dst, dstType);
resize(dst, dst, dstSize);
resize(dst, dst, dstSize, 0, 0, dstType == CV_32FC1 ? INTER_LINEAR : INTER_LINEAR_EXACT);
return dst;
}

@ -99,7 +99,7 @@ static Mat convertTypeAndSize(Mat src, int dstType, Size dstSize)
}
dst.convertTo(dst, dstType);
resize(dst, dst, dstSize);
resize(dst, dst, dstSize, 0, 0, INTER_LINEAR_EXACT);
return dst;
}

@ -83,7 +83,7 @@ static Mat convertTypeAndSize(Mat src, int dstType, Size dstSize)
}
dst.convertTo(dst, dstType);
resize(dst, dst, dstSize);
resize(dst, dst, dstSize, 0, 0, INTER_LINEAR_EXACT);
return dst;
}

@ -81,7 +81,7 @@ static Mat convertTypeAndSize(Mat src, int dstType, Size dstSize)
}
dst.convertTo(dst, dstType);
resize(dst, dst, dstSize);
resize(dst, dst, dstSize, 0, 0, INTER_LINEAR_EXACT);
return dst;
}

@ -130,7 +130,7 @@ void WaldBoost::detect(Ptr<CvFeatureEvaluator> eval,
float h;
for (size_t i = 0; i < scales.size(); ++i) {
float scale = scales[i];
resize(img, resized_img, Size(), scale, scale);
resize(img, resized_img, Size(), scale, scale, INTER_LINEAR_EXACT);
eval->setImage(resized_img, 0, 0, feature_indices_);
int n_rows = (int)(24 / scale);
int n_cols = (int)(24 / scale);
@ -162,7 +162,7 @@ void WaldBoost::detect(Ptr<CvFeatureEvaluator> eval,
float h;
for (size_t i = 0; i < scales.size(); ++i) {
float scale = scales[i];
resize(img, resized_img, Size(), scale, scale);
resize(img, resized_img, Size(), scale, scale, INTER_LINEAR_EXACT);
eval->setImage(resized_img, 0, 0, feature_indices_);
int n_rows = (int)(24 / scale);
int n_cols = (int)(24 / scale);

@ -179,7 +179,7 @@ void WBDetectorImpl::train(
win_count = min(win_count, stage_neg - bootstrap_count);
Mat window;
for (int k = 0; k < win_count; ++k) {
resize(img(bboxes[indices(k, 0)]), window, Size(24, 24));
resize(img(bboxes[indices(k, 0)]), window, Size(24, 24), 0, 0, INTER_LINEAR_EXACT);
neg_imgs.push_back(window.clone());
bootstrap_count += 1;
}

@ -64,7 +64,7 @@ PERF_TEST_P(learningBasedWBPerfTest, perf, Combine(SZ_ALL_HD, Values(CV_8UC3, CV
Mat src_dscl(Size(size.width / 16, size.height / 16), t);
RNG rng(1234);
rng.fill(src_dscl, RNG::UNIFORM, 0, range_max_val);
resize(src_dscl, src, src.size());
resize(src_dscl, src, src.size(), 0, 0, INTER_LINEAR_EXACT);
Ptr<xphoto::LearningBasedWB> wb = xphoto::createLearningBasedWB();
wb->setRangeMaxVal(range_max_val);
wb->setSaturationThreshold(0.98f);

Loading…
Cancel
Save