Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, September 3, 2012 4:01:42 AM(UTC)
username77

Groups: Registered
Posts: 40

Thanks: 5 times

I have this type of PatchCode on A4 format (http://www.alliancegroup.co.uk/patch-codes.htm). What is the best way of reading for this type of PatchCode?

im using those settings:

Dim bar1d As Barcode1d = New Barcode1d()
bar1d.Direction = BarcodeDirectionFlags.Horizontal And BarcodeDirectionFlags.Vertical

bar1d.ErrorCheck = False
bar1d.Granularity = 50
bar1d.OutShowText = False

bar1d.StandardFlags = Barcode1dStandardFlags.Barcode1dNormal

Dim barColor As BarcodeColor = New BarcodeColor()

barColor.BarColor = RasterColor.FromKnownColor(RasterKnownColor.Black)
barColor.SpaceColor = RasterColor.FromKnownColor(RasterKnownColor.White)


Dim searchRect As LeadRect = LeadRect.Empty

Dim Image As RasterImage = codecs.Load(filename, bitperpixel, CodecsLoadByteOrder.RgbOrGray, n, n)

Dim readBarcodes As RasterCollection(Of BarcodeData) = barEngine.Read(Image, searchRect, BarcodeSearchTypeFlags.Barcode1dPatchcode, BarcodeUnit.ScanlinesPerPixels, BarcodeReadFlags.UseColors, 0, bar1d, Nothing, barColor)
Dim data As BarcodeData = CType(readBarcodes(0), BarcodeData)

Dim strData As String()

strData = BarcodeData.ConvertToStringArray(data.Data)
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, September 3, 2012 4:10:50 AM(UTC)
username77

Groups: Registered
Posts: 40

Thanks: 5 times

I mistyped the name of patchdoce. The type of barcode is the patch2 and not the patchT. The attached file is the correct type of barcode that i used.
File Attachment(s):
9001AR-001393012A_D_2.tif (45kb) downloaded 37 time(s).
 
#3 Posted : Monday, September 3, 2012 6:16:29 AM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

I'm not sure what you mean by "best way". I tested using our barcode demo and it is reading the barcode correctly.

In your code, I noticed you used the AND operator to combine the BarcodeDirectionFlags.Horizontal And BarcodeDirectionFlags.Vertical flags. Since these are bit-wise values, ANDing them will result in a zero and the correct way to combine them is to use the OR operator like this:
bar1d.Direction = BarcodeDirectionFlags.Horizontal Or BarcodeDirectionFlags.Vertical

Other than that, your code appears OK, but I haven't tested it. If you correct the direction flag, do you still face problems?
 
#4 Posted : Monday, September 3, 2012 6:37:57 AM(UTC)
username77

Groups: Registered
Posts: 40

Thanks: 5 times

I thought of using vertical and horizontal because the barcodes are 2 vertical (top and bottom) and two horizontal (top and bottom). In this way, I thought to eliminate the False Positive.

On this attachment I can not read this PatchCode T (on this case, direction is horizontal only). Are you able to reproduce this error?
File Attachment(s):
9001AR-001391012A_D_3.tif (29kb) downloaded 34 time(s).
 
#5 Posted : Monday, September 3, 2012 11:57:51 PM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

I checked the TIF image you sent and it was very noisy. I did some processing on it to remove the Dots in the image. After that, I was able to read the barcode successfully using our latest patches of LEADTOOLS v17.0.

Here is what I did:
1. Ran our C# main demo. You can find it under the name "CSMainDemo_Original.exe" in the following folder:
[LEADTOOLS 17 Folder]\Bin\Dotnet\Win32

2. From File menu, I selected Open. Then, I opened your TIF image.
3. From Image Menu, I selected Document sub-menu, then selected Dot Remove.
4. From the Dot Remove dialog, I set both Minimum width and Minimum height to "1", and then I pressed OK.

5. Saved the image as TIF 1-bit with CCITTG4 compression.
6. Ran our C# barcode demo. You can find it under the name "CSBarcodeDemo_Original.exe" in the following folder:
[LEADTOOLS 17 Folder]\Bin\Dotnet\Win32

7. From File menu, I selected Open. Then, I opened the new TIF image.
8. From Action menu, I selected Read.
9. From the Patch Code tab, I set the Direction to Vertical. Then, I pressed Read.

I am attaching the image after removing the dots. If you want to remove the dots programmatically, please see the help topic "DotRemoveCommand Class" in the LEADTOOLS .Net documentation.

Please try to do the above steps. If you face problems in any step, please open a support ticket, so I can give you the instructions to download the latest patches of LEADTOOLS v17.0. To do that, send an email to support@leadtools.com and include the following information:
1. Your toolkit serial number (do NOT post it here).
2. A link to this forum post.
 
#6 Posted : Monday, September 3, 2012 11:58:49 PM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Here is the attachment.
File Attachment(s):
New.zip (8kb) downloaded 33 time(s).
 
#7 Posted : Monday, January 28, 2013 10:35:22 PM(UTC)
username77

Groups: Registered
Posts: 40

Thanks: 5 times

Since I use Dot Remove I noticed that the recognition of patchcode is fantastic.

Ibrahim, thanks for the help.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.119 seconds.