A computer-implemented method for obtaining, for at least one pixel of an image sensor comprised in an optical device, parameters defining a pixel beam, wherein a pixel beam is defined as a pencil of rays of light that reach said pixel when propagating through an optical system associated with said optical device via an entrance pupil, the method being characterized in that it comprises: - determining a direction of a chief ray associated with said at least one pixel of said image sensor from the features of said optical system associated with said optical device; - determining a set of pixels comprised in a screen of a display device, said set of pixels comprising at least one pixel close to a point corresponding to an intersection of said chief ray and said screen, and said set of pixels comprising only pixels which are detected by said at least one pixel of said image sensor, when they are illuminated; and wherein said determining said set of pixels comprises: - illuminating at least one pixel around said point corresponding to the intersection of said chief ray and said screen; - verifying if said at least one illuminated pixel is detected by said at least one pixel of said image sensor; and wherein said method further comprises: - determining a subset of pixels comprised in said set of pixels, said subset of pixels corresponding to a cross section of said pixel beam; and wherein said determining said subset of pixels comprises: - illuminating said pixels in said set of pixels one at a time and measuring values sensed by said at least one pixel of said image sensor for said illuminated pixels; - determining from said measured values those pixels in said set of pixels that are part of the cross section of said pixel beam; and wherein said determining said set of pixels comprised in said screen of said display device and said determining said subset of pixels comprised in said set of pixels are repeated for two or more distances between said optical device and said display device; and wherein said parameters defining said pixel beam associated with said at least one pixel of said image sensor are determined by fitting a hyperboloid to the subsets of pixels corresponding to cross sections of said pixel beam obtained for different distances. - determining a direction of a chief ray associated with said at least one pixel of said image sensor from the features of said optical system associated with said optical device; - determining a set of pixels comprised in a screen of a display device, said set of pixels comprising at least one pixel close to a point corresponding to an intersection of said chief ray and said screen, and said set of pixels comprising only pixels which are detected by said at least one pixel of said image sensor, when they are illuminated; - illuminating at least one pixel around said point corresponding to the intersection of said chief ray and said screen; - verifying if said at least one illuminated pixel is detected by said at least one pixel of said image sensor; - determining a subset of pixels comprised in said set of pixels, said subset of pixels corresponding to a cross section of said pixel beam; - illuminating said pixels in said set of pixels one at a time and measuring values sensed by said at least one pixel of said image sensor for said illuminated pixels; - determining from said measured values those pixels in said set of pixels that are part of the cross section of said pixel beam;