Home Image-Pro Automation (Macros, Apps, Reports)

Performance hit after processing ~10 images

I'm processing hundreds of images using image math, and'ing with a skeletonized image.  Four images are opened and I collect 2 pieces of data in two data collections per image processed. The data collection involves counting 200-500 features in one of the images, and data collecting the area of the grid.  I close all images before opening and processing the next image.  after about ten images processed, the performance takes a major hit.  Is there something I can do to maintain performance?  Using 9.3, latest revision.

Thanks

Best Answer

Answers

  • Thanks, Yuri.

    Running the GarbageCollect worked.  I probably ran it excessively (after each image processed), but it worked.

    BTW, the routine did not work if the message box was commented out.  In general, it would process about 10 images and the app would lock-up.  The only way out (that I know of) was closing the app from Task Manager.  I didn't actually look for leaking images.

    One other note:  I'm not sure if the timing of all these operations are causing issues (e.g. the previous paragraph).  I'm running on a Dell Workstation Laptop, Core I& (8-core) and all images are on SDD drives. It seems like running garbage collection without the MsgBox delay should work.

    We are using version 9.3.1.

    Jeff

  • Jeff,

    GarbageCollect without message box should also work. Maybe your SSD needs some time to release all files and MessageBox provided that delay. You may try adding DoEvents call instead of MsgBox to see if it helps.

    Yuri

  • 2017-05-01-104049

    Jeff --

    You might also add

            'Give the OS a chance to catch up
            System.Windows.Forms.Application.DoEvents()

    to your code.

    This has been helpful in allowing the PREMIER USER INTERFACE, PREMIER APPS, and the APP CODE to SYNC UP.

    I hope this information is helpful.

    -- Matt

Sign In or Register to comment.