Difference: ProsilicaCapture (2 vs. 3)

Revision 32006-02-17 - DerekBradley

Line: 1 to 1
 
META TOPICPARENT name="PsmSpace"

Guide to Using dcam_capture

Line: 26 to 26
 

How to use the dcam_capture utility

Added:
>
>
The dcam_capture command-line utility was developed to provide an interface to the camera for scripts. The utility makes use of the DCAM API, which is documented in "Prosilica DCAM API.pdf" (available on CVS, see "How to modify the dcam_capture utility"). With dcam_capture you can capture a single image or a number of images with different exposures. To use dcam_capture, follow the first two steps above in order to connect the camera to anduril and log in. It is a good idea to follow all of the steps above to make sure the camera is working correctly and focused on the object you wish to capture before using dcam_capture. Once the camera is set up and you are logged in, do the following:

  • Start Cygwin.
  • Type dcam_capture (which is equivalent to dcam_capture -help) to see the usage information. You will get the following output.

$ dcam_capture
Prosilica DCAM Single Capture Utility
Usage: dcam_capture filename [-e exp_time] [-o offset] [-g gain] [-m gamma] [-r x y w h] [-f format] [-s]
  filename       Currently supported extensions: .PNG, .JPG, .PGM, .PPM, .BMP
                     Use %lu to include exposure time in filename.
  -e exp_time    Set exposure time in microseconds.
                     For multiple exposures, use -e t1,t2,t3,...,tn
  -o offset      Set DAC offset.
  -g gain        Set pre-DAC gain.
  -m gamma       Set gamma (0 or 1).
  -r x y w h     Set region of interest. pixel (x,y), width w and height h.
  -s             Enable sub-sampling.
  -f format      Set format.  Currently supported formats:
                     mono8, rgb24, raw8, (mono16, raw16 for PNG only)

  -help          Display this help message.

The arguments are fairly self-explanatory. The image file format is determined by the extension, and the data format is set using the -f option. The camera parameters are all optional, and will take on default values if not specified. These default values will usually be the last known value (ie: if a value was set using the vendor-supplied viewer). However, it is a good idea to explicitly set the important parameters such as exposure time and format. Note that 16-bit single channel images can only be saved as PNG files.

When specifying the image filename you can include the exposure time in the filename by placing %lu in the filename. For instance, if the filename is outImg%lu.png and the exposure time is 500 milliseconds, then the file will be saved as outImg500000.png. Multiple exposures can be captured with a single call to dcam_capture using the argument -e t1,t2,t3,...,tn. In this case, it is essential to include the %lu in the filename, or each exposure will overwrite the same image file.

The latest version of dcam_capture has been placed in the /bin directory of Cygwin on anduril, so you should have no problem accessing it from any directory of your choice.

 

How to modify the dcam_capture utility

Added:
>
>
The dcam_capture code is stored in the CVS repository. The location is /imager/project/ModelingAndRendering/Repository/dcam_capture/. To make changes to dcam_capture:

  • Ensure your CVSROOT environment variable is set to /imager/project/ModelingAndRendering/Repository/
  • Type cvs checkout dcam_capture to check out the source.
  • dcam_capture is a Windows application, so you can modify the source using MS Visual Studio .NET or simply using Cygwin (a Makefile is supplied). Note, if you add or remove files from the project, make sure to update both the Visual Studio project file as well as the Makefile.
  • The main source for the program is in main.cpp.
  • Documentation of the camera API is included in CVS as "Prosilica DCAM API.pdf".
  • Once your changes are complete, be sure to copy the new executable (dcam_capture.exe) as well as any new DLL files to the /bin directory of Cygwin on anduril so that everyone will have access to the new version. (Note, you will need to log in as an Administrator to write to the /bin directory).
  • Finally, commit your changes to CVS using cvs commit -m "your log message" updatedFile.
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback