Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Can't convert an ofTexture to CV compatible Mat with OpenGL ES

$
0
0

@aceslowman wrote:

Curious what the solution might be to this, or if there is just another route I should go.

I am starting to experiment with ARKit (ofxARKit) and OpenCV (ofxCv), and immediately I came to an issue. To pass the camera input to OpenCV, I need to get a Mat from it. I immediately attempted this:

ofTexture tex = processor->getCameraTexture();
tex.readToPixels(pix);
img.setFromPixels(pix); 
Mat cam = toCv(img);
contourFinder.findContours(cam);

This doesn’t work, which seems to be because ofTexture::readToPixels() isn’t compatible with OpenGL ES, as stated in the documentation.

So what is the best way to make a texture usable with OpenCV on iOS?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles