An optical device for measuring the position of an object (B) along a first axis (z), the object (B) being subjected to light radiations emitted by a light source , the optical device comprising: - an imaging system comprising an objective for collecting light radiations diffused by the object (B), the objective having an optical axis (O) extending parallel to the first axis (z), - a transmission mask having at least a first pair of apertures and a second pair of apertures , the first pair of apertures and second pair of apertures 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 (B) into two first beams (R11, R12) passing through the first pair of apertures and two second beams (R21, R22) passing through the second pair of apertures , while blocking a part of the radiations (R3) 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 (S1) and a second spot (S2), the first spot (S1) and the second spot (S2) 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 (S1) and the two second beams (R21, R22) interfering with each other so as to create a second interference pattern within the second spot (S2), 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 (B) 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 (B), the objective having an optical axis (O) extending parallel to the first axis (z), - a transmission mask having at least a first pair of apertures and a second pair of apertures , the first pair of apertures and second pair of apertures 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 (B) into two first beams (R11, R12) passing through the first pair of apertures and two second beams (R21, R22) passing through the second pair of apertures , while blocking a part of the radiations (R3) 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 (S1) and a second spot (S2), the first spot (S1) and the second spot (S2) 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 (S1) and the two second beams (R21, R22) interfering with each other so as to create a second interference pattern within the second spot (S2), 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 (B) along the first axis (z) as a function of said spatial phase shift. <EOS>