Automated optical inspection method for MEMS fabrication