![]()  | 
  
    ZED Open Capture
    v0.6.0
    
   Low level camera driver for the ZED stereo camera family 
   | 
 
The VideoCapture class provides image grabbing functions and settings control for all the Stereolabs camera models. More...
#include <videocapture.hpp>
Public Member Functions | |
| VideoCapture (VideoParams params=VideoParams()) | |
| The default constructor.  More... | |
| virtual | ~VideoCapture () | 
| The class destructor.  More... | |
| bool | initializeVideo (int devId=-1) | 
| Open a ZED camera using the specified ID or searching for the first available.  More... | |
| const Frame & | getLastFrame (uint64_t timeout_msec=100) | 
| Get the last received camera image.  More... | |
| void | getFrameSize (int &width, int &height) | 
| Get the size of the camera frame.  More... | |
| int | setLEDstatus (bool status) | 
| Set the status of the camera led.  More... | |
| int | getLEDstatus (bool *status) | 
| Get the status of the camera led.  More... | |
| int | toggleLED (bool *value) | 
| Toggle the status of the camera led.  More... | |
| void | setBrightness (int brightness) | 
| Set the Brightness value.  More... | |
| int | getBrightness () | 
| Get the Brightness value.  More... | |
| void | resetBrightness () | 
| Reset the Brightness value to default value.  More... | |
| void | setSharpness (int sharpness) | 
| Set the Sharpness value.  More... | |
| int | getSharpness () | 
| Get the Sharpness value.  More... | |
| void | resetSharpness () | 
| Reset the Sharpness value to default value.  More... | |
| void | setContrast (int contrast) | 
| Set the Contrast value.  More... | |
| int | getContrast () | 
| Get the Contrast value.  More... | |
| void | resetContrast () | 
| Reset the Contrast value to default value.  More... | |
| void | setHue (int hue) | 
| Set the Hue value.  More... | |
| int | getHue () | 
| Get the Hue value.  More... | |
| void | resetHue () | 
| Reset the Hue value to default value.  More... | |
| void | setSaturation (int saturation) | 
| Set the Saturation value.  More... | |
| int | getSaturation () | 
| Get the Saturation value.  More... | |
| void | resetSaturation () | 
| Reset the Saturation value to default value.  More... | |
| void | setWhiteBalance (int wb) | 
| Set the White Balance value (disable auto White Balance if active)  More... | |
| int | getWhiteBalance () | 
| Get the White Balance value.  More... | |
| void | setAutoWhiteBalance (bool active) | 
| Enable/Disable the automatic White Balance control.  More... | |
| bool | getAutoWhiteBalance () | 
| Get the status of the automatic White Balance control.  More... | |
| void | resetAutoWhiteBalance () | 
| Reset the automatic White Balance control value to default value.  More... | |
| void | setGamma (int gamma) | 
| Set the Gamma value.  More... | |
| int | getGamma () | 
| Get the Gamma value.  More... | |
| void | resetGamma () | 
| Reset the Gamma value to default value.  More... | |
| int | setAECAGC (bool active) | 
| Enable/Disable the automatic Exposure and Gain control.  More... | |
| bool | getAECAGC () | 
| Get the status of the automatic Exposure and Gain control.  More... | |
| void | resetAECAGC () | 
| Reset the automatic Exposure and Gain control value to default value.  More... | |
| bool | setROIforAECAGC (CAM_SENS_POS side, uint16_t x, uint16_t y, uint16_t w, uint16_t h) | 
| Set Region Of Interest (ROI) for AECAGC control.  More... | |
| bool | resetROIforAECAGC (CAM_SENS_POS side) | 
| Reset the ROI for AECAGC control.  More... | |
| bool | getROIforAECAGC (CAM_SENS_POS side, uint16_t &x, uint16_t &y, uint16_t &w, uint16_t &h) | 
| Get the coordinates of the current ROI for AECAGC control.  More... | |
| void | setGain (CAM_SENS_POS cam, int gain) | 
| Set the Gain value (disable Exposure and Gain control if active)  More... | |
| int | getGain (CAM_SENS_POS cam) | 
| Get the current Gain value.  More... | |
| void | setExposure (CAM_SENS_POS cam, int exposure) | 
| Set the Exposure value (disable Exposure and Gain control if active)  More... | |
| int | getExposure (CAM_SENS_POS cam) | 
| Get the current Exposure value.  More... | |
| int | getSerialNumber () | 
| Retrieve the serial number of the connected camera.  More... | |
| void | setColorBars (int side, bool c) | 
| Utils fct to set Color Bars on Image.  More... | |
| std::string | getDeviceName () | 
| Retrieve the OS device name.  More... | |
| int | getDeviceId () | 
| Retrieve the OS device index.  More... | |
| bool | enableAecAgcSensLogging (bool enable, int frame_skip=10) | 
| Start logging to file of AEG/AGC camera registers.  More... | |
| void | saveAllISPRegisters (std::string filename) | 
| Save all ISP camera registers into a file.  More... | |
| void | saveAllSensorsRegisters (std::string filename) | 
| Save all sensors ctrl register.  More... | |
| bool | enableSensorSync (sensors::SensorCapture *sensCap=nullptr) | 
| Enable synchronizations between Camera frame and Sensors timestamps.  More... | |
| void | setReadyToSync () | 
| Indicates that the SensorCapture object received the HW sync signal and a frame must be synchronized to the last Sensor Data.  More... | |
| bool | resetAGCAECregisters () | 
The VideoCapture class provides image grabbing functions and settings control for all the Stereolabs camera models.
Definition at line 64 of file videocapture.hpp.
| sl_oc::video::VideoCapture::VideoCapture | ( | VideoParams | params = VideoParams() | ) | 
The default constructor.
| params | the initialization parameters (see VideoParams) | 
Definition at line 115 of file videocapture.cpp.
References params, and sl_oc::video::VideoParams::verbose.
      
  | 
  virtual | 
| bool sl_oc::video::VideoCapture::enableAecAgcSensLogging | ( | bool | enable, | 
| int | frame_skip = 10  | 
        ||
| ) | 
Start logging to file of AEG/AGC camera registers.
| enable | set to true to enable logging | 
| frame_skip | number of frames to skip when logging to file | 
Definition at line 1939 of file videocapture.cpp.
Referenced by main().
| bool sl_oc::video::VideoCapture::enableSensorSync | ( | sensors::SensorCapture * | sensCap = nullptr | ) | 
Enable synchronizations between Camera frame and Sensors timestamps.
| sensCap | pointer to SensorCapture object | 
Definition at line 2151 of file videocapture.cpp.
References sl_oc::sensors::SensorCapture::setVideoPtr().
Referenced by main().
| bool sl_oc::video::VideoCapture::getAECAGC | ( | ) | 
Get the status of the automatic Exposure and Gain control.
Definition at line 1711 of file videocapture.cpp.
Referenced by setExposure(), and setGain().
| bool sl_oc::video::VideoCapture::getAutoWhiteBalance | ( | ) | 
Get the status of the automatic White Balance control.
Definition at line 1664 of file videocapture.cpp.
Referenced by setWhiteBalance().
| int sl_oc::video::VideoCapture::getBrightness | ( | ) | 
Get the Brightness value.
Definition at line 1585 of file videocapture.cpp.
| int sl_oc::video::VideoCapture::getContrast | ( | ) | 
Get the Contrast value.
Definition at line 1615 of file videocapture.cpp.
      
  | 
  inline | 
Retrieve the OS device index.
Definition at line 358 of file videocapture.hpp.
      
  | 
  inline | 
Retrieve the OS device name.
Definition at line 352 of file videocapture.hpp.
Referenced by main().
| int sl_oc::video::VideoCapture::getExposure | ( | CAM_SENS_POS | cam | ) | 
Get the current Exposure value.
| cam | position of the camera sensor (see CAM_SENS_POS) | 
Definition at line 1867 of file videocapture.cpp.
      
  | 
  inline | 
Get the size of the camera frame.
| width | the frame width | 
| height | the frame height | 
Definition at line 105 of file videocapture.hpp.
Referenced by main().
| int sl_oc::video::VideoCapture::getGain | ( | CAM_SENS_POS | cam | ) | 
Get the current Gain value.
| cam | position of the camera sensor (see CAM_SENS_POS) | 
Definition at line 1825 of file videocapture.cpp.
| int sl_oc::video::VideoCapture::getGamma | ( | ) | 
Get the Gamma value.
Definition at line 1699 of file videocapture.cpp.
| int sl_oc::video::VideoCapture::getHue | ( | ) | 
Get the Hue value.
Definition at line 1630 of file videocapture.cpp.
| const Frame & sl_oc::video::VideoCapture::getLastFrame | ( | uint64_t | timeout_msec = 100 | ) | 
Get the last received camera image.
| timeout_msec | frame grabbing timeout in millisecond. | 
Definition at line 890 of file videocapture.cpp.
Referenced by main().
| int sl_oc::video::VideoCapture::getLEDstatus | ( | bool * | status | ) | 
Get the status of the camera led.
| status | returned status: true for "ON", false for "OFF" | 
Definition at line 1418 of file videocapture.cpp.
Referenced by toggleLED().
| bool sl_oc::video::VideoCapture::getROIforAECAGC | ( | CAM_SENS_POS | side, | 
| uint16_t & | x, | ||
| uint16_t & | y, | ||
| uint16_t & | w, | ||
| uint16_t & | h | ||
| ) | 
Get the coordinates of the current ROI for AECAGC control.
| side | position of the camera sensor (see CAM_SENS_POS) | 
| x | top left ROI rectangle X coordinate | 
| y | top left ROI rectangle Y coordinate | 
| w | ROI rectangle width | 
| h | ROI rectangle width | 
Definition at line 1773 of file videocapture.cpp.
| int sl_oc::video::VideoCapture::getSaturation | ( | ) | 
Get the Saturation value.
Definition at line 1645 of file videocapture.cpp.
| int sl_oc::video::VideoCapture::getSerialNumber | ( | ) | 
Retrieve the serial number of the connected camera.
Definition at line 548 of file videocapture.cpp.
Referenced by main().
| int sl_oc::video::VideoCapture::getSharpness | ( | ) | 
Get the Sharpness value.
Definition at line 1600 of file videocapture.cpp.
| int sl_oc::video::VideoCapture::getWhiteBalance | ( | ) | 
Get the White Balance value.
Definition at line 1650 of file videocapture.cpp.
| bool sl_oc::video::VideoCapture::initializeVideo | ( | int | devId = -1 | ) | 
Open a ZED camera using the specified ID or searching for the first available.
| devId | Id of the camera (see /dev/video*). Use -1 to open the first available camera  | 
Definition at line 276 of file videocapture.cpp.
References resetAECAGC(), resetAutoWhiteBalance(), resetBrightness(), resetContrast(), resetGamma(), resetHue(), resetSaturation(), resetSharpness(), setLEDstatus(), and sl_oc::video::VideoParams::verbose.
Referenced by main().
| void sl_oc::video::VideoCapture::resetAECAGC | ( | ) | 
Reset the automatic Exposure and Gain control value to default value.
Definition at line 1718 of file videocapture.cpp.
References setAECAGC().
Referenced by initializeVideo().
| bool sl_oc::video::VideoCapture::resetAGCAECregisters | ( | ) | 
Definition at line 2138 of file videocapture.cpp.
| void sl_oc::video::VideoCapture::resetAutoWhiteBalance | ( | ) | 
Reset the automatic White Balance control value to default value.
Definition at line 1674 of file videocapture.cpp.
References setAutoWhiteBalance().
Referenced by initializeVideo().
| void sl_oc::video::VideoCapture::resetBrightness | ( | ) | 
Reset the Brightness value to default value.
Definition at line 1580 of file videocapture.cpp.
Referenced by initializeVideo().
| void sl_oc::video::VideoCapture::resetContrast | ( | ) | 
Reset the Contrast value to default value.
Definition at line 1610 of file videocapture.cpp.
Referenced by initializeVideo().
| void sl_oc::video::VideoCapture::resetGamma | ( | ) | 
Reset the Gamma value to default value.
Definition at line 1691 of file videocapture.cpp.
Referenced by initializeVideo().
| void sl_oc::video::VideoCapture::resetHue | ( | ) | 
Reset the Hue value to default value.
Definition at line 1625 of file videocapture.cpp.
Referenced by initializeVideo().
| bool sl_oc::video::VideoCapture::resetROIforAECAGC | ( | CAM_SENS_POS | side | ) | 
Reset the ROI for AECAGC control.
| side | position of the camera sensor (see CAM_SENS_POS) | 
Definition at line 1768 of file videocapture.cpp.
References setROIforAECAGC().
| void sl_oc::video::VideoCapture::resetSaturation | ( | ) | 
Reset the Saturation value to default value.
Definition at line 1640 of file videocapture.cpp.
Referenced by initializeVideo().
| void sl_oc::video::VideoCapture::resetSharpness | ( | ) | 
Reset the Sharpness value to default value.
Definition at line 1595 of file videocapture.cpp.
Referenced by initializeVideo().
| void sl_oc::video::VideoCapture::saveAllISPRegisters | ( | std::string | filename | ) | 
Save all ISP camera registers into a file.
| filename | csv filename | 
Definition at line 2030 of file videocapture.cpp.
Referenced by main().
| void sl_oc::video::VideoCapture::saveAllSensorsRegisters | ( | std::string | filename | ) | 
Save all sensors ctrl register.
| filename | csv filename | 
Definition at line 2051 of file videocapture.cpp.
Referenced by main().
| int sl_oc::video::VideoCapture::setAECAGC | ( | bool | active | ) | 
Enable/Disable the automatic Exposure and Gain control.
| active | true to activate automatic White Balance | 
Definition at line 1703 of file videocapture.cpp.
Referenced by main(), resetAECAGC(), setExposure(), and setGain().
| void sl_oc::video::VideoCapture::setAutoWhiteBalance | ( | bool | active | ) | 
Enable/Disable the automatic White Balance control.
| active | true to activate automatic White Balance | 
Definition at line 1669 of file videocapture.cpp.
Referenced by main(), resetAutoWhiteBalance(), and setWhiteBalance().
| void sl_oc::video::VideoCapture::setBrightness | ( | int | brightness | ) | 
Set the Brightness value.
| brightness | Brightness value in the range [0,8] | 
Definition at line 1575 of file videocapture.cpp.
| void sl_oc::video::VideoCapture::setColorBars | ( | int | side, | 
| bool | c | ||
| ) | 
Utils fct to set Color Bars on Image.
Definition at line 2016 of file videocapture.cpp.
Referenced by main().
| void sl_oc::video::VideoCapture::setContrast | ( | int | contrast | ) | 
Set the Contrast value.
| contrast | Contrast value in the range [0,8] | 
Definition at line 1605 of file videocapture.cpp.
| void sl_oc::video::VideoCapture::setExposure | ( | CAM_SENS_POS | cam, | 
| int | exposure | ||
| ) | 
Set the Exposure value (disable Exposure and Gain control if active)
| cam | position of the camera sensor (see CAM_SENS_POS) | 
| exposure | Exposure value in the range [0,100] | 
Definition at line 1841 of file videocapture.cpp.
References getAECAGC(), and setAECAGC().
| void sl_oc::video::VideoCapture::setGain | ( | CAM_SENS_POS | cam, | 
| int | gain | ||
| ) | 
Set the Gain value (disable Exposure and Gain control if active)
| cam | position of the camera sensor (see CAM_SENS_POS) | 
| gain | Gain value in the range [0,100] | 
Definition at line 1803 of file videocapture.cpp.
References getAECAGC(), and setAECAGC().
| void sl_oc::video::VideoCapture::setGamma | ( | int | gamma | ) | 
Set the Gamma value.
| gamma | Gamma value in the range [1,9] | 
Definition at line 1679 of file videocapture.cpp.
| void sl_oc::video::VideoCapture::setHue | ( | int | hue | ) | 
Set the Hue value.
| hue | Hue value in the range [0,11] | 
Definition at line 1620 of file videocapture.cpp.
| int sl_oc::video::VideoCapture::setLEDstatus | ( | bool | status | ) | 
Set the status of the camera led.
| status | true for "ON", false for "OFF" | 
Definition at line 1403 of file videocapture.cpp.
Referenced by initializeVideo(), and toggleLED().
      
  | 
  inline | 
