I’m trying to convert an ofXCVGrayScaleImage into an ofImage so that I can save it out, as ofxCVImage has no method for doing this.
I’ve tried all manner of snippets on these boards, but am unable to achieve this.
I’m using the following to grab the pixels, but when I try to set them it bombs out. I’m assuming that getPixels in the 1st instance returns something less like a continuous block of grayscale values.
... // from setup
myImage.allocate(640, 480,OF_IMAGE_GRAYSCALE);
...
// from update
unsigned char * pixels = grayScaleImage.getPixels();
myImage.setFromPixels(pixels, 640,480);
I appreciate any help.