Detects potential barcode candidates in an image.
public class FindBarcodeCandidateAreasCommand : RasterCommand
public class FindBarcodeCandidateAreasCommand
extends RasterCommand
public:
ref class FindBarcodeCandidateAreasCommand : RasterCommand
class FindBarcodeCandidateAreasCommand(RasterCommand):
FindBarcodeCandidateAreasCommand is useful on images that have a barcode of poor quality and returns the candidate barcode bounds and confidence.
Another benefit with using FindBarcodeCandidateAreasCommand is a boost up in speed by locating potential barcode areas. To achieve this, use the bounds of the candidate barcode to pass to the BarcodeReader on the entire image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
public void FindBarcodeCandidateAreasCommandExample()
{
// Initialize codecs
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "barcode1.tif"));
// Create command and set parameters for barcodes
FindBarcodeCandidateAreasCommand command = new FindBarcodeCandidateAreasCommand();
command.UnitsType = BarcodeCandidateAreasUnitsType.Pixels;
command.BackgroundColor = new RasterColor(255, 255, 255);
command.BarcodeColor = new RasterColor(0, 0, 0);
command.MinimumBarcodeDimension = 10;
// Run the command
command.Run(image);
// First candidate area returned from running command
BarcodeCandidateArea barcodeCandidateArea = command.CandidateAreas[0];
codecs.Dispose();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document