VB program for machine vision