Inspecting patterns on the surface of objects