To fix change the dept of IplImage to 8 and change the nChannels to 1
something like .. .
IplImage *img;
img->depth = 8;
img->nChannels = 1;
Not correct way since the picture will be more stretch than the original
finding more correct way ...
http://osdir.com/ml/lib.opencv/2006-03/msg00760.html
IplImage *img; // Kept color image (image that nChannels > 1)
IplImage *dst = cvCreateImage(cvSize(img->width,img->height), 8, 1);
cvCvtColor(img, dst, CV_RGB2GRAY);
No comments:
Post a Comment