Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpFlyCaptureGrabber.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: Class which enables to project an image in the 3D space
31
* and get the view of a virtual camera.
32
*/
33
39
40
#ifndef _vpFlyCaptureGrabber_h_
41
#define _vpFlyCaptureGrabber_h_
42
43
#include <ostream>
44
#include <visp3/core/vpConfig.h>
45
#include <visp3/core/vpFrameGrabber.h>
46
47
#ifdef VISP_HAVE_FLYCAPTURE
48
49
#include <FlyCapture2.h>
50
51
BEGIN_VISP_NAMESPACE
52
162
class
VISP_EXPORT
vpFlyCaptureGrabber
:
public
vpFrameGrabber
163
{
164
public
:
165
vpFlyCaptureGrabber
();
166
virtual
~vpFlyCaptureGrabber
();
167
168
void
acquire
(
vpImage<unsigned char>
&I);
169
void
acquire
(
vpImage<unsigned char>
&I, FlyCapture2::TimeStamp ×tamp);
170
void
acquire
(
vpImage<vpRGBa>
&I);
171
void
acquire
(
vpImage<vpRGBa>
&I, FlyCapture2::TimeStamp ×tamp);
172
173
void
close
();
174
void
connect
();
175
void
disconnect
();
176
177
float
getBrightness
();
178
std::ostream &
getCameraInfo
(std::ostream &os);
// Cannot be const since
179
// FlyCapture2::Camera::GetCameraInfo()
180
// isn't
181
FlyCapture2::Camera *
getCameraHandler
();
183
unsigned
int
getCameraIndex
()
const
{
return
m_index
; }
184
bool
getCameraPower();
185
static
unsigned
int
getCameraSerial(
unsigned
int
index);
186
float
getExposure();
187
float
getFrameRate();
188
float
getGain();
189
static
unsigned
int
getNumCameras();
190
unsigned
int
getSharpness();
191
float
getShutter();
192
193
bool
isCameraPowerAvailable();
195
bool
isConnected
()
const
{
return
m_connected
; }
197
bool
isCaptureStarted
()
const
{
return
m_capture
; }
198
bool
isFormat7Supported(FlyCapture2::Mode format7_mode);
199
bool
isVideoModeAndFrameRateSupported(FlyCapture2::VideoMode video_mode, FlyCapture2::FrameRate frame_rate);
200
void
open
(
vpImage<unsigned char>
&I);
201
void
open
(
vpImage<vpRGBa>
&I);
202
203
vpFlyCaptureGrabber
&operator>>(
vpImage<unsigned char>
&I);
204
vpFlyCaptureGrabber
&operator>>(
vpImage<vpRGBa>
&I);
205
206
float
setBrightness(
bool
brightness_auto,
float
brightness_value = 0);
207
void
setCameraIndex(
unsigned
int
index);
208
void
setCameraPower(
bool
on);
209
void
setCameraSerial(
unsigned
int
serial);
210
float
setExposure(
bool
exposure_on,
bool
exposure_auto,
float
exposure_value = 0);
211
float
setGain(
bool
gain_auto,
float
gain_value = 0);
212
void
setFormat7VideoMode(FlyCapture2::Mode format7_mode, FlyCapture2::PixelFormat pixel_format,
unsigned
int
width,
213
unsigned
int
height);
214
float
setFrameRate(
float
frame_rate);
215
unsigned
int
setSharpness(
bool
sharpness_on,
bool
sharpness_auto,
unsigned
int
sharpness_value = 0);
216
float
setShutter(
bool
auto_shutter,
float
shutter_ms = 10);
217
void
setVideoModeAndFrameRate(FlyCapture2::VideoMode video_mode, FlyCapture2::FrameRate frame_rate);
218
219
void
startCapture();
220
void
stopCapture();
221
222
protected
:
223
typedef
enum
224
{
225
ABS_VALUE
,
226
VALUE_A
,
227
} PropertyValue;
228
std::pair<unsigned int, unsigned int> centerRoi(
unsigned
int
size,
unsigned
int
max_size,
unsigned
int
step);
229
FlyCapture2::Property getProperty(FlyCapture2::PropertyType prop_type);
230
FlyCapture2::PropertyInfo getPropertyInfo(FlyCapture2::PropertyType prop_type);
231
void
open
();
232
void
setProperty(
const
FlyCapture2::PropertyType &prop_type,
bool
on,
bool
auto_on,
float
value,
233
PropertyValue prop_value = ABS_VALUE);
234
235
protected
:
236
FlyCapture2::Camera
m_camera
;
237
FlyCapture2::PGRGuid
m_guid
;
238
unsigned
int
m_index
;
239
unsigned
int
m_numCameras
;
240
FlyCapture2::Image
m_rawImage
;
241
bool
m_connected
;
242
bool
m_capture
;
243
};
244
END_VISP_NAMESPACE
245
#endif
246
#endif
vpFlyCaptureGrabber
Definition
vpFlyCaptureGrabber.h:163
vpFlyCaptureGrabber::getBrightness
float getBrightness()
Definition
vpFlyCaptureGrabber.cpp:272
vpFlyCaptureGrabber::getCameraHandler
FlyCapture2::Camera * getCameraHandler()
Definition
vpFlyCaptureGrabber.cpp:188
vpFlyCaptureGrabber::m_rawImage
FlyCapture2::Image m_rawImage
Image buffer.
Definition
vpFlyCaptureGrabber.h:240
vpFlyCaptureGrabber::disconnect
void disconnect()
Definition
vpFlyCaptureGrabber.cpp:1101
vpFlyCaptureGrabber::connect
void connect()
Definition
vpFlyCaptureGrabber.cpp:1066
vpFlyCaptureGrabber::m_capture
bool m_capture
true is capture started
Definition
vpFlyCaptureGrabber.h:242
vpFlyCaptureGrabber::isCaptureStarted
bool isCaptureStarted() const
Return true if the camera capture is started.
Definition
vpFlyCaptureGrabber.h:197
vpFlyCaptureGrabber::m_camera
FlyCapture2::Camera m_camera
Pointer to each camera.
Definition
vpFlyCaptureGrabber.h:236
vpFlyCaptureGrabber::m_index
unsigned int m_index
Active camera index.
Definition
vpFlyCaptureGrabber.h:238
vpFlyCaptureGrabber::m_numCameras
unsigned int m_numCameras
Number of connected cameras.
Definition
vpFlyCaptureGrabber.h:239
vpFlyCaptureGrabber::vpFlyCaptureGrabber
vpFlyCaptureGrabber()
Definition
vpFlyCaptureGrabber.cpp:53
vpFlyCaptureGrabber::getCameraInfo
std::ostream & getCameraInfo(std::ostream &os)
Definition
vpFlyCaptureGrabber.cpp:81
vpFlyCaptureGrabber::VALUE_A
@ VALUE_A
Consider FlyCapture2::Property::valueA.
Definition
vpFlyCaptureGrabber.h:226
vpFlyCaptureGrabber::ABS_VALUE
@ ABS_VALUE
Consider FlyCapture2::Property::absValue.
Definition
vpFlyCaptureGrabber.h:225
vpFlyCaptureGrabber::m_connected
bool m_connected
true if camera connected
Definition
vpFlyCaptureGrabber.h:241
vpFlyCaptureGrabber::m_guid
FlyCapture2::PGRGuid m_guid
Active camera guid.
Definition
vpFlyCaptureGrabber.h:237
vpFlyCaptureGrabber::getCameraIndex
unsigned int getCameraIndex() const
Definition
vpFlyCaptureGrabber.h:183
vpFlyCaptureGrabber::isConnected
bool isConnected() const
Return true if the camera is connected.
Definition
vpFlyCaptureGrabber.h:195
vpFrameGrabber::open
virtual void open(vpImage< unsigned char > &I)=0
vpFrameGrabber::vpFrameGrabber
vpFrameGrabber()
Definition
vpFrameGrabber.h:114
vpFrameGrabber::acquire
virtual void acquire(vpImage< unsigned char > &I)=0
vpFrameGrabber::close
virtual void close()=0
vpImage
Definition of the vpImage class member functions.
Definition
vpImage.h:131
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
sensor
include
visp3
sensor
vpFlyCaptureGrabber.h
Generated by
1.17.0