zoukankan      html  css  js  c++  java
  • resize


    1
    #include<opencv2/opencv.hpp> 2 #include<iostream> 3 #include<cassert> 4 #include<vector> 5 #include<stdio.h> 6 #include <sys/time.h> 7 8 using namespace cv; 9 using namespace std; 10 11 int main(int argc, char* argv[]) 12 { 13 int resize_height = 360; 14 int resize_width = 480; 15 Mat src = imread(argv[1], CV_LOAD_IMAGE_COLOR); 16 Mat dst; 17 //imshow("src", src); 18 double time = getTime_us(); 19 resize(src, dst, Size(resize_width, resize_height), 0, 0, cv::INTER_LINEAR); 20 cout << "time:" << (getTime_us()-time)/1000 <<"ms"<< endl; 21 //imshow("dst", dst); 22 23 cout << "type:" << dst.type() << endl; 24 cout << "CV_8UC3:" << CV_8UC3 << endl; 25 cout << "depth:" << dst.depth() << endl; 26 cout << "channel:" << dst.channels() << endl; 27 cout << "rows:" << dst.rows << endl; 28 cout << "cols:" << dst.cols << endl; 29 30 cv::waitKey(0); 31 return 0; 32 }
     1 #include<opencv2/opencv.hpp>  
     2 #include<iostream>  
     3 #include<cassert>  
     4 #include<vector>  
     5 #include<stdio.h>
     6 #include <sys/time.h>
     7 
     8 using namespace cv;  
     9 using namespace std;
    10 
    11 int main(int argc, char* argv[])
    12 {
    13     int resize_height = 360;
    14     int resize_width = 480;
    15     Mat src = imread(argv[1], CV_LOAD_IMAGE_COLOR); 
    16     Mat dst;
    17     //imshow("src", src);
    18     double time = getTime_us(); 
    19     resize(src, dst, Size(resize_width, resize_height), 0, 0, cv::INTER_LINEAR);
    20     cout << "time:" << (getTime_us()-time)/1000 <<"ms"<< endl;
    21     //imshow("dst", dst);
    22 
    23     cout << "type:" << dst.type() << endl;
    24     cout << "CV_8UC3:" << CV_8UC3 << endl;
    25     cout << "depth:" << dst.depth() << endl;
    26     cout << "channel:" << dst.channels() << endl;
    27     cout << "rows:" << dst.rows << endl;
    28     cout << "cols:" << dst.cols << endl;
    29 
    30     cv::waitKey(0);
    31     return 0;
    32 }
  • 相关阅读:
    ios-表视图-demo4-内容自己适应高度
    ios-表视图-demo3-单选
    应用管理的实现
    初识MVC和KVC
    Xcode的常用快捷键
    UI基础--手写代码实现汤姆猫动画
    UI基础--UIView常见属性之frame、center、bounds、transframe属性
    UI基础--UIButton、懒加载
    ios多线程
    ios多线程简介
  • 原文地址:https://www.cnblogs.com/black-mamba/p/5975547.html
Copyright © 2011-2022 走看看