A method, performed in a device, for estimating a sub-pixel position of an extreme point in an image in the presence of noise using a parametric function, the extreme point in the image being of a type which is either a maximum or a minimum, the method comprising: a) selecting a group of neighboring pixels in the image, wherein a number of pixels in the group of neighboring pixels is larger than a number of parameters defining the parametric function, b) fitting the parametric function to pixel values of the group of neighboring pixels, wherein the parametric function approximates the pixel values of the group of neighboring pixels as a function of spatial position, c) identifying a spatial position (405b, 405d) of an extreme point of the parametric function, the extreme point of the parametric function being of a type which is a maximum, a minimum, or a saddle point, d) checking (S08a, S08b) whether the extreme point of the parametric function is of the same or a different type than the extreme point in the image, and whether the position (405b, 405d) of the extreme point of the parametric function is located inside or outside of an area defined by pixel positions of the group of neighboring pixels in the image, and if the extreme point of the parametric function is of a different type than the extreme point in the image or the position (405b, 405d) of the extreme point of the parametric function is located outside said area: removing (S08c) a pixel from the group of neighboring pixels, and repeating steps b), c) and d) if the number of pixels in the group of neighboring pixels is still larger than, or equal to, the number of parameters defining the parametric function, e) estimating the sub-pixel position of the extreme point in the image as the spatial position of the extreme point of the parametric function, and f) associating the estimated sub-pixel position with a level of uncertainty corresponding to a number of iterations of steps b), c) and d). a) selecting a group of neighboring pixels in the image, wherein a number of pixels in the group of neighboring pixels is larger than a number of parameters defining the parametric function, b) fitting the parametric function to pixel values of the group of neighboring pixels, wherein the parametric function approximates the pixel values of the group of neighboring pixels as a function of spatial position, c) identifying a spatial position (405b, 405d) of an extreme point of the parametric function, the extreme point of the parametric function being of a type which is a maximum, a minimum, or a saddle point, d) checking (S08a, S08b) whether the extreme point of the parametric function is of the same or a different type than the extreme point in the image, and whether the position (405b, 405d) of the extreme point of the parametric function is located inside or outside of an area defined by pixel positions of the group of neighboring pixels in the image, and if the extreme point of the parametric function is of a different type than the extreme point in the image or the position (405b, 405d) of the extreme point of the parametric function is located outside said area: removing (S08c) a pixel from the group of neighboring pixels, and repeating steps b), c) and d) if the number of pixels in the group of neighboring pixels is still larger than, or equal to, the number of parameters defining the parametric function, removing (S08c) a pixel from the group of neighboring pixels, and repeating steps b), c) and d) if the number of pixels in the group of neighboring pixels is still larger than, or equal to, the number of parameters defining the parametric function, e) estimating the sub-pixel position of the extreme point in the image as the spatial position of the extreme point of the parametric function, and f) associating the estimated sub-pixel position with a level of uncertainty corresponding to a number of iterations of steps b), c) and d).