opencvtest.cpp
1 | #include <cv.h> |
---|---|
2 | #include <highgui.h> |
3 | |
4 | using namespace cv; |
5 | |
6 | int main(int arg, char** argv) |
7 | { |
8 | Mat1b data(23, 42); |
9 | data.setTo(0);
|
10 | |
11 | Rect roi(2, 2, data.cols-4, data.rows-4); |
12 | Mat1b data_roi(data, roi); |
13 | |
14 | MatIterator_<uchar> it; |
15 | for (it = data_roi.begin(); it != data_roi.end(); ++it)
|
16 | *it = 255;
|
17 | // *it = 255;
|
18 | imshow("data", data);
|
19 | waitKey(); |
20 | return 0; |
21 | } |