Patent Description:
Modern vehicles are frequently equipped with various electronic systems intended to assist a driver in the driving of a vehicle. Such driver assistance systems often include environment sensors such as image, radar and lidar sensors which are operable to collect information about an external environment of the vehicle. The environment sensors may be mounted on the vehicle itself or located remotely with sensor data being transmitted to the vehicle wirelessly. Data collected by the sensors is then analysed by one or more processors and used to provide various driving assistance functions which may range from providing driver notifications/warning, semi to fully autonomous manoeuvring of the vehicle.

In some instances, driver assistance systems may be used to detect for the presence of approaching emergency vehicles (EV) such as ambulances, fire engines and police cars so that a driver or autonomous driving modules of the vehicle may take appropriate action such as yielding to the vehicle. The detection of emergency vehicles may be achieved by analysing images of the vehicle environment taken by an image sensor alone or in combination with other sensor data. Accordingly, there is a demand for image-based methods and device for detecting the presence of emergency vehicles which are efficient that that appropriate actions may be promptly taken.

Relevant prior art document <CIT> (<NUM>-<NUM>-<NUM>) discloses a method and a device for detecting emergency vehicles, where polar histograms of identified bright regions in a plurality of images are compared to determine changes in color and intensity associated with content of a particular polar bin.

Aspects of this disclosure provide methods and device for detecting the presence of emergency vehicles from a plurality of image frames taken by an image sensor over a period of time.

One aspect of this disclosure provides a method for detecting the presence of emergency vehicles comprising receiving a plurality of image frames taken by an image sensor over a period of time. By way of example, the image sensor may be mounted externally on a vehicle and configured to capture images of an external environment of the vehicle. The image sensor may be a mono-camera or a wide angle fisheye camera. In some implementations, the image sensor may be mounted on the rear of a vehicle and configured to continuously capture images in a rearward direction of the vehicle. A computing processor may be configured to analyse image frames taken by the image sensor so as to determine if there are any emergency vehicles in the rearward direction of the vehicle. In other implementations, the image sensor may also be mounted on an infrastructure such as a lamp-post and image frames captured sent to a processor for processing. The analysis of the image frames comprises determining an emergency vehicle (EV) colour component for a plurality of pixels in each image frame based on the ratio of a first colour relative to the total colour in each pixel and assigning to a pixel a first value if the EV colour component exceeds a predefined threshold value and a second value if the EV colour component does not. The first colour corresponds to the colour of flashing light sources belonging to one or more types emergency vehicles of interest. For example, the first colour may be blue, yellow or any other colour associated with an emergency vehicle. The EV colour component measures the content of the first colour in each pixel relative to the total colour in each pixel. In some implementations, the first value or second value assigned to a pixel may be <NUM> and <NUM> respectively The method may also further comprise removing spurious spikes using a median filter after determining the EV colour component for the plurality of pixels in each of the plurality of image frames and before determining the EV colour value. Other values may also be suitable so long as the first and second values are different. Preferably, the EV colour component is computed for all the pixels in an image frame. An EV colour value for each of the plurality of image frames is then determined based on the sum of all the first values for each image frame. The EV colour value gives an indication of the colour intensity for a chosen first colour being analysed in a given frame. A time domain representation based on the EV colour values associated with the image frames is generated followed by a conversion of the time domain representation for the plurality of image frames to a frequency spectrum. The frequency spectrum may be, for example, be represented as a variation in power spectral density (PSD) versus frequency or a normalized frequency spectrum which shows the relative contribution of a frequency component with respect to all the frequency components in a signal may also be generated instead. The frequency spectrum is analysed to determine if there are any flashing light sources of the first colour associated with one or more types of emergency vehicles present in the plurality of image frames.

Implementations of this disclosure according to the above method may bring about several advantages. Firstly, the method does not require complex computational processes which accordingly reduces computational demands and processing time. For instance, methods for detecting flashing light sources of emergency vehicle according to implementations of this disclosure do not require identification of specific light sources within an image frame. Such identification imposes additional processing demands compared to the current method as image frames have to be analysed and light sources specifically identified based on templates of known flashing light sources belonging to emergency vehicles stored in a database. The templates may include information such as colour and spatial configuration of known emergency vehicle light sources. Implementations of this disclosure also do not require the flashing rate of each specifically identified potential light source to be individually checked for correspondence with the flashing rate of known emergency vehicles stored in the database. Instead, the EV colour value of each of a plurality of image frames taken by an image sensor over a period of time is computed and a frequency spectrum derived therefrom is used to identify if there are any light sources of a first colour with a flashing rate associated with one or more types of emergency vehicles. Further, implementations of this disclosure are not only capable of detecting emergency vehicles based on light sources which are directly visible to an image sensor but also based on reflections of such light sources off different surfaces such as road and glass surfaces and vehicle body. This is because implementations of this disclosure do not require specific matching of light sources detected in images with those of known emergency vehicles. The latter scenario is useful when an emergency vehicle light source is occluded.

In some implementations, generating the time domain representation of the plurality of image frames may further comprise removing any direct current (d. ) bias in the EV colour values. This may be achieved by by calculating the average EV colour value for all the image frames and deducting it from the individual EV colour values of each frame. As for converting the time domain representation to a frequency spectrum, algorithms such as Fourier transform and wavelet transform may be used. In a preferred implementation, fast Fourier transform is used to convert the time domain representation to the frequency spectrum. Fast Fourier transform is generally faster compared to discrete Fourier transformation and gives the same results. Relatively fewer data points are also required to obtain a smooth frequency response. The conversion process may also be configured to render a one frequency sided spectrum. Since this disclosure only requires the absolute value of signals in the frequency spectrum to detect flashing light sources, one-sided spectrums advantageously eliminate redundant computations associated with two sided spectrums because both sides of the spectrum have the same requisite information. Additionally, the elimination of redundant computations also allows more relevant sampling points to be processed without incurring additional computational resources. By way of example, the conversion to a one-sided frequency spectrum may be carried out using the known pwelch function in the MATLAB™ software.

In another exemplary implementation, analysing the frequency spectrum may comprise determining if frequency components present in the frequency spectrum matches frequency components of known first colour light sources belonging to one or more types of emergency vehicles. In one variation, a frequency component may be considered as present if it has an amplitude greater than or equal toa predefined minimum amplitude. By way of example, the frequency components present in the frequency spectrum are considered as matching frequency components of a known first colour light source associated with one or more types of emergency vehicles if at least the fundamental frequency and one or more other harmonics match. The one or more harmonics chosen as being representative of a first colour light source depends various factors such as image sensor quality, frame rate of incoming image frames being processed, or a combination thereof. In an optional implementation, the method may further comprise causing one or more actions to be executed based at least in part upon determining that at least one light source associated with a particular type of emergency vehicle is present. By way of example, the one or more actions may include determining a location of one or more emergency vehicles detected to be present.

Implementations of this disclosure may also be in the form of a non-transitory computer-readable storage medium comprising computer-readable instructions for carrying out the aforementioned methods.

Another aspect of the disclosure provides a device for detecting the presence of emergency vehicles comprising a processor and at least one memory coupled to the processor. The at least one memory stores instructions executable by the processor causing the processor to receive a plurality of image frames taken by an image sensor over a period of time, determine an EV colour component for a plurality of pixels in each image frame based on the ratio of a first colour relative to the total colour in each pixel and assign to a pixel a first value if the EV colour component exceeds a predefined threshold value and a second value if the EV colour component does not. The processor is further caused to generate a time domain representation based on the EV colour values associated with the plurality of image frames, convert the time domain representation for the plurality of image frames to a frequency spectrum and determine if any flashing light sources of the first colour associated with one or more types of emergency vehicles is present by analysing the frequency spectrum. A vehicle comprising a device in accordance with this disclosure may also be implemented. In some implementations, the first value may be <NUM> and the second value <NUM>.

In some variations, analysis of the frequency spectrum by the processor comprises determining if frequency components present in the frequency spectrum matches frequency components of known first colour light sources associated with one or more types of emergency vehicles. For instance, the frequency components present in the frequency spectrum may be considered as matching frequency components of a known first colour light source associated with one or more types of emergency vehicles if at least the fundamental frequency and one or more harmonics match.

