Saving a ofCvImage to file

Hi,

Did anybody save an ofCvImage to a file? What is the best way to do this?

It seems it can be done via openGL and ofImage.grabScreen(), is this the best solution?

cheers
/cj

hi,

how about this, if you had a ofCvGrayscaleImage of size 320x240 :

  
  
ofImage temp;  
temp.allocate(320,240, OF_IMAGE_GRAYSCALE);  
temp.setPixels(myCvImage.getPixels(), 320,240);  
temp.saveImage("blah.jpg");  
  

hope that helps !
take care,
zach

hmmm… i think a setPixels() function in ofImage is missing.

But, I agree, it would be nice if the openCv image types had their own load/save functions. At least they should be able to save themselves…