Engine
Engine

Reputation: 5432

reusing a device in opencv

I have a program that uses cv::Videocapture to stream a video from a webcm, my question is, is there any possibility to reopen or resuing this device in the same program after releasing it ?? and that witout closing the programm!! thanks .

Upvotes: 0

Views: 157

Answers (1)

Barshan Das
Barshan Das

Reputation: 3767

VideoCapture cap(0);

//do stuff

cap.release();



cap.open(0);

// do stuff

cap.release();

Upvotes: 3

Related Questions