Commit 12569dc7 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #7625 from souch55:Fixapi

parents a19cb20b 94b5a740
...@@ -650,6 +650,16 @@ public: ...@@ -650,6 +650,16 @@ public:
*/ */
CV_WRAP virtual bool open(int index); CV_WRAP virtual bool open(int index);
/** @brief Open a camera for video capturing
@overload
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Parameters are similar as the constructor VideoCapture(int index),except it takes an additional argument apiPreference.
@return open(cameraNum + apiPreference).
*/
CV_WRAP bool open(int cameraNum, int apiPreference);
/** @brief Returns true if video capturing has been initialized already. /** @brief Returns true if video capturing has been initialized already.
If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns
......
...@@ -606,6 +606,11 @@ bool VideoCapture::open(int index) ...@@ -606,6 +606,11 @@ bool VideoCapture::open(int index)
cap.reset(cvCreateCameraCapture(index)); cap.reset(cvCreateCameraCapture(index));
return isOpened(); return isOpened();
} }
bool VideoCapture::open(int cameraNum, int apiPreference)
{
cameraNum = cameraNum + apiPreference;
return open(cameraNum);
}
bool VideoCapture::isOpened() const bool VideoCapture::isOpened() const
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment