Visual Servoing Platform
version 3.6.1 under development (2024-11-15)
|
#include "vpPylonGrabberUsb.h"
Public Types | |
enum | UserSetName { USERSET_DEFAULT , USERSET_USERSET1 , USERSET_USERSET2 , USERSET_USERSET3 , USERSET_UNKNOWN } |
Public Member Functions | |
vpPylonGrabberUsb () | |
virtual | ~vpPylonGrabberUsb () |
void | acquire (vpImage< unsigned char > &I) |
void | acquire (vpImage< vpRGBa > &I) |
void | close () |
void | connect () |
void | disconnect () |
float | getBlackLevel () |
std::ostream & | getCameraInfo (std::ostream &os) |
Pylon::CInstantCamera * | getCameraHandler () |
unsigned int | getCameraIndex () const |
std::string | getCameraSerial (unsigned int index) |
float | getExposure () |
float | getFrameRate () |
float | getGain () |
unsigned int | getNumCameras () |
float | getGamma () |
bool | loadUserSet (UserSetName user_set) |
UserSetName | getUserSetDefault () |
bool | isConnected () const |
bool | isCaptureStarted () const |
void | open (vpImage< unsigned char > &I) |
void | open (vpImage< vpRGBa > &I) |
vpPylonGrabber & | operator>> (vpImage< unsigned char > &I) |
vpPylonGrabber & | operator>> (vpImage< vpRGBa > &I) |
float | setBlackLevel (float blacklevel_value=0) |
void | setCameraIndex (unsigned int index) |
void | setCameraSerial (const std::string &serial) |
float | setExposure (bool exposure_on, bool exposure_auto, float exposure_value=0) |
float | setGain (bool gain_auto, float gain_value=0) |
float | setFrameRate (float frame_rate) |
float | setGamma (bool gamma_on, float gamma_value=1) |
bool | saveUserSet (UserSetName user_set, bool set_default=false) |
bool | setUserSetDefault (UserSetName user_set) |
void | startCapture () |
void | stopCapture () |
Public Attributes | |
bool | init |
Protected Member Functions | |
void | open () |
bool | selectUserSet (UserSetName user_set) |
Inherited functionalities from vpFramegrabber | |
unsigned int | getHeight () const |
unsigned int | getWidth () const |
unsigned int | height |
unsigned int | width |
Allows to grab images from a Basler USB camera using Pylon SDK.
This class should not be instantiated directly. Use vpPylonFactory::createPylonGrabber() instead.
Definition at line 66 of file vpPylonGrabberUsb.h.
|
inherited |
Valid values for user set names.
Enumerator | |
---|---|
USERSET_DEFAULT | The default user set. |
USERSET_USERSET1 | User set 1. |
USERSET_USERSET2 | User set 2. |
USERSET_USERSET3 | User set 3. |
USERSET_UNKNOWN | User set not supported. |
Definition at line 107 of file vpPylonGrabber.h.
BEGIN_VISP_NAMESPACE vpPylonGrabberUsb::vpPylonGrabberUsb | ( | ) |
Default constructor that consider the first camera found on the bus as active.
Definition at line 56 of file vpPylonGrabberUsb.cpp.
References getNumCameras().
|
virtual |
Default destructor that closes the connection with the camera.
Definition at line 64 of file vpPylonGrabberUsb.cpp.
References close().
|
virtual |
Acquire a gray level image from the active camera.
I | : Image data structure (8 bits image). |
Implements vpPylonGrabber.
Definition at line 642 of file vpPylonGrabberUsb.cpp.
References vpImage< Type >::bitmap, vpException::fatalError, getCameraSerial(), vpFrameGrabber::height, open(), vpImage< Type >::resize(), and vpFrameGrabber::width.
Referenced by open(), and operator>>().
Acquire a color image from the active camera.
I | : Image data structure (RGBa image). |
Implements vpPylonGrabber.
Definition at line 671 of file vpPylonGrabberUsb.cpp.
References vpException::fatalError, getCameraSerial(), vpFrameGrabber::height, open(), vpImage< Type >::resize(), and vpFrameGrabber::width.
|
virtual |
Stop active camera capturing images and disconnect the active camera.
If you want to use again this camera, you may call setCameraIndex(const unsigned int &) and open(vpImage<unsigned char> &) or open(vpImage<vpRGBa> &) to connect again the camera.
Implements vpPylonGrabber.
Definition at line 631 of file vpPylonGrabberUsb.cpp.
References disconnect(), and stopCapture().
Referenced by ~vpPylonGrabberUsb().
|
virtual |
Connect the active camera.
Implements vpPylonGrabber.
Definition at line 578 of file vpPylonGrabberUsb.cpp.
References vpException::fatalError, getNumCameras(), and vpFrameGrabber::init.
Referenced by getBlackLevel(), getCameraHandler(), getCameraInfo(), getExposure(), getFrameRate(), getGain(), getGamma(), getUserSetDefault(), loadUserSet(), open(), saveUserSet(), selectUserSet(), setBlackLevel(), setExposure(), setFrameRate(), setGain(), setGamma(), setUserSetDefault(), and startCapture().
|
virtual |
Disconnect the active camera.
Implements vpPylonGrabber.
Definition at line 611 of file vpPylonGrabberUsb.cpp.
References vpFrameGrabber::init.
Referenced by close().
|
virtual |
Return blacklevel value in % or raw value. If the camera doesn't support blacklevel property, return an exception.
According to SFNC (standard feature naming convention) of GenICam standard, Black level is used instead of brightness.
See "Terminology Changes" section of the page: https://www.ptgrey.com/kb/11020?countryid=237
Implements vpPylonGrabber.
Definition at line 167 of file vpPylonGrabberUsb.cpp.
References connect(), and vpException::notImplementedError.
|
virtual |
Return the handler to the active camera or nullptr if the camera is not connected. This function was designed to provide a direct access to the Pylon SDK to get access to advanced functionalities that are not implemented in this class.
Implements vpPylonGrabber.
Definition at line 114 of file vpPylonGrabberUsb.cpp.
References connect().
|
inlinevirtual |
Return the index of the active camera.
Implements vpPylonGrabber.
Definition at line 83 of file vpPylonGrabberUsb.h.
|
virtual |
Print to the output stream active camera information (serial number, camera model, camera vendor, sensor, resolution, firmware version, ...).
Implements vpPylonGrabber.
Definition at line 87 of file vpPylonGrabberUsb.cpp.
References connect().
|
virtual |
Return the serial id of a camera with index.
index | : Camera index. |
Implements vpPylonGrabber.
Definition at line 218 of file vpPylonGrabberUsb.cpp.
References vpException::badValue, and getNumCameras().
Referenced by acquire(), and setCameraSerial().
|
virtual |
Return exposure value in ms. If the camera doesn't support exposure property, return an exception.
According to SFNC (standard feature naming convention) of GenICam standard, Exposure is used and deprecates shutter.
See "Terminology Changes" section of the page: https://www.ptgrey.com/kb/11020?countryid=237
Implements vpPylonGrabber.
Definition at line 188 of file vpPylonGrabberUsb.cpp.
References connect(), and vpException::notImplementedError.
|
virtual |
Return camera capture framerate. If the camera doesn't support framerate property, return an exception.
Implements vpPylonGrabber.
Definition at line 132 of file vpPylonGrabberUsb.cpp.
References connect().
|
virtual |
Return camera gain value in dB or raw value. If the camera doesn't support gain property, return an exception.
Implements vpPylonGrabber.
Definition at line 146 of file vpPylonGrabberUsb.cpp.
References connect(), and vpException::notImplementedError.
|
virtual |
Return gamma correction value. If the camera doesn't support gamma property, return an exception.
Implements vpPylonGrabber.
Definition at line 204 of file vpPylonGrabberUsb.cpp.
References connect().
|
inherited |
Return the number of rows in the image.
Definition at line 38 of file vpFrameGrabber.cpp.
References vpFrameGrabber::height.
|
virtual |
Implements vpPylonGrabber.
Definition at line 69 of file vpPylonGrabberUsb.cpp.
Referenced by connect(), getCameraSerial(), setCameraSerial(), and vpPylonGrabberUsb().
|
virtual |
Gets the configuration set being used as the default startup set.
Implements vpPylonGrabber.
Definition at line 269 of file vpPylonGrabberUsb.cpp.
References connect(), vpPylonGrabber::USERSET_DEFAULT, vpPylonGrabber::USERSET_UNKNOWN, vpPylonGrabber::USERSET_USERSET1, vpPylonGrabber::USERSET_USERSET2, and vpPylonGrabber::USERSET_USERSET3.
|
inherited |
Return the number of columns in the image.
Definition at line 43 of file vpFrameGrabber.cpp.
References vpFrameGrabber::width.
|
inlinevirtual |
Return true if the camera capture is started.
Implements vpPylonGrabber.
Definition at line 96 of file vpPylonGrabberUsb.h.
|
inlinevirtual |
Return true if the camera is connected.
Implements vpPylonGrabber.
Definition at line 94 of file vpPylonGrabberUsb.h.
|
virtual |
Loads the selected configuration into the camera's volatile memory and makes it the active configuration set.
user_set | See vpPylonGrabber::UserSetName for valid values. |
Implements vpPylonGrabber.
Definition at line 248 of file vpPylonGrabberUsb.cpp.
References connect(), selectUserSet(), and vpTime::wait().
|
protected |
Connect to the active camera and start capture.
Similar then calling:
Definition at line 737 of file vpPylonGrabberUsb.cpp.
References connect(), and startCapture().
|
virtual |
Connect to the active camera, start capture and retrieve an image.
I | : Captured image. |
Implements vpPylonGrabber.
Definition at line 710 of file vpPylonGrabberUsb.cpp.
Connect to the active camera, start capture and retrieve an image.
I | : Captured image. |
Implements vpPylonGrabber.
Definition at line 720 of file vpPylonGrabberUsb.cpp.
|
virtual |
Operator that allows to capture a grey level image.
I | : The captured image. |
Implements vpPylonGrabber.
Definition at line 781 of file vpPylonGrabberUsb.cpp.
References acquire().
|
virtual |
Operator that allows to capture a color image.
I | : The captured image. |
Implements vpPylonGrabber.
Definition at line 791 of file vpPylonGrabberUsb.cpp.
References acquire().
|
virtual |
Saves the current active configuration set into the selected user set.
user_set | See vpPylonGrabber::UserSetName for valid values. |
set_default | Whether to set the configuration set to be used as the default startup set. |
Implements vpPylonGrabber.
Definition at line 486 of file vpPylonGrabberUsb.cpp.
References connect(), selectUserSet(), setUserSetDefault(), and vpTime::wait().
|
protected |
Selects the configuration set to load, save, or configure.
user_set | See vpPylonGrabber::UserSetName for valid values. |
Default User Set is read-only and cannot be modified.
Definition at line 751 of file vpPylonGrabberUsb.cpp.
References connect(), vpPylonGrabber::USERSET_DEFAULT, vpPylonGrabber::USERSET_USERSET1, vpPylonGrabber::USERSET_USERSET2, and vpPylonGrabber::USERSET_USERSET3.
Referenced by loadUserSet(), and saveUserSet().
|
virtual |
Set camera blacklevel mode and parameter.
blacklevel_value | : This is the level of black in an image. A high blacklevel will result in a low amount of black in the image. |
According to SFNC (standard feature naming convention) of GenICam standard, Black level is used instead of brightness.
See "Terminology Changes" section of the page: https://www.ptgrey.com/kb/11020?countryid=237
Implements vpPylonGrabber.
Definition at line 397 of file vpPylonGrabberUsb.cpp.
References connect(), and vpException::notImplementedError.
|
virtual |
If multiples cameras are connected on the bus, select the camera to dial with.
index | : Current camera index, a value comprised between 0 (the first camera found on the bus) and the number of cameras found and returned by getNumCameras() minus 1. |
If two cameras are connected on the bus, setting index to one allows to communicate with the second one. This identifier is not unique. That is why, it is also possible to select a camera by its serial number, which is unique using setCameraSerial().
vpException::badValue | : If the index is greater or equal to the number of cameras connected to the bus. |
Implements vpPylonGrabber.
Definition at line 309 of file vpPylonGrabberUsb.cpp.
References vpException::badValue.
|
virtual |
Set the current camera from its unique serial identifier.
serial | : Camera serial string. |
Implements vpPylonGrabber.
Definition at line 325 of file vpPylonGrabberUsb.cpp.
References vpException::badValue, getCameraSerial(), and getNumCameras().
|
virtual |
Set camera exposure mode and parameter.
exposure_on | : If true turn exposure on, otherwise turn off. |
exposure_auto | : If true set auto exposure, if false set manual exposure applying exposure_value parameter. |
exposure_value | : This is the exposure value in ms. |
According to SFNC (standard feature naming convention) of GenICam standard, Exposure is used and deprecates shutter.
See "Terminology Changes" section of the page: https://www.ptgrey.com/kb/11020?countryid=237
Implements vpPylonGrabber.
Definition at line 426 of file vpPylonGrabberUsb.cpp.
References connect(), and vpException::notImplementedError.
|
virtual |
Set camera frame rate.
frame_rate | : Camera frame rate (fps) to set. |
Implements vpPylonGrabber.
Definition at line 344 of file vpPylonGrabberUsb.cpp.
References connect().
|
virtual |
Set camera gain mode and value.
gain_auto | : If true set auto gain, if false set manual gain applying gain_value parameter. |
gain_value | : The amount of amplification that is applied to a pixel in manual mode. An increase in gain can result in an increase in noise. |
Implements vpPylonGrabber.
Definition at line 366 of file vpPylonGrabberUsb.cpp.
References connect(), and vpException::notImplementedError.
|
virtual |
Set camera gamma correction mode and parameter.
gamma_on | : If true turn gamma correction on, otherwise turn off. |
gamma_value | : Parameter used to perform gamma correction of pixel intensity. |
Implements vpPylonGrabber.
Definition at line 460 of file vpPylonGrabberUsb.cpp.
References connect(), and vpException::notImplementedError.
|
virtual |
Sets the configuration set to be used as the default startup set.
user_set | See vpPylonGrabber::UserSetName for valid values. |
Implements vpPylonGrabber.
Definition at line 513 of file vpPylonGrabberUsb.cpp.
References connect(), vpPylonGrabber::USERSET_DEFAULT, vpPylonGrabber::USERSET_USERSET1, vpPylonGrabber::USERSET_USERSET2, and vpPylonGrabber::USERSET_USERSET3.
Referenced by saveUserSet().
|
virtual |
Start active camera capturing images.
Implements vpPylonGrabber.
Definition at line 544 of file vpPylonGrabberUsb.cpp.
References connect(), and vpFrameGrabber::init.
Referenced by open().
|
virtual |
Stop active camera capturing images.
Implements vpPylonGrabber.
Definition at line 562 of file vpPylonGrabberUsb.cpp.
References vpFrameGrabber::init.
Referenced by close().
|
protectedinherited |
Number of rows in the image.
Definition at line 134 of file vpFrameGrabber.h.
Referenced by vpDiskGrabber::acquire(), vpPylonGrabberGigE::acquire(), acquire(), vpFlyCaptureGrabber::acquire(), vpV4l2Grabber::acquire(), vp1394TwoGrabber::acquire(), vp1394TwoGrabber::dequeue(), vpDirectShowGrabber::getFormat(), vpVideoReader::getFrame(), vpFrameGrabber::getHeight(), vp1394TwoGrabber::getHeight(), vpDiskGrabber::open(), vp1394CMUGrabber::open(), vpV4l2Grabber::open(), vpDirectShowGrabber::setFormat(), vp1394TwoGrabber::setFormat7ROI(), vpDirectShowGrabber::setImageSize(), vp1394CMUGrabber::setVideoMode(), vp1394TwoGrabber::setVideoMode(), vp1394CMUGrabber::vp1394CMUGrabber(), and vp1394TwoGrabber::vp1394TwoGrabber().
|
inherited |
Set to true if the frame grabber has been initialized.
Definition at line 102 of file vpFrameGrabber.h.
Referenced by vpV4l2Grabber::acquire(), vp1394CMUGrabber::close(), vp1394TwoGrabber::close(), vpFlyCaptureGrabber::connect(), vpPylonGrabberGigE::connect(), connect(), vpFlyCaptureGrabber::disconnect(), vpPylonGrabberGigE::disconnect(), disconnect(), vpDiskGrabber::open(), vpV4l2Grabber::open(), vp1394TwoGrabber::resetBus(), vpFlyCaptureGrabber::startCapture(), vpPylonGrabberGigE::startCapture(), startCapture(), vpFlyCaptureGrabber::stopCapture(), vpPylonGrabberGigE::stopCapture(), stopCapture(), vp1394CMUGrabber::vp1394CMUGrabber(), vp1394TwoGrabber::vp1394TwoGrabber(), vpDiskGrabber::vpDiskGrabber(), and vpV4l2Grabber::vpV4l2Grabber().
|
protectedinherited |
Number of columns in the image.
Definition at line 135 of file vpFrameGrabber.h.
Referenced by vpDiskGrabber::acquire(), vpPylonGrabberGigE::acquire(), acquire(), vpFlyCaptureGrabber::acquire(), vpV4l2Grabber::acquire(), vp1394TwoGrabber::acquire(), vp1394TwoGrabber::dequeue(), vpDirectShowGrabber::getFormat(), vpVideoReader::getFrame(), vpFrameGrabber::getWidth(), vp1394TwoGrabber::getWidth(), vpDiskGrabber::open(), vp1394CMUGrabber::open(), vpV4l2Grabber::open(), vpDirectShowGrabber::setFormat(), vp1394TwoGrabber::setFormat7ROI(), vpDirectShowGrabber::setImageSize(), vp1394CMUGrabber::setVideoMode(), vp1394TwoGrabber::setVideoMode(), vp1394CMUGrabber::vp1394CMUGrabber(), and vp1394TwoGrabber::vp1394TwoGrabber().