- /* load image */
- IplImage *src = cvLoadImage( argv[1], CV_LOAD_IMAGE_COLOR );
- /* get image properties */
- width = src->width;
- height = src->height;
- /* create new image for the grayscale version */
- IplImage *dst = cvCreateImage( cvSize( width, height ), IPL_DEPTH_8U, 1 );
- /* CV_RGB2GRAY: convert RGB image to grayscale */
- cvCvtColor( src, dst, CV_RGB2GRAY );
Sunday, May 22, 2011
OpenCV - Convert image to grayscale
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment