Binning and Video Formats in VB.NET

Posted by Stefan Geißler on April 14, 2011

Using binning is quite simple. The exact video format simply must be passed to the ic.VideoFormat property:

IcImagingControl1.VideoFormat = "RGB32 (640x480) [Binning 4x]" 

But often it is necessary to provide a list of available video formats. The DFK 72 series has many video formats, based on the ROI of the CMOS sensor. That means, it is possible to choose almost any resolution between the minimum (96x96) and the maximum format (2592x1944). Therefore, it is not a good idea, to implement a list of all possible video formats, because it is just too long.

Therefore, we invented the video format description VideoFormatDesc in IC Imaging Control 3.2. The VideoFormatDesc shows the pixel format, the minimum and maximum resolution and some more properties, e.g. binning. Thus, it is a better idea to define a list with formats presented to the user, like 320x240, 640x480, 1920x1080 and so on. This can be done in an array:

Dim Sizes(6) As System.Drawing.Size

' Define some wanted video formats
Sizes(0) = New System.Drawing.Size(320, 240)
Sizes(1) = New System.Drawing.Size(640, 480)
Sizes(2) = New System.Drawing.Size(1024, 768)
Sizes(3) = New System.Drawing.Size(1600, 1200)
Sizes(4) = New System.Drawing.Size(1920, 1080) ' Full HD
Sizes(5) = New System.Drawing.Size(2592, 1944)

The camera has a list of VideoFormatDescriptions, which are saved in the VideoFormatDescs collection. We simply need to enumerate all video format descriptions and check, whether our required resolutions are valid for them. If so, we create a temporary video format and write its name, for example, into a combo box for selection by the end user:

cboVideoFormats.Items.Clear()
Dim S As Integer

For Each VFD As TIS.Imaging.VideoFormatDesc In IcImagingControl1.VideoFormatDescs
    For S = 0 To Sizes.Length() - 1
        If VFD.IsValidSize(Sizes(S)) = True Then ' Check, whether the current resolution fits 
            Dim VF As TIS.Imaging.VideoFormat
            VF = VFD.CreateVideoFormat(Sizes(S))
            'Console.WriteLine(VF.Name) ' For debugging purposes.
            cboVideoFormats.Items.Add(VF.Name)
        End If
    Next
Next

In the SelectedIndexChanged event handler of the combobox we can set the chosen video format:

Private Sub cboVideoFormats_SelectedIndexChanged(...)
    IcImagingControl1.LiveStop()
    IcImagingControl1.VideoFormat = cboVideoFormats.SelectedItem.ToString()
    IcImagingControl1.LiveStart()
End Sub

The parameter of the cboVideoFormats_SelectedIndexChanged sub have been removed to make the sample more readable.

IC Imaging Control ActiveX returns!

Posted by Stefan Geißler on April 8, 2011

Since we had so many requests regarding the ActiveX component, we have brought it back to live. It does not have all of the new features of IC Imaging Control 3.2, but it will be available in 32 and 64 bit versions.

And yes, software trigger will work, an example is pending.

It can be used in the old environments, such as VB6 and Delphi 6, and also in LabVIEW 2010 32/64 bit.

Please contact us, if you would like the new ActiveX component.

I would like to point out the ActiveX is not fully tested in 64 bit environments, since we have no 64 bit software that supports the old COM / ActiveX interface.

IC Imaging Control 3.2 Released

Posted by Stefan Geißler on April 8, 2011

Features:

  • Support of ROI formats of DxK 72 cameras
  • Different VDA handling
  • License mechanism removed
  • Support of .NET 2.0 and 4.0
  • Smaller VC++ runtime files

The VDA files, which are the adapters that define the camera properties, are now compiled into IC Imaging Control. When new ones are released, they are now installed by the camera driver. This has the advantage, that developers no longer have to think about installing or updating the adapters.

The licensing mechanism of IC Imaging Control has been removed, thus there is no fiddling around with the licenses.licx file any more. IC Imaging Control now only supports The Imaging Source devices.

IC Imaging Control supports .NET framework 2.0 and 4.0. Additional files are installed for each version. Visual Studio 2010™ C++ is also supported.

IC Imaging Control 3.2 was built with VC++ 2010. It has a smaller runtime and is easier to install than the previous VC++ 2008 version. Thus, creating setups is now easier.

In order to receive a free update, please create a support case at http://www.imagingcontrol.com/en_US/support/case/.

IC Imaging Control 3.1 Released

Posted by Stefan Geißler on December 10, 2009

After months of intensive development, I am delighted to announce that IC Imaging Control® 3.1 has just been released.

Features:

  • 32 and 64 bit support
  • Native .NET component
  • Class library no longer requires the DirectShow® SDK

Support for Visual C++® 6.0, Visual Basic® 6 (ActiveX) and Visual Studio™ 2003 .NET has come to an end.

Support for Visual Studio™ 2003 C++ (version 7.1) is still available.

In order to receive a free update, please create a support case at:
http://www.imagingcontrol.com/en_US/support/case/.

IC Imaging Control 3.1 Release Candidate

Posted by Stefan Geißler on January 23, 2009

In the past weeks, I have told a number of customers that we are working on the next version of IC Imaging Control - version 3.1.

The .NET component has been redesigned to work extremely well on Windows Vista with Visual Studio™ 2008.

If you encounter any issues with IC Imaging Control 3.0.6 on Windows Vista with Visual Studio™ 2008, please contact me.

Currently, IC Imaging Control 3.1 is only available as release candidate and thus should not yet be used in a production environment.

The latest version is 3.1.0.251. In this version we have not found any critical errors.

IC Service Pack 3 for Visual Studio 2008 C++

Posted by Stefan Geißler on June 9, 2008

I am delighted to announce that we have just released IC Imaging Control 3.0.6 Class Library Service Pack 3 for Visual Studio™ 2008 C++.

The service pack contains following updates:

  • DLL, library and header files
  • Dynamic help and Keyword help integration in Visual Studio™ 2008
  • Class Library C++ Dialog application and Frame Filter wizards

Download and install the service pack today!

Exposure Absolute Values

Posted by Stefan Geißler on March 31, 2008

Very often, I am asked how to access the Absolute Values interface of the exposure time. Although this seems to be complicated at first glace, it is not:

The interface is accessed in the following three steps:

  1. Declare the necessary variables for the interfaces.
  2. Query the interfaces.
  3. Work with the queried interfaces.

Declare the variables for the interfaces

We need a variable for the interface to toggle automatic exposure and a variable for the exposure values interface.

VB:

Dim AbsoluteValues As ICImagingControl3.VCDAbsoluteValueProperty
Dim ExposureAuto As ICImagingControl3.VCDSwitchProperty
    

C#:

using TIS.Imaging;
ICImagingControl3.VCDAbsoluteValueProperty AbsoluteValues;
ICImagingControl3.VCDSwitchProperty ExposureAuto;
    

Query the interfaces

This step is quite simple. The only thing you have to do is gather the required information:

VB:

AbsoluteValues = IcImagingControl1.VCDPropertyItems.FindInterface(
                                           VCDIDs.VCDID_Exposure + ":" + _
                                           VCDIDs.VCDElement_Value + ":" + _
                                           VCDIDs.VCDInterface_AbsoluteValue)

ExposureAuto = IcImagingControl1.VCDPropertyItems.FindInterface(
                                           VCDIDs.VCDID_Exposure + ":" + _
                                           VCDIDs.VCDElement_Auto + ":" + _
                                           VCDIDs.VCDInterface_Switch)
    

C#:

AbsoluteValues = (ICImagingControl3.VCDAbsoluteValueProperty)icImagingControl1.VCDPropertyItems.FindInterface(
                                                     VCDIDs.VCDID_Exposure + ":" +
                                                     VCDIDs.VCDElement_Value + ":" +
                                                     VCDIDs.VCDInterface_AbsoluteValue);

ExposureAuto = (ICImagingControl3.VCDSwitchProperty) icImagingControl1.VCDPropertyItems.FindInterface(
                                                     VCDIDs.VCDID_Exposure + ":" +
                                                     VCDIDs.VCDElement_Auto + ":" +
                                                     VCDIDs.VCDInterface_Switch);
    

Work with the queried interfaces

Now we can check, whether the interfaces exist and query their values.

VB:

    'Disable automatic
If Not ExposureAuto Is  Nothing Then
    ExposureAuto.Switch = false
End If


If Not AbsoluteValues Is  Nothing Then
    Dim ExposureMin As Double
    Dim ExposureMax As Double
    Dim ExposureValue As Double

    ' Query the currently set values:
    ExposureMax = AbsoluteValues.RangeMax
    ExposureMin = AbsoluteValues.RangeMin
    ExposureValue = AbsoluteValues.Value

    'Set a new exposure value
    AbsoluteValues.Value = 0.002
End if

C#:

// If ExposureAuto exposure exists ...
if (ExposureAuto != null)
{
    //... make sure, it is disabled.
    ExposureAuto.Switch = false;
}


// If the absolute values interface exists...
if (AbsoluteValues != null)
{
    double ExpMin, ExpMax, ExpCurrent;

    // ... query the currenty values:
    ExpMin = AbsoluteValues.RangeMin;
    ExpMax = AbsoluteValues.RangeMax;
    ExpCurrent = AbsoluteValues.Value;

    //.. set a new value
    AbsoluteValues.Value = 0.001;

}

Please keep in mind that not all cameras and video capture devices support the Absolute Values interface.

USB Camera Driver Updated

Posted by Stefan Geißler on December 13, 2007

The new driver version 1.0.0.15 is now available at http://www.theimagingsource.com.

Following Windows® versions are supported:

  • XP SP2
  • XP 64bit
  • Vista® 32bit
  • Vista® 64bit

The Windows® standard USB video driver can be used for the DFK 21AU04 and DFK 21BU04 cameras. But this driver does not offer the full range of available camera properties.

The monochrome and the higher resolution cameras such as DFK 31AU03 or DMK 21BU04 need the TIS WDM driver. The Windows® standard USB video driver simply shows a "Code 10, device can not start" error for them in the Device Manager.

All WDM drivers for The Imaging Source video capture devices (converters, grabbers, DCam cameras and USB cameras) support Windows Vista® 32 and 64 bit.

Visual Studio® 2008 is available

Posted by Stefan Geißler on December 11, 2007

The new Visual Studio® 2008 is now available. We have tested the compatibility of IC Imaging Control Classlibrary and .NET component with Visual Studio® 2008.

The current version of IC Imaging Control 3.0.5 Classlibrary is incompatible to Visual Studio® 2008.

IC Imaging Control .NET 3.0.5 component works fine in Visual Studio® 2008 in Windows XP®, but not in Visual Studio® 2008 in Windows Vista®.The IC .NET component 3.0.5 runs fine in Visual Studio® 2005 in Windows Vista®.

The next version of IC Imaging Control that is fully compatible to Visual Studio® 2008 in Windows XP® and Windows Vista® is already in the pipeline. We hope it will be finished soon.

How to Display the Property Pages of a Camera

Posted by Stefan Geißler on October 2, 2007

Users of IC Imaging Control Professional often inquire how to show the property dialog box that ships with the driver of their video capture device. Typically, this dialog box allows access to certain special properties that are not accessible through IC Imaging Control. The IC Imaging Control Grabber object exports an IUnknown COM pointer that can be used to access the driver's dialog box.

The following C++ code shows the driver's dialog box.

smart_com<IUnknown> pksps = 0;
m_cGrabber.getDev().getInternalInterface( pksps );

if( pksps != NULL )
{
    HRESULT hr;
    smart_com<ISpecifyPropertyPages> pSpec;
    hr = pksps->QueryInterface(IID_ISpecifyPropertyPages, (void **)&pSpec.get());
    if (hr == S_OK)
    {
        CAUUID cauuid;
        hr = pSpec->GetPages(&cauuid);
        if( SUCCEEDED( hr ) && cauuid.cElems > 0 && cauuid.pElems != 0 )
        {
            hr = OleCreatePropertyFrame( this->m_hWnd, 30, 30, 0, 1, &pksps.getImpl(), cauuid.cElems,
                (GUID *)cauuid.pElems, 0, 0, 0);

            CoTaskMemFree(cauuid.pElems);
        }
    }
}
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.