Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpFlyCaptureGrabber.cpp
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
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
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 http://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  * Authors:
34  * Fabien Spindler
35  *
36  *****************************************************************************/
37 
43 #include <visp3/core/vpException.h>
44 #include <visp3/sensor/vpFlyCaptureGrabber.h>
45 
46 #ifdef VISP_HAVE_FLYCAPTURE
47 
48 #include <visp3/core/vpTime.h>
49 
54  : m_camera(), m_guid(), m_index(0), m_numCameras(0), m_rawImage(), m_connected(false), m_capture(false)
55 {
56  m_numCameras = this->getNumCameras();
57 }
58 
63 {
64  close();
65 }
70 {
71  unsigned int numCameras;
72  FlyCapture2::BusManager busMgr;
73  FlyCapture2::Error error = busMgr.GetNumOfCameras(&numCameras);
74  if (error != FlyCapture2::PGRERROR_OK) {
75  numCameras = 0;
76  }
77  return numCameras;
78 }
79 
84 std::ostream &vpFlyCaptureGrabber::getCameraInfo(std::ostream & os)
85 {
86  this->connect();
87 
88  FlyCapture2::CameraInfo camInfo;
89  FlyCapture2::Error error = m_camera.GetCameraInfo(&camInfo);
90  if (error != FlyCapture2::PGRERROR_OK) {
91  error.PrintErrorTrace();
92  }
93 
94  os << "Camera information: " << std::endl;
95  os << " Serial number : " << camInfo.serialNumber << std::endl;
96  os << " Camera model : " << camInfo.modelName << std::endl;
97  os << " Camera vendor : " << camInfo.vendorName << std::endl;
98  os << " Sensor : " << camInfo.sensorInfo << std::endl;
99  os << " Resolution : " << camInfo.sensorResolution << std::endl;
100  os << " Firmware version : " << camInfo.firmwareVersion << std::endl;
101  os << " Firmware build time: " << camInfo.firmwareBuildTime << std::endl;
102  return os;
103 }
104 
105 
184 {
185  this->connect();
186 
187  if (m_connected == true) {
188  return &m_camera;
189  }
190  else {
191  return NULL;
192  }
193 }
194 
208 {
209  this->connect();
210 
211  FlyCapture2::Property prop = this->getProperty(FlyCapture2::FRAME_RATE);
212  return prop.absValue;
213 }
214 
228 {
229  this->connect();
230 
231  FlyCapture2::Property prop = this->getProperty(FlyCapture2::SHUTTER);
232  return prop.absValue;
233 }
234 
248 {
249  this->connect();
250 
251  FlyCapture2::Property prop = this->getProperty(FlyCapture2::GAIN);
252  return prop.absValue;
253 }
254 
268 {
269  this->connect();
270 
271  FlyCapture2::Property prop = this->getProperty(FlyCapture2::BRIGHTNESS);
272  return prop.absValue;
273 }
274 
288 {
289  this->connect();
290 
291  FlyCapture2::Property prop = this->getProperty(FlyCapture2::SHARPNESS);
292  return prop.valueA;
293 }
294 
308 {
309  this->connect();
310 
311  FlyCapture2::Property prop = this->getProperty(FlyCapture2::AUTO_EXPOSURE);
312  return prop.absValue;
313 }
314 
345 unsigned int vpFlyCaptureGrabber::getCameraSerial(unsigned int index)
346 {
347  unsigned int num_cameras = vpFlyCaptureGrabber::getNumCameras();
348  if(index >= num_cameras) {
350  "The camera with index %u is not present. Only %d cameras connected.",
351  index, num_cameras) );
352  }
353  unsigned int serial_id;
354  FlyCapture2::BusManager busMgr;
355  FlyCapture2::Error error;
356  error = busMgr.GetCameraSerialNumberFromIndex(index, &serial_id);
357  if (error != FlyCapture2::PGRERROR_OK) {
358  error.PrintErrorTrace();
360  "Cannot get camera with index %d serial id.", index) );
361  }
362  return serial_id;
363 }
364 
381 void vpFlyCaptureGrabber::setCameraIndex(unsigned int index)
382 {
383  if(index >= m_numCameras) {
385  "The camera with index %u is not present. Only %d cameras connected.",
386  index, m_numCameras) );
387  }
388 
389  m_index = index;
390 }
391 
420 void vpFlyCaptureGrabber::setCameraSerial(unsigned int serial_id)
421 {
422  FlyCapture2::BusManager busMgr;
423  FlyCapture2::Error error;
424  m_numCameras = this->getNumCameras();
425  for (unsigned int i=0; i<m_numCameras; i++) {
426  if (vpFlyCaptureGrabber::getCameraSerial(i) == serial_id) {
427  m_index = i;
428  return;
429  }
430  }
432  "The camera with serial id %u is not present.",
433  serial_id) );
434 }
435 
445 void vpFlyCaptureGrabber::setProperty(const FlyCapture2::PropertyType &prop_type,
446  bool on, bool auto_on,
447  float value, PropertyValue prop_value)
448 {
449  this->connect();
450 
451  FlyCapture2::PropertyInfo propInfo;
452  propInfo = this->getPropertyInfo(prop_type);
453 
454  if (propInfo.present) {
455  FlyCapture2::Property prop;
456  prop.type = prop_type;
457  prop.onOff = on && propInfo.onOffSupported;
458  prop.autoManualMode = auto_on && propInfo.autoSupported;
459  prop.absControl = propInfo.absValSupported;
460  switch(prop_value) {
461  case ABS_VALUE: {
462  float value_ = std::max<float>(std::min<float>(value, propInfo.absMax), propInfo.absMin);
463  prop.absValue = value_;
464  break;
465  }
466  case VALUE_A: {
467  unsigned int value_ = std::max<unsigned int>(std::min<unsigned int>((unsigned int)value, propInfo.max), propInfo.min);
468  prop.valueA = value_;
469  break;
470  }
471  }
472 
473  FlyCapture2::Error error;
474  error = m_camera.SetProperty(&prop);
475  if (error != FlyCapture2::PGRERROR_OK) {
476  error.PrintErrorTrace();
478  "Cannot set property %d.",
479  (int)prop_type) );
480  }
481  }
482 }
483 
516 float vpFlyCaptureGrabber::setFrameRate(float frame_rate)
517 {
518  this->connect();
519 
520  this->setProperty(FlyCapture2::FRAME_RATE, true, false, frame_rate);
521  FlyCapture2::Property prop = this->getProperty(FlyCapture2::FRAME_RATE);
522  return prop.absValue;
523 }
524 
558 float vpFlyCaptureGrabber::setShutter(bool auto_shutter, float shutter_ms)
559 {
560  this->connect();
561 
562  this->setProperty(FlyCapture2::SHUTTER, true, auto_shutter, shutter_ms);
563  FlyCapture2::Property prop = this->getProperty(FlyCapture2::SHUTTER);
564  return prop.absValue;
565 }
566 
602 float vpFlyCaptureGrabber::setGain(bool gain_auto, float gain_value)
603 {
604  this->connect();
605 
606  this->setProperty(FlyCapture2::GAIN, true, gain_auto, gain_value);
607  FlyCapture2::Property prop = this->getProperty(FlyCapture2::GAIN);
608  return prop.absValue;
609 }
610 
644 float vpFlyCaptureGrabber::setBrightness(bool brightness_auto, float brightness_value)
645 {
646  this->connect();
647 
648  this->setProperty(FlyCapture2::BRIGHTNESS, true, brightness_auto, brightness_value);
649  FlyCapture2::Property prop = this->getProperty(FlyCapture2::BRIGHTNESS);
650  return prop.absValue;
651 }
652 
696 float vpFlyCaptureGrabber::setExposure(bool exposure_on, bool exposure_auto, float exposure_value)
697 {
698  this->connect();
699 
700  this->setProperty(FlyCapture2::AUTO_EXPOSURE, exposure_on, exposure_auto, exposure_value);
701  FlyCapture2::Property prop = this->getProperty(FlyCapture2::AUTO_EXPOSURE);
702  return prop.absValue;
703 }
704 
741 unsigned int vpFlyCaptureGrabber::setSharpness(bool sharpness_on, bool sharpness_auto, unsigned int sharpness_value)
742 {
743  this->connect();
744 
745  this->setProperty(FlyCapture2::SHARPNESS, sharpness_on, sharpness_auto, (float)sharpness_value, VALUE_A);
746  FlyCapture2::Property prop = this->getProperty(FlyCapture2::SHARPNESS);
747  return prop.valueA;
748 }
749 
754 FlyCapture2::Property vpFlyCaptureGrabber::getProperty(FlyCapture2::PropertyType prop_type)
755 {
756  this->connect();
757 
758  FlyCapture2::Property prop;
759  prop.type = prop_type;
760  FlyCapture2::Error error;
761  error = m_camera.GetProperty( &prop );
762  if (error != FlyCapture2::PGRERROR_OK) {
763  error.PrintErrorTrace();
765  "Cannot get property %d value.", (int)prop_type));
766  }
767  return prop;
768 }
769 
775 FlyCapture2::PropertyInfo
776 vpFlyCaptureGrabber::getPropertyInfo(FlyCapture2::PropertyType prop_type)
777 {
778  this->connect();
779 
780  FlyCapture2::PropertyInfo propInfo;
781  propInfo.type = prop_type;
782 
783  FlyCapture2::Error error;
784  error = m_camera.GetPropertyInfo(&propInfo);
785  if (error != FlyCapture2::PGRERROR_OK) {
786  error.PrintErrorTrace();
787  throw (vpException(vpException::fatalError, "Cannot get property %d info.",
788  (int)prop_type) );
789  }
790  return propInfo;
791 }
792 
823 void vpFlyCaptureGrabber::setVideoModeAndFrameRate(FlyCapture2::VideoMode video_mode,
824  FlyCapture2::FrameRate frame_rate)
825 {
826  this->connect();
827 
828  FlyCapture2::Error error;
829  error = m_camera.SetVideoModeAndFrameRate(video_mode, frame_rate);
830  if (error != FlyCapture2::PGRERROR_OK) {
831  error.PrintErrorTrace();
832  throw (vpException(vpException::fatalError, "Cannot set video mode and framerate.") );
833  }
834 }
835 
839 bool vpFlyCaptureGrabber::isVideoModeAndFrameRateSupported(FlyCapture2::VideoMode video_mode,
840  FlyCapture2::FrameRate frame_rate)
841 {
842  this->connect();
843 
844  FlyCapture2::Error error;
845  bool supported = false;
846  error = m_camera.GetVideoModeAndFrameRateInfo(video_mode, frame_rate, &supported);
847  if (error != FlyCapture2::PGRERROR_OK) {
848  error.PrintErrorTrace();
849  throw (vpException(vpException::fatalError, "Cannot get video mode and framerate.") );
850  }
851  return supported;
852 }
853 
860 std::pair<unsigned int, unsigned int>
861 vpFlyCaptureGrabber::centerRoi(unsigned int size, unsigned int max_size, unsigned int step)
862 {
863  if (size == 0 || size > max_size) size = max_size;
864  // size should be a multiple of step
865  size = size / step * step;
866  const unsigned int offset = (max_size - size) / 2;
867  // Return offset for centering roi
868  return std::make_pair(size, offset);
869 }
870 
901 void vpFlyCaptureGrabber::setFormat7VideoMode(FlyCapture2::Mode format7_mode,
902  FlyCapture2::PixelFormat pixel_format,
903  unsigned int width, unsigned int height)
904 {
905  this->connect();
906 
907  FlyCapture2::Format7Info fmt7_info;
908  bool fmt7_supported;
909  FlyCapture2::Error error;
910 
911  fmt7_info.mode = format7_mode;
912  error = m_camera.GetFormat7Info(&fmt7_info, &fmt7_supported);
913  if (error != FlyCapture2::PGRERROR_OK) {
914  error.PrintErrorTrace();
915  throw (vpException(vpException::fatalError, "Cannot get format7 info.") );
916  }
917  if (! fmt7_supported) {
918  throw (vpException(vpException::fatalError, "Format7 mode %d not supported.", (int)format7_mode) );
919  }
920 
921  FlyCapture2::Format7ImageSettings fmt7_settings;
922  fmt7_settings.mode = format7_mode;
923  fmt7_settings.pixelFormat = pixel_format;
924  // Set centered roi
925  std::pair<unsigned int, unsigned int> roi_w = this->centerRoi(width, fmt7_info.maxWidth, fmt7_info.imageHStepSize);
926  std::pair<unsigned int, unsigned int> roi_h = this->centerRoi(height, fmt7_info.maxHeight, fmt7_info.imageVStepSize);
927  fmt7_settings.width = roi_w.first;
928  fmt7_settings.offsetX = roi_w.second;
929  fmt7_settings.height = roi_h.first;
930  fmt7_settings.offsetY = roi_h.second;
931 
932  // Validate the settings
933  FlyCapture2::Format7PacketInfo fmt7_packet_info;
934  bool valid = false;
935  error = m_camera.ValidateFormat7Settings(&fmt7_settings, &valid, &fmt7_packet_info);
936  if (error != FlyCapture2::PGRERROR_OK) {
937  error.PrintErrorTrace();
938  throw (vpException(vpException::fatalError, "Cannot validate format7 settings.") );
939  }
940  if (! valid) {
941  throw (vpException(vpException::fatalError, "Format7 settings are not valid.") );
942  }
943  error = m_camera.SetFormat7Configuration(&fmt7_settings, fmt7_packet_info.recommendedBytesPerPacket);
944  if (error != FlyCapture2::PGRERROR_OK) {
945  error.PrintErrorTrace();
946  throw (vpException(vpException::fatalError, "Cannot set format7 settings.") );
947  }
948 }
949 
953 bool vpFlyCaptureGrabber::isFormat7Supported(FlyCapture2::Mode format7_mode)
954 {
955  this->connect();
956 
957  FlyCapture2::Format7Info fmt7_info;
958  bool supported = false;
959  FlyCapture2::Error error;
960 
961  fmt7_info.mode = format7_mode;
962  error = m_camera.GetFormat7Info(&fmt7_info, &supported);
963  if (error != FlyCapture2::PGRERROR_OK) {
964  error.PrintErrorTrace();
965  throw (vpException(vpException::fatalError, "Cannot get format7 info.") );
966  }
967 
968  return supported;
969 }
976 {
977  this->connect();
978 
979  if (m_capture == false) {
980 
981  FlyCapture2::Error error;
982  error = m_camera.StartCapture();
983  if (error != FlyCapture2::PGRERROR_OK) {
984  error.PrintErrorTrace();
986  "Cannot start capture for camera with serial %u", getCameraSerial(m_index)));
987  }
988  m_capture = true;
989  }
990  if (m_connected && m_capture)
991  init = true;
992  else
993  init = false;
994 }
995 
1002 {
1003  if (m_capture == true) {
1004 
1005  FlyCapture2::Error error;
1006  error = m_camera.StopCapture();
1007  if (error != FlyCapture2::PGRERROR_OK) {
1008  error.PrintErrorTrace();
1009  throw (vpException(vpException::fatalError, "Cannot stop capture.") );
1010  }
1011  m_capture = false;
1012  }
1013  if (m_connected && m_capture)
1014  init = true;
1015  else
1016  init = false;
1017 }
1018 
1025 {
1026  if (m_connected == false) {
1027  FlyCapture2::Error error;
1028  m_numCameras = this->getNumCameras();
1029  if (m_numCameras == 0) {
1030  throw (vpException(vpException::fatalError, "No camera found on the bus"));
1031  }
1032 
1033  FlyCapture2::BusManager busMgr;
1034 
1035  error = busMgr.GetCameraFromIndex(m_index, &m_guid);
1036  if (error != FlyCapture2::PGRERROR_OK) {
1037  error.PrintErrorTrace();
1039  "Cannot retrieve guid of camera with index %u.",
1040  m_index) );
1041  }
1042  // Connect to a camera
1043  error = m_camera.Connect(&m_guid);
1044  if (error != FlyCapture2::PGRERROR_OK) {
1045  error.PrintErrorTrace();
1047  "Cannot connect to camera with serial %u", getCameraSerial(m_index)));
1048  }
1049  m_connected = true;
1050  }
1051  if (m_connected && m_capture)
1052  init = true;
1053  else
1054  init = false;
1055 }
1056 
1063 {
1064  if (m_connected == true) {
1065 
1066  FlyCapture2::Error error;
1067  error = m_camera.Disconnect();
1068  if (error != FlyCapture2::PGRERROR_OK) {
1069  error.PrintErrorTrace();
1070  throw (vpException(vpException::fatalError, "Cannot stop capture.") );
1071  }
1072  m_connected = false;
1073  }
1074  if (m_connected && m_capture)
1075  init = true;
1076  else
1077  init = false;
1078 }
1079 
1094 {
1095  this->stopCapture();
1096  this->disconnect();
1097 }
1098 
1105 {
1106  FlyCapture2::TimeStamp timestamp;
1107  this->acquire(I, timestamp);
1108 }
1109 
1117 void vpFlyCaptureGrabber::acquire(vpImage<unsigned char> &I, FlyCapture2::TimeStamp &timestamp)
1118 {
1119  this->open();
1120 
1121  FlyCapture2::Error error;
1122  // Retrieve an image
1123  error = m_camera.RetrieveBuffer( &m_rawImage );
1124  if (error != FlyCapture2::PGRERROR_OK) {
1125  error.PrintErrorTrace();
1127  "Cannot retrieve image from camera with serial %u", getCameraSerial(m_index)));
1128  }
1129  timestamp = m_rawImage.GetTimeStamp();
1130 
1131  // Create a converted image
1132  FlyCapture2::Image convertedImage;
1133 
1134  // Convert the raw image
1135  error = m_rawImage.Convert( FlyCapture2::PIXEL_FORMAT_MONO8, &convertedImage );
1136  if (error != FlyCapture2::PGRERROR_OK) {
1137  error.PrintErrorTrace();
1139  "Cannot convert image from camera with serial %u", getCameraSerial(m_index)));
1140  }
1141  height = convertedImage.GetRows();
1142  width = convertedImage.GetCols();
1143  unsigned char *data = convertedImage.GetData();
1144  I.resize(height, width);
1145  memcpy(I.bitmap, data, height*width);
1146 }
1147 
1154 {
1155  FlyCapture2::TimeStamp timestamp;
1156  this->acquire(I, timestamp);
1157 }
1158 
1166 void vpFlyCaptureGrabber::acquire(vpImage<vpRGBa> &I, FlyCapture2::TimeStamp &timestamp)
1167 {
1168  this->open();
1169 
1170  FlyCapture2::Error error;
1171  // Retrieve an image
1172  error = m_camera.RetrieveBuffer( &m_rawImage );
1173  if (error != FlyCapture2::PGRERROR_OK) {
1174  error.PrintErrorTrace();
1176  "Cannot retrieve image from camera with serial %u", getCameraSerial(m_index)));
1177  }
1178  timestamp = m_rawImage.GetTimeStamp();
1179 
1180  // Create a converted image
1181  FlyCapture2::Image convertedImage;
1182 
1183  // Convert the raw image
1184  error = m_rawImage.Convert( FlyCapture2::PIXEL_FORMAT_RGBU, &convertedImage );
1185  if (error != FlyCapture2::PGRERROR_OK) {
1186  error.PrintErrorTrace();
1188  "Cannot convert image from camera with serial %u", getCameraSerial(m_index)));
1189  }
1190  height = convertedImage.GetRows();
1191  width = convertedImage.GetCols();
1192  unsigned char *data = convertedImage.GetData();
1193  I.resize(height, width);
1194  unsigned int bps = convertedImage.GetBitsPerPixel();
1195  memcpy(I.bitmap, data, width*height*bps/8);
1196 }
1197 
1198 
1204 {
1205  this->open();
1206  this->acquire(I);
1207 }
1208 
1214 {
1215  this->open();
1216  this->acquire(I);
1217 }
1218 
1231 {
1232  this->connect();
1233  this->startCapture();
1234 }
1235 
1242 {
1243  this->connect();
1244 
1245  const unsigned int powerReg = 0x400;
1246  unsigned int powerRegVal = 0;
1247 
1248  FlyCapture2::Error error;
1249  error = m_camera.ReadRegister( powerReg, &powerRegVal );
1250  if ( error != FlyCapture2::PGRERROR_OK ) {
1251  return false;
1252  }
1253 
1254  return ( (powerRegVal & 0x00008000 ) != 0 );
1255 }
1256 
1263 {
1264  if ( ! isCameraPowerAvailable() )
1265  return false;
1266  const unsigned int powerReg = 0x610;
1267  unsigned int powerRegVal = 0 ;
1268 
1269  FlyCapture2::Error error;
1270  error = m_camera.ReadRegister( powerReg, &powerRegVal );
1271  if ( error != FlyCapture2::PGRERROR_OK ) {
1272  return false;
1273  }
1274 
1275  return ( (powerRegVal & (0x1 << 31)) != 0 );
1276 }
1277 
1307 {
1308  this->connect();
1309 
1310  if ( ! isCameraPowerAvailable() ) {
1312  "Cannot power on camera. Feature not available") );
1313  }
1314 
1315  // Power on the camera
1316  const unsigned int powerReg = 0x610;
1317  unsigned int powerRegVal = 0;
1318 
1319  powerRegVal = (on == true) ? 0x80000000 : 0x0;
1320 
1321  FlyCapture2::Error error;
1322  error = m_camera.WriteRegister( powerReg, powerRegVal );
1323  if (error != FlyCapture2::PGRERROR_OK) {
1324  error.PrintErrorTrace();
1325  throw (vpException(vpException::fatalError, "Cannot power on the camera.") );
1326  }
1327 
1328  const unsigned int millisecondsToSleep = 100;
1329  unsigned int regVal = 0;
1330  unsigned int retries = 10;
1331 
1332  // Wait for camera to complete power-up
1333  do
1334  {
1335  vpTime::wait(millisecondsToSleep);
1336  error = m_camera.ReadRegister(powerReg, &regVal);
1337  if (error == FlyCapture2::PGRERROR_TIMEOUT) {
1338  // ignore timeout errors, camera may not be responding to
1339  // register reads during power-up
1340  }
1341  else if (error != FlyCapture2::PGRERROR_OK) {
1342  error.PrintErrorTrace();
1343  throw (vpException(vpException::fatalError, "Cannot power on the camera.") );
1344  }
1345 
1346  retries--;
1347  } while ((regVal & powerRegVal) == 0 && retries > 0);
1348 
1349  // Check for timeout errors after retrying
1350  if (error == FlyCapture2::PGRERROR_TIMEOUT) {
1351  error.PrintErrorTrace();
1352  throw (vpException(vpException::fatalError, "Cannot power on the camera. Timeout occur") );
1353  }
1354 }
1355 
1373 {
1374  this->acquire(I);
1375  return *this;
1376 }
1377 
1395 {
1396  this->acquire(I);
1397  return *this;
1398 }
1399 
1400 #else
1401 // Work arround to avoid warning: libvisp_flycapture.a(vpFlyCaptureGrabber.cpp.o) has no symbols
1402 void dummy_vpFlyCaptureGrabber() {};
1403 #endif
1404 
1405 
void setFormat7VideoMode(FlyCapture2::Mode format7_mode, FlyCapture2::PixelFormat pixel_format, unsigned int width, unsigned int height)
FlyCapture2::Image m_rawImage
Image buffer.
VISP_EXPORT int wait(double t0, double t)
Definition: vpTime.cpp:157
FlyCapture2::Camera m_camera
Pointer to each camera.
Type * bitmap
points toward the bitmap
Definition: vpImage.h:134
void setCameraSerial(unsigned int serial)
float setShutter(bool auto_shutter, float shutter_ms=10)
void acquire(vpImage< unsigned char > &I)
error that can be emited by ViSP classes.
Definition: vpException.h:73
float setBrightness(bool brightness_auto, float brightness_value=0)
Consider FlyCapture2::Property::valueA.
FlyCapture2::Camera * getCameraHandler()
void setCameraIndex(unsigned int index)
std::pair< unsigned int, unsigned int > centerRoi(unsigned int size, unsigned int max_size, unsigned int step)
float setExposure(bool exposure_on, bool exposure_auto, float exposure_value=0)
float setGain(bool gain_auto, float gain_value=0)
FlyCapture2::PGRGuid m_guid
Active camera guid.
unsigned int height
Number of rows in the image.
void setProperty(const FlyCapture2::PropertyType &prop_type, bool on, bool auto_on, float value, PropertyValue prop_value=ABS_VALUE)
FlyCapture2::PropertyInfo getPropertyInfo(FlyCapture2::PropertyType prop_type)
bool isFormat7Supported(FlyCapture2::Mode format7_mode)
bool m_connected
true if camera connected
void resize(const unsigned int h, const unsigned int w)
resize the image : Image initialization
Definition: vpImage.h:903
Consider FlyCapture2::Property::absValue.
unsigned int setSharpness(bool sharpness_on, bool sharpness_auto, unsigned int sharpness_value=0)
bool m_capture
true is capture started
vpFlyCaptureGrabber & operator>>(vpImage< unsigned char > &I)
FlyCapture2::Property getProperty(FlyCapture2::PropertyType prop_type)
bool init
Set to true if the frame grabber has been initialized.
static unsigned int getNumCameras()
unsigned int m_index
Active camera index.
static unsigned int getCameraSerial(unsigned int index)
float setFrameRate(float frame_rate)
unsigned int m_numCameras
Number of connected cameras.
std::ostream & getCameraInfo(std::ostream &os)
bool isVideoModeAndFrameRateSupported(FlyCapture2::VideoMode video_mode, FlyCapture2::FrameRate frame_rate)
unsigned int width
Number of columns in the image.
void setVideoModeAndFrameRate(FlyCapture2::VideoMode video_mode, FlyCapture2::FrameRate frame_rate)