An optical device for measuring the position of an object along a first axis (z), the object being subjected to light radiations emitted by a light source (2, 21, 22), the optical device comprising: - an imaging system comprising an objective for collecting light radiations diffused by the object, the objective having an optical axis extending parallel to the first axis (z), - a transmission mask having at least a first pair of apertures (81, 83) and a second pair of apertures (82, 84), the first pair of apertures (81, 83) and second pair of apertures (82, 84) being spaced from each other along a second axis (x), perpendicular to the first axis (z), the transmission mask dividing the radiation diffused by the object into two first beams (R11, R12) passing through the first pair of apertures (81, 83) and two second beams (R21, R22) passing through the second pair of apertures (82, 84), while blocking a part of the radiations emitted by the light source which is not diffused by the object, and - a detector having a detector plane, the detector being adapted for generating an image including a first spot and a second spot, the first spot and the second spot being representative of the first beams (R11, R12) and second beams (R21, R22) impacting the detector plane respectively, the two first beams (R11, R12) interfering with each other so as to create a first interference pattern within the first spot and the two second beams (R21, R22) interfering with each other so as to create a second interference pattern within the second spot, and - a processing module for processing the image generated by the detector, the processing module being configured for determining a spatial phase shift between the first interference pattern and the second interference pattern along the second axis (x), and for determining the position of the object along the first axis (z) as a function of said spatial phase shift. - an imaging system comprising an objective for collecting light radiations diffused by the object, the objective having an optical axis extending parallel to the first axis (z), - a transmission mask having at least a first pair of apertures (81, 83) and a second pair of apertures (82, 84), the first pair of apertures (81, 83) and second pair of apertures (82, 84) being spaced from each other along a second axis (x), perpendicular to the first axis (z), the transmission mask dividing the radiation diffused by the object into two first beams (R11, R12) passing through the first pair of apertures (81, 83) and two second beams (R21, R22) passing through the second pair of apertures (82, 84), while blocking a part of the radiations emitted by the light source which is not diffused by the object, and - a detector having a detector plane, the detector being adapted for generating an image including a first spot and a second spot, the first spot and the second spot being representative of the first beams (R11, R12) and second beams (R21, R22) impacting the detector plane respectively, the two first beams (R11, R12) interfering with each other so as to create a first interference pattern within the first spot and the two second beams (R21, R22) interfering with each other so as to create a second interference pattern within the second spot, and - a processing module for processing the image generated by the detector, the processing module being configured for determining a spatial phase shift between the first interference pattern and the second interference pattern along the second axis (x), and for determining the position of the object along the first axis (z) as a function of said spatial phase shift.