I'd like to sum my 4X4 block. Suppose I have an image and will divide it into 4X4 blocks. Then afterward I'd like to determine the sum of each block using cvIntegral. How can I cope this?
Here is my basic program in order to calculate integral image value of whole image:
float s = 0.0f;
//Read in the image
IplImage* hImage = cvLoadImage("bayer-image.jpg",0);
UINT width = hImage->width; UINT height = hImage->height;
CvMat* sum = cvCreateMat(height + 1, width + 1, CV_32SC1);
CvMat* sqsum = cvCreateMat(height + 1, width + 1, CV_64FC1);
cvIntegral(hImage, sum, sqsum);
cvReleaseImage(&hImage);
cvReleaseMat(&sum);
cvReleaseMat(&sqsum);
What should I do next?
Really thanks in advance.