Hello,
I am having performance issues with recognition of OneCode barcode.
Below is sample code:
[STAThread]
static void Main(string[] args)
{
Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense("Aspose.BarCode.lic");
string image1 = "Three Barcodes on W-4 (text with barcodes).TIF";
string image2 = "Three Barcodes on W-4 (just barcodes).TIF";
ProcessImage(image1, Rectangle.Empty, "scanning entire image");
ProcessImage(image1, new Rectangle(240, 3100, 1000, 100), "scanning specified rectangle");
ProcessImage(image2, Rectangle.Empty, "scanning entire image");
}
static void ProcessImage(string imageFile, Rectangle scanArea, string description)
{
Debug.WriteLine("Processing Image: " + imageFile + " - " + description);
//Read from this image
BarCodeReader br = new BarCodeReader(imageFile);
br.SymbologyType = Symbology.Interleaved2of5 | Symbology.OneCode | Symbology.DataMatrix;
br.ScanArea = scanArea;
BarCodeInfo[] results;
DateTime startTime = DateTime.Now;
//Recognize
results = br.Read();
DateTime endTime = DateTime.Now;
TimeSpan span = endTime - startTime;
foreach (BarCodeInfo info in results)
{
Debug.WriteLine("BarCode Found: [" + info.SymbologyType + "],[" + info.CodeText + "]");
}
int totalMS = span.Minutes * 60 * 1000 + span.Seconds * 1000 + span.Milliseconds;
Debug.WriteLine("Processing Time: " + totalMS.ToString() + "ms\n");
}
And output:
Processing Image: Three Barcodes on W-4 (text with barcodes).TIF - scanning entire image
BarCode Found: [Interleaved2of5],[10822725318850010001]
BarCode Found: [OneCode],[0012332463599999999909586736450]
BarCode Found: [DataMatrix],[12345678901234567898 ]
Processing Time: 12703ms
Processing Image: Three Barcodes on W-4 (text with barcodes).TIF - scanning specified rectangle
BarCode Found: [OneCode],[0012332463599999999909586736450]
Processing Time: 7531ms
Processing Image: Three Barcodes on W-4 (just barcodes).TIF - scanning entire image
BarCode Found: [Interleaved2of5],[10822725318850010001]
BarCode Found: [OneCode],[0012332463599999999909586736450]
BarCode Found: [DataMatrix],[12345678901234567898 ]
Processing Time: 609ms
From the output you can tell it takes nearly 13 seconds to read all the barcodes from image, when I specify ScanArea it works faster but it is still slow. When I process image with just barcodes (all text removed manually using image editor) it is really fast.
Looks like ScanArea is not working well, I had to remove text from image manually to make it fast.
Now, same code as above with one exception:
br.SymbologyType = Symbology.Interleaved2of5 | Symbology.DataMatrix;
OneCode removed.
Processing Image: Three Barcodes on W-4 (text with barcodes).TIF - scanning entire image
BarCode Found: [Interleaved2of5],[10822725318850010001]
BarCode Found: [DataMatrix],[12345678901234567898 ]
Processing Time: 2171ms
Processing Image: Three Barcodes on W-4 (text with barcodes).TIF - scanning specified rectangle
Processing Time: 375ms
Processing Image: Three Barcodes on W-4 (just barcodes).TIF - scanning entire image
BarCode Found: [Interleaved2of5],[10822725318850010001]
BarCode Found: [DataMatrix],[12345678901234567898 ]
Processing Time: 375ms
Recognition is pretty fast with OneCode excluded.
This test image is not actual form we process on our system but it is similar, slightly smaller though. With our actual form the difference is even greater. It takes over 60 seconds to recognize all three types of barcodes and only 3 seconds without OneCode.
We are evaluating this product and this is huge problem for us. We need to be able to recognize all three barcodes under 1-3 second(s). We cannot specify region or orientation. Even if we could it would still not work because ScanArea does not seem to work correctly. If not OneCode slow performance we would be OK.
Is there a chance these issues can be addressed in nearest future.
Entire project including test images is attached. Please take a look at it ASAP.
Artur