Barcode recognition returns an inexistent barcode

Hi,
I tried to get barcode from 2 images, using different RecognitionMode.
The first image (image1.png (607.4 KB)) has a barcode and the second (image2.png (461.1 KB)) has no barcode.

From second image the recognition returna some inexistent Code128 barcodes (with value % and 01).
I cannot find a configuration for RecognitionMode and ManualHints that allow me to:

  • correctly returns the real barcode in the first image
  • correctly returns no barcode for second image

Wich is the right configuration to obtain my goal?

Here’s my code sample:

	findBarcodes("image1.png")
	findBarcodes("image2.png")


		Shared Sub findBarcodes(filePath As String)
			Console.WriteLine("")
			Console.WriteLine("File: " & filePath)
			Console.WriteLine("")

			Using reader As New BarCodeReader(filePath, DecodeType.Code128)

				' Set RecognitionMode
				reader.RecognitionMode = RecognitionMode.ManualHints
				reader.ManualHints = ManualHint.None Or ManualHint.MedianSmoothing
				Console.WriteLine("RecognitionMode: " & reader.RecognitionMode.ToString())
				Console.WriteLine("ManualHints: " & reader.ManualHints.ToString())
				While reader.Read()
					Console.WriteLine(reader.GetCodeType().ToString + ": " + reader.GetCodeText())
				End While
				Console.WriteLine("")
			End Using

			Using reader As New BarCodeReader(filePath, DecodeType.Code128)

				' Set RecognitionMode
				reader.RecognitionMode = RecognitionMode.MaxBarCodes
				Console.WriteLine("RecognitionMode: " & reader.RecognitionMode.ToString())
				While reader.Read()
					Console.WriteLine(reader.GetCodeType().ToString + ": " + reader.GetCodeText())
				End While
				Console.WriteLine("")
			End Using


			Using reader As New BarCodeReader(filePath, DecodeType.Code128)

				' Set RecognitionMode
				reader.RecognitionMode = RecognitionMode.MaxPerformance
				Console.WriteLine("RecognitionMode: " & reader.RecognitionMode.ToString())
				While reader.Read()
					Console.WriteLine(reader.GetCodeType().ToString + ": " + reader.GetCodeText())

				End While
				Console.WriteLine("")
			End Using


			Using reader As New BarCodeReader(filePath, DecodeType.Code128)

				' Set RecognitionMode
				reader.RecognitionMode = RecognitionMode.MaxQuality
				Console.WriteLine("RecognitionMode: " & reader.RecognitionMode.ToString())
				While reader.Read()
					Console.WriteLine(reader.GetCodeType().ToString + ": " + reader.GetCodeText())

				End While
				Console.WriteLine("")
			End Using

			Console.WriteLine("")
		End Sub

And the result is:

File: image1.png

RecognitionMode: ManualHints
ManualHints: MedianSmoothing

RecognitionMode: MaxBarCodes
Code128: T400011561

RecognitionMode: MaxPerformance
Code128: T400011561

RecognitionMode: MaxQuality
Code128: T400011561



File: image2.png

RecognitionMode: ManualHints
ManualHints: MedianSmoothing

RecognitionMode: MaxBarCodes
Code128: 01
Code128: %

RecognitionMode: MaxPerformance
Code128: 01

RecognitionMode: MaxQuality
Code128: 01

@itconsult.developer,

We have evaluated the sample input images at our end. We are able to extract barcode from “image1.png”. Following are the details:

Code128:: T400011561 

Please confirm is this the required barcode or it is an incorrect one. Furthermore we are able to reproduce the issue in the second (empty) image i.e. “image2.png”. The issue has been logged into our system with ID BARCODENET-36705 for further investigation by our Product team. We’ll update you here once there is some information or a fix version available in this regard.

Hi Ikram,
thank you for the support.

The value T400011561 is the correct barcode in the first image.

I will wait for any news about the ticket BARCODENET-36705

@itconsult.developer,

Thank you for update. We’ll update you about the issue in this forum thread.

@itconsult.developer,

The issue (BARCODENET-36705) has been fixed. Please download the latest version of Aspose.BarCode for .NET and try it at your end.

Thank you.
I tried the new version and the result is better but not not completely correct.
The dll still returns the inexistent barcode “%” for the image2, using RecognitionMode=MaxBarCodes.

Anyway, thank you for the improvement.

@itconsult.developer,

Thank you for your feedback. The information has been shared with the product team.