1. 程式人生 > >OPENCV學習筆記1-8_選取圖像局部區域

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

src enc har span extract yun opencv http alt

#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); }

技術分享

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