Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save p208p2002/0a68cbcbe1b3735bb05c86ca98bf85fd to your computer and use it in GitHub Desktop.

Select an option

Save p208p2002/0a68cbcbe1b3735bb05c86ca98bf85fd to your computer and use it in GitHub Desktop.
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main()
{
Size size(281, 369);//the dst image size,e.g.100x100
Size size2(2810, 3690);//the dst image size,e.g.100x100
Mat dst;//dst image
Mat dst2;
Mat src= imread("C:/img/p1.tif");//src image
resize(src, dst, size, INTER_NEAREST);//resize image
resize(dst, dst2, size2, INTER_NEAREST);//resize image
imshow("src img", src);
imshow("zoom down", dst);
imshow("zoom up after zoom down", dst2);
waitKey(0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment