Getting Started with CVB .Net
The simplest way for getting started is using Visual Studio. Make sure you have the .Net-Desktop Development package installed. Also a current version of CVB needs to be installed (download for Windows 32 or Windows 64). Starting with :cvb: 13.02.000 CVB .Net is included in the standard installers for Windows. If you use an older 13.x version you still can download it separately (see here) .
First create a Console, Windows Forms or WPF App as you like (or take an existing one). In this post we just add the necessary assemblies. Later on we see some code.
But before we start letâs take care of a gotcha when using :cvb: 64 bit: Default project setting is AnyCPU which is exactly what we need. Uncheck the Prefer 32-bit check box in the build settings for Debug and Release:
If this stays checked the process will be 32-bit. Then some things are not working as expected or you immediatly get a BadImageFormatException
as we install either 32-bit or 64-bit :cvb:.
I recommend reading this from top to bottom, but here are the main topics for the impatient:
- Acquire Images from a Stream (AVI Demo)
- Acquire Images from a Camera
- Windows Forms App
- WPF App
- Stream Statistics
Add Reference to Stemmer.Cvb Assemblies
Before you can do anything with :cvb: in .Net, you need to add the references to our Stemmer.Cvb assemblies:
In the opened dialog switch to Browse and click on the Browse⌠button:
Enter
%CVB%Lib\Net
in your address list to jump to the :cvb: library directory for .Net. Ignore the iXXX.dll group of DLLs (e.g. iCVCImg.dll) â these are the C-style P/Invoke assemblies. We are interested in the Stemmer.Cvb.* assemblies.
The Assemblies
Image Manager (and thus CameraSuite)
Stemmer.Cvb.dll
This is the core assembly containing basic Image
and Device
handling including acquisition via Stream
s and configuration (like GenICam GenApi or IDeviceControl).
This combines now the functionality of CVCError.dll, iCVCImg.dll, iCVCDriver.dll, iCVCUtilities.dll, and iCVGenApi.dll.
Stemmer.Cvb.Forms.dll
The :cvb: Display
and GenApiGrid
for Windows Forms apps. If you reference this one Stemmer.Cvb.Extensions.dll and Stemmer.Cvb.Aux.dll are needed.
This combines the functionality of the CVDisplay ActiveX and CVGenApi ActiveX controls.
Stemmer.Cvb.Wpf.dll
The :cvb: Display
and GenApiGrid
for WPF apps. You also need Stemmer.Cvb.Extensions.dll if you reference this assembly.
In principle this also combines the functionality of the CVDisplay ActiveX and CVGenApi ActiveX controls. The display is a pure WPF implementation, though.
Stemmer.Cvb.Aux.dll
This is needed by the Stemmer.Cvb.Forms.Controls.Display
for native interop handling (mostly overlay related).
Stemmer.Cvb.Extensions.dll
In here we put extension methods especially for the System.Drawing
namespace to be able to support .Net Core.
Foundation Package
Stemmer.Cvb.Foundation.dll
All Foundation functions and Foundation tools are bundled in here covering for example correlation, filtering, non-linear calibration, blob, optical flow and more.
Combined in here is the functionality of the iCVCFoundation.dll, iBayerToRGB.dll, iCVCEdge.dll, and iLightMeter.dll.
Tools
- Stemmer.Cvb.Manto.dll
- Stemmer.Cvb.Minos.dll
- Stemmer.Cvb.Movie2.dll
- Stemmer.Cvb.Polimago.dll
- Stemmer.Cvb.SampleDatabase.dll
(Sample Image List (SIL) handling) - Stemmer.Cvb.ShapeFinder.dll