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

Getpixels have some problem in emscripten

$
0
0

@kokawa2003 wrote:

This is my code to display video
fingerMovie is meaning ofVideoPlayer fingerMovie;
and img is ofxCvColorImage img;

fingerMovie.draw(20,20,320,240);
ofPixels  pixels = fingerMovie.getPixels();
cout<<"h1"<<pixels.getHeight();
cout<<"w1"<<pixels.getWidth()<<std::endl;
pixels.resize(320,240);
cout<<"h2"<<pixels.getHeight();
cout<<"w2"<<pixels.getWidth()<<std::endl;
img.setFromPixels(pixels);
cv::Mat mat=ofxCv::toCv(img);
convertImg(mat,mat);

img.draw(400,20);

this code is working in linux.
but if I ran this code in web(emscripten ) ,it caused error.
fingerMovie.getPixels(); return (width.height)=(0,0);
Please tell me why.
output screen show this
h1 0w1 0
h2 0w2 0
[ error ] ofxCvColorImage: setFromPixels(): width and height are zero
[warning] ofxCvImage: getPixels(): image not allocated
[ error ] ofPixels: format doesn’t support channels

Please tell me why ?
How to solve this.

not inpriment now?

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles