How convert Mat class to ofxCvColorImage or ofxCvGrayscaleImage?

I have an image, that is Mat image, now i want to change the image to ofxCvColorImage class,it likes :
ofxCvColorImage IMG=image;
, and then I can use the function “IMG.draw(0,0)” to draw the image on the screen in the openframeworks.
but now I have no ideas about how could I convert it.
If you know about it, please tell me soon. Thank you very much!

for example:
ofxCvGrayscaleImage gray;
Mat img(gray.getCvImage());

but could from Mat to ofxCvGrayscaleImage or ofxCvColorImage ??

Hi wangwenfeng,
If your purpose is to draw the Mat, have you seen these usefull tips in the ofxCv readme.md:
https://github.com/kylemcdonald/ofxCv#drawmat-vs-toof ?

thank you for your reply, but now i have a question about findContours() function, it does run in the example code, i don’t know the reason for it.;