Exemplo n.º 1
0
int set_cam_param ( FlyCapture2::Camera &camera)
{
  Property prop;
  prop.type = SHUTTER;
  //Ensure the property is on.
  prop.onOff = true;
  //Ensure auto-adjust mode is off.
  prop.autoManualMode = false;
  //Ensure the property is set up to use absolute value control.
  prop.absControl = true;
  //Set the absolute value of shutter to 20 ms.
  // prop.absValue = 39.3;
  //Set the property.
  err = camera.SetProperty( &prop );

  prop.type = AUTO_EXPOSURE;
  prop.onOff = true;
  prop.autoManualMode = true;
  prop.absControl = true;
  prop.absValue = 2.0;
  err = camera.SetProperty( &prop );

  // Enable metadata
  FlyCapture2::EmbeddedImageInfo info;
  info.timestamp.onOff = true;
  err = camera.SetEmbeddedImageInfo(&info);

  if ( err == PGRERROR_PROPERTY_FAILED )
  {
    std::cout << "Property failed " << std::endl;
    return false;
  }
  else if ( err == PGRERROR_PROPERTY_NOT_PRESENT ) 
  {
    std::cout << "Property not present" << std::endl;
    return false;
  }
  else if (err != PGRERROR_OK)
  {
    std::cout << "Properties not set" << std::endl;
    return false;
  }

}
Exemplo n.º 2
0
void CCflycap_set_camera_property(CCflycap *ccntxt,
				  int property_number,
				  long Value,
				  int Auto ) {
  CHECK_CC(ccntxt);
  FlyCapture2::Camera *cam = (FlyCapture2::Camera *)ccntxt->inherited.cam;

  if ((property_number<0) || (property_number>=NUM_CAM_PROPS)) {
    BACKEND_GLOBAL(cam_iface_error) = CAM_IFACE_GENERIC_ERROR;
    CAM_IFACE_ERROR_FORMAT("property invalid");
  }

  FlyCapture2::Property prop;
  FlyCapture2::PropertyInfo propinfo;
  prop.type = propno2prop(property_number);
  CIPGRCHK(cam->GetProperty( &prop ));

  prop.valueA = Value;
  prop.autoManualMode = Auto;
  CIPGRCHK(cam->SetProperty( &prop ));
  return;
}