A method for measuring a depth of a narrow hole, the method includes: obtaining from a chromatic confocal sensor a group of height measurements taken along an imaginary line that crosses the narrow hole; ignoring height measurements attributed to optical artifacts and blind measurement points and calculating an inverted parabolic estimate of a sub-group of the height measurements; wherein a top of the parabolic estimate is representative of a height of a bottom of the narrow hole.