LEADTOOLS Support
Multimedia
Multimedia SDK Examples
HOW TO: Use the LEADTOOLS Video Callback Filter to recognize barcodes via webcam.
Groups: Registered, Tech Support, Administrators
Posts: 39
Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)
Attached is a very simple example that demonstrates how the LEADTOOLS can be used to process individual video frames and extract barcode information. This uses both the
LEADTOOLS Multimedia SDK and the
LEADTOOLS Barcode SDK. Using the
LEADTOOLS Video Callback Filter.
I used the LEADTOOLS CaptureCtrl in this project and I created a custom class the implements the
ILMVUserCallback interface, which has one method:
Code:public void ReceiveProc(int pData, int lWidth, int lHeight, int lBitCount, int lSize, int bTopDown)
This method is called for every frame received by the Callback filter. Here we can access the data for each frame of a media file or live capture and with that create a LEADTOOLS RasterImage for further processing:
Code:img = new RasterImage(
RasterMemoryFlags.Conventional,
lWidth,
lHeight,
lBitCount,
RasterByteOrder.Bgr,
viewPerspective,
null,
null,
lSize);
img.Access();
img.SetRow(0, new IntPtr(pData), lSize);
img.Release();
The project runs a very simple barcode recognition routine:
Code:BarcodeData[] DetectedBarcodecs = barcodeEngine.Reader.ReadBarcodes(image, LogicalRectangle.Empty, 0, new BarcodeSymbology[] { BarcodeSymbology.Unknown });
if (DetectedBarcodecs != null)
{
foreach (BarcodeData data in DetectedBarcodecs)
{
if (data != null)
{
Console.WriteLine("Barcode Sybmology: " + data.Symbology);
}
}
}
The attached project is a .NET C# created with Visual Studio 2017. This project assumes you have both the LEADTOOLS Multimedia SDK and the LEADTOOLS SDK installed in the default locations as seperate installations. The reference paths in this project are set to:
C:\LEADTOOLS 19\Bin\Dotnet4\Win32\
and
C:\LEADTOOLS Multimedia 19\Bin\Dotnet4\Win32\
If your setup is different do change these accordingly.
You should be able to download this zip file, extract it, and run it from Visual Studio.
Edited by moderator 6 years ago
| Reason: Not specified
Roberto Rodriguez
Developer Support Engineer
LEAD Technologies, Inc.

Groups: Registered, Tech Support, Administrators
Posts: 15
Was thanked: 1 time(s) in 1 post(s)
This has been updated for version 20 of the LEADTOOLS SDK.
Please extract this project to the below default installation path:
C:\LEADTOOLS 20\Examples\DotNet\CS\
The reference paths in this project are set to the below if you have integrated the Multimedia Evaluation with your Main LEADTOOLS Evaluation SDK:
C:\LEADTOOLS 20\Bin\Dotnet4\x64\
Blaise Kress
Developer Support Engineer
LEAD Technologies, Inc.

Groups: Registered, Manager, Tech Support, Administrators
Posts: 107
Was thanked: 9 time(s) in 9 post(s)
This project has been updated to support v21. This can be downloaded here:
Marcus Andra
Developer Support Engineer
LEAD Technologies, Inc.

LEADTOOLS Support
Multimedia
Multimedia SDK Examples
HOW TO: Use the LEADTOOLS Video Callback Filter to recognize barcodes via webcam.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.