We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Barcode & Dimension

Hello,

I am a developer in .NET.

Now I have problem in reading the barcode from the pages I scanned.

Please see the attached,

The first named "Section Separator(A4&200DPI).tif" is a Multi-Tiff Tiff document,

These Tiff pages can not been recognized correctly.

But , if these pages are zoomed out and saved a copy, they can be read correctly.

Please see the attached. (firstpage.png)

I want to know why.

These

I need your help, thank you.

Best.

Tsing

My Code:

Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense(Application.StartupPath+@"\Aspose.BarCode.lic");
// BarCodeReader br = new BarCodeReader(_filepath);
BarCodeReader br = new BarCodeReader();
Bitmap bitmap = new Bitmap(_filepath);
br.BarCodeImage = bitmap;

br.SymbologyType = Symbology.DataMatrix;
br.VisualizeScanResult = true;
BarCodeInfo[] results

results = br.Read();

Please help me to check if the attached pages can be read correctly using the latest version 3.6.

Than you .

Best,

Tsing

Hi Tsing,


Below is the output using v3.6. You may also verify using the sample project after you receive the temporary license file.

Recognized from Section+Separator(A4%26200DPI).tif: Page: 0 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section A;
===========================

Recognized from Section+Separator(A4%26200DPI).tif: Page: 1 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section A;
===========================

Recognized from Section+Separator(A4%26200DPI).tif: Page: 2 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section B;
===========================

Recognized from Section+Separator(A4%26200DPI).tif: Page: 3 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section C;
===========================

Recognized from Section+Separator(A4%26300DPI).tif: Page: 0 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section A;
===========================

Recognized from Section+Separator(A4%26300DPI).tif: Page: 1 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section A;
===========================

Recognized from Section+Separator(A4%26300DPI).tif: Page: 2 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section B;
===========================

Recognized from Section+Separator(A4%26300DPI).tif: Page: 3 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section C;
===========================

Recognized from Section+Separator(A5%26200DPI).tif: Page: 0 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section A;
===========================

Recognized from Section+Separator(A5%26200DPI).tif: Page: 1 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section A;
===========================

Recognized from Section+Separator(A5%26200DPI).tif: Page: 2 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section B;
===========================

Recognized from Section+Separator(A5%26200DPI).tif: Page: 3 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section C;
===========================

Recognized from Section+Separator(A5%26300DPI).tif: Page: 0 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section A;
===========================

Recognized from Section+Separator(A5%26300DPI).tif: Page: 1 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section A;
===========================

Recognized from Section+Separator(A5%26300DPI).tif: Page: 2 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section B;
===========================

Recognized from Section+Separator(A5%26300DPI).tif: Page: 3 Codetext: 0123456789071C71D05-817A-4d9b-B80D-05EB86109C4C;0;20100711;;;Customer;none;1;20100711;20100711 ;;SD;no batch id;;;indexvalues;_Company=_Other;_DocDate=7/12/2010;DD9E491D-C47B-4b1d-9814-1401BF9F2F0D;Parent;5d518f28-d69b-41e8-abd4-629b6f3f352d;Section Information:;Section=Section C;
===========================

Hello ,

I used the latest version 3.6 in my project.

it is better , but there are still some barcode sheets can not be recognized .

Please see the attached,I used the sameple you sent me to read , but failed.

Can you help me to check ?

Thank you .

Tsing

HI Saqilb,

Please check if the 2th and 3th pags can be recognized on your side.

the 1th and 4th pages can be recognized on my side.

Thank you very much.

Tsing.

Hi Tsing,


I tested the attached tif file at my end and was able to recognize the barcodes from first 2 pages.

However, I updated the program and added the following statement, after that it recognized the barcodes from all 4 pages. Please try at your end too.

BarCodeReader reader = new BarCodeReader(bmp, BarCodeReadType.DataMatrix);
reader.SetHints(RecognitionHints.ImageBinarizationHints.MedianSmoothing); // add this

Sorry to bother you.

I added the code in my project.

Yes, it can read all barcode from the attatched Multi-Tiff file.

I will check if the other barcode sheets can be recoginized correctly .

I will let you know the result.

Thank you very much.

Best,

Tsing

HI Saqib,

Thank you again.

I have added the statement in my project, and made some testing.

After added this statement ,I feel the application is slower than before.

but there are still some barcode sheets can not be recognized.

please see attached,

1. Can the 3th page be recognized in the Test2.Tif.

2.Can the 1th and 4th pages be recognized in the TEST3.TIF

I want to know:

1.Why they are not recognized ?

2. Is there somting wrong in print and scaner?

3. What I should do to avoid this ?

Thank you very much.

Best,

Tsing

Hi Tsing,


I have also got the similar results here. I have sent the sample images to the development team for their analysis and also logged the issue in our bug tracking system (ID: 18477). We will inform you as soon as the issue gets resolved. Sorry for the inconvenience.

If you find some other images from which barcodes could not be recognized, please post for our analysis.

Thank you very much,

PS: You can try to zoom out the Bitmap in the code,

I think the barcode can be recognized correctly, but I don't think it is a good solution.

Please see the code.

--------------------

public Image GetThumb(Bitmap SrcImg,int ImgWidth,int ImgHeight)
{
if (SrcImg.Width <= ImgWidth) ImgWidth = SrcImg.Width;
int NewHeight = SrcImg.Height * ImgWidth / SrcImg.Width;
if (NewHeight > ImgHeight)
{
// Resize with height instead
ImgWidth = SrcImg.Width * ImgHeight / SrcImg.Height;
NewHeight = ImgHeight;
}
return new Bitmap(SrcImg, new Size(ImgWidth, NewHeight));
}
----------------------------------------

Bitmap bmp =new Bitmap(path);
Bitmap bmp = (Bitmap)GetThumb(bmp, 1000, 1000);
BarCodeReader reader = new BarCodeReader(bmp, BarCodeReadType.DataMatrix);

The Barcode Text can be recognized from the thumb bitmap.

Thank you very much again.

Best.

Tsing

Hi,

Good morning.

Thank you very much.

PS: you can try to get a thumb .

please see the function below:

public Image GetThumb(Bitmap SrcImg,int ImgWidth,int ImgHeight)
{
if (SrcImg.Width <= ImgWidth) ImgWidth = SrcImg.Width;
int NewHeight = SrcImg.Height * ImgWidth / SrcImg.Width;
if (NewHeight > ImgHeight)
{
// Resize with height instead
ImgWidth = SrcImg.Width * ImgHeight / SrcImg.Height;
NewHeight = ImgHeight;
}
return new Bitmap(SrcImg, new Size(ImgWidth, NewHeight));
}

-----------------------------------------------------

Bitmap bmp =new Bitmap(path);
Bitmap bmp = (Bitmap)GetThumb(bmp, 1000, 1000);
BarCodeReader reader = new BarCodeReader(bmp, BarCodeReadType.DataMatrix);

-----------------------

If you changes the code as above, I think the barcode text can be recognized correctly,

but I don't think it is a good solution.

Thank you .

Best.

Tsing

Hi,

Good morning.

Thank you very much.

PS: you can try to get a thumb .

please see the function below:

public Image GetThumb(Bitmap SrcImg,int ImgWidth,int ImgHeight)
{
if (SrcImg.Width <= ImgWidth) ImgWidth = SrcImg.Width;
int NewHeight = SrcImg.Height * ImgWidth / SrcImg.Width;
if (NewHeight > ImgHeight)
{
// Resize with height instead
ImgWidth = SrcImg.Width * ImgHeight / SrcImg.Height;
NewHeight = ImgHeight;
}
return new Bitmap(SrcImg, new Size(ImgWidth, NewHeight));
}

-----------------------------------------------------

Bitmap bmp =new Bitmap(path);
Bitmap bmp = (Bitmap)GetThumb(bmp, 1000, 1000);
BarCodeReader reader = new BarCodeReader(bmp, BarCodeReadType.DataMatrix);

-----------------------

If you changes the code as above, I think the barcode text can be recognized correctly,

but I don't think it is a good solution.

Thank you .

Best.

Tsing

Hi,

The 3th page can not be recognized correctly,

thank you.

Tsing.

The issues you have found earlier (filed as BARCODENET-18477) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.