Cannot convert ofTexture or ofImage to ofxCvColorImage

Hi,

I’m trying to get a ofxCvColorImage from a spout texture.

This is working fine with ofImage :

ofPixels tmpPix;
spoutInput.getTexture().readToPixels(tmpPix);
ofImage tmpOfImage;
tmpOfImage.setFromPixels(tmpPix);
tmpOfImage.draw(0, 0);

But with a ofxCvColorImage, I always end up with some vertical lines, like a color channels remap issue.
What I tried :

ofxCvColorImage tmpCvColorImage;
tmpCvColorImage.setFromPixels(tmpPix.getData(), 1024, 768);

OR

tmpCvColorImage.setFromPixels(tmpPix);

I tried to allocate, with OF_IMAGE_COLOR, to allocate the texture with GL_RGB, (I think the spout texture comes in GL_RGBA)

I ended up trying to copy the pixels from the ofImage to a ofxCvColorImage, but the same issue occurs.

Any hint ?

Thank you.

I had to add
tmpOfImage.setImageType(OF_IMAGE_COLOR);

Otherwise the ofImage would stay in GL_RGBA, even if allocated in OF_IMAGE_COLOR before.

Thanks