The at least one memory may also further cause to processor to cause one or more actions to be executed at least in part upon determining that at least one light source associated with a particular type of emergency vehicle is present. By way of example, the one or more actions may include issuing a notification to a driver of the vehicle that there is an emergency vehicle in the vicinity and/or instructing a telematics module to send signals to other vehicles alerting them about the presence of the emergency vehicle.

In the following detailed description, reference is made to the accompanying figures. In the figures, similar symbols typically identify similar components, unless context dictates otherwise.

<FIG> is a functional block diagram of an exemplary system <NUM> associated with a vehicle comprising an environment module <NUM>, a machine vision module <NUM>, an autonomous driving module <NUM>, a user interface <NUM> and a telematics module <NUM> according to one implementation of this disclosure. The environment module <NUM> comprises environment sensors operative to sense and collect information about an external environment of the vehicle. In the <FIG> implementation, the environment module comprises an image sensor module <NUM> including two image sensors (<NUM> and <NUM>) mounted externally at different parts of the vehicle. The image sensors being operable to capture images of an external environment of the vehicle. The image sensors may continuously capture images of the external environment so long as the vehicle ignition is switched on or capture images on demand basis. <FIG> shows an exemplary implementation where the two image sensors (<NUM>, <NUM>) are mounted at the front and rear of the vehicle <NUM> respectively. The image sensors (<NUM>, <NUM>) may, for example, be vision image sensors such as mono cameras or wide angle fisheye cameras mounted at the front and rear bumpers of the vehicle. The respective field of view associated with the front and rear facing image sensors (<NUM>, <NUM>) are denoted by the reference numerals 114a and 116a respectively. It will be appreciated by a person skilled in the art that other types and numbers of image sensors may also be used in the image sensor module <NUM>. The environment module <NUM> may also include other types of environment sensors such as a radar sensor module (<NUM>), lidar, ultrasonic sensors (not shown).

The machine vision module <NUM> is in communication with the environment module <NUM> and is configured to perform an automated method for detecting the presence of emergency vehicles by processing and analysing a plurality of image frames taken by one or more image sensors in the image sensor module <NUM> over a period of time. For instance, the image sensor module <NUM> may continuously send image frames captured by the image sensors to the machine vision module for detection of emergency vehicles or only send images on an as-demanded basis. The machine vision module <NUM> comprises a computing processor <NUM> and a hardware memory <NUM> in communication with the processor <NUM>. The computing processor <NUM> may, for example, be a microcontroller or graphics processing units (GPU) capable of accessing the memory <NUM> to store information and execute instructions stored therein. Alternatively, the processor <NUM> and memory <NUM> may also be integrated on a single integrated circuit. The memory <NUM> stores information accessible by the processor <NUM> such as instructions executable by the processor <NUM> and data which may be stored, retrieved or otherwise used by the processor <NUM>. For example, the processor <NUM> may execute a method for detecting the presence of emergency vehicles according to some implementations of this disclosure based on instructions stored in the memory <NUM>. Such method includes determining an EV colour component for a plurality of pixels in each image frame of a plurality of image frames taken by an image sensor over a period of time. Preferably, the EV colour component is computed for all the pixels in each of the plurality of image frames. The EV colour component refers to the proportion of a first colour associated with one or more types of emergency vehicles in a pixel relative to the total colour component in the pixel. Examples of emergency vehicles include police cars, ambulances and fire trucks. By way of example, the first colour may be blue and it may be associated with ambulances and police cars. A pixel is assigned a first value if the EV colour component for that pixel exceeds a predefined threshold value and a second value if the EV colour component does not. The first value may for example, be <NUM> and the second value <NUM>. Other values may also be suitable so long as the first and second values are different. In some implementations, data stored in the memory <NUM> may include EV colour component predefined threshold value (s) for one or more types of emergency vehicles. An EV colour value associated with the first colour is then calculated for each image frame based on the sum of all the first values for that frame. The memory <NUM> may be used as a temporary buffer for storing EV colour component and EV colour values. A time domain representation of EV colour value versus time is then generated for the plurality of image frames by plotting the EV colour value of each image frame against the time when the image frame was captured. The processor then determines if any light sources with the first colour and flashing at a rate matching those of an emergency vehicle is present in the plurality of image frames by converting the time representation to a frequency spectrum. The frequency spectrum is then compared with known frequency spectrums of emergency vehicles having emergency lights of the first colour to see if there is a match. In one implementation, a comparison is made between the frequency components in the frequency spectrum and known frequency spectrums of emergency vehicles. The frequency components being compared may include at least the fundamental frequency and one or more harmonics. The frequency spectrum signatures of emergency vehicles may be stored in memory <NUM> and retrieved therefrom by the processor <NUM> for comparison.

Although <FIG> functionally illustrates the processor <NUM> and memory <NUM> as being located within the same block, it will be appreciated by an ordinary person skilled in the art that the processor and memory may actually comprise multiple processors and/or memories located in different housing. Accordingly, references to a processor or memory will be understood to include references to a collection of processors and/or memories that operate to perform the functions of the machine vision module described in this disclosure. Further, it will be appreciated by a person skilled in the art that the machine vision module may exist independently of other modules or components. Alternatively, it may also be a shared element or process of other modules, programs or hardware. Although the implementations illustrated in <FIG> and <FIG> shows the machine vision module and image sensors as being associated with a vehicle, this is not intended to be limiting. For example, the present disclosure may be used to detect emergency vehicles based on image frames captured by one or more image sensors mounted on a building or lamp post and the processor may be configured to alert vehicles in the proximity of the image sensor about the presence of an emergency vehicle when one is detected.

The system <NUM> also comprises an autonomous driving module <NUM>, a user interface <NUM> and a telematics module <NUM> in communication with the machine vision module <NUM>. By way of example, the machine vision module <NUM> may be communicatively coupled to the other modules via a controller area network (CAN) bus. The autonomous driving module <NUM> is responsible for controlling the vehicle's semi-autonomous and autonomous driving functions such as adaptive cruise control (ACC), active lane assist, highly automated driving (HAD) and park assist. It typically comprises a supervisory electronic control unit (ECU) which plans, co-ordinates and executes the various semi-autonomous and autonomous driving functions by receiving data/instructions from various vehicle modules, analysing them and sending instructions to for example, a powertrain, steering and braking module in order to effect the desired vehicle manoeuvre. As for the user interface <NUM> associated with the vehicle, it may be used for communicating audio and visual messages to a driver of the vehicle. In one variation, the user interface <NUM> may comprise components such as an instrument panel, an electronic display and an audio system. The instrument panel may be a dashboard or a centre display which displays for example, a speedometer, tachometer and warning light indicators. The user interface may also comprise an electronic display such as an infotainment or heads-up display for communicating other visual messages to the driver and an audio system for playing audio messages, warning or music. As for the telematics module <NUM> it is operable to carry out communications between the ego vehicle and other vehicles, that is, vehicle-to-vehicle (V2V) communications. The telematics module <NUM> may also be operable to allow for vehicle-to-infrastructure (V2I) communication. In some implementations of this disclosure, the processor <NUM> in the machine vision module <NUM> may also cause one or more actions to be executed at least partially in response to detecting that one or more light sources associated with one or more types of emergency vehicles is present. These actions may include causing a notification to be issued to the driver that there is an emergency vehicle in his proximity and he should take appropriate action to give way to the emergency vehicle. The notification may be displayed and/or aurally communicated to the driver via the HUD <NUM> and/or audio system <NUM> in the user interface <NUM>. The processor <NUM> may also send a signal to the autonomous driving module <NUM> instructing it to take over control of the vehicle and manoeuvre the vehicle such that it yields to the emergency vehicle. In yet another variation, the one or more actions may also include sending signals to other vehicles in the proximity via the telematics module <NUM> so as to alert them about the presence of an emergency vehicle.

