cvIntegral
expects the output image to be of type CV_32F
or CV_64F
. Also, the number of channels for the source and destination images should be same. You should be doing this:
image2 = cvCreateImage(cvSize(image->width+1,image->height+1),IPL_DEPTH_32F,image->nChannels);