I am doing some drawing in an ofFbo which I then wish to translate into a ofxCvGrayscaleImage for tracing.
The following works fine, but when I start to work on very large ofFbos (3,000 pixels across, etc) it starts to stall (just takes a long time and so hangs for a couple of seconds).
Does anyone have any suggestions on how I can shorten how long the below code will take? Or, is there a more efficient way of making the translation?
//start and clear ofFbo object drawTo.begin(); ofClear(ofColor(255,0,255)); ofSetColor(255); //do drawing here with black lines etc //..... drawTo.end(); // move to pixels object ofPixels tmpPixels; tmpPixels.clear(); drawTo.readToPixels(tmpPixels); //move to rgb image object colorImg.clear(); colorImg.setFromPixels(tmpPixels); tmpPixels.clear(); //move to ofxCvGrayscaleImage object grayImage = colorImg; grayImage.threshold(170);