<FIG> is a flowchart illustrating an exemplary process <NUM> for detecting the presence of one or more types of emergency vehicle having a flashing light source of a first colour in accordance one implementation of this disclosure. The process <NUM> may be executed sequentially or in parallel with other implementations of this disclosure for detecting emergency vehicles having flashing light sources of other colours. For instance, some countries such as the US may use blue lights sources on ambulances and law enforcement vehicles such as police cars, and red light sources for fire engines. As such, two processes may be executed in contemporaneously or sequentially to detect for the presence of emergency vehicles with blue or red flashing lights. The operations of the process <NUM> will be described with reference to the system in <FIG>. However, it will be appreciated that other similar systems may also be suitable. The process starts at step <NUM> and may be initiated upon the ignition of a vehicle being switched on. Other events for initiating the start of the process <NUM> may also be suitable and the process may also be initiated on demand. In step <NUM>, starting of the process in block <NUM> causes the processor <NUM> in the machine vision module <NUM> to start receiving a first block of image frames comprising a plurality of image frames taken by an image sensor over a period of time, t. The image sensor may, for example, be an image sensor <NUM> mounted at the rear of the vehicle like in <FIG>. In this disclosure, the presence of emergency vehicles is detected by analysing image frames in blocks each comprising a plurality of image frames taken by an image sensor over a period of time, t.

In one implementation, each block of image frames comprises a total of <NUM> image frames taken by an image sensor over a period of <NUM> seconds at a rate of <NUM> image frames per second. The processor <NUM> processes the plurality of image frames in each block for example using the methods in steps <NUM>-<NUM> in <FIG> to determine if any light source(s) associated with one or more particular types of emergency vehicles is present in a block. A different number of image frames and duration over which the image frames are captured may also be suitable so long as the frame rate (number of frames per second) and timing is suitable for detecting flashing light sources associated with emergency vehicles of interest.

In block <NUM>, the processor <NUM> determines for each of the plurality of image frames received by the processor, the EV colour value for a first colour associated with one or more types of emergency vehicles. For purposes of illustration, we will assume that the method <NUM> is used to emergency vehicles having blue flashing lights. That is, the first colour is blue. However, it is to be appreciated that this disclosure can also be deployed for the detection of flashing light sources of other colours. An exemplary detailed illustration of the steps for determining the EV colour value for each of the plurality of image frames in a block is shown in <FIG>. At step <NUM>, the processor <NUM> determines for an image frame, the EV colour component for a pixel in the image frame and assigns to the pixel a first value if the EV colour component exceeds a predefined threshold value and a second value if it does not. Preferably, the first value is <NUM> and the second value is <NUM>. The same process is then repeated for a plurality of pixels in the image frame. The EV colour component is determined by calculating the ratio of the first colour in a pixel relative to the total colour in the pixel. For instance, if the image sensor is a photographic digital camera that uses a Bayer filter arrangement where the colours are described in terms of green, blue and red, and the total colour in an image frame is G1|B|G2|R, then the EV colour component for a pixel may be determined using the formula <MAT> where the first colour may be a primary colour such as blue, green or red, or a secondary colour composed of two or more primary colours. In implementations where the first colour is a secondary colour, the first colour is expressed in terms of the primary colour components. For instance, if the first colour is yellow, the first colour will be red + green. Therefore, if the method <NUM> is used to detect emergency vehicle lights which are blue in colour, then the formula for determining the EV colour component for each pixel will be <MAT>.

As for the setting of predefined threshold values which determine whether an EV colour component of first or second value should be assigned to a pixel, this will depend on factors such as the type of image sensor being used, sensitivity of the image sensor and image processing techniques applied to image frames. In some implementations, predefined threshold values may be selected empirically by observing the variation in detection distance and other detection performance related parameters against predefined threshold values. For instance, the inventors have found that for the detection of emergency vehicles with blue flashing lights, a predefined threshold value of <NUM> is preferred for better detection performance when images are taken from image sensors using Bayer filter arrangements while a value of <NUM> is better for images originating from image sensors which use demonsaicing algorithms. The values of <NUM> and <NUM> are not intended to be limiting and other predefined threshold values may also be suitable.

