main.cpp
1 | #include <opencv2/imgproc/imgproc.hpp> |
---|---|
2 | #include <opencv2/highgui/highgui.hpp> |
3 | #include <opencv2/core/core.hpp> |
4 | |
5 | #include <iostream> |
6 | |
7 | int main( int argc, const char** argv ) |
8 | { |
9 | using namespace cv; |
10 | |
11 | |
12 | IplImage *img = cvCreateImage(cvSize(100, 100), IPL_DEPTH_8U, 3); |
13 | cv::Mat matImg(cv::Mat::ones(10,10,CV_8UC1)); |
14 | |
15 | std::cout << img->width <<img->height << std::endl; |
16 | std::cout << img->imageData <<img->height << std::endl; |
17 | |
18 | std::cout << matImg.cols << std::endl; |
19 | |
20 | cv::Mat rowSum(cv::Mat::zeros(1, matImg.cols,CV_8UC1));
|
21 | std::cout << rowSum << std::endl; |
22 | |
23 | reduce(matImg,rowSum,0,CV_REDUCE_SUM,1); |
24 | |
25 | std::cout << rowSum << std::endl; |
26 | return 0; |
27 | } |