A method for determining a movement of an object (100) in an optical axis (A) of a camera (101), comprising the steps of: placing (201) a camera with the optical axis directed towards the object activating (202) camera continuous autofocus functionality monitoring (203) autofocus parameter pattern change and determining (204) the movement of the object depending on the autofocus parameter pattern change.