This chapter shows the most important functions of the uEye API for integrating your camera into your own applications. You will find comprehensive lists of the API functions, sorted by task, in the How to proceed chapter.
The uEye SimpleLive and uEye SimpleAcquire C++ programming samples included in the SDK illustrate the steps described below.
For information on required include files (uEye API and header) see Programming notes chapter.
Open (initialize) the camera
Connect your uEye camera with the PC (Installation and connection). If you are using a GigE uEye camera, open the IDS Camera Manager first and assign an IP address before connecting the camera. See also the Installing the GigE uEye camera.
The is_InitCamera() function initializes the uEye camera. The camera is assigned a unique handle through which it is accessed in subsequent function calls (see Preparing image capture).
The uEye API provides different modes you can use to display the camera's images on the PC (see Display mode selection). To quickly show a live image under Windows, it is easiest to use the Direct3D mode. Under Linux the OpenGL mode can be used.
The Direct3D mode has the advantage that no image memory has to be allocated, and that image capture is handled by the driver. Call is_SetDisplayMode() to select the display mode. You can then customize the Direct3D mode by using is_DirectRenderer().
For advanced users: You can also access the image data directly by selecting the Bitmap (DIB) mode. To use DIB mode, you first have to allocate one or more memories by using is_AllocImageMem(), add them to a memory sequence, if required, and then activate a memory with is_SetImageMem() before each image capture. To show the image on-screen, call the is_RenderBitmap() function after each completed image capture. From the events or messages you can see when an image is available for display.
Capture images
Recording live images with the uEye camera is very simple (see Image capture). Just call the is_CaptureVideo() function and the camera captures the live images at the default frame rate. To capture single frames, use the is_FreezeVideo() function. Every uEye camera of course also provides different trigger modes for image capture. Use is_SetExternalTrigger() to activate the desired mode before starting the image capture.
Adjust the frame rate, brightness and colors
To change the frame rate, for example, you call is_SetFrameRate(). With is_SetColorMode() you set the color mode. Image brightness is adjusted through the exposure time set with is_Exposure(). You can also implement automatic control of image brightness and other parameters by using is_SetAutoParameter() (see Setting camera parameters).
If you are using a color camera, you should activate color correction in order to achieve rich vibrant colors for on-screen display (is_SetColorCorrection()). To adapt a color camera to the ambient light conditions, it is essential to carry out white balancing. This is also done using the is_SetAutoParameter() function.
Save an image
Use the is_ImageFile() function to save the current image as a BMP or JPEG file (see Saving images and videos). To save a specific image, it is better to use the Snap function (single frame mode) than the Live function (continuous mode).
Close the camera
When you want to exit your application, close the camera with is_ExitCamera(). The camera and the allocated memory are automatically released. All previously set camera parameters will be lost, however. So, if you want to save specific settings, use the is_ParameterSet() function before closing the camera. The next time you start the application, you can simply load the settings again by using the same function.