Unable to detect patch code

Discussions about 1D barcode reading and writing
Post Reply
ElleryQ
Posts: 1
Joined: Fri Aug 12, 2016 9:47 am

Unable to detect patch code

Post by ElleryQ » Fri Aug 12, 2016 10:03 am

Hi all,
I'm using the last version of GdPicture 12 and I need to detect Patch Code on a A4 page.
With the following images:
00000003.jpg
First example
00000003.png
Second example
00000003.png (23.82 KiB) Viewed 1337 times
the PatchCodeReaderDoScan() does not recognize the patch codes.

I'm trying using the example installed with SDK: barcode_recognition

Any idea?

Thank you in advance,
Andrea
Attachments
00000003.png
00000003.png (23.82 KiB) Viewed 1336 times

sk4g
Posts: 1
Joined: Thu Sep 01, 2016 11:15 am

Re: Unable to detect patch code

Post by sk4g » Thu Sep 01, 2016 12:18 pm

Hi,

Please try below C# code with the first example.

Code: Select all


string strMsg = string.Empty;
using (GdPictureImaging gdPictureImaging = new GdPictureImaging())
{
  int intImgID = gdPictureImaging.CreateGdPictureImageFromFile(@"C:\Users\user\Desktop\00000003.jpg");

   //gdPictureImaging.FxBlackNWhite(intImgID, BitonalReduction.Stucki);
   gdPictureImaging.ConvertTo1Bpp(intImgID);

   Single Angle = gdPictureImaging.GetSkewAngle(intImgID, 15);
   gdPictureImaging.RotateAnglePreserveDimensionsCenterBackColor(intImgID, -Angle, Color.Black);
   
   gdPictureImaging.PatchCodeReaderDoScan(intImgID);
   //gdPictureImaging.ReleaseGdPictureImage(intImgID);
   strMsg = string.Empty;
   for (int i = 1; i <= gdPictureImaging.PatchCodeReaderGetCodeCount(); i++)
   {
      strMsg += "Barcode type: " + gdPictureImaging.PatchCodeReaderGetCodeType(i).ToString() + "\r\n";
   }
}
MessageBox.Show(strMsg);

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest