Machine Vision Express™ enables computers to "see" like a human.

Machine Vision - FAQ - MVE GUI


Why do MVE GUI based scripts always contain an Initialization Macro?

The simple answer is: they save time and thereby improve overall system performance.

Here is why:
Scripts are run over and over again, at least once for every product passing by the camera. If the structure of a script requires a number of "Setup" steps, then this section of the script should only be processed once and not every time a product passes by the camera. That is why all steps included within the Initialization Macro are run only once, at the time the script is run for the first time. During subsequent runs of the same script all steps inside the Initialization Macro are skipped.

Example:
It may be necessary to compare a "Master Pattern" with a "Product Pattern" every time a product passes by the camera. Given this situation it is useful to create the "Master Pattern" only once. In this situation the Initialization Macro could be used to load the "Master Image" and create the "Master Pattern" from it. Thus, the "Master Pattern" does not need to be created over and over when subsequent products pass by the camera.