The embodiments discussed herein are related to an image processing apparatus and an image processing method.
In driving a vehicle, if it is possible to inform a driver of information on locations where a near miss, that is, phenomenon such that the driver gets a fright or gets startled such as nearly colliding with a pedestrian often occurs, it may be possible to prevent an accident from occurring. Data recorded in a drive recorder may be used for identifying the information on the locations where a near miss often occurs. For example, in the drive recorder, a position of the vehicle, a date and time of photographing, acceleration of the vehicle, speed of the vehicle, an image ahead of the vehicle, and the like are recorded.
Here, if detection of a near miss is attempted only using numeric data such as the acceleration recorded in the drive recorder, in some cases, a phenomenon that is not really a near miss may be erroneously detected as a near miss. It is because, in some cases, the acceleration is abruptly changed while the vehicle is driven unrelated to a near miss due to ups and downs of a road and the like.
In order to prevent the near miss as described above from being erroneously detected, it is desired that an analysis be made whether it has been a near miss or not based on the image ahead of the vehicle recorded together with the acceleration.
As a cause of a near miss, existence of a detection target such as a pedestrian and a bicycle within own lane may be listed-. Therefore, by determining whether or not the detection target exists in the image as well as using information on the acceleration, it is possible to determine whether or not the cause of a near miss exists in the image, whereby it is possible to analyze whether or not it has been a near miss or not.
Patent Literature 1: Japanese Laid open Patent Publication. No. 05-143897
According to an aspect of an embodiment, an image processing apparatus, includes a processor configured to execute a process including: detecting a region in which a pixel value is changed between frames included in moving image data and identifying a frame including a detection target based on a filling ratio of the region to a circumscribed rectangle of the region.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
With the above-described prior art, however, there is a problem in that accurate detection of the detection target is not possible.
A camera for the drive recorder is mounted on the vehicle, and the camera is moved as the vehicle moves, whereby in an image recorded by the drive recorder, it seems as though a stationary object is moving. Therefore, when a region in which there is a change between frames is simply determined as the detection target, within a own lane region, paint and the like within the lane, which are the stationary objects, may also be determined as the detection target in some cases.
Preferred embodiments of the present invention will be explained with reference to accompanying drawings. Note, however, that the present invention is not to be limited by the embodiments.
A configuration of an image processing apparatus according to a first embodiment is described.
The detection unit 11 detects a region in which a pixel value is changed between frames included, in moving image data.
The identification unit 12 specifies a frame including a detection target based on a filling ratio of the region detected by the detection unit 11 to a circumscribed rectangle of the region.
An effect of the image processing apparatus 10 according to the first embodiment is described. The image processing apparatus 10 detects the region in which the pixel value is changed between the frames included in the moving image data, and based on the filling ratio of the detected region to the circumscribed rectangle of the region, specifies the frame including the detection target. For example, in many cases, paint within a lame appears as the region having a nearly rectangular shape on an image whereas a pedestrian, a bicycle, and the like to be the detection target have an irregular shape. Therefore, it is possible to accurately detect the detection target by using the filling ratio relative to the circumscribed rectangle.
A configuration of an image processing apparatus according to a second embodiment is described.
The communication unit 110 is a processing unit that executes data communication with another device through a network. For example, the communication unit. 110 corresponds to a communication device and the like.
The input unit 120 is an input device for inputting various data to the image processing apparatus 100. For example, the input unit 120 corresponds to a keyboard, a mouse, a touch panel, and the like. The display unit 130 is a display device that displays data, which is output from the control unit 150. For example, the display unit 120 corresponds to a liquid crystal display, a touch panel, and the like.
The storage unit 140 is a storage unit that stores drive recorder information 141. For example, the storage unit. 140 corresponds to a storage device such as a semiconductor memory element such as a random access memory (RAM), a read only memory (ROM), and a flash memory.
The drive recorder information 141 includes various data recorded by a drive recorder.
The control unit 150 includes a processing frame determination unit 151, an average image creation unit 152, a processing image creation unit 153, a detection unit 154, and an identification unit 155. The control unit 150 corresponds to an integration device such as an application specific integrated circuit CASIC) and a field programmable gate array (FPGA), for example. The control unit 150 also corresponds to an electronic circuit such as a CPU and a micro processing unit (MPU), for example.
The processing frame determination unit 151 is a processing unit that accesses the drive recorder information 141 and extracts each of the image data corresponding to the frame number while the vehicle is decelerating. In descriptions below, the image data corresponding to the frame number while the vehicle is decelerating is expressed as a processing frame. The processing frame determination unit 151 outputs information on each of the processing frames that has been extracted to the average image creation unit 152.
The average image creation unit. 152 is a processing unit that creates an average image of each of the processing frames acquired from the processing frame determination unit 151. For example, the average image creation unit 152 performs addition of each of pixel values in the processing frame for each pixel. Then, the average image creation unit 152 creates the average image by dividing a pixel value of each of the added pixels by the number of processing frames. The processing of creating the average image from each of the processing frames by the average image creation unit 152 is not limited to the above-described processing, and any well-known technique may be used. The average image creation unit 152 outputs the average image and the information on each of the processing frames to the processing image creation unit 153.
The processing image creation unit 153 generates a difference image between the processing frame and the average, image for each of the processing frames. The processing image creation unit 153 also generates a binary image based on each of the difference images. Hereinafter, processing of generating the difference image and processing of generating the binary image by the processing image creation unit 153 are described.
The processing of generating the difference image by the processing image creation unit 153 is described. For example, the processing image creation unit 153 generates the difference image by subtracting the pixel value of each of the pixels in the average image from the pixel value of each of the pixels in the processing frame. The processing image creation unit 153 generates the difference image for all of the processing frames.
The processing of generating the binary image by the processing image creation unit 153 is described. The processing image creation unit 153 decomposes the difference image into red, green, and blue (RGB). After the difference image has been decomposed into the RGB, for each of the pixels therein, in a case where R, G, and B values exceeds respective predetermined threshold values, the processing image creation unit 153 generates the binary image by setting the pixel value of the corresponding pixel to “1” and the pixel value of other pixels to “0”. The processing image creation unit 153 generates the binary image for each of the difference images. The processing image creation unit 153 outputs information on the binary image to the detection unit 154.
For example, the processing image creation unit 153 may create a histogram of each of the RGB values and may set the value exceeding 80% as the threshold value to be compared with each of the R value, G value, and B value.
Due to an influence of light from the vehicle and light outside, the image of the processing frame may be reddish in some cases. To deal with this, it is possible to improve detection accuracy of a detection target by decomposing the image into the RGB and generating the binary image as described above.
Note that the processing image creation unit 153 may limit a range of processing in generating the binary image.
The detection unit 154 is a processing unit that detects, based on the binary image, the region in which the pixel valve is changed between frames included in moving image data. The detection unit 154 executes labeling processing and corner determination processing.
The labeling processing executed by the detection unit. 154 is described. The detection unit 154 executes the labeling processing of scanning the binary image and joining together the consecutive pixels each having the pixel value of “1”. In descriptions below, the region in which the pixels are joined together in the labeling processing is described as a candidate region. After the candidate region has been detected, the detection unit 154 executes an area check, a filling ratio check, and an aspect ratio check thereon and excludes the candidate region not corresponding with the detection target.
The area check executed by the detection unit 154 is described. The detection unit 154 leaves the corresponding candidate region in a case where an area of the candidate region is equal to or greater than a predetermined area set in advance. In contrast, the detection unit 154 excludes the corresponding candidate region in a case where the area of the candidate region is less than the predetermined area set in advance.
The filling ratio check executed by the detection unit 154 is described.
The aspect ratio check executed by the detection unit 154 is described. In the same way as in RIG. 5, the detection unit 154 sets a circumscribed rectangle to the candidate region. The detection unit 154 calculates an aspect ratio of the circumscribed rectangle. In a case where a ratio of a vertical width to a horizontal width of the circumscribed rectangle or a ratio of the horizontal width to the vertical width of the circumscribed rectangle is less than a predetermined ratio, the detection unit 154 leaves the corresponding candidate region 30.
In contrast, in a case where the ratio of the vertical width to the horizontal width of the circumscribed rectangle or the ratio of the horizontal width to the vertical width of the circumscribed rectangle is the predetermined ratio or more, the detection unit 154 excludes the corresponding candidate region. In the case where the ratio of the vertical width to the horizontal width of the circumscribed rectangle or the ratio of the horizontal width to the vertical, width of the circumscribed rectangle is the predetermined ratio or more, it represents that the candidate region is extremely long vertically or horizontally compared to a shape of a general pedestrian, whereby it is unlikely that the candidate region is the detection target.
Next, the detection unit 154 performs the area check, the filling ratio check, and the aspect ratio check on the candidate region, which has been detected from the binary image, and executes corner determination on information of the candidate region that have not been excluded.
The corner determination processing executed by the detection unit 154 is described.
The detection unit 154 obtains an area of each of corner regions respectively including corners 41a, 41b, 41c, and 41d and excluding the candidate region 31 within the circumscribed rectangle 41. The corner region can be described as a polygon surrounded by a side constituting the circumscribed rectangle and a side constituting the candidate region. In an example illustrated in
The exclusion condition 1 is described. In a case where an area of the pair angle, corners is a predetermined area or greater, the detection unit 154 excludes the corresponding candidate region.
The exclusion condition 2 is described. In a case where an area of at least one of the pair angle corners is a predetermined area or greater as well as an area of the reverse pair angle corners is less than a predetermined area, the detection unit 154 excludes the corresponding candidate region.
The exclusion condition 3 is described. In a case where the area of the pair angle corners is a predetermined area or greater, triangularity of the pair angle corners is a predetermined triangularity or greater, and the area of the reverse pair angle corners is less than a predetermined area, the detection unit 154 excludes the corresponding candidate region.
Note that a threshold value used in the exclusion conditions 1 to 3 may be changed according to a size of the area of the circumscribed rectangle 41. For example, when the area of the circumscribed rectangle 41 is 0, the threshold value is obtained by S divided by 6. Note that in a case where the threshold value is less than 40 pixels, the threshold value is set to 40.
A method of calculating the triangularity is described. FIG. GB is a view for describing the method of calculating the triangularity. Here, a case of obtaining the triangularity of the corner region 42c is described. A pixel value of pixels included in a triangle BCD is set to 1, and a pixel value of pixels surrounded by a triangle ABC is set to 0. Then, the triangularity of the corner region 42c can be calculated by dividing an area having the pixel value of 1 among the pixels included in a rectangle ABCD by the rectangle ABCD.
Here, one example of the candidate region meeting the exclusion condition and one example of the candidate region not meeting the exclusion condition are described.
The detection unit 154 outputs the information of the candidate region that have not been excluded by the above-described exclusion conditions 1 to 3 to the identification unit 155. As described above after acquiring the binary image from the processing image creation unit 153, the detection unit 154 executes the labeling processing and the corner determination processing and outputs the information of each of the candidate regions that have not been excluded to the identification unit 155. Note that each of the candidate regions is associated with information of the frame number at a detection source and the location coordinates.
The identification unit 155 is a processing unit that acquires the information of the candidate region from the detection unit 154 and specifies a frame including the detection target. Based on the information of the candidate region, the identification unit 155 determines whether or not each of the candidate regions having a consecutive frame number overlaps with each other. In a case where each of the candidate regions having the consecutive frame number partially overlaps with each other, the identification unit 155 determines that each of the candidate regions is the detection target.
In contrast, the identification unit 155 determines that the candidate regions 45a, 45b, and 45c are not the detection targets in a case where the area in which the candidate region 45a overlaps with the candidate region 45b is less than the predetermined area or the area in which the candidate region 45b overlaps with the candidate region 45c is less than the predetermined area.
The identification unit 155 outputs the frame number of each of the candidate regions determined as the detection target. For example, the identification unit 155 may output the frame number to the display unit 130 or may inform another device of the frame number through the communication unit 110.
Next, a processing procedure of the image processing apparatus. 100 according to the second embodiment is described.
As illustrated in
The image processing apparatus 100 decomposes the difference image into the RGB and determines the threshold values for the RGB values (step S104). For the difference image, the image processing apparatus 100 generates the binary image by setting the pixels having the RGB values equal to or greater than the threshold values to 1 and any other pixels to 0 (step S105).
The image processing apparatus 100 executes the labeling processing (step S106) and executes the corner determination processing (step S107). The image processing apparatus 100 determines whether or not all of the processing frames have been processed (step S108). In a case where all of the processing frames have not been processed (No in step S108), the image processing apparatus 100 selects the next frame (step S109) and proceeds to step. S103.
On the other hand, in a case where all of the processing frames have been processed (Yes is step S108), the image processing apparatus 100 specifies the detection target (step S110), and it specifies the frame including the detection target (step S111).
Next, an effect of an image processing apparatus 100 according to the second embodiment is described. The image processing apparatus 100 according to the second embodiment detects the region in which the pixel value is changed between the frames included in the moving image data, and based on the filling ratio of the detected region to the circumscribed rectangle of the region, specifies the frame including the detection target. For example, in many cases, the paint within the lane appears as the region having a nearly rectangular shape on the image whereas a pedestrian, a bicycle, and the like to be the detection target have an irregular shape. Therefore, it is possible to accurately detect the detection target by using the filling ratio relative to the circumscribed rectangle.
The image processing apparatus 100 specifies the frame including the detection target based on the size relationship with a plurality of corner regions, which is formed based on the circumscribed rectangle and the candidate region. In many cases, the paint on a road surface appears as a region having a nearly rectangular shape on the image whereas the detection target such as a pedestrian has an irregular shape. Therefore, by using the size relationship with the corners formed by the circumscribed rectangle and the candidate region, it is possible to distinguish the detection target such as a pedestrian from the paint on the road surface.
The image processing apparatus 100 specifies the frame including the detection target by further using the aspect ratio of the circumscribed rectangle. In a case where the ratio of the vertical width to the horizontal width of the circumscribed rectangle or the ratio of the horizontal width to the vertical width of the circumscribed rectangle is equal to or greater than a predetermined ratio, it represents that the candidate region is extremely long vertically or horizontally compared to a shape of a general pedestrian, whereby it is unlikely that the candidate region is the detection target. Therefore, by further using the aspect ratio of the circumscribed rectangle, it is possible to more accurately distinguish the detection target such as a pedestrian from the paint on the road surface.
The image processing apparatus 100 detects the candidate region by using a frame in which the speed is reduced. When the speed is increased, it may be because a cause of deceleration has been solved, whereby it is very likely that the detection target is not in a frame at the point where the speed is increased. By using the frame during the deceleration, it is possible to reduce unnecessary detection processing.
The image processing apparatus 100 detects the candidate region from a predetermined range, including own lane. Therefore, by setting only the region in which it is very likely that the detection target such as a pedestrian exists as the detection target, it is possible to reduce an overall calculation amount.
Next, one example of a computer that executes an image processing program for realizing a similar function as the image processing apparatus described in the above embodiments.
As illustrated in
The hard disk device 207 includes a detection program 207a and an identification program. 207b, for example. The CPU 201 reads each of the programs 207a and 207b and expands them into the RAM 206.
The detection program 207a functions as a detection process 206a. The identification program 207b functions as an identification process 206b.
For example, the detection process 206a corresponds to the detection units 11, 154, and the like. The identification process 206b corresponds to the identification units. 12, 155, and the like.
It is also possible to store each of the programs 207a and 207b in a “portable physical medium”, such as a flexible disk (FD), a CD-ROM, a DUD disk, a magneto optical disk, and an IC card, to be inserted into the computer 200. Then, each of the programs 207a and 207b may be read therefrom and executed by the computer 200.
According to one embodiment of the present invention, an effect is provided that the detection target can be accurately detected.
All examples and conditional language recited herein are intended for pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit, and scope of the invention.
This application is a continuation of International Application. No. PCT/JP2012/0720.80, filed on Aug. 30, 2012, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP2012/072080 | Aug 2012 | US |
Child | 14633339 | US |