Visual inspection of workpiece and tool