Live Display: Mark over/underexposed pixels 1

The following programming example shows how you can use IC Imaging Control to mark over and underexposed pixels.
Language:Visual Basic 6
Version:3.0.3
Released on:August 20, 2006
Author:IC Imaging Control Support Department
Requirements:IC Imaging Control 3.0 or higher
Camera, converter or grabber with WDM Stream Class drivers.

Preparation: In the head of this page you will find the source code of various programming languages. Please download the one that best suits your requirements and start the installation. The following Visual Basic™6 programming example shows how you can use a ready-to-use filter in IC Imaging Control. For details, please refer to the chapter "Frame Filters" in the IC Imaging Control documentation.

The sample application's window looks as follows:

The Testdialog of IC Imaging Control,

First of all a variable filter of type FrameFilter must be declared in Form1. This variable will contain the frame filter and is used to communicate with it.

Dim filter As FrameFilter 'This variable will hold the Clipping filter.

The filter used here marks pixels which are above or below a brightness threshold. At the beginning, the program shows a built-in dialog that allows a device to be selected (.ShowDeviceSettingsDialog). In a second step, the filter "Clipping" is loaded and inserted in the display path of IC Imaging Control. In a third step, the filter is enabled and the live stream is started (.LiveStart). Please feel free to download the filter's C++ source code in the head of this page. Please note that it is not needed to understand the following programming example. It should be considered as background information.

Private Sub Form_Load()
    ICImagingControl1.ShowDeviceSettingsDialog
    If Not ICImagingControl1.DeviceValid Then
        Unload Me
        Exit Sub
    End If
    Set filter = ICImagingControl1.FrameFilterCreateString("Clipping", "")
    ' Insert the frame filter in the display path of IC.
    ICImagingControl1.DisplayFrameFilters.Add filter
    ' Enable the filter
    filter.Parameter("Enable") = cbEnable.Value
    ' Initialize the Enable check box.
    cbEnable.Value = Checked
    ICImagingControl1.LiveStart
End Sub
Private Sub cbEnable_Click()
    filter.BeginParameterTransfer
    filter.Parameter("Enable") = cbEnable.Value
    filter.EndParameterTransfer
End Sub

The method .ShowDialog displays the built-in dialog for setting up the following parameters: the brightness threshold, whether pixels are marked that are over or under the brightness threshold, the color or pattern that is used to mark the pixels. After the dialog has been closed, the checkbox bEnable has to be synchronized with the filter parameter "Enable" because this parameter might have been altered in the dialog.

Private Sub btParameter_Click()
    filter.ShowDialog
    If filter.Parameter("Enable") Then
        cbEnable.Value = Checked
    Else
        cbEnable.Value = Unchecked
    End If
End Sub

The filter properties window looks as follows:

The Testdialog of IC Imaging Control,

Related Source Code Samples

Disclaimer
The source code that appears in the IC Imaging Control Source Code Library is indented for educational purposes only. The Imaging Source Europe GmbH, the manufacturer of IC Imaging Control, does not assume any kind of warranty expressed or implied, resulting from the use of the content of this page.

This site is part of The Imaging Source Network. Other sites include Company Portal, Image Processing, Astronomy Cameras, Astronomy Cameras Blog, Blog caméras d'astronomie, Astronomy Cameras Competition, TX Text Control, LiveDocx, phpLiveDocx and Forums.