[SOLVED] OpenCV ofxCvColorImage from ofTexture gives glitchy image?

The issue seems to have been the ofImageType of the ofPixels instance. Setting it to OF_IMAGE_COLOR in update() solves the issue.
I guess the fbo or texture have an alpha channel which ofxCvImage doesn’t like?

Hi all,

I’m working on a program which takes 3 camera inputs and combines them into 1 texture (by going through an FBO). I want to use this texture in OpenCV, but the only way I’ve found to do this is by going from the texture to ofPixels and reading those pixels in the ofxCvColorImage, as demonstrated below.
I’m not sure if this is the best way of doing things, as it feels there are some redundant steps…

    videoTexture0.draw( 0, 0); //camera 1 ofTexture
    videoTexture1.draw(320, 0); //camera 2 ofTexture
    videoTexture2.draw(640, 0); //camera 3 ofTexture
    colorImg1.setFromPixels(pixelsGoal); //the ofxCvColorImage

Now, apart from this feeling redundant, there’s something strangely different happening when drawing the ofTexture or when drawing the ofxCvColorImage:

Texture: (the third image is white, I’ve only 2 cameras attached)

versus OfxCvColorImage:

Any help would be very welcome!

yes opencv images in the ofxOpenCv addon only work without alpha. They should probably check the ofPixels being passed to see the pixel format is correct and convert it if not or something like that.