Friday, May 30, 2008

cvConvertImage ,cvCvtColor and cvFlip

First: How to convert a gray image to a 3 channel color image
cvCvtColor() can do GRAY2RGB
The other method,you can use it to filp image:
cvConvertImage(ori,dst,flag);
ori is original image;
dst is destination image;
flag is CV_CVTIMG_FLIP or CV_CVTIMG_SWAP_RB;
here if you just want to convert image to color , you can set flag=0;


Second: How to flip image by x axis or y axis.
Method: cvFlip
cvFlip(src,dst,flag)

here flag=0,Positive value or passive value..


See more:http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html

No comments: