TECHNICAL FIELD

The invention relates to a method for detecting an object in an image and a device implementing said method.

PRIOR ART

Methods using object detection are normally used for monitoring the environment, in particular in air and sea fields. These methods consist in entering at least one optronic image of the environment and, in each image, seeking indicators of a presence of a potential object.

Known methods for detecting an object in an image consist in calculating local signal to noise (SNR) values and then comparing each local SNR value with a predefined detection threshold. An object is considered to be detected when a local SNR value is above the detection threshold.

FIG. 1illustrates an implementation of such a method on the image1consisting of a grid of pixels. The image1comprises two objects O1and O2. To detect whether at least one object is present in the image1, the image is travelled over by a mask A. A mask is a set of pixels contained in a subpart of predefined form of the image being analysed. The set of pixels of the mask comprises one or a plurality of pixels. For each possible position of the mask in the image1, a mean value IAof the values of the pixels included in the mask A (for example a value of a pixel is a grey-level value of said pixel), a mean value IBand a value of variance σB2of the values of the pixels in a neighbourhood B around the mask A are calculated. When the mask comprises a plurality of pixels, for reasons of calculation load, the mean IAmay just as well be replaced by the value of a centre pixel of the mask A. A predefined neighbourhood of a mask is a set of pixels contained in a subpart of the image being analysed of predefined form located in proximity to said mask. From these three values, for each possible position of the mask, an SNR value is calculated as follows:

SNR=(IA-IB)σB

Here typically positive-contrast object detection is spoken of, i.e. it is necessary for the value of IAto be higher than that of IBfor a detection test to be able to be applied. An SNR value may also be calculated as follows:

SNR=IA-IBσB

Here typically positive or negative contrast object detection is spoken of, i.e. the sign of the difference between the mean value IAand the mean value IBis of little importance.

The SNR value obtained is next compared with the detection threshold in order to determine the presence or not of an object. When the SNR value exceeds the detection threshold, a detection, referred to as initial detection, is declared. When the mask comprises a single pixel, the pixel constitutes the initial detection. When the mask comprises a plurality of pixels, the centre pixel of the mask constitutes the initial detection. Labelling is next performed in order to attempt to group together initial detections. One objective of the labelling is to group together initial detections corresponding to the same object. The grouping is performed in accordance with position proximity criteria (typically implemented with a connectiveness of “4” or “8”). A grouping of initial detections constitutes a detection also referred to as a plot.

Furthermore, it is known that an object may move in a variable environment. A known problem occurs when, on a given image, the object is located on a textured background, such as a multimode background comprising at least two different textures.

FIGS. 2A, 2B and 2Cshow an image acquired by an optronic device such as a camera (not shown) wherein an aircraft1is moving in an environment comprising a cloud2. During its movement in this environment, the aircraft1passes successively from a cloudless zone to a cloudy zone, and then returns to a cloudless zone. The aircraft1is potentially an object able to be detected by an object-detection method.

In the images shown byFIGS. 2A and 2B, the pixels corresponding to the aircraft1have characteristics (brightness values, grey-level values, SNR values, etc.) very different from the pixels in the vicinity of the aircraft1. It is considered here, to simplify, that the cloud is an almost uniform zone. An object corresponding to the aircraft1is then detected without difficulty in these images, for example by the method using the mask A described above. This is because, in this case, when the mask A is positioned in the aircraft1, the SNR value obtained is above the detection threshold.

FIG. 2Cdescribes a less favourable situation. In the image corresponding toFIG. 2C, the aircraft1is situated partly on a background corresponding to the cloud2and partly on a background corresponding to the sky. In this case, when the mask A is positioned on the aircraft1, the value of the variance σB2is high, which has the effect of decreasing the SNR value obtained. The SNR value may then pass below the detection threshold.FIG. 2Ctherefore represents a typical case of non-detection of an object when the object is located on a multimode background.

