Sign In  Sign Up Live-Chat

OneCode recognition performance issue

Last post 03-04-2008, 10:31 AM by arturlm. 3 replies.
Sort Posts: Previous Next
  •  02-27-2008, 9:16 PM 115263

    OneCode recognition performance issue

    Attachment: Present (inaccessible)

    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

     
  •  02-28-2008, 9:38 AM 115365 in reply to 115263

    Re: OneCode recognition is very slow.

    Hi arturlm,

       Thanks for your post! Our developers are working at this issue and will back to you ASAP.


    Dean Deng
    Lead Developer
    Aspose Guangzhou Team
    About Us
    Contact Us
     
  •  03-04-2008, 6:45 AM 116045 in reply to 115365

    Re: OneCode recognition is very slow.

    Attachment: Present (inaccessible)

    Hi Artur,

       Our developer have release a beta version which is able to improve the reading efficiency of OneCode evidently. Here is the test result of your sample using the new version:

    BarCode Found: [Interleaved2of5],[10822725318850010001]
    BarCode Found: [OneCode],[0012332463599999999909586736450]
    BarCode Found: [DataMatrix],[12345678901234567898                                                                       ]
    Processing Time: 843ms

    Processing Image: Three Barcodes on W-4 (text with barcodes).TIF - scanning specified rectangle
    BarCode Found: [OneCode],[0012332463599999999909586736450]
    Processing Time: 296ms

    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: 250ms

     I think the speed is more acceptable now. You can download the attached beta dll and try if it fit your application.

       Thanks


    Dean Deng
    Lead Developer
    Aspose Guangzhou Team
    About Us
    Contact Us
     
  •  03-04-2008, 10:31 AM 116085 in reply to 116045

    Re: OneCode recognition is very slow.

    Dean,

    You guys rock! Thank you so much. I tested new code on my machine (CoreDuo 1.8GHz laptop)and performance is pretty good now.

    Below are my results using new code:

    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: 1343ms

    Processing Image: Three Barcodes on W-4 (text with barcodes).TIF - scanning specified rectangle
    BarCode Found: [OneCode],[0012332463599999999909586736450]
    Processing Time: 500ms

    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: 437ms

    From 12.7s down to 1.3s, about 10 times. This is great improvment. Something we can work with. Since the faster the better I am hoping final version will be even faster :-).

    Thank you again for hard work and prompt resolution.

    Artur

     
View as RSS news feed in XML