In one implementation, the EV colour component of all the pixels in each image frame is calculated and a first or second value is assigned to a pixel depending on whether the EV colour component exceeds a predefined threshold value. For instance, if an image frame comprises m x n number of pixels and the first and second values are <NUM> and <NUM> respectively, we will obtain a matrix of m x n in size which is populated with values of either <NUM> or <NUM>. In other implementations, the EV colour component may only be computed for a selection of pixels in an image frame. For example, the EV colour component may be calculated for every alternate pixel. Computing the EV colour component for only a selection of pixels in an image frame has the advantage of reducing computational processing time and demands. However, the number of pixels chosen in the selection should be sufficient to enable the detection of first colour flashing light sources belonging to emergency vehicles of interest.

In step <NUM>, the EV colour value for an image frame is determined by calculating the sum of all the first values in the image frame. The EV colour value gives an indication of the first colour content in an image frame. For instance, if the first colour is blue, the EV colour value gives an indication of the blueness measurement for that image frame. In some implementations, a median filter may be used to remove salt and pepper noise such as spurious spikes due to hard thresholding from an image frame after the EV colour component for all the pixels in an image frame have been computed but before the calculation of EV colour value. The process then goes on to decision step <NUM> which checks if the EV colour value for all the image frames in a block have been computed. If the answer is no, the process goes back to step <NUM> and retrieves another frame from the current block and repeats steps <NUM>-<NUM>. If the answer is yes, that is the number of image frames processed equals to the total number of image frames in the current block of image frames being processed then the method goes on to step <NUM>.

In step <NUM>, a time domain representation is generated based on the EV colour values associated with the plurality of image frames in the block. This is done by plotting the EV colour value for each image frame against the timing of the image frame in the block. In some implementations, the EV colour value for the plurality of image frames (e.g. <NUM> images frames) may be stored in a temporary buffer such as a circular buffer located in the memory <NUM> of the machine vision module. The EV colour values are then retrieved from the buffer and used to generate the time domain representation. In some implementations, the generation of a time domain representation may include process steps for removing any direct current (d. ) bias in the EV colour values. This may be accomplished by deducting the average EV colour value for all the image frames in a block from the individual EV colour values of each image frame. The time domain representation is then created based on the d. bias adjusted EV colour values. Graphs (a) of <FIG> are exemplary time domain representations illustrating the variation in d. bias adjusted EV colour value versus time. In both the <FIG> graphs, time is set to zero at the start of a block of image frames.

In step <NUM>, the processor converts the time domain representation generated in step <NUM> to a frequency spectrum. Unlike a time domain representation which looks at how a signal changes with time, a frequency spectrum shows how much of a signal (that is, in the present context the EV colour value associated with the plurality of image frames) lies within each given frequency band over a range of frequencies. As discussed earlier, EV colour value gives an indication of the first colour content in an image frame. Therefore, if there are blue light sources which are flashing at the same rate as emergency vehicles of interest, the blue EV colour value for the plurality of image frames in a block should flash at the same rate as the relevant emergency vehicles. That is, the frequency spectrum associated with the blue EV colour value should match that of flashing light sources found on emergency vehicles of interest. In some implementations, a Fourier transform may be used to convert the time domain representation into a frequency spectrum. However, other types of mathematical transforms which are suitable for converting a signal from a time to frequency domain such as wavelet transform may also be used. For frequency spectrums derived using Fourier transform, the frequency components are represented as sinusoidal waves with its own amplitude and phase. In one implementation, a <NUM>-point fast Fourier transform (FFT) may be used to convert the time domain representation to a frequency spectrum. FFT is generally faster compared to discrete Fourier transformation and gives the same results. Relatively fewer data points are also required to obtain a smooth frequency response. Prior to applying the FFT algorithm, the time domain signal may be smoothed such as by using the hamming window algorithm in the MATLAB™ software. In some variations, it may be desirable to have a resulting frequency spectrum which is one-sided spectrum and this can be obtained by using the known pwelch function in the MATLAB™ software. Since this disclosure only requires the absolute value of signals in the frequency spectrum to detect flashing light sources, one-sided spectrums advantageously eliminate redundant computations associated with two sided spectrums because both sides of the spectrum have the same requisite information. Additionally, the elimination of redundant computations also allows more relevant sampling points to be processed without incurring additional computational resources. Graphs (b) in <FIG> show illustrative examples of frequency spectrums converted from a time domain representation in graphs (a) of <FIG> respectively. In both <FIG>, the frequency spectrum is represented as a variation in power spectral density (PSD) versus frequency. In other implementations, a normalized frequency spectrum which shows the relative contribution of a frequency component with respect to all the frequency components in a signal may also be generated instead. This may be achieved by normalizing the peak amplitudes of a PSD signal with respect to the sum of all the available peaks in the signal. For instance, if a frequency component has a normalized peak value of <NUM>, this means that that frequency component contributes to <NUM>% of the total frequency component.

