I'm new to OpenCV and I want to transfer the image in grayscale, but I get the wrong output size.
IplImage *img = cvLoadImage("image.jpg");
int width = img->width;
int height = img->height;
I want to transfer it:
IplImage *imgT = cvCreateImage(cvSize(height,width),img->depth,img->nChannels);
cvTranspose(img,imgT);
When I check the images, I see that the original image imghas a size of 329324, which is true: 493*668* 1byte, as it is unsigned char. However, it imgThas a size of 331328.
I am not sure where this happened.
EDIT: 1- I am using Windows XP and OpenCV 2.2. 2- When I check the image, I meant when I see the values of the imgT variable. For example, imgT-> width, imgT-> heigt, imgT-> size, etc.
Louis source
share