Method, implemented on a device, for detecting an object in an image of pixels, each pixel being represented by a pixel value, characterised in that it comprises: - obtaining a position of a mask in said image, said mask covering at least one pixel of said image; - obtaining a predefined neighbourhood of pixels around said mask and dividing this neighbourhood into a plurality of zones; - calculating, for each possible pair of zones of said neighbourhood, a value representing a difference between said zones; - if at least one of the values representing a difference is above a first predetermined threshold, determining that a background of the mask is of the multimode type, and otherwise determining that said background is of the monomode type; - calculating (308, 309, 310) a variance σ B 2 using a first calculation formula when said background is of the monomode type and using a second calculation formula when said background is of the multimode type, said first calculation formula being as follows: σ B 2 = 1 N ∑ i = 1 N I B i − I B 2 + 1 N ∑ i = 1 N σ B i 2 where N is the number of zones of the neighbourhood, I B i is the mean of the values of the pixels of a zone of index i of the neighbourhood, I B is the mean of the values of the pixels of the neighbourhood, and σ B i 2 is the variance of the values of the pixels of the zone of index i of the neighbourhood, and said second calculation formula being as follows σ B 2 = 1 N ∑ i = 1 N σ B i 2 - calculating a signal to noise ratio for the position of the mask the noise of which is estimated by the variance σ B 2 calculated; - determining (312, 313) that an initial detection of an object has been made when said signal to noise ratio is above a second predetermined threshold; and - applying a labelling to each initial detection to attempt to form at least one grouping of initial detections called a plot from neighbouring initial detections according to a predefined criterion from said initial detections. - obtaining a position of a mask in said image, said mask covering at least one pixel of said image; - obtaining a predefined neighbourhood of pixels around said mask and dividing this neighbourhood into a plurality of zones; - calculating, for each possible pair of zones of said neighbourhood, a value representing a difference between said zones; - if at least one of the values representing a difference is above a first predetermined threshold, determining that a background of the mask is of the multimode type, and otherwise determining that said background is of the monomode type; - calculating (308, 309, 310) a variance σ B 2 using a first calculation formula when said background is of the monomode type and using a second calculation formula when said background is of the multimode type, said first calculation formula being as follows: σ B 2 = 1 N ∑ i = 1 N I B i − I B 2 + 1 N ∑ i = 1 N σ B i 2 where N is the number of zones of the neighbourhood, I B i is the mean of the values of the pixels of a zone of index i of the neighbourhood, I B is the mean of the values of the pixels of the neighbourhood, and σ B i 2 is the variance of the values of the pixels of the zone of index i of the neighbourhood, and said second calculation formula being as follows σ B 2 = 1 N ∑ i = 1 N σ B i 2 where N is the number of zones of the neighbourhood, I B i is the mean of the values of the pixels of a zone of index i of the neighbourhood, I B is the mean of the values of the pixels of the neighbourhood, and σ B i 2 is the variance of the values of the pixels of the zone of index i of the neighbourhood, and said second calculation formula being as follows σ B 2 = 1 N ∑ i = 1 N σ B i 2 - calculating a signal to noise ratio for the position of the mask the noise of which is estimated by the variance σ B 2 calculated; - determining (312, 313) that an initial detection of an object has been made when said signal to noise ratio is above a second predetermined threshold; and - applying a labelling to each initial detection to attempt to form at least one grouping of initial detections called a plot from neighbouring initial detections according to a predefined criterion from said initial detections.