Indicates that the SensorCapture object received the HW sync signal and a frame must be synchronized to the last Sensor Data.
Definition at line 397 of file videocapture.hpp.
| bool sl_oc::video::VideoCapture::setROIforAECAGC | ( | CAM_SENS_POS | side, | 
| uint16_t | x, | ||
| uint16_t | y, | ||
| uint16_t | w, | ||
| uint16_t | h | ||
| ) | 
Set Region Of Interest (ROI) for AECAGC control.
| side | position of the camera sensor (see CAM_SENS_POS) | 
| x | top left ROI rectangle X coordinate | 
| y | top left ROI rectangle Y coordinate | 
| w | ROI rectangle width | 
| h | ROI rectangle width | 
Definition at line 1723 of file videocapture.cpp.
References sl_oc::video::LEFT, and sl_oc::video::RIGHT.
Referenced by resetROIforAECAGC().
| void sl_oc::video::VideoCapture::setSaturation | ( | int | saturation | ) | 
Set the Saturation value.
| saturation | Saturation value in the range [0,8] | 
Definition at line 1635 of file videocapture.cpp.
| void sl_oc::video::VideoCapture::setSharpness | ( | int | sharpness | ) | 
Set the Sharpness value.
| sharpness | Sharpness value in the range [0,8] | 
Definition at line 1590 of file videocapture.cpp.
| void sl_oc::video::VideoCapture::setWhiteBalance | ( | int | wb | ) | 
Set the White Balance value (disable auto White Balance if active)
| wb | White Balance value in the range [2800,6500] | 
Definition at line 1655 of file videocapture.cpp.
References getAutoWhiteBalance(), and setAutoWhiteBalance().
| int sl_oc::video::VideoCapture::toggleLED | ( | bool * | value | ) | 
Toggle the status of the camera led.
| value | returned status: true for "ON", false for "OFF" | 
Definition at line 1432 of file videocapture.cpp.
References getLEDstatus(), and setLEDstatus().