.NET Code for Better and Faster Image Processing for Barcode

More
10 years 5 months ago #13362 by zarfishan
This Technical tip explains how to perform faster and better barcode image recognition using Aspose.BarCode for .NET. Aspose.BarCode for .NET provides better and faster barcode recognition using the following image processing algorithms:


• Median smoothing image processing (RecognitionHints.ImageBinarizationHints.MedianSmoothing)
• HLS image processing (RecognitionHints.ImageBinarizationHints.HLS)
• Grayscale image processing (RecognitionHints.ImageBinarizationHints.Grayscale)



Median smoothing: MedianSmoothing technique gives a perfect result. In more complicated images, less data will be lost by taking the median. MedianSmoothing removes the noise from the image while preserving the image edges.


HLS: HLS is also a Color space similar to RGB. But instead of red, green and blue components, HLS contain Hue, Luminance & Saturation components. It's a color space in which the Hue, saturation and luminance of a color can be separated and modified.


GrayScale: It converts image to grayscale. This processing technique can be useful while detecting bar codes from scanned or slightly damaged images. The probability of bar code detection will increase by this setting.


The following code snippet shows how to use median smoothing, HLS and gray-scale image processing techniques while recognizing the barcode.


[C#]


Code:
string image = @"code39Extended.jpg"; // create an instance of BarCodeReader and set image and symbology type to recognize BarCodeReader reader = new BarCodeReader(image, BarCodeReadType.Code39Standard); // set grayscale image processing reader.ImageBinarizationHints = RecognitionHints.ImageBinarization.Grayscale; // try to recognize all possible barcodes in the image while (reader.Read()) { // display the codetext Console.WriteLine("Codetext: " + reader.GetCodeText()); } // close the reader reader.Close();



[VB.NET]

Code:
Dim image As String = "code39Extended.jpg" ' create an instance of BarCodeReader and set image and symbology type to recognize Dim reader As BarCodeReader = New BarCodeReader(image, BarCodeReadType.Code39Standard) ' setgrayscale image processing reader.ImageBinarizationHints = RecognitionHints.ImageBinarization.Grayscale ' try to recognize all possible barcodes in the image Do While reader.Read() ' display the codetext Console.WriteLine("Codetext: " &reader.GetCodeText()) Loop ' close the reader reader.Close();

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #13386 by Pete
Thanks for sharing this with us.

Pete

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #13514 by cathyhill345

zarfishan wrote: This Technical tip explains how to perform faster and better barcode image recognition using Aspose.BarCode for .NET. Aspose.BarCode for .NET provides better and faster barcode recognition using the following image processing algorithms:


• Median smoothing image processing (RecognitionHints.ImageBinarizationHints.MedianSmoothing)
• HLS image processing (RecognitionHints.ImageBinarizationHints.HLS)
• Grayscale image processing (RecognitionHints.ImageBinarizationHints.Grayscale)


Thanks for recommending this barcode image recognition solution. I just have one question that can I use it to set the number of decoded barcode numbers when processing source image file?

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #13532 by Pete
I am not 100% sure. You will have to go on the Software Vendor's website and ask them there.

Pete

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
9 years 9 months ago #13833 by brentme
You can also check out this barcode generator some time. B)

Please Log in or Create an account to join the conversation.

Time to create page: 0.124 seconds
Powered by Kunena Forum