【发布时间】:2014-03-25 06:45:43
【问题描述】:
美好的一天,
我想弄清楚如何在 openCV 中关闭 beaglebone 上的相机。我尝试了许多命令,例如 release(&camera) 但都不存在,并且当我不想要它时,相机会继续保持打开状态。
VideoCapture capture(0);
capture.set(CV_CAP_PROP_FRAME_WIDTH,320);
capture.set(CV_CAP_PROP_FRAME_HEIGHT,240);
if(!capture.isOpened()){
cout << "Failed to connect to the camera." << endl;
}
Mat frame, edges, cont;
while(1){
cout<<sending<<endl;
if(sending){
for(int i=0; i<frames; i++){
capture >> frame;
if(frame.empty()){
cout << "Failed to capture an image" << endl;
return 0;
}
cvtColor(frame, edges, CV_BGR2GRAY);
代码是这样的,在for循环结束时,我想关闭相机,但当然它仍然保持打开状态
【问题讨论】:
标签: c++ opencv camera beagleboard