Method and arrangement to locate an object with a predetermined number of marks, the arrangement comprising a light source, a sensor and a processor, by means of the following steps:-illuminating the object with the light source;-receiving an image of the object and generate image pixel data including image pixel locations and image pixel intensities for each image pixel location with said sensor;-receiving the image pixel data and storing them in a memory;-comparing said image pixel intensities with a predetermined threshold;-determining object position based on said comparing;-using a digital match mask that corresponds with said object with said marks;-finding a best match between said digital match mask and said object on said object position;-determining mark positions within said object position from said best match.