Index: CaptureCamera.hpp =================================================================== --- CaptureCamera.hpp (.../trunk/ocl/hardware/camera) (revision 29985) +++ CaptureCamera.hpp (.../branches/ocl-pma/hardware/camera) (revision 29985) @@ -1,5 +1,6 @@ // Copyright (C) 2006 Ruben Smits -// +// Copyright (C) 2008 Francois Cauwe +// // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or @@ -32,6 +33,9 @@ #include #include +#include "../../vision/VisionToolkit.hpp" + + namespace OCL { @@ -63,7 +67,7 @@ protected: /// Dataport which contains grabbed image - RTT::WriteDataPort _image; + RTT::WriteDataPort _image; /// Dataport which contains grabbing timestamp RTT::WriteDataPort _capture_time; /// Command to grab image @@ -105,6 +109,7 @@ RTT::Seconds _elapsed; IplImage* _frame; + RgbImage _RgbFrame; bool _update; bool _update_properties; }; Index: CaptureCamera.cpp =================================================================== --- CaptureCamera.cpp (.../trunk/ocl/hardware/camera) (revision 29985) +++ CaptureCamera.cpp (.../branches/ocl-pma/hardware/camera) (revision 29985) @@ -22,7 +22,9 @@ // Make this component deployable ORO_CREATE_COMPONENT(OCL::CaptureCamera) +//ORO_LIST_COMPONENT_TYPE( OCL::CaptureCamera ) + namespace OCL { @@ -85,11 +87,6 @@ { Logger::In in(this->getName().data()); - // Read config file - //================= - if ( this->marshalling()->readProperties( this->getName() + ".cpf" ) == false) - return false; - //Initialize capturing //==================== if (_video_driver.value()=="firewire"){ @@ -115,12 +112,12 @@ // Grab one frame //=============== _frame=cvQueryFrame(_capture); - _image.Set(*_frame); + _RgbFrame.Set(_frame); + _image.Set(_RgbFrame); if(_show_image.value()){ + cvStartWindowThread(); cvNamedWindow(this->getName().c_str(),CV_WINDOW_AUTOSIZE); - cvWaitKey(3);//wait 3 ms for main loop of graphical server cvShowImage(this->getName().c_str(),_frame); - cvWaitKey(3);//wait 3 ms for main loop of graphical server } log(Info) << "Capturing initialized..." << endlog(); @@ -145,7 +142,6 @@ // Close window if(_show_image.value()){ cvDestroyWindow(this->getName().c_str()); - cvWaitKey(3);//wait 3 ms for main loop of graphical server } // Release capture device @@ -183,13 +179,11 @@ this->error(); } _frame = cvRetrieveFrame(_capture); + _RgbFrame.Set(_frame); + _image.Set(_RgbFrame); - _image.Set(*_frame); - - // Show image if(_show_image.value()){ cvShowImage(this->getName().c_str(),_frame); - cvWaitKey(3);//wait 3 ms for main loop of graphical server } // Show time used for capturing