aihot  2017-05-16 22:10:24  OpenCV |   查看评论   
float, 1> mat1(height, width, matSrc.data);  
  •         fbc::Mat_<float, 1> mat2(height, width);  
  •         fbc::flip(mat1, mat2, flipCode[i]);  
  •   
  •         cv::Mat mat1_(height, width, CV_32FC1, matSrc.data);  
  •         cv::Mat mat2_;  
  •         cv::flip(mat1_, mat2_, flipCode[i]);  
  •   
  •         assert(mat2.rows == mat2_.rows && mat2.cols == mat2_.cols && mat2.step == mat2_.step);  
  •         for (int y = 0; y < mat2.rows; y++) {  
  •             const fbc::uchar* p1 = mat2.ptr(y);  
  •             const uchar* p2 = mat2_.ptr(y);  
  •   
  •             for (int x = 0; x < mat2.step; x++) {  
  •                 assert(p1[x] == p2[x]);  
  •             }  
  •         }  
  •     }  
  •   
  •     return 0;  
  • }  
  •  

     

    除特别注明外,本站所有文章均为 赢咖4注册 原创,转载请注明出处来自OpenCV代码提取:flip函数的实现

    留言与评论(共有 0 条评论)
       
    验证码:
    [lianlun]1[/lianlun]