i'm working with openCV and i'm trying to convert an image into a single channel image.
i loaded the image with:
IplImage* img=cvLoadImage(“abc.pbm”);
i wasnt sure how i was supposed to convert to single channel so i used:
IplImage* temp = cvCreateImage(cvGetSize(img), img->depth, 1);
cvSetImageCOI(img, 1);
cvCopy(img, temp);
it compiles fine, but it crashes during runtime saying "opencv error: assertion failed (src.channels()==dst.channels()) in unknown function ..."
can anyone help me out?? can i get any better suggestions to convert to single channel image?