Skip to content

Commit e53977f

Browse files
committed
Merge pull request #1482 from terfendail:bitexact_resize
2 parents 43ff131 + 8c394a4 commit e53977f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+80
-75
lines changed

modules/bgsegm/test/test_backgroundsubtractor_lsbp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ template<typename T>
9191
static double evaluateBGSAlgorithm(Ptr<T> bgs) {
9292
Mat background = imread(getDataDir() + "shared/fruits.png");
9393
Mat object = imread(getDataDir() + "shared/baboon.png");
94-
cv::resize(object, object, Size(100, 100));
94+
cv::resize(object, object, Size(100, 100), 0, 0, INTER_LINEAR_EXACT);
9595
Ptr<bgsegm::SyntheticSequenceGenerator> generator = bgsegm::createSyntheticSequenceGenerator(background, object);
9696

9797
double f1_mean = 0;

modules/ccalib/src/randpattern.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ void RandomPatternGenerator::generatePattern()
371371

372372
Mat r = Mat(n, m, CV_32F);
373373
cv::randn(r, Scalar::all(0), Scalar::all(1));
374-
cv::resize(r, r, Size(_imageWidth ,_imageHeight));
374+
cv::resize(r, r, Size(_imageWidth ,_imageHeight), 0, 0, INTER_LINEAR_EXACT);
375375
double min_r, max_r;
376376
minMaxLoc(r, &min_r, &max_r);
377377

modules/dpm/src/dpm_feature.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void Feature::computeFeaturePyramid(const Mat &imageM, vector< Mat > &pyramid)
8787
{
8888
const double scale = (double)(1.0f/pow(params.sfactor, i));
8989
Mat imScaled;
90-
resize(imageM, imScaled, imSize * scale);
90+
resize(imageM, imScaled, imSize * scale, 0, 0, INTER_LINEAR_EXACT);
9191
// First octave at twice the image resolution
9292
computeHOG32D(imScaled, pyramid[i], params.binSize/2,
9393
params.padx + 1, params.pady + 1);
@@ -106,7 +106,7 @@ void Feature::computeFeaturePyramid(const Mat &imageM, vector< Mat > &pyramid)
106106
{
107107
Mat imScaled2;
108108
Size_<double> imScaledSize = imScaled.size();
109-
resize(imScaled, imScaled2, imScaledSize*0.5);
109+
resize(imScaled, imScaled2, imScaledSize*0.5, 0, 0, INTER_LINEAR_EXACT);
110110
imScaled = imScaled2;
111111
computeHOG32D(imScaled2, pyramid[j+params.interval],
112112
params.binSize, params.padx + 1, params.pady + 1);

modules/face/samples/facemark_lbf_fitting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ int main(int argc, char** argv ){
104104
double __time__ = (double)getTickCount();
105105

106106
float scale = (float)(400.0/frame.cols);
107-
resize(frame, img, Size((int)(frame.cols*scale), (int)(frame.rows*scale)));
107+
resize(frame, img, Size((int)(frame.cols*scale), (int)(frame.rows*scale)), 0, 0, INTER_LINEAR_EXACT);
108108

109109
facemark->getFaces(img, rects);
110110
rects_scaled.clear();

modules/face/samples/sampleDetectLandmarks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ int main(int argc,char** argv){
7272
facemark->loadModel(filename);
7373
cout<<"Loaded model"<<endl;
7474
vector<Rect> faces;
75-
resize(img,img,Size(460,460));
75+
resize(img,img,Size(460,460), 0, 0, INTER_LINEAR_EXACT);
7676
facemark->getFaces(img,faces);
7777
vector< vector<Point2f> > shapes;
7878
if(facemark->fit(img,faces,shapes))

modules/face/samples/sampleDetectLandmarksvideo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ int main(int argc,char** argv){
8383
shapes.clear();
8484
cap>>img;
8585
//Detect faces in the current image
86-
resize(img,img,Size(600,600));
86+
resize(img,img,Size(600,600), 0, 0, INTER_LINEAR_EXACT);
8787
facemark->getFaces(img,faces);
8888
if(faces.size()==0){
8989
cout<<"No faces found in this frame"<<endl;

modules/face/samples/sample_face_swapping.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ int main( int argc, char** argv)
139139
//Detect faces in the current image
140140
float ratio1 = (float)img1.cols/(float)img1.rows;
141141
float ratio2 = (float)img2.cols/(float)img2.rows;
142-
resize(img1,img1,Size((int)(640*ratio1),(int)(640*ratio1)));
143-
resize(img2,img2,Size((int)(640*ratio2),(int)(640*ratio2)));
142+
resize(img1,img1,Size((int)(640*ratio1),(int)(640*ratio1)), 0, 0, INTER_LINEAR_EXACT);
143+
resize(img2,img2,Size((int)(640*ratio2),(int)(640*ratio2)), 0, 0, INTER_LINEAR_EXACT);
144144
Mat img1Warped = img2.clone();
145145
facemark->getFaces(img1,faces1);
146146
facemark->getFaces(img2,faces2);

modules/face/src/face_alignment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ bool FacemarkKazemiImpl::scaleData( vector< vector<Point2f> > & trainlandmarks,
173173
//calculating scale for x and y axis
174174
scalex=float(s.width)/float(trainimages[i].cols);
175175
scaley=float(s.height)/float(trainimages[i].rows);
176-
resize(trainimages[i],trainimages[i],s);
176+
resize(trainimages[i],trainimages[i],s,0,0,INTER_LINEAR_EXACT);
177177
for (vector<Point2f>::iterator it = trainlandmarks[i].begin(); it != trainlandmarks[i].end(); it++) {
178178
Point2f pt = (*it);
179179
pt.x = pt.x*scalex;

modules/face/src/facemarkAAM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ bool FacemarkAAMImpl::fitImpl( const Mat image, std::vector<Point2f>& landmarks,
374374
imgray = image;
375375
}
376376

377-
resize(imgray,img,Size(int(image.cols/scale),int(image.rows/scale)));// matlab use bicubic interpolation, the result is float numbers
377+
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
378378

379379
/*chop the textures model*/
380380
int maxCol = param_m;

modules/face/tutorials/face_landmark/face_landmark_detection.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ in which landmarks have to be detected.
6363
facemark->loadModel(filename);
6464
cout<<"Loaded model"<<endl;
6565
vector<Rect> faces;
66-
resize(img,img,Size(460,460));
66+
resize(img,img,Size(460,460),0,0,INTER_LINEAR_EXACT);
6767
facemark->getFaces(img,faces);
6868
vector< vector<Point2f> > shapes;
6969

0 commit comments

Comments
 (0)