Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpPylonGrabberUsb.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * See the file LICENSE.txt at the root directory of this source
10 * distribution for additional information about the GNU GPL.
11 *
12 * For using ViSP with software that can not be combined with the GNU
13 * GPL, please contact Inria about acquiring a ViSP Professional
14 * Edition License.
15 *
16 * See https://visp.inria.fr for more information.
17 *
18 * This software was developed at:
19 * Inria Rennes - Bretagne Atlantique
20 * Campus Universitaire de Beaulieu
21 * 35042 Rennes Cedex
22 * France
23 *
24 * If you have questions regarding the use of this file, please contact
25 * Inria at visp@inria.fr
26 *
27 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * Description: Header of vpPylonGrabberUsb class.
31 *
32 * Authors:
33 * Wenfeng CAI
34 */
35
41
42#ifndef _vpPylonGrabberUsb_h_
43#define _vpPylonGrabberUsb_h_
44
45#include <visp3/core/vpConfig.h>
46
47#include <visp3/sensor/vpPylonGrabber.h>
48
49#ifdef VISP_HAVE_PYLON
50
51#include <pylon/usb/BaslerUsbInstantCamera.h>
52
64class VISP_EXPORT vpPylonGrabberUsb : public vpPylonGrabber
65{
66public:
68 virtual ~vpPylonGrabberUsb();
69
71 void acquire(vpImage<vpRGBa> &I);
72
73 void close();
74 void connect();
75 void disconnect();
76
77 float getBlackLevel();
78 std::ostream &getCameraInfo(std::ostream &os);
79 Pylon::CInstantCamera *getCameraHandler();
81 unsigned int getCameraIndex() const { return m_index; }
82 std::string getCameraSerial(unsigned int index);
83 float getExposure();
84 float getFrameRate();
85 float getGain();
86 unsigned int getNumCameras();
87 float getGamma();
88 bool loadUserSet(UserSetName user_set);
89 UserSetName getUserSetDefault();
90
92 bool isConnected() const { return m_connected; }
94 bool isCaptureStarted() const { return m_camera.IsGrabbing(); }
96 void open(vpImage<vpRGBa> &I);
97
100
101 float setBlackLevel(float blacklevel_value = 0);
102 void setCameraIndex(unsigned int index);
103 void setCameraSerial(const std::string &serial);
104 float setExposure(bool exposure_on, bool exposure_auto, float exposure_value = 0);
105 float setGain(bool gain_auto, float gain_value = 0);
106 float setFrameRate(float frame_rate);
107 float setGamma(bool gamma_on, float gamma_value = 1);
108 bool saveUserSet(UserSetName user_set, bool set_default = false);
109 bool setUserSetDefault(UserSetName user_set);
110
111 void startCapture();
112 void stopCapture();
113
114protected:
115 void open();
116 bool selectUserSet(UserSetName user_set);
117
118private:
119 Pylon::CBaslerUsbInstantCamera m_camera;
120 unsigned int m_index;
121 unsigned int m_numCameras;
122 bool m_connected;
123};
124END_VISP_NAMESPACE
125#endif // #ifdef VISP_HAVE_PYLON
126#endif // #ifndef _vpPylonGrabberUsb_h_
Definition of the vpImage class member functions.
Definition vpImage.h:131
unsigned int getCameraIndex() const
bool isCaptureStarted() const
Return true if the camera capture is started.
bool isConnected() const
Return true if the camera is connected.
virtual void startCapture()=0
virtual void close()=0
Stop active camera capturing images and disconnect the active camera.
virtual float getFrameRate()=0
virtual void disconnect()=0
virtual float setExposure(bool exposure_on, bool exposure_auto, float exposure_value)=0
virtual float setGain(bool gain_auto, float gain_value)=0
virtual Pylon::CInstantCamera * getCameraHandler()=0
virtual vpPylonGrabber & operator>>(vpImage< unsigned char > &I)=0
virtual unsigned int getNumCameras()=0
Get the number of cameras of specific subclasses. GigE, USB, etc.
virtual void setCameraSerial(const std::string &serial)=0
virtual float getBlackLevel()=0
virtual float setGamma(bool gamma_on, float gamma_value=1)=0
virtual float setFrameRate(float frame_rate)=0
virtual float getGain()=0
virtual void acquire(vpImage< unsigned char > &I)=0
virtual void stopCapture()=0
virtual float getExposure()=0
virtual bool setUserSetDefault(UserSetName user_set)=0
Sets the configuration set to be used as the default startup set.
virtual void open(vpImage< unsigned char > &I)=0
virtual void connect()=0
virtual std::string getCameraSerial(unsigned int index)=0
virtual UserSetName getUserSetDefault()=0
Gets the configuration set being used as the default startup set.
virtual void setCameraIndex(unsigned int index)=0
virtual bool loadUserSet(UserSetName user_set)=0
Loads the selected configuration into the camera's volatile memory and makes it the active configurat...
virtual std::ostream & getCameraInfo(std::ostream &os)=0
virtual bool saveUserSet(UserSetName user_set, bool set_default=false)=0
Saves the current active configuration set into the selected user set.
virtual float setBlackLevel(float blacklevel_value)=0
virtual float getGamma()=0