Method and a device for determining the number of people present in a determined space by processing the grey levels of points in an image
The invention relates to a method and to a device for determining the number of people present in a determined space, and it is equally applicable to performing television audience surveys and to performing automatic suveillance of premises. 
     Apparatuses already exist for performing television audience surveys, these apparatuses are associated with respective television sets and they are capable of recording the times at which the television set is switched on and off, together with the channel that is selected, thereby making it possible, in combination with the times given by a time base, to accurately determine which programs are selected. A central computer uses the telephone network to interrogate apparatuses of this nature associated with television sets and thus to automatically determine audience ratings and hence the success of various broadcasts put out by different television channels. However, these prior apparatuses do not provide information concerning the number of people watching a program on a television set, indeed they do not even specify whether there is anybody actually watching a television set which happens to be switched on. 
     Devices are also known, in general for use in premises surveillance for security purposes, which make use of ultrasonic or Doppler effect detectors and which provide information on the presence or absence or people in a determined premises. Nevertheless, these prior devices do not specify how many people are present. To obtain the number of people present it is necessary to use means for counting people passing through the entrance and through the exit of a room. However, this requires the entrance to a room to be separated from its exit, and it also requires counting to be initialized. Further, such means would not be suitable for performing automatic television audience surveys since merely verifying the presence of a person in a room where a television set is present does not ensure that the person is actually watching a broadcast. 
     A particular object of the present invention is to mitigate these drawbacks of known devices. 
     The present invention provides a method and a device for determining the number of people present in a room, and in particular the number of people watching a broadcast on a television set. 
     To this end, the present invention provides a method of determining the number of people present in a determined space, the method being characterized in that it consists in forming an image of said space on a strip or set of photodetectors, in reading the gray levels of the points in said image at a determined read frequency, in comparing the gray levels of the same points in successive images, in determining the variations in gray levels which are caused by the movements of a person, and in deducing the number of people present in said space therefrom. 
     The method of the invention thus makes it possible not only to know the number of people present in a determined space at a given moment, but also to know the variations in this number and the departures and returns of the people present. The space in question may be a premises under surveillance, or that portion of a room which faces a television set and within which people may indeed be looking at the television. 
     In accordance with another characteristic of the invention, the method further consists in varying the frequency at which the photodetectors are read as a function of the intensity with which the determined space is illuminated in order to obtain a mean image gray level which is substantially independent of lighting conditions. 
     This avoids the photodetectors saturating, and comparison between images is facilitated. 
     The method of the invention also consists in recording the above-specified images at a frequency which is a submultiple of the read frequency, in comparing pairs of successive images which are separated from each other by a determined number of recorded images, and in determining the variations in gray levels by taking the difference between these images. 
     The method also consists in varying the frequency at which images are recorded and/or the number of images separating two compared images as a function of the speed of displacement of a person. 
     The method thus adapts automatically to the movements of people within a room or a premises. 
     Finally, the method also consists in mutually comparing a variable number of successive results in order to eliminate erroneous results due, for example, to a local variation in illumination or to the temporary superposition of the images of two people. 
     The invention also provides a device for determining the number of people present in a determined space, characterized in that it comprises an objective lens forming an image of said space on a strip or set of photodetectors, circuits for controlling and reading the photodetectors, an analog-to-digital converter, and information processing means, such as a microprocessor, for comparing the signals successively provided by the photodetector in order to determine significant differences in said signals due to a person moving, and for deducing the number of persons present in the field of observation of the lens therefrom. 
     In a preferred embodiment of the invention, this device also comprises means for determining the frequency with which the photodetectors are read as a function of the intensity of illumination in said space, means for recording the signals as read and digitized, said recording taking place at a frequency which is a submultiple of the photodetector read frequency, means for comparing pairs of successively recorded signals which are separated from each other by a determined number of recorded signals and for taking the difference between the compared signals, means for transforming the differences between the compared signals into bimary signals, and filter circuits for eliminating non-significant differences. 
     Such a device may be associated with a television set in order to perform automatic audience surveys, or else it may be associated with a system for keeping premises under surveillance. 
    
    
     The invention will be better understood, and other details, chracteristics, and advantages thereof will appear on reading the following explanatory description which is made by way of example and with reference to the accompanying drawings, in which: 
     FIG. 1 is a diagram of a device in accordance with the invention; 
     FIG. 2 is a diagram showing a method of processing the signals from the photodetector; and 
     FIG. 3 is a diagram showing the timing of essential stages in the method of the invention. 
    
    
     Reference is made initially to FIG. 1 which shows the essential components of a device in accordance with the invention. 
     The device comprises an objective lens 10, such as the lens of a still camera or a video camera, said lens having a field of observation in which objects or persons 12 may be present. 
     The lens 10 is associated with a strip or row 14 of elementary photodetectors 16 such as charge-transfer photodetectors, and there may be 512 or 1,024 of them. The lens 10 forms an image of a plane in the space lying in its field of observation on the strip 14 of photodetectors 16, said plane corresponding to the plane of the drawing of FIG. 1. 
     The photodetectors 16 of the strip 14 are associated with circuits given an overall reference 18, including circuits for reading the charges on the photodetectors 16 and at least one clock for determining the integration period or the frequency at which the photodetectors 16 are read. The read circuits are connected via an analog-to-digital converter 20 to a microprocessor 22 which processes the output signals from the photodetectors 16 and which controls the circuits 18. The microprocessor 22 may be interrogated , for example over the telephone network 24 by a remotely situated computer or else by a central unit 26. 
     When the invention is applied to performing automatic audience surveys, the device of the invention is associated with a television set and is arranged to form an image on the strip 14 of photodetectors corresponding to a substantially horizontal flat zone situated at about 1 meter (m) above the ground, which height corresponds to the upper portion of the body of a person sitting in front of a television set. 
     When the invention is applied to performing the surveillance of premises, the device may include a matrix of photodetectors, thereby avoiding limiting its scan to a single dimension. 
     The main stages of the method of the invention, and the operation of the device, are now described with reference to FIGS. 2 and 3. 
     Curves a and b in FIG. 2 represent the video signals obtained by reading the elementary photodetectors 16 of the strip 14 at two instants which are separated by a predetermined time interval. 
     Each of the curves a and b represents the gray levels which are observed by the various photodetectors. 
     When the scene under observation does not change between two observation instants, and providing the illumination thereof has not changed either, then the curves a and b are identical. However, when a person forming a part of the scene under observation moves, even by very little, that movement gives rise to a variation in the gray levels seen by the corresponding photodetectors. Detecting variations in the gray levels seen by the photodetectors thus serves to show that a person has moved, and as a result makes it possible to recognize the presence of a person and to distinguish that person from other people forming a part of the same scene under observation. As a corollary, it is possible to determine the number of people present in the scene. It is not possible, in practice, for a person to remain completely stationary, without even breathing, for more than a few seconds. 
     The processing of the video signals provided by the strip 14 of photodetectors is essentially as follows: two successive signals such as those represented by curves a and b are compared, and they are subtracted from each other in order to obtain the signal shown by curve c. This signal is amplified (curve d), and is then rectified and converted into binary signals by comparison with a given threshold, which is set to eliminate the residual noise of the photodetectors 16. The gain of the amplification is adjusted as a function of the illumination observed during the preceding reads, and for each point under consideration, the threshold is a function of the illumination of said point. The resulting signal, shown in curve e, comprises a first squarewave pulse or echo 28 of relatively large width and a second squarewave pulse or echo 30 of much smaller width. This signal is then applied to a filter which retains only the first echo 28 (curve f) which corresponds to a person, while eliminating the second echo 30 whose width is much to small to correspond to a person, and which may be due, for example, to a local change in illumination (e.g. a lamp being switched on or off) or to the movement of a hand or an object held by a person. 
     In greater detail, the timing of the various operations of the method of the invention may be as follows (FIG. 3): 
     The photodetectors in the strip 14 are read at a frequency which is determined by the microprocessor 22 as a function of the intensity with which the observed scene is illuminated so as to avoid saturating the photodetectors and so as to ensure that the mean gray levels seen by the photodetectors remain substantially constant and independent of lighting conditions. In practice, the rate at which the photodetectors are read may vary over the range one to ten (or even more) reads per second. The series of reads applied to the photodetectors for a given 5 second (s) to 6 s period of time is represented by portion A of FIG. 3, from which it can be seen that reading takes place at a frequency of about four reads per second. 
     The signals read by the circuit 18 and digitized by the converter 20 are recorded by the microprocessor 22 at a frequency which is no greater than the read frequency and which is more often a submultiple of said read frequency. Portion B of FIG. 3 shows the stage of recording the digitized signals, and it can be seen in this example that a signal is recorded every half-second, which is equivalent to saying that only every other digitized signal is recorded. 
     The next stage consists in comparing pairs of successive recorded signls which are separated from each other by a predetermined time interval or by a predetermined number of recorded signals, and in taking the difference between the pair of signals being compared. This stage is represented by portion C of FIG. 3 for the case where the recorded signals being compared are separated from each other by an interval of 3 seconds. In other words, the first signal recorded at instant zero is compared 3 seconds later with the signal which has just been recorded, and the difference between them is processed as described with reference to FIG. 2 (they are amplified, rectified, transformed into binary signals, and then filtered) in order to obtain a result signal which is recorded at instant t=3 s (portion C of FIG. 3). The signal recorded at time t=0.5 s is compared with the signal recorded at time t=3.5 s, and so on. 
     The next stage consists in mutually comparing a variable number of results in order to eiminate spurious results which may be due to a person passing quickly in front of the television set, to the temporary superposition of the images of two people, etc. . . . . This stage is represented by portion D of FIG. 3 for the case where three successive results are mutually compared. The result of this comparison is recorded at instant t=4 s. 
     It follows from the timing of these various stages, that the final result is obtained 4 s after the first event to be recorded. This delay is known since it is determined by the frequency at which the photodetectors are read, the frequency at which the read and digitized signals are recorded, the selected time interval between the pairs of signals which are compared, and the number of successive results which are mutually compared, and it can therefore be taken into account by the microprocessor which specifies the exact instant corresponding to each result. 
     The microprocessor also serves to adjust the frequency at which the digitized signals are recorded at the time interval between two compared signals as a function of the detected speed of displacement of a person in the scene being observed. Naturally, when people are sitting down in front of a television set, their movements are generally relatively slow, and the time interval between two recorded signals that are to be compared should be at least 2 s to 3 s in order to ensure that the difference between the two compared signals is not substantially zero, i.e. so as to make it possible to determine the number of people present. However, when people are moving rapidly in a premises, this time interval between compared signals should be smaller and the frequency at which signals are recorded may be increased. 
     The method of the invention is performed by the microcomputer under the control of software comprising a set of programs whose main functions are as follows: 
     acquire the signals provided by the photodetectors of the strip; 
     compare these signals in pairs in order to determine a difference at each point, compare the difference with a threshold as a function of the energy level from the photodetector under consideration (e.g. compare a given signal with the signal that preceded it by 0.1 s, by 1 s, by 2 s, by 3 s, and by 4 s), and obtain result signals; 
     compare successive result signals with each other to verify continuity and to determine an overall result over a given period, e.g. over 1 second; 
     compare the results obtained in this way over various periods, e.g. 3 s, 5 s, 10 s, or 15 s or more, said periods varying as a function of the results obtained (probabilities of the corresponding data), and make conclusions about the movements of people entering and leaving the field of observation of the strip of photodetectors and about the number of people present; and 
     present and display the results. 
     Appendices A, B, and C are the main parts of the programs and correspond respectively acquiring the signals, to determining the amplification gain, and to displaying the results (with the other programs being essentially constituted by signal comparisons which can easily be written by the person skilled in the art). ##SPC1##