Anant Vemuri
unread,May 3, 2010, 9:20:36 AM5/3/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fw4spl-...@googlegroups.com
Dear all,
I am using openCV 2.1 with the framework for video capture from USB source. On linux it uses video4linux api for video capture. I created a simple app for video stream using openCV and fw4spl. In this I use cvQueryFrame for getting frame from camera. It works alright, but I am having some trouble with the app. I do this inside an video adaptor, I created.
/// doUpdate() in Video adaptor
while ( 1 )
{
frame = cvQueryFrame( video->m_capture );
OSLM_ASSERT( "Frame could not captured!", frame );
/// Convert image to fw4spl format
fromIPLImage( frame, pImage ); /// Convert from IplImage to fwdata::image
// Notify message to all service listeners
::fwComEd::ImageMsg::NewSptr outMsg;
outMsg->addEvent( "NEW_2D_IMAGE" );
::fwServices::IEditionService::notify( this->getSptr(), pImage, outMsg ); /// Message received by image adaptor to display it in the scene.
key = cvWaitKey( 50 );
}
the last cvWaitKey is to try to create a delay for the system. However in my simple app, is kind of freezing up even though it displays the video but then the app refuses to close and becomes unresponsive. The thing is I have done something similar in the past without the framework and I have not had any problems. I believe this is due to three process intensive tasks,
a. cvQueryFrame().
b. fromIPLImage()
c. ::vtkIO::toVTKImage()
But I feel cvQueryFrame could be the primary culprit. This is just a test program and needs improvements, but for a quick test does anyone have any suggestions.
Thanks
Anant.