Tuesday, May 5, 2009

OpenCV #3: Converting an image to gray scale


int M = img_rgb->width;
int N = img_rgb->height;

// convert to gray scale
IplImage* img_gray = cvCreateImage( cvSize(M, N), IPL_DEPTH_8U, 1 );
cvCvtColor( img_rgb, img_gray, CV_BGR2GRAY );

No comments:

Post a Comment

Followers