Re: [osg-users] image processing with OSG
Christian Rumpf writes: Hello! For one of my project I want to create an average image consisting of 10 images captured by a static camera to erase camera noise. I tried this stuff with OpenCV (http://opencv.willowgarage.com/wiki/) and its cv::Mat class and it worked well. I want to do the same with OSG by loading 10 PNGs into an array with osgDB::readImageFile(pic.png) and recognized a big problem. For some reasons osg::Image doesn't use methods to change pixel color, but only to get pixel color (osg::Image::getColor(...)), and it doesn't return a reference. Do you have any idea how to change pixel colors? Hi Christian, accessing the raw image data with osg::Image::data() could be what you are after. Nevertheless, that implies that you have to deal with the internal format of the image. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ESC key: Error: pthread_cond_destroy(, ) returned error status, status = 16
michael kapelko writes: Hi. Can anybody please tell me how to stop osgViewer from listening to ESC key? It frequently results into Error: pthread_cond_destroy(,) returned error status, status = 16. I want to control ESC key myself. I think if you write an osgGA::GUIEventHandler that reports that you handled the ESC key (by returning true), the viewer won't do its own processing. -- Alberto ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ESC key: Error: pthread_cond_destroy(, ) returned error status, status = 16
On 04/08/2012 2:38 PM, Alberto Luaces wrote: I think if you write an osgGA::GUIEventHandler that reports that you handled the ESC key (by returning true), the viewer won't do its own processing. In addition to this, I suggest you look into the following methods of the osgViewer::ViewerBase class (which both CompositeViewer and Viewer inherit): /** Set the key event that the viewer checks on each frame to see if the viewer's done flag should be set to * signal end of viewers main loop. * Default value is Escape (osgGA::GUIEVentAdapter::KEY_Escape). * Setting to 0 switches off the feature.*/ void setKeyEventSetsDone(int key) { _keyEventSetsDone = key; } /** get the key event that the viewer checks on each frame to see if the viewer's done flag.*/ int getKeyEventSetsDone() const { return _keyEventSetsDone; } /** if the flag is true, the viewer set its done flag when a QUIT_APPLICATION is received, false disables this feature */ void setQuitEventSetsDone(bool flag) { _quitEventSetsDone = flag; } /** @return true if the viewer respond to the QUIT_APPLICATION-event */ bool getQuitEventSetsDone() const { return _quitEventSetsDone; } Hope this helps, J-S -- __ Jean-Sebastien Guay jean_...@videotron.ca http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] ESC key: Error: pthread_cond_destroy(, ) returned error status, status = 16
Thanks. ViewerBase::setKeyEventSetsDone(0) did help so that Viewer doesn't listen to ESC, but now when I call ViewerBase::setDone(true) myself, Viewer still fails to exit and prints: Error: pthread_cond_destroy(,) returned error status, status = 16 after that, only Ctrl+C helps, because app hangs. What is this and how do I fight it? Thanks. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org