Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpFlyCaptureGrabber.cpp
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#include <visp3/core/vpException.h>
41#include <visp3/sensor/vpFlyCaptureGrabber.h>
42
43#ifdef VISP_HAVE_FLYCAPTURE
44
45#include <visp3/core/vpTime.h>
46
48
58
67{
68 unsigned int numCameras;
69 FlyCapture2::BusManager busMgr;
70 FlyCapture2::Error error = busMgr.GetNumOfCameras(&numCameras);
71 if (error != FlyCapture2::PGRERROR_OK) {
72 numCameras = 0;
73 }
74 return numCameras;
75}
76
81std::ostream &vpFlyCaptureGrabber::getCameraInfo(std::ostream &os)
82{
83 this->connect();
84
85 FlyCapture2::CameraInfo camInfo;
86 FlyCapture2::Error error = m_camera.GetCameraInfo(&camInfo);
87 if (error != FlyCapture2::PGRERROR_OK) {
88 error.PrintErrorTrace();
89 }
90
91 os << "Camera information: " << std::endl;
92 os << " Serial number : " << camInfo.serialNumber << std::endl;
93 os << " Camera model : " << camInfo.modelName << std::endl;
94 os << " Camera vendor : " << camInfo.vendorName << std::endl;
95 os << " Sensor : " << camInfo.sensorInfo << std::endl;
96 os << " Resolution : " << camInfo.sensorResolution << std::endl;
97 os << " Firmware version : " << camInfo.firmwareVersion << std::endl;
98 os << " Firmware build time: " << camInfo.firmwareBuildTime << std::endl;
99 return os;
100}
101
189{
190 this->connect();
191
192 if (m_connected == true) {
193 return &m_camera;
194 }
195 else {
196 return nullptr;
197 }
198}
199
213{
214 this->connect();
215
216 FlyCapture2::Property prop = this->getProperty(FlyCapture2::FRAME_RATE);
217 return prop.absValue;
218}
219
233{
234 this->connect();
235
236 FlyCapture2::Property prop = this->getProperty(FlyCapture2::SHUTTER);
237 return prop.absValue;
238}
239
253{
254 this->connect();
255
256 FlyCapture2::Property prop = this->getProperty(FlyCapture2::GAIN);
257 return prop.absValue;
258}
259
273{
274 this->connect();
275
276 FlyCapture2::Property prop = this->getProperty(FlyCapture2::BRIGHTNESS);
277 return prop.absValue;
278}
279
293{
294 this->connect();
295
296 FlyCapture2::Property prop = this->getProperty(FlyCapture2::SHARPNESS);
297 return prop.valueA;
298}
299
313{
314 this->connect();
315
316 FlyCapture2::Property prop = this->getProperty(FlyCapture2::AUTO_EXPOSURE);
317 return prop.absValue;
318}
319
355unsigned int vpFlyCaptureGrabber::getCameraSerial(unsigned int index)
356{
357 unsigned int num_cameras = vpFlyCaptureGrabber::getNumCameras();
358 if (index >= num_cameras) {
359 throw(vpException(vpException::badValue, "The camera with index %u is not present. Only %d cameras connected.",
360 index, num_cameras));
361 }
362 unsigned int serial_id;
363 FlyCapture2::BusManager busMgr;
364 FlyCapture2::Error error;
365 error = busMgr.GetCameraSerialNumberFromIndex(index, &serial_id);
366 if (error != FlyCapture2::PGRERROR_OK) {
367 error.PrintErrorTrace();
368 throw(vpException(vpException::fatalError, "Cannot get camera with index %d serial id.", index));
369 }
370 return serial_id;
371}
372
389{
390 if (index >= m_numCameras) {
391 throw(vpException(vpException::badValue, "The camera with index %u is not present. Only %d cameras connected.",
392 index, m_numCameras));
393 }
394
395 m_index = index;
396}
397
431void vpFlyCaptureGrabber::setCameraSerial(unsigned int serial_id)
432{
433 FlyCapture2::BusManager busMgr;
434 FlyCapture2::Error error;
435 m_numCameras = this->getNumCameras();
436 for (unsigned int i = 0; i < m_numCameras; i++) {
437 if (vpFlyCaptureGrabber::getCameraSerial(i) == serial_id) {
438 m_index = i;
439 return;
440 }
441 }
442 throw(vpException(vpException::badValue, "The camera with serial id %u is not present.", serial_id));
443}
444
454void vpFlyCaptureGrabber::setProperty(const FlyCapture2::PropertyType &prop_type, bool on, bool auto_on, float value,
455 PropertyValue prop_value)
456{
457 this->connect();
458
459 FlyCapture2::PropertyInfo propInfo;
460 propInfo = this->getPropertyInfo(prop_type);
461
462 if (propInfo.present) {
463 FlyCapture2::Property prop;
464 prop.type = prop_type;
465 prop.onOff = on && propInfo.onOffSupported;
466 prop.autoManualMode = auto_on && propInfo.autoSupported;
467 prop.absControl = propInfo.absValSupported;
468 switch (prop_value) {
469 case ABS_VALUE: {
470 float value_ = std::max<float>(std::min<float>(static_cast<float>(value), static_cast<float>(propInfo.absMax)), static_cast<float>(propInfo.absMin));
471 prop.absValue = value_;
472 break;
473 }
474 case VALUE_A: {
475 unsigned int value_ =
476 std::max<unsigned int>(std::min<unsigned int>(static_cast<unsigned int>(value), static_cast<unsigned int>(propInfo.max)), static_cast<unsigned int>(propInfo.min));
477 prop.valueA = value_;
478 break;
479 }
480 }
481
482 FlyCapture2::Error error;
483 error = m_camera.SetProperty(&prop);
484 if (error != FlyCapture2::PGRERROR_OK) {
485 error.PrintErrorTrace();
486 throw(vpException(vpException::fatalError, "Cannot set property %d.", static_cast<int>(prop_type)));
487 }
488 }
489}
490
528{
529 this->connect();
530
531 this->setProperty(FlyCapture2::FRAME_RATE, true, false, frame_rate);
532 FlyCapture2::Property prop = this->getProperty(FlyCapture2::FRAME_RATE);
533 return prop.absValue;
534}
535
573float vpFlyCaptureGrabber::setShutter(bool auto_shutter, float shutter_ms)
574{
575 this->connect();
576
577 this->setProperty(FlyCapture2::SHUTTER, true, auto_shutter, shutter_ms);
578 FlyCapture2::Property prop = this->getProperty(FlyCapture2::SHUTTER);
579 return prop.absValue;
580}
581
621float vpFlyCaptureGrabber::setGain(bool gain_auto, float gain_value)
622{
623 this->connect();
624
625 this->setProperty(FlyCapture2::GAIN, true, gain_auto, gain_value);
626 FlyCapture2::Property prop = this->getProperty(FlyCapture2::GAIN);
627 return prop.absValue;
628}
629
669float vpFlyCaptureGrabber::setBrightness(bool brightness_auto, float brightness_value)
670{
671 this->connect();
672
673 this->setProperty(FlyCapture2::BRIGHTNESS, true, brightness_auto, brightness_value);
674 FlyCapture2::Property prop = this->getProperty(FlyCapture2::BRIGHTNESS);
675 return prop.absValue;
676}
677
727float vpFlyCaptureGrabber::setExposure(bool exposure_on, bool exposure_auto, float exposure_value)
728{
729 this->connect();
730
731 this->setProperty(FlyCapture2::AUTO_EXPOSURE, exposure_on, exposure_auto, exposure_value);
732 FlyCapture2::Property prop = this->getProperty(FlyCapture2::AUTO_EXPOSURE);
733 return prop.absValue;
734}
735
779unsigned int vpFlyCaptureGrabber::setSharpness(bool sharpness_on, bool sharpness_auto, unsigned int sharpness_value)
780{
781 this->connect();
782
783 this->setProperty(FlyCapture2::SHARPNESS, sharpness_on, sharpness_auto, static_cast<float>(sharpness_value), VALUE_A);
784 FlyCapture2::Property prop = this->getProperty(FlyCapture2::SHARPNESS);
785 return prop.valueA;
786}
787
792FlyCapture2::Property vpFlyCaptureGrabber::getProperty(FlyCapture2::PropertyType prop_type)
793{
794 this->connect();
795
796 FlyCapture2::Property prop;
797 prop.type = prop_type;
798 FlyCapture2::Error error;
799 error = m_camera.GetProperty(&prop);
800 if (error != FlyCapture2::PGRERROR_OK) {
801 error.PrintErrorTrace();
802 throw(vpException(vpException::fatalError, "Cannot get property %d value.", static_cast<int>prop_type)));
803 }
804 return prop;
805}
806
812FlyCapture2::PropertyInfo vpFlyCaptureGrabber::getPropertyInfo(FlyCapture2::PropertyType prop_type)
813{
814 this->connect();
815
816 FlyCapture2::PropertyInfo propInfo;
817 propInfo.type = prop_type;
818
819 FlyCapture2::Error error;
820 error = m_camera.GetPropertyInfo(&propInfo);
821 if (error != FlyCapture2::PGRERROR_OK) {
822 error.PrintErrorTrace();
823 throw(vpException(vpException::fatalError, "Cannot get property %d info.", static_cast<int>prop_type)));
824 }
825 return propInfo;
826}
827
862void vpFlyCaptureGrabber::setVideoModeAndFrameRate(FlyCapture2::VideoMode video_mode, FlyCapture2::FrameRate frame_rate)
863{
864 this->connect();
865
866 FlyCapture2::Error error;
867 error = m_camera.SetVideoModeAndFrameRate(video_mode, frame_rate);
868 if (error != FlyCapture2::PGRERROR_OK) {
869 error.PrintErrorTrace();
870 throw(vpException(vpException::fatalError, "Cannot set video mode and framerate."));
871 }
872}
873
877bool vpFlyCaptureGrabber::isVideoModeAndFrameRateSupported(FlyCapture2::VideoMode video_mode,
878 FlyCapture2::FrameRate frame_rate)
879{
880 this->connect();
881
882 FlyCapture2::Error error;
883 bool supported = false;
884 error = m_camera.GetVideoModeAndFrameRateInfo(video_mode, frame_rate, &supported);
885 if (error != FlyCapture2::PGRERROR_OK) {
886 error.PrintErrorTrace();
887 throw(vpException(vpException::fatalError, "Cannot get video mode and framerate."));
888 }
889 return supported;
890}
891
897std::pair<unsigned int, unsigned int> vpFlyCaptureGrabber::centerRoi(unsigned int size, unsigned int max_size,
898 unsigned int step)
899{
900 if (size == 0 || size > max_size)
901 size = max_size;
902 // size should be a multiple of step
903 size = size / step * step;
904 const unsigned int offset = (max_size - size) / 2;
905 // Return offset for centering roi
906 return std::make_pair(size, offset);
907}
908
944void vpFlyCaptureGrabber::setFormat7VideoMode(FlyCapture2::Mode format7_mode, FlyCapture2::PixelFormat pixel_format,
945 unsigned int w, unsigned int h)
946{
947 this->connect();
948
949 FlyCapture2::Format7Info fmt7_info;
950 bool fmt7_supported;
951 FlyCapture2::Error error;
952
953 fmt7_info.mode = format7_mode;
954 error = m_camera.GetFormat7Info(&fmt7_info, &fmt7_supported);
955 if (error != FlyCapture2::PGRERROR_OK) {
956 error.PrintErrorTrace();
957 throw(vpException(vpException::fatalError, "Cannot get format7 info."));
958 }
959 if (!fmt7_supported) {
960 throw(vpException(vpException::fatalError, "Format7 mode %d not supported.", static_cast<int>format7_mode)));
961 }
962
963 FlyCapture2::Format7ImageSettings fmt7_settings;
964 fmt7_settings.mode = format7_mode;
965 fmt7_settings.pixelFormat = pixel_format;
966 // Set centered roi
967 std::pair<unsigned int, unsigned int> roi_w = this->centerRoi(w, fmt7_info.maxWidth, fmt7_info.imageHStepSize);
968 std::pair<unsigned int, unsigned int> roi_h = this->centerRoi(h, fmt7_info.maxHeight, fmt7_info.imageVStepSize);
969 fmt7_settings.width = roi_w.first;
970 fmt7_settings.offsetX = roi_w.second;
971 fmt7_settings.height = roi_h.first;
972 fmt7_settings.offsetY = roi_h.second;
973
974 // Validate the settings
975 FlyCapture2::Format7PacketInfo fmt7_packet_info;
976 bool valid = false;
977 error = m_camera.ValidateFormat7Settings(&fmt7_settings, &valid, &fmt7_packet_info);
978 if (error != FlyCapture2::PGRERROR_OK) {
979 error.PrintErrorTrace();
980 throw(vpException(vpException::fatalError, "Cannot validate format7 settings."));
981 }
982 if (!valid) {
983 throw(vpException(vpException::fatalError, "Format7 settings are not valid."));
984 }
985 error = m_camera.SetFormat7Configuration(&fmt7_settings, fmt7_packet_info.recommendedBytesPerPacket);
986 if (error != FlyCapture2::PGRERROR_OK) {
987 error.PrintErrorTrace();
988 throw(vpException(vpException::fatalError, "Cannot set format7 settings."));
989 }
990}
991
995bool vpFlyCaptureGrabber::isFormat7Supported(FlyCapture2::Mode format7_mode)
996{
997 this->connect();
998
999 FlyCapture2::Format7Info fmt7_info;
1000 bool supported = false;
1001 FlyCapture2::Error error;
1002
1003 fmt7_info.mode = format7_mode;
1004 error = m_camera.GetFormat7Info(&fmt7_info, &supported);
1005 if (error != FlyCapture2::PGRERROR_OK) {
1006 error.PrintErrorTrace();
1007 throw(vpException(vpException::fatalError, "Cannot get format7 info."));
1008 }
1009
1010 return supported;
1011}
1012
1018{
1019 this->connect();
1020
1021 if (m_capture == false) {
1022
1023 FlyCapture2::Error error;
1024 error = m_camera.StartCapture();
1025 if (error != FlyCapture2::PGRERROR_OK) {
1026 error.PrintErrorTrace();
1027 throw(vpException(vpException::fatalError, "Cannot start capture for camera with serial %u",
1029 }
1030 m_capture = true;
1031 }
1032 if (m_connected && m_capture)
1033 init = true;
1034 else
1035 init = false;
1036}
1037
1044{
1045 if (m_capture == true) {
1046
1047 FlyCapture2::Error error;
1048 error = m_camera.StopCapture();
1049 if (error != FlyCapture2::PGRERROR_OK) {
1050 error.PrintErrorTrace();
1051 throw(vpException(vpException::fatalError, "Cannot stop capture."));
1052 }
1053 m_capture = false;
1054 }
1055 if (m_connected && m_capture)
1056 init = true;
1057 else
1058 init = false;
1059}
1060
1067{
1068 if (m_connected == false) {
1069 FlyCapture2::Error error;
1070 m_numCameras = this->getNumCameras();
1071 if (m_numCameras == 0) {
1072 throw(vpException(vpException::fatalError, "No camera found on the bus"));
1073 }
1074
1075 FlyCapture2::BusManager busMgr;
1076
1077 error = busMgr.GetCameraFromIndex(m_index, &m_guid);
1078 if (error != FlyCapture2::PGRERROR_OK) {
1079 error.PrintErrorTrace();
1080 throw(vpException(vpException::fatalError, "Cannot retrieve guid of camera with index %u.", m_index));
1081 }
1082 // Connect to a camera
1083 error = m_camera.Connect(&m_guid);
1084 if (error != FlyCapture2::PGRERROR_OK) {
1085 error.PrintErrorTrace();
1086 throw(vpException(vpException::fatalError, "Cannot connect to camera with serial %u", getCameraSerial(m_index)));
1087 }
1088 m_connected = true;
1089 }
1090 if (m_connected && m_capture)
1091 init = true;
1092 else
1093 init = false;
1094}
1095
1102{
1103 if (m_connected == true) {
1104
1105 FlyCapture2::Error error;
1106 error = m_camera.Disconnect();
1107 if (error != FlyCapture2::PGRERROR_OK) {
1108 error.PrintErrorTrace();
1109 throw(vpException(vpException::fatalError, "Cannot stop capture."));
1110 }
1111 m_connected = false;
1112 }
1113 if (m_connected && m_capture)
1114 init = true;
1115 else
1116 init = false;
1117}
1118
1134{
1135 this->stopCapture();
1136 this->disconnect();
1137}
1138
1145{
1146 FlyCapture2::TimeStamp timestamp;
1147 this->acquire(I, timestamp);
1148}
1149
1157void vpFlyCaptureGrabber::acquire(vpImage<unsigned char> &I, FlyCapture2::TimeStamp &timestamp)
1158{
1159 this->open();
1160
1161 FlyCapture2::Error error;
1162 // Retrieve an image
1163 error = m_camera.RetrieveBuffer(&m_rawImage);
1164 if (error != FlyCapture2::PGRERROR_OK) {
1165 error.PrintErrorTrace();
1166 std::cerr << "Cannot retrieve image from camera with serial " << getCameraSerial(m_index) << std::endl;
1167 }
1168 timestamp = m_rawImage.GetTimeStamp();
1169
1170 height = m_rawImage.GetRows();
1171 width = m_rawImage.GetCols();
1172 I.resize(height, width);
1173
1174 // Create a converted image using a stride equals to `sizeof(unsigned
1175 // char) * width`, which makes sure there is no paddings or holes
1176 // between pixel data. And the convertedImage object is sharing the
1177 // same data buffer with vpImage object `I`.
1178 FlyCapture2::Image convertedImage(height, width, sizeof(unsigned char) * width, I.bitmap,
1179 sizeof(unsigned char) * I.getSize(), FlyCapture2::PIXEL_FORMAT_MONO8);
1180
1181 // Convert the raw image
1182 error = m_rawImage.Convert(FlyCapture2::PIXEL_FORMAT_MONO8, &convertedImage);
1183 if (error != FlyCapture2::PGRERROR_OK) {
1184 error.PrintErrorTrace();
1185 throw(vpException(vpException::fatalError, "Cannot convert image from camera with serial %u",
1187 }
1188}
1189
1196{
1197 FlyCapture2::TimeStamp timestamp;
1198 this->acquire(I, timestamp);
1199}
1200
1208void vpFlyCaptureGrabber::acquire(vpImage<vpRGBa> &I, FlyCapture2::TimeStamp &timestamp)
1209{
1210 this->open();
1211
1212 FlyCapture2::Error error;
1213 // Retrieve an image
1214 error = m_camera.RetrieveBuffer(&m_rawImage);
1215 if (error != FlyCapture2::PGRERROR_OK) {
1216 error.PrintErrorTrace();
1217 std::cerr << "Cannot retrieve image from camera with serial " << getCameraSerial(m_index) << std::endl;
1218 }
1219 timestamp = m_rawImage.GetTimeStamp();
1220
1221 // Create a converted image
1222 FlyCapture2::Image convertedImage;
1223
1224 // Convert the raw image
1225 error = m_rawImage.Convert(FlyCapture2::PIXEL_FORMAT_RGBU, &convertedImage);
1226 if (error != FlyCapture2::PGRERROR_OK) {
1227 error.PrintErrorTrace();
1228 throw(vpException(vpException::fatalError, "Cannot convert image from camera with serial %u",
1230 }
1231 height = convertedImage.GetRows();
1232 width = convertedImage.GetCols();
1233 I.resize(height, width);
1234
1235 unsigned char *data = convertedImage.GetData();
1236 unsigned int stride = convertedImage.GetStride();
1237 unsigned int Bps = convertedImage.GetBitsPerPixel() / 8; // Bytes per pixel
1238 // `I.bitmap` and `I[i]` are pointers to `vpRGBa` objects. While
1239 // `data` is a pointer to an array of 32-bit RGBU values with each
1240 // value a byte in the order of R, G, B and U and goes on.
1241 for (unsigned int i = 0; i < height; ++i) {
1242 for (unsigned int j = 0; j < width; ++j) {
1243 unsigned char *pp = data + i * stride + j * Bps;
1244 I[i][j].R = pp[0];
1245 I[i][j].G = pp[1];
1246 I[i][j].B = pp[2];
1247 I[i][j].A = pp[3];
1248 }
1249 }
1250}
1251
1257{
1258 this->open();
1259 this->acquire(I);
1260}
1261
1267{
1268 this->open();
1269 this->acquire(I);
1270}
1271
1284{
1285 this->connect();
1286 this->startCapture();
1287}
1288
1295{
1296 this->connect();
1297
1298 const unsigned int powerReg = 0x400;
1299 unsigned int powerRegVal = 0;
1300
1301 FlyCapture2::Error error;
1302 error = m_camera.ReadRegister(powerReg, &powerRegVal);
1303 if (error != FlyCapture2::PGRERROR_OK) {
1304 return false;
1305 }
1306
1307 return ((powerRegVal & 0x00008000) != 0);
1308}
1309
1316{
1318 return false;
1319 const unsigned int powerReg = 0x610;
1320 unsigned int powerRegVal = 0;
1321
1322 FlyCapture2::Error error;
1323 error = m_camera.ReadRegister(powerReg, &powerRegVal);
1324 if (error != FlyCapture2::PGRERROR_OK) {
1325 return false;
1326 }
1327
1328 return ((powerRegVal & (0x1 << 31)) != 0);
1329}
1330
1364{
1365 this->connect();
1366
1367 if (!isCameraPowerAvailable()) {
1368 throw(vpException(vpException::badValue, "Cannot power on camera. Feature not available"));
1369 }
1370
1371 // Power on the camera
1372 const unsigned int powerReg = 0x610;
1373 unsigned int powerRegVal = 0;
1374
1375 powerRegVal = (on == true) ? 0x80000000 : 0x0;
1376
1377 FlyCapture2::Error error;
1378 error = m_camera.WriteRegister(powerReg, powerRegVal);
1379 if (error != FlyCapture2::PGRERROR_OK) {
1380 error.PrintErrorTrace();
1381 throw(vpException(vpException::fatalError, "Cannot power on the camera."));
1382 }
1383
1384 unsigned int millisecondsToSleep = 100;
1385 unsigned int regVal = 0;
1386 unsigned int retries = 10;
1387
1388 // Wait for camera to complete power-up
1389 do {
1390 vpTime::wait(millisecondsToSleep);
1391 error = m_camera.ReadRegister(powerReg, &regVal);
1392 if (error == FlyCapture2::PGRERROR_TIMEOUT) {
1393 // ignore timeout errors, camera may not be responding to
1394 // register reads during power-up
1395 }
1396 else if (error != FlyCapture2::PGRERROR_OK) {
1397 error.PrintErrorTrace();
1398 throw(vpException(vpException::fatalError, "Cannot power on the camera."));
1399 }
1400
1401 retries--;
1402 } while ((regVal & powerRegVal) == 0 && retries > 0);
1403
1404 // Check for timeout errors after retrying
1405 if (error == FlyCapture2::PGRERROR_TIMEOUT) {
1406 error.PrintErrorTrace();
1407 throw(vpException(vpException::fatalError, "Cannot power on the camera. Timeout occur"));
1408 }
1409}
1410
1435
1457{
1458 this->acquire(I);
1459 return *this;
1460}
1461END_VISP_NAMESPACE
1462#else
1463// Work around to avoid warning:
1464// libvisp_flycapture.a(vpFlyCaptureGrabber.cpp.o) has no symbols
1465void dummy_vpFlyCaptureGrabber() { }
1466#endif
error that can be emitted by ViSP classes.
Definition vpException.h:60
@ badValue
Used to indicate that a value is not in the allowed range.
Definition vpException.h:73
@ fatalError
Fatal error.
Definition vpException.h:72
FlyCapture2::Camera * getCameraHandler()
static unsigned int getNumCameras()
FlyCapture2::Image m_rawImage
Image buffer.
float setGain(bool gain_auto, float gain_value=0)
std::pair< unsigned int, unsigned int > centerRoi(unsigned int size, unsigned int max_size, unsigned int step)
float setShutter(bool auto_shutter, float shutter_ms=10)
float setExposure(bool exposure_on, bool exposure_auto, float exposure_value=0)
void setProperty(const FlyCapture2::PropertyType &prop_type, bool on, bool auto_on, float value, PropertyValue prop_value=ABS_VALUE)
bool m_capture
true is capture started
vpFlyCaptureGrabber & operator>>(vpImage< unsigned char > &I)
void setCameraSerial(unsigned int serial)
void setCameraIndex(unsigned int index)
float setFrameRate(float frame_rate)
FlyCapture2::Camera m_camera
Pointer to each camera.
unsigned int m_index
Active camera index.
FlyCapture2::PropertyInfo getPropertyInfo(FlyCapture2::PropertyType prop_type)
static unsigned int getCameraSerial(unsigned int index)
void setFormat7VideoMode(FlyCapture2::Mode format7_mode, FlyCapture2::PixelFormat pixel_format, unsigned int width, unsigned int height)
unsigned int m_numCameras
Number of connected cameras.
unsigned int setSharpness(bool sharpness_on, bool sharpness_auto, unsigned int sharpness_value=0)
void acquire(vpImage< unsigned char > &I)
FlyCapture2::Property getProperty(FlyCapture2::PropertyType prop_type)
bool isVideoModeAndFrameRateSupported(FlyCapture2::VideoMode video_mode, FlyCapture2::FrameRate frame_rate)
std::ostream & getCameraInfo(std::ostream &os)
bool isFormat7Supported(FlyCapture2::Mode format7_mode)
@ VALUE_A
Consider FlyCapture2::Property::valueA.
@ ABS_VALUE
Consider FlyCapture2::Property::absValue.
void setVideoModeAndFrameRate(FlyCapture2::VideoMode video_mode, FlyCapture2::FrameRate frame_rate)
bool m_connected
true if camera connected
FlyCapture2::PGRGuid m_guid
Active camera guid.
float setBrightness(bool brightness_auto, float brightness_value=0)
unsigned int height
Number of rows in the image.
bool init
Set to true if the frame grabber has been initialized.
unsigned int width
Number of columns in the image.
Definition of the vpImage class member functions.
Definition vpImage.h:131
VISP_EXPORT int wait(double t0, double t)