Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Comparison betweens resize/interpolation algorithms

Hello, I'm trying to evaluate nearest, bilinear and bicubic interpolation algorithms from the resize function but all my images are exactly the same.

Can anyone help me?

Mat img; 
Mat img2;

img = imread("face2.png", IMREAD_UNCHANGED);

Size size(720,1080);

vector<int> com_param;
com_param.push_back(CV_IMWRITE_JPEG_QUALITY);
com_param.push_back(9);
cv::resize(img, img2, size, cv::INTER_NEAREST);
imwrite("nearest.jpg",img2,com_param);
cv::resize(img, img2, size, cv::INTER_NEAREST);
imwrite("bilinear.jpg",img2,com_param);
cv::resize(img, img2, size, cv::INTER_NEAREST);
imwrite("cubic.jpg",img2,com_param);

Comparison betweens resize/interpolation algorithms

Hello, I'm trying to evaluate nearest, bilinear and bicubic interpolation algorithms from the resize function but all my images are exactly the same.

Can anyone help me?

Mat img; 
Mat img2;

img = imread("face2.png", IMREAD_UNCHANGED);

Size size(720,1080);

vector<int> com_param;
com_param.push_back(CV_IMWRITE_JPEG_QUALITY);
com_param.push_back(9);
cv::resize(img, img2, size, cv::INTER_NEAREST);
imwrite("nearest.jpg",img2,com_param);
cv::resize(img, img2, size, cv::INTER_NEAREST);
imwrite("bilinear.jpg",img2,com_param);
cv::resize(img, img2, size, cv::INTER_NEAREST);
imwrite("cubic.jpg",img2,com_param);