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