Quality control of mechanical pieces by artificial vision