Advertisement
Kojima0502

resize2

Nov 26th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <cv.h>
  2. #include <highgui.h>
  3. #include <iostream>
  4.  
  5. using namespace cv;
  6.  
  7. int
  8. main( int argc, char** argv )
  9. {
  10.     if( argc != 4 ) {
  11.         std::cerr << "Usage: " << argv[0] << " <InputImage>  <OutputImage> up:3.0" << std::endl;      return EXIT_FAILURE;  }
  12.    float up;
  13.    
  14.     {
  15.    
  16.     char* src_img = argv[1];
  17.     Mat src_img;
  18.    
  19.     src_img = imread( imageName, 1 );
  20.    
  21.     if( argc != 3 || !up )
  22.     {
  23.         printf( " No image data \n " );
  24.         return -1;
  25.     }
  26.    
  27.     resize(src_img, dst_img, dst_img.size(), cv::INTER_CUBIC);//画像のサイズを変更 imwrite( argv[2], gray_image );
  28.     namedWindow( src_img, CV_WINDOW_AUTOSIZE );
  29.     namedWindow( "dst_img", CV_WINDOW_AUTOSIZE );
  30.    
  31.     imshow( src_img, image );
  32.     imshow( "dst_img", dst_img );
  33.    
  34.     waitKey(0);
  35.     return 0;
  36.    
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement