Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <opencv2/core/core.hpp>
- #include <opencv2/imgproc/imgproc.hpp>
- #include <opencv2/highgui/highgui.hpp>
- int
- main(int argc, char *argv[])
- { float up;
- cv::Mat src_img = cv::imread(argv[1], 1);
- if(src_img.empty()) return -1;
- up=atof(argv[3]);
- cv::Mat dst_img(src_img.rows*up, src_img.cols*up, src_img.type());
- // INTER_CUBIC(バイキュービック補間)でのサイズ変更
- cv::resize(src_img, dst_img, dst_img.size(), cv::INTER_CUBIC);
- cv::namedWindow("resize image", CV_WINDOW_AUTOSIZE|CV_WINDOW_FREERATIO);
- cv::imshow("resize image", dst_img);
- cv::imwrite(argv[2],dst_img);
- cv::waitKey(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement