Created
November 14, 2018 11:29
-
-
Save p208p2002/0a68cbcbe1b3735bb05c86ca98bf85fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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