之前在vector容器中保存frame时,按你教的方法读取的时候读出来的总是错误的
if(m_List.GetItemState(i,LVIS_SELECTED)==LVIS_SELECTED){CStringstr_Path;str_Path=m_Li...
if(m_List.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED )
{
CString str_Path;
str_Path = m_List.GetItemText(i,0);
cvNamedWindow("PlayTest");
CvCapture* capture = cvCreateFileCapture(str_Path.GetBuffer());
IplImage* frame;
//vector<IplImage*> m_frame;
while(1)
{
frame = cvQueryFrame(capture);
if(!frame)
break ;
cvShowImage("PlayTest",frame);
m_frames.push_back(frame);
char c = cvWaitKey(1);
if (c == 27)
{
break;
}
}
//cvReleaseVideoWriter(&writer);
cvReleaseCapture(&capture);
cvDestroyWindow("PlayTest");
}
cvNamedWindow("PlayTest");
for(int i = 0;i < (int)m_frames.size();i++)
{
IplImage* m_IplImage = m_frames[i];//经过调试这里提取出来的m_frames[i]总是错误的
cvShowImage("PlayTest",m_IplImage);
}
cvDestroyWindow("PlayTest");
} 展开
{
CString str_Path;
str_Path = m_List.GetItemText(i,0);
cvNamedWindow("PlayTest");
CvCapture* capture = cvCreateFileCapture(str_Path.GetBuffer());
IplImage* frame;
//vector<IplImage*> m_frame;
while(1)
{
frame = cvQueryFrame(capture);
if(!frame)
break ;
cvShowImage("PlayTest",frame);
m_frames.push_back(frame);
char c = cvWaitKey(1);
if (c == 27)
{
break;
}
}
//cvReleaseVideoWriter(&writer);
cvReleaseCapture(&capture);
cvDestroyWindow("PlayTest");
}
cvNamedWindow("PlayTest");
for(int i = 0;i < (int)m_frames.size();i++)
{
IplImage* m_IplImage = m_frames[i];//经过调试这里提取出来的m_frames[i]总是错误的
cvShowImage("PlayTest",m_IplImage);
}
cvDestroyWindow("PlayTest");
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询