It is desirable to overcome these drawbacks of the prior art. It is in particular desirable to propose a method that makes it possible to detect an object, whether the object be located on a monomode background or on a multimode background. It is moreover desirable to propose a method that is simple to implement and which has a low calculation cost.

DISCLOSURE OF THE INVENTION

According to a first aspect of the present invention, the present invention relates to a method for detecting an object in an image of pixels, each pixel being represented by a pixel value, comprising: 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 a variance σB2using 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; calculating a signal to noise ratio for the position of the mask the noise of which is estimated by the variance σB2calculated; determining 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 initial detection grouping called a plot from neighbouring initial detections in accordance with a predefined criterion among said detections.

According to one embodiment, when the background of the mask is of the monomode type, the formula for calculating the variance σB2takes into account, for each zone, a difference between the mean of the values of the pixels of said zone and a mean of the values of the pixels of said neighbourhood, and takes into account the variance of the values of the pixels of each zone of the neighbourhood, and, when the background of the mask is of the multimode type, the formula for calculating the variance σB2takes into account only the variance of the values of the pixels of each zone of the neighbourhood.

According to a particular embodiment, the first calculation formula is as follows:

σB2=1N⁢(∑i=1N⁢(IBi-IB)2)+1N⁢∑i=1N⁢σBi2⁢

where N is the number of zones of the neighbourhood, IBiis the mean of the values of the pixels of a zone of index i of the neighbourhood, IBis the mean of the values of the pixels of the neighbourhood, and (σB2) is the variance of the values of the pixels of the zone of index i of the neighbourhood, and

the second calculation formula is as follows:

σB2=1N⁢∑i=1N⁢σBi2⁢

According to one embodiment, a value representing a difference between two zones is a value of a difference between each of the zones in accordance with a χ2law:

δij=(IBi-IBj)2((σBi)2+(σBj)2)

where δijis a difference value between a zone of index i and a zone of index j, IBiis a mean value of the values of the pixels of the zone of index i, IBjis a mean value of the values of the pixels of the zone of index j, (σBi)2is a variance of the values of the pixels of the zone of index i and (σBj)2is a variance of the values of the pixels of the zone of index j.

According to a second aspect of the invention, the invention relates to a device for detecting an object in an image of pixels, each pixel being represented by a pixel value, comprising: obtaining means for obtaining a position of a mask in said image, said mask covering at least one pixel of said image; obtaining means for obtaining a predefined neighbourhood of pixels around said mask and for dividing this neighbourhood into a plurality of zones; calculation means for calculating, for each zone, a mean and a variance of the values of the pixels of said zone; calculation means for calculating, for each possible pair of zones of said neighbourhood, a value representing a difference between said zones; determination means for determining, if at least one of the values representing a difference is above a first predetermined threshold, that a background of the mask is of the multimode type, and otherwise for determining that the background of the mask is of the monomode type; calculation means for calculating a variance σB2using 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 the following:

σB2=1N⁢(∑i=1N⁢(IBi-IB)2)+1N⁢∑i=1N⁢σBi2⁢

where N is the number of zones of the neighbourhood, IBiis the mean of the values of the pixels of a zone of index i of the neighbourhood, IBis the mean of the values of the pixels of the neighbourhood, and (σBi)2is the variance of the values of the pixels of the zone of index i of the neighbourhood, and

said second calculation formula is as follows:

σB2=1N⁢∑i=1N;

calculation means for calculating a signal to noise ratio for the position of the mask the noise of which is estimated by the calculated variance σB2; detection means for determining that an initial detection of an object has been made when said signal to noise ratio is above a second predetermined threshold; and labelling means for 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 among said initial detections.

According to a third aspect of the invention, the invention relates to a computer program comprising instructions for implementing, by a device, the method according to the first aspect, when said program is executed by a processor of said device.

According to a fourth aspect, the invention relates to storage means storing a computer program comprising instructions for executing, by a device, the method according to the first aspect, when said program is executed by a processor of said device.