The method then proceeds onto decision step <NUM> where the processor <NUM> determines by analysing the frequency spectrum if there are any flashing light sources of the first colour associated with one or more types of emergency vehicles present in the image frames. In some implementations, this comprises determining if the frequency components present in the frequency spectrum matches the frequency components of known flashing first colour light sources belonging to one or more types of emergency vehicle. For instance, if the first colour is blue then the processor checks if it matches any known frequency spectrum of one or more types of emergency vehicle equipped with flashing blue light. The comparison of frequency spectrum eliminates flashing light sources of the first colour which are unrelated to emergency vehicles of interest such as advertising signs. The known frequency spectrums of emergency vehicles may be stored in a memory <NUM> located within the machine vision module <NUM> or on a remote server and retrieved by the processor for comparison. A frequency component may be considered as being present in a frequency spectrum if the amplitude of the frequency component is greater than or equal to predefined minimum amplitude limit. In some implementations, the frequency spectrum is said to match that of a known emergency vehicle light source of the same colour if at least the fundamental frequency and one or more harmonics correspond.

If the processor determines at step <NUM> that no flashing light sources associated with emergency vehicles of interest are present in the image frames, the process goes to step <NUM> where the method <NUM> ends. <FIG> shows the corresponding time domain representation and frequency spectrum for an exemplary scenario where the method <NUM> has been deployed to detect flashing blue light belonging to one or more types of emergency vehicles in a block of images and none were detected. The time domain representation in <FIG> shows the EV colour values of the image frames plotted against the timing of the image frames. The EV colour values shown in <FIG> are d. bias adjusted and time = <NUM> indicates the beginning of the block of frames. The power spectral density (PSD) versus frequency graph in <FIG> is the corresponding frequency spectrum converted from the time domain representation in <FIG>. In this example, the predefined minimum amplitude for acknowledging the presence of a frequency component is <NUM> Watts/Hz. Therefore, since the <FIG> frequency spectrum does not contain any spectral peaks with an amplitude greater than <NUM> Watts/Hz within the frequencies of interest, there are no flashing blue lights present in the image frames. On the other hand, if the processor determines at step <NUM> that there is at least one light source associated with a particular type of emergency vehicle present in the image frames, then the process goes on to step <NUM>. <FIG> shows another exemplary set of time domain representation (<FIG>) and frequency spectrum (<FIG>) obtained by applying method <NUM> to detect flashing blue light belonging to emergency vehicles. In this example, the frequency spectrum is similarly represented as a variation in power spectral density (PSD) versus frequency. The frequency spectrum in <FIG> contains flashing blue light as there are frequency components at <NUM>, <NUM>, <NUM> and <NUM> exceeding <NUM> Watts/Hz. Any signals having a frequency less than <NUM> are ignored as they are considered as a d. components that do not form part of a flashing light source. In <FIG>, the frequency component or peak at <NUM> is the fundamental frequency and while the <NUM>, <NUM> and <NUM> peaks are the respective first, second and third harmonics associated with the <NUM> fundamental frequency. Fundamental frequency is defined as the lowest frequency sinusoidal in a frequency spectrum. A flashing blue light source associated with an emergency vehicle of interest is said to be present in the <FIG> image frames if the frequency components in the <FIG> spectrum matches the frequency component of a known first colour light source belonging to one or more types of emergency vehicles. In some implementations, the frequency components are considered as matching if the fundamental frequency and one or more harmonics match.

