I am trying to convert pixels (retreived from pixels = ofVideoPlayer.getPixels() ) to IplImage type. But for some reasons, executing the code below returns a video with color channels being imbalanced. How do I copy all the channels (R, G, B) from pixels to IplImage?
i’m pretty sure OpenCV 2 uses the same IplImage* internally. in any case you could have a look inside the ofxOpenCv code to see how setFromPixels does it, then copy/paste and adapt the code for your case. you’re probably better sticking of ofxCv*Image if you can, because managing IplImages by hand can be a bit of a pain. you should be able to use just the ofxCv*Image classes to your project and use them, leaving behind the other code.