//显示视频时
m_Frame=cvQueryFrame(m_Video);
if (!m_Frame)
{
MessageBox::Show("can not query image!!!");
}
pictureBox1->Image = gcnew System::Drawing::Bitmap(m_Frame->width,m_Frame->height,m_Frame->widthStep,
System::Drawing::Imaging::PixelFormat::Format24bppRgb,(System::IntPtr) m_Frame->imageData);pictureBox1->Refresh();//this is very important
//释放资源时
pin_ptr<CvCapture*> p;
p = &m_Video;
cvReleaseCapture( p ); //replace cvReleaseCapture(&m_Video) when the
sentence is inside a class.
本文介绍如何使用C#结合OpenCV进行视频播放,并展示了具体的代码实现过程,包括视频帧的获取与显示,以及资源释放等关键步骤。
710

被折叠的 条评论
为什么被折叠?



