OPENCV學習筆記1-8_選取圖像局部區域

#include <iostream>
#include "opencv2/opencv.hpp"
#include <stdio.h>
using namespace std;
using namespace cv;
int main( int argc, char* argv[] )
{
    Mat A = Mat::eye(6, 6, CV_32S);
    Mat B = A.row(2);               //get second row
    Mat C = 3*A.col(2);
    // extracts A columns, 1 (inclusive) to 3 (exclusive).
    Mat D= A(Range(1, 3), Range::all());

    cout<<"yunfung test:"<<endl<<endl;
    cout<<"A"<< A<<endl<<endl;
    cout<<"B"<< B<<endl<<endl;
    cout<<"C"<< C<<endl<<endl;
    cout<<"D"<< D<<endl<<endl;

    return(0);
}

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章