Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

OpenCV ofxCvColorImage from ofTexture gives glitchy image?

$
0
0

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...

    comboFBO.begin();
    videoTexture0.draw( 0, 0); //camera 1 ofTexture
    videoTexture1.draw(320, 0); //camera 2 ofTexture
    videoTexture2.draw(640, 0); //camera 3 ofTexture
    comboFBO.end();
   
    tex0=comboFBO.getTextureReference();
    tex0.readToPixels(pixelsGoal);
    
    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!


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>