Samples Manual
Samples Manual
Samples Manual
Version:V1.1.3
Date:2017-01-18
Notice
All rights reserved. No parts of this manual may be used or reproduced, in any forms or by any means,
without prior written permission of China Daheng Group, Inc. Beijing Image Vision Technology Branch.
The right is also reserved to modify or change any parts of this manual in the future without prior
notification.
© 2020 China Daheng Group, Inc. Beijing Image Vision Technology Branch
Web: http://www.daheng-imaging.com
Sales Email: isales@daheng-imaging.com
Sales Tel: +86 10 8282 8878
Support Email: isupport@daheng-imaging.com
Contents
1. Introduction ..................................................................................................................... 1
2. GxSingleCamMono ......................................................................................................... 2
2.1. Function introduction ................................................................................................2
2.2. UI Interface ...............................................................................................................2
2.3. Precautions ..............................................................................................................2
3. GxSingleCamColor ......................................................................................................... 3
3.1. Function introduction ................................................................................................3
3.2. UI Interface ...............................................................................................................3
3.3. Precautions ..............................................................................................................3
4. GxMultiCam ..................................................................................................................... 5
4.1. Function introduction ................................................................................................5
4.2. UI Interface ...............................................................................................................5
4.3. Precautions ..............................................................................................................6
5. GxGetImage .................................................................................................................... 7
5.1. Function introduction ................................................................................................7
5.2. UI Interface ...............................................................................................................7
5.3. Precautions ..............................................................................................................7
6. GxIOSample .................................................................................................................... 8
6.1. Function introduction ................................................................................................8
6.2. UI Interface ...............................................................................................................8
6.3. Precautions ..............................................................................................................8
7. GxStoreAVI ...................................................................................................................... 9
7.1. Function introduction ................................................................................................9
7.2. UI Interface ...............................................................................................................9
7.3. Precautions ..............................................................................................................9
8. GxAutoFuncCtrl ............................................................................................................. 11
8.1. Function introduction .............................................................................................. 11
8.2. UI Interface ............................................................................................................. 11
8.3. Precautions ............................................................................................................ 11
9. GxUSBSnapPnp ............................................................................................................ 12
9.1. Function introduction ..............................................................................................12
9.2. UI Interface .............................................................................................................12
9.3. Precautions ............................................................................................................12
10. GxViewer ..................................................................................................................... 13
10.1. Function introduction ............................................................................................13
10.2. UI Interface ...........................................................................................................13
10.3. Precautions ..........................................................................................................13
11. GxSnapRaw16 ............................................................................................................. 14
11.1. Function introduction ............................................................................................14
11.2. UI Interface ...........................................................................................................14
11.3. Precautions ...........................................................................................................14
12. GxCameraEvents ........................................................................................................ 15
12.1. Function introduction ............................................................................................15
12.2. UI Interface ...........................................................................................................15
12.3. Precautions ..........................................................................................................15
13. GxGigeRecovery ......................................................................................................... 16
13.1. Function introduction ............................................................................................16
13.2. UI Interface ...........................................................................................................16
13.3. Precautions ..........................................................................................................16
14. GxImageProcess......................................................................................................... 17
14.1. Function introduction ............................................................................................17
14.2. UI Interface ...........................................................................................................17
14.3. Precautions ..........................................................................................................18
15. GxTransferDelay ......................................................................................................... 19
15.1. Function introduction ............................................................................................19
15.2. UI Interface ...........................................................................................................19
15.3. Precautions ..........................................................................................................19
16. Revision History ......................................................................................................... 20
1.Introduction
1. Introduction
In this samples manual, the demos of samples are for some type of the cameras, which cannot cover the
operation of all models. The parameter information on the interface after the programs runs is only used
as the user's reference, and the specific parameter information is based on the device that the user
actually opens.
2. GxSingleCamMono
2.1. Function introduction
The GxSingleCamMono is the sample written for monochrome camera, the program code mainly
demonstrates how to allocate the buffers, images display, processing images, and save the image data
into a bmp file for the monochrome images.
2.2. UI Interface
Demonstration process demo
Parameter description
Trigger Control: Demonstrates how to set the related parameter in trigger mode, and the trigger control
function is valid only when the trigger mode is On.
Save Image: Demonstrates the process how to save the monochrome image data into a bmp file, and the
bmp file is named with the system time that the image saved, the specific format is
"year_month_day_hour_minute_second_millisecond.bmp".
2.3. Precautions
The image is saved in the GxSingleCamMonoImages folder which is in the same level directory as
the executable program. The folder is created by the program automatically, and the folder name and
the path cannot be modified manually.
When saving the images, the program will not detect the disk space where the storage path is located,
so when the storage space is full, it will only generate the 0kB size BMP empty file.
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn:schemas-microsoft-com:asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
3. GxSingleCamColor
3.1. Function introduction
And corresponding to the GxSingleCamMono, the GxSingleCamColor is written for the color cameras.
The program code demonstrates how to allocate the buffers, images display, image RGB conversion,
image quality improvement, automatic and manual white balance adjustment, and save the image data
into a bmp file for the color images.
3.2. UI Interface
Demonstration process demo
Parameter description
White Balance Adjustment: Demonstrates how to adjust the white balance manually/ automatically. The
manual adjustment is effective by setting the white balance channel and the white balance coefficient.
Image Quality Improvement: Demonstrates how to improve the image quality. And the image quality is
best when cooperated with the white balance adjustment function.
Trigger Control: Demonstrates how to set the related parameter in trigger mode, and the trigger control
function is valid only when the trigger mode is On.
Save Image: Demonstrates the process how to save the color image data which has been a RGB
conversion into a bmp file, and the bmp file is named with the system time that the image saved, the
specific format is "year_month_day_hour_minute_second_millisecond.bmp".
3.3. Precautions
The image is saved in the GxSingleCamColorImages folder which is in the same level directory as
the executable program. The folder is created by the program automatically, and the folder name and
the path cannot be modified manually.
When saving the images, the program will not detect the disk space where the storage path is located,
so when the storage space is full, it will only generate the 0kB size BMP empty file.
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
4. GxMultiCam
4.1. Function introduction
The GxMultiCam sample mainly demonstrates how to capture, process, and display images with multiple
cameras simultaneously. This sample supports up to four cameras at the same time.
4.2. UI Interface
Demonstration process demo
Parameter description
Acquisition speed level: Demonstrates how to set the acquisition speed level, multiple cameras capture at
the same time may be affected by the PC performance, leading to a camera cannot output images, and
the display frame rate is 0.0fps, in this case, you can try to reduce the acquisition speed level and reduce
the acquisition frame rate, in order to let all the cameras output images.
4.3. Precautions
When compiling in VS2005/VS2008/VS2010 development platform, prompt "warning C4996: 'itoa'
was declared deprecated", if you replace the function itoa as _itoa_s, the message will not occur.
Because the VC6.0 development platform does not support the _itoa_s function, so it is unchanged
and has no effect.
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
5. GxGetImage
5.1. Function introduction
This sample mainly demonstrates the way to call the GxGetImage interface to get the image: send a
software trigger and call the GxGetImage (you need to enter waiting time) to get an image. Note that the
way to call the GxGetImage interface for images cannot be the same way as to call callback acquisition,
and the GX_STATUS_INVALID_CALL error will be returned if the GXGetImage interface is called after the
callback is registered.
5.2. UI Interface
Demonstration process demo
Parameter description
Timeout Time: By calling the GxGetImage interface to get the maximum waiting time.
Time Statistical: The statistical time is the time interval between sending software trigger command and
calling the GetImage interface to get the images, and the maximum value, minimum value and mean
value are calculated according to the recorded data.
5.3. Precautions
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
6. GxIOSample
6.1. Function introduction
The GxIOSample sample mainly demonstrates the setting process of basic parameters such as trigger
acquisition function, IO control function, and exposure/gain.
6.2. UI Interface
Demonstration process demo
Parameter description
Trigger Control: Demonstrates how to set the related parameter in trigger mode, and the trigger control
function is valid only when the trigger mode is On.
Output Control: Demonstrates how to set the related parameters of output control, where the user-defined
output value is true for high level and false for low level.
6.3. Precautions
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
7. GxStoreAVI
7.1. Function introduction
The GxStoreAVI sample mainly demonstrates how to save the AVI video stream by means of
compression and non-compression mode. To save the AVI video stream by the compression mode, you
need to choose the video compressor. The sample also demonstrates how to select the video encoder.
7.2. UI Interface
Demonstration process demo
Parameter description
Open Device: The operation simultaneously performs the opening the device, registering the callback
function and starting the acquisition process.
Start Recording: After starting recording is successful, the operation of writing AVI Video files is executed
in the callback function.
Broadcast frame rate: This parameter is used to set the broadcast frame rate of the AVI video, which is
recommended to match the frame rate of the current camera connected.
Storage Path: The AVI video is saved by default in the current directory of the executable program, if you
want to modify the storage directory, you can click the path modified button " " before recording.
Storage Name: The AVI video file is named with system time that the video obtained, and the specific
format is "year_month_day_hour_minute_second_millisecond.avi".
7.3. Precautions
When storage in the compression mode, if selecting video encoder failure or starting recording failure,
you can try to choose other video encoder. The color camera is recommended to use the "DIVX"
video encoder and the monochrome camera is recommended to use "Indeo video 5.10" encoder.
During the recording process, the program storage the AVI file by the unit of 2GB/block.
During the AVI video saving process, the application will detect the store path of disk space, when the
free disk space is not enough to save the AVI video, the program will automatically stop recording.
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
8. GxAutoFuncCtrl
8.1. Function introduction
The GxAutoFuncCtrl sample mainly demonstrates the exposure adjustment (manual/automatic), gain
adjustment (manual/automatic), and the 2A ROI, expect gray value, 2A lighting environment functions
settings that are related to automatic gain/automatic exposure adjustment.
8.2. UI Interface
Demonstration process demo
Parameter description
2A ROI: Demonstrates how to set the range of statistical area, and the range is a statistical area for the
calculation of automatic functions.
Exposure Adjustment: Demonstrates how to adjust the exposure time manually or automatically.
Expected gray value: Demonstrates how to set the gray value. The value is a benchmark parameter of
automatic exposure and automatic gain adjustment, and the final expectation of automatic function
adjustment is to meet the desired gray value of the user set.
2A lighting environment: Demonstrates how to set the external lighting environment, and when the
automatic function adjustment is enable, it will adapt to adjust according to the light environment.
8.3. Precautions
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
9. GxUSBSnapPnp
9.1. Function introduction
The GxUSBSnapPnp sample is mainly demonstrates how to detect the camera’s hot plug state, the
implementation principle is according to the captured windows message WM_DEVICECHANGE of the
windows, by judging the message parameter and selecting the plug in or pull out message of the
registered device. The GxUSBSnapPnp sample behavior is that when a device is detected plug in or pull
out, it again enumerates the device and update the list of devices displayed on the interface, and the
interface only shows the current connected device information.
9.2. UI Interface
Demonstration process demo
Parameter description
Name: When connecting the device, the name column displays the device model and serial number
information.
9.3. Precautions
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
When the camera is continuously plugged in or pulled out, it is necessary to wait for the device to be
stable before the next plug in / pull out operation, in which the device manager will no longer refresh
the operation indicating that the device has been stable.
10. GxViewer
10.1. Function introduction
The GxViewer sample is mainly demonstrates the capture, processing and display functions of the 8-bit
images in the form of a single document.
10.2. UI Interface
Demonstration process demo
Parameter description
Not have.
10.3. Precautions
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
11. GxSnapRaw16
11.1. Function introduction
The GxSnapRaw16 sample is mainly demonstrates the capture, processing, and display functions of the
non 8-bit images and the process of how to save the image data to a raw file.
11.2. UI Interface
Demonstration process demo
Parameter description
Save Image: Demonstrates the process how to save the non-8bit image data which output by the camera
into a Raw file, and the Raw file is named with the system time that the image saved, the specific format is
"year_month_day_hour_minute_second_millisecond.raw".
11.3. Precautions
The image is saved in the GxSnapRaw16Images folder which is in the same level directory as the
executable program. The folder is created by the program automatically, and the folder name and the
path cannot be modified manually.
When saving the images, the program will not detect the disk space where the storage path is located,
so when the storage space is full, it will only generate the 0kB size BMP empty file.
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
12. GxCameraEvents
12.1. Function introduction
The GXCameraEvents sample mainly demonstrates the exposure end event in software trigger mode.
12.2. UI Interface
Demonstration process demo
Parameter description
Record the time: Record the time when sending the software trigger command, the time between sending
software trigger command and the exposure end event, and the time between sending software trigger
command and receiving the image successfully.
12.3. Precautions
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
13. GxGigeRecovery
13.1. Function introduction
The GxGigeRecovery sample demonstrates the process of camera offline and reconnection, and the
import and export of configuration file.
13.2. UI Interface
Demonstration process demo
Parameter description
Not have.
13.3. Precautions
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.
14. GxImageProcess
14.1. Function introduction
The GxImageProcess sample demonstrates the use of image integrated processing functions for color
cameras.
14.2. UI Interface
Demonstration process demo
Parameter description
Automatic White Balance: Demonstrates how to set the automatic white balance function.
Automatic White Balance light source: Demonstrates how to set the automatic white balance light source.
Bad Pixel Correction: Demonstrates how to operate the bad pixel correction.
14.3. Precautions
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, due to add the manifest administrator identity, there is no effect.
15. GxTransferDelay
15.1. Function introduction
The GxTransferDelay sample mainly demonstrates the transmission delay function of four cameras in
trigger mode.
15.2. UI Interface
Demonstration process demo
Parameter description
Not have.
15.3. Precautions
There must to connect four cameras simultaneously, the sample can be run successfully.
When compiling in VS2005 development platform, prompt "manifest authoring warning 81010002:
Unrecognized Element "requestedPrivileges" in namespace "urn: schemas-microsoft-com: asm.v3"."
warning information, this is because of adding the manifest administrator identity, there is no effect.