Multi barcodes in single image unordered list

Hi,


I am getting multiple barcodes from a single image. But i get the list from reader unordered.(in image from top to bottom). Is there anything possible to get them ordered ?

Hi


Thanks for your inquiry. Aspose.BarCode product allows you to get the bar code region information from the image. Please refer to this documentation link here:
http://www.aspose.com/docs/display/barcodenet/Getting+BarCode+Region+Information+from+the+Image

Please let me know in case of further assistance or questions.

Hi,
Thank you for replying.

I know the way you mentioned.
But I want to know that are there any properties for setting order type on BarCodeReader objects.

When multiple barcodes founded on the file, I will have to order them using all barcode regions.
It will cost extra process and sorting algorithms on my way.

How does the sdk process on the file while finding barcodes ? Which analysis direction (Horizontal or vertical) is used when reader.OrientationHints property is RecognitionHints.Orientation.NoRotate?

Hi

Thank you for these details. Could you please explain a bit more about your requirement? Because there is a confusion. I mean what type of properties you need to set and their expected behavior. You can mark bar code regions in the image as described here. Are you thinking to change the actual position of the bar code within the image boundary?
yns:
How does the sdk process on the file while finding barcodes ? Which analysis direction (Horizontal or vertical) is used when reader.OrientationHints property is RecognitionHints.Orientation.NoRotate?
Bar code recognition order depends upon better recognition percentage although I don't know much about inside algorithms. Furthermore, I would like to update you that these orientation hints are used to rotate the bar code before passed in recognition. Bar code read method also auto detects the orientation of the bar code e.g. in some cases, you can recognize a bar code with 90 degrees without setting orientation hints. NoRotate means 0 degrees.

Hi,

I attached sample image containing multiple barcodes. Could you please analyze?

I want to get barcodes on the file from left to right order while reader.Read() executing. I defined sample order on attached image.

Is there are any property for managing left to right read.

Hi


Thanks for these details and sorry for the delayed response. I’m sorry to share with you that there is no direct way to achieve this process. I have logged this feature request under ticket id BARCODENET-33606 in our issue tracking system. Your request has also been linked to this issue and you will be notified as soon as it is resolved and available for the public use. We’re sorry for your inconvenience.

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


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

Hi

Thanks for your patience. Please try the following source code below:

string path = @“c:\temp\MultipleBarcodes.tif”;

List<FoundBarCodes> found = new List<FoundBarCodes>();

using (BarCodeReader reader = new BarCodeReader(path, BarCodeReadType.Code128))

{

while (reader.Read())

found.Add(new FoundBarCodes(reader.GetCodeText(), reader.GetRegion()));

}

found.Sort(new FoundComparator());


public struct FoundBarCodes

{

private string codetext;

public readonly BarCodeRegion region;


public FoundBarCodes(string text, BarCodeRegion reg)

{

codetext = text;

region = reg;

}

}


public class FoundComparator : IComparer<FoundBarCodes>

{

#region Implementation of IComparer


public int Compare(FoundBarCodes found1, FoundBarCodes found2)

{

Point[] found1Points = found1.region.Points;

Point[] found2Points = found2.region.Points;

Point found1XYMin = new Point(int.MaxValue, int.MaxValue);

Point found2XYMin = new Point(int.MaxValue, int.MaxValue);

foreach (Point p in found1Points)

if (p.X < found1XYMin.X && p.Y < found1XYMin.Y)

{

found1XYMin.X = p.X;

found1XYMin.Y = p.Y;

}

foreach (Point p in found2Points)

if (p.X < found2XYMin.X && p.Y < found2XYMin.Y)

{

found2XYMin.X = p.X;

found2XYMin.Y = p.Y;

}

if (found1XYMin.X < found2XYMin.X && found1XYMin.Y < found2XYMin.Y)

return -1;

if (found1XYMin.X > found2XYMin.X && found1XYMin.Y > found2XYMin.Y)

return 1;

if (found1XYMin.Y < found2XYMin.Y)

return -1;

if (found1XYMin.Y > found2XYMin.Y)

return 1;


return 0;

}

#endregion

}

Please let me know in case of any confusion or questions.