Created
July 30, 2019 04:50
-
-
Save codebudo/2652866589e405ed1d8f93006675c1b9 to your computer and use it in GitHub Desktop.
OpenCV example resizing an image with CPU
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 <stdio.h> | |
#include <opencv2/opencv.hpp> | |
using namespace cv; | |
int main(int argc, char** argv ) { | |
if ( argc != 2 ) { | |
printf("usage: resizecpu <Image_Path>\n"); | |
return -1; | |
} | |
Mat inImage; | |
Mat outImage; | |
inImage = imread( argv[1], 1 ); | |
if ( !inImage.data ) { | |
printf("No image data \n"); | |
return -1; | |
} | |
for(int i=0; i < 100; i++){ | |
//resize | |
resize(inImage, outImage, Size(4096, 4096)); | |
imwrite("output_cpu.jpg", outImage); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment