1. A method for calibrating a measuring system, which system comprises a light source, optics and a sensor, wherein said light source is adapted to produce a light plane and said optics is located between said light plane and said sensor, wherein said method is performed in order to obtain a mapping from at least one point on said sensor to at least one point in said light plane, said method comprising the steps of: switching on said light source such that said light plane is produced; introducing a mapping calibration profile in a first mapping position in said light plane, wherein said mapping calibration profile comprises at least three points forming a straight line; characterized in that the method further comprises the steps of: computing a non-linear mapping from at least a first portion of said sensor to at least a first portion of said light plane by using said at least three points of said mapping calibration profile; introducing a homography calibration profile in a first homography position in said light plane, wherein said homography calibration profile comprises at least four points the relative distance between which are predetermined, and computing a homography from at least a first portion of said sensor to at least a first portion of said light plane based on said at least four points of said homography calibration profile.