Image Component Library (ICL)
PylonGrabber.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLIO/src/ICLIO/PylonGrabber.h **
10 ** Module : ICLIO **
11 ** Authors: Viktor Richter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLIO/PylonIncludes.h>
34 
35 #include <ICLUtils/CompatMacros.h>
36 #include <ICLIO/Grabber.h>
37 #include <ICLIO/PylonUtils.h>
41 #include <ICLUtils/Time.h>
42 
43 namespace icl {
44  namespace io{
45 
46  namespace pylon {
47 
49 
88  class PylonGrabber : public Grabber, public Interruptable {
89  public:
91 
95  ICLIO_API PylonGrabber(const Pylon::CDeviceInfo &dev, const std::string args);
96 
99 
101 
102  ICLIO_API virtual const core::ImgBase* acquireImage();
103 
105 
109  ICLIO_API static Pylon::CDeviceInfo getDeviceFromArgs(std::string args);
110 
111  private:
117  static const int m_NumBuffers = 3;
119  Pylon::IPylonDevice* m_Camera;
121  Pylon::IStreamGrabber* m_Grabber;
129  std::vector<PylonGrabberBuffer<uint16_t>*> m_BufferList;
132 
134  void acquisitionStart();
136  void acquisitionStop();
138  void grabbingStart();
140  void grabbingStop();
141 
143  static void printHelp();
144 
146  void cameraDefaultSettings();
148  void convert(const void *pImageBuffer);
149  };
150 
151  } //namespace pylon
152 
154 
155  } // namespace io
156 } //namespace icl
157 
Grabber implementation for a Basler Pylon-based GIG-E Grabber.
Definition: PylonGrabber.h:88
undocument this line if you encounter any issues!
Definition: Any.h:37
void convert(const void *pImageBuffer)
Converts pImageBuffer to correct type and writes it into m_Image.
PylonGrabberThread * m_GrabberThread
PylonGrabberThread used for continous image acquisition.
Definition: PylonGrabber.h:127
This is the color-conversion-class for Pylon images.
Definition: PylonColorConverter.h:58
void grabbingStop()
deregisters buffers from grabber and deletes them
void acquisitionStop()
stops the acquisition of pictures by the camera
Pylon::IPylonDevice * m_Camera
The camera interface.
Definition: PylonGrabber.h:119
Pylon::IStreamGrabber * m_Grabber
The streamGrabber of the camera.
Definition: PylonGrabber.h:121
ICLIO_API PylonGrabber(const Pylon::CDeviceInfo &dev, const std::string args)
The constructor.
static ICLIO_API Pylon::CDeviceInfo getDeviceFromArgs(std::string args)
Uses args to choose a pylon device.
utils::Mutex m_ImgMutex
A mutex lock to synchronize buffer and color converter access.
Definition: PylonGrabber.h:113
PylonAutoEnv m_PylonEnv
The PylonEnvironment automation.
Definition: PylonGrabber.h:115
#define ICLIO_API
Definition: CompatMacros.h:176
ICLIO_API ~PylonGrabber()
Destructor.
std::vector< PylonGrabberBuffer< uint16_t > * > m_BufferList
A list of used buffers.
Definition: PylonGrabber.h:129
void cameraDefaultSettings()
helper function that makes default settings for the camera.
Common interface class for all grabbers.
Definition: Grabber.h:153
core::ImgBase * m_LastBuffer
A pointer to the last used buffer.
Definition: PylonGrabber.h:131
void grabbingStart()
creates buffers and registers them at the grabber
Utility Structure.
Definition: PylonUtils.h:202
PylonCameraOptions * m_CameraOptions
PylonCameraOptions used to get and set camera settings.
Definition: PylonGrabber.h:123
void acquisitionStart()
starts the acquisition of pictures by the camera
pylon::PylonGrabber PylonGrabber
Definition: PylonGrabber.h:153
virtual ICLIO_API const core::ImgBase * acquireImage()
grab function grabs an image (destination image is adapted on demand)
PylonColorConverter * m_ColorConverter
PylonColorConverter used for color conversion.
Definition: PylonGrabber.h:125
Internally spawned thread class for continuous grabbing.
Definition: PylonGrabberThread.h:46
This is a helper class for Pylon camera settings.
Definition: PylonCameraOptions.h:44
Utility Structure.
Definition: PylonUtils.h:183
Mutex class of the ICL.
Definition: Mutex.h:54
static void printHelp()
Prints information about the startup argument options.
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
static const int m_NumBuffers
Count of buffers for grabbing.
Definition: PylonGrabber.h:117