Home > C: Programming > History back  Previous chapter  Next chapter  Print  

First Steps to uEye programming

uEye Camera Manual Version 3.80

First Steps to uEye programming

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 section Programming Notes.

Camera_Open_Freerun_128x128

Open (initialize) the camera

Connect your uEye camera with the PC. If you are using a GigE uEye, open the uEye Camera Manager first and assign an IP address before connecting the camera. See also the Installing the GigE Camera and uEye Camera Manager chapters

The is_InitCamera() function initializes the uEye camera. The camera is assigned a unique handle through which it is accessed in subsequent function calls.

monitor_128x128

Select a display mode

The uEye API provides two different modes you can use to display the camera's images on the PC. To quickly show a live image under Windows, it is easiest to use the Direct3D mode. This 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.

 

Under Linux:

The display functions of the uEye API are not available under Linux. You need to allocate and activate the relevant image memory as described above. The application then displays the image data via the Linux function library used.

See also:

How to proceed: Display Mode Selection

Capture_Freerun_128x128

Capture images

Recording live images with the uEye is very simple. 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.

See also:

How to proceed: Image Capture

Camera_Settings_128x128

Adjust the frame rate, brightness and colors

All function calls with which you can change camera settings start with is_Set. To change the frame rate, for example, you call is_SetFrameRate(). Image brightness is adjusted through the exposure time set with is_SetExposureTime(). You can also implement automatic control of image brightness and other parameters by using is_SetAutoParameter().

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.

See also:

How to proceed: Setting Camera Parameters

Save_Image_128x128

Save an image

Use the is_SaveImageEx() function to save the current image as a BMP or JPEG file. To save a specific image, it is better to use the Snap function (single frame mode) than the Live function (continuous mode).

See also:

How to proceed: Saving Images and Videos

Camera_Exit_128x128

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_SaveParameters() function before closing the camera. The next time you start the application, you can simply load the settings again by using is_LoadParameters().


Suggestion for improvement? Send us your short Feedback on this chapter. Thank you very much!


© 2010 IDS Imaging Development Systems GmbH
http://www.ids-imaging.com