At step <NUM>, the processor <NUM> causes one or more actions to be executed at least partially in response to detecting at least one light source associated with a particular type of emergency vehicle in step <NUM>. That is, the processor may take the one or more actions just based on detection of at least one relevant light source or check for the presence of other conditions before deciding which actions to take. In some implementations, the one or more actions may comprise identifying the location any emergency vehicles being detected. By way of example, this may comprise activating one or more environment sensors to identify the location of one or more emergency vehicles detected and/or analysing data from one or more environment sensors for the same purpose. If the emergency vehicle is identified to be within a certain proximity to the ego vehicle the processor may also cause a visual and/or aural notification to be issued to the driver of the ego vehicle. The notification may also inform the driver to take appropriate action to give way to the emergency vehicle. The notification may be issued via the HUD display <NUM> and/or audio system <NUM> in the user interface <NUM>. Other user interface such as an infotainment system display or wearables such as Google™ glasses may also be used for communication. The processor <NUM> may also send a signal to the autonomous driving module <NUM> instructing it to take over control of the vehicle and manoeuvre the vehicle such that it yields to the emergency vehicle being detected if the emergency vehicle is identified to be within a certain proximity to the ego vehicle. For instance, the autonomous driving module <NUM> may cause the vehicle to slow down, steer the vehicle such that it yields to the emergency vehicle being detected. The autonomous driving module <NUM> may also instruct a signalling system of the vehicle to activate the relevant signalling lights indicating the vehicle's intention to other road users. In yet another variation, the one or more actions may include instructing the telematics module <NUM> to send signals to other vehicles in the proximity alerting them about the presence of an emergency vehicle.

Therefore, the presence of light sources associated with emergency vehicles is detected by calculating the EV colour component for a representative plurality of pixels in an image frame and adding all the first values derived therefrom in order to obtain the EV colour value of an image frame. The EV colour value gives an indication of the colour intensity for a chosen first colour being analysed in a given frame. Going back to the example where the first colour is blue, this gives us an indication of the blueness value of an image frame. In order to determine if there are any flashing first colour light sources matching that of an emergency vehicle, the EV colour value for all image frames in a block of frames is calculated and a time domain representation derived therefrom. The time domain representation is then converted to a frequency spectrum and analysed. For instance, it may be compared with known frequency spectrums of one or more types of emergency vehicles in order to determine if any first colour light sources present flashing at the same rate as a known emergency vehicle. Therefore, implementations of this disclosure do not require image frames to be analysed and light sources corresponding to potential emergency vehicles identified based on templates of known emergency vehicles stored in a database. Such templates including characteristics such as colour and spatial configuration. It also does not require determining individually if the flashing rate of each potential light source being identified matches the flashing rate of known emergency vehicles stored in the database. Instead, the EV colour value of each of a plurality of image frames taken by an image sensor over a period of time is computed and a frequency spectrum derived therefrom is used to identify if there are any light sources of a first colour and having a flashing rate associated with one or more types of emergency vehicles. This advantageously reduces the computational requirements compared to which require image processing steps to specifically identify light sources belonging to potential emergency vehicles as part of the emergency vehicle detection process.

Claim 1:
A method for detecting the presence of an emergency vehicle (EV) comprising:
receiving a plurality of image frames taken by an image sensor over a period of time;
for each pixel of a plurality of pixels in each image frame, determining an EV colour component of the pixel, based on the ratio of a first colour relative to the total colour in the pixel and assigning to the pixel a first value if the EV colour component exceeds a predefined threshold value and a second value if the EV colour component does not, wherein the EV colour component measures the content of the first color in the pixel;
determining for each of the plurality of image frames an EV colour value for the first colour based on the sum of all of the first values for each image frame;
generating a time domain representation based on the EV colour values associated with the plurality of image frames;
converting the time domain representation for the plurality of image frames to a frequency spectrum; and
determining if any flashing light sources of the first colour associated with one or more types of emergency vehicles is present by analysing the frequency spectrum.