The present application claims priority to and incorporates by reference the entire contents of Japanese Patent Application No. 2021-208634 filed in Japan on Dec. 22, 2021.
The present disclosure relates to an object detection device, an object detection method, and a computer-readable storage medium.
There is an object detection device that analyzes an image acquired by a camera or the like, and that detects an object in the image. The object detection device includes a device that detects a plurality of objects and that tracks each of the objects.
Patent Literature 1 discloses an object tracking system including a plurality of detection units that each detects an object from a captured image and that outputs a detection result, and an integrated tracking unit that calculates position information on an object represented in a common coordinate system on the basis of the detection results output by each of the detection units. The integrated tracking unit outputs the calculated position information of the object in the common coordinate system. The detection unit converts the position information of the object in the common coordinate system to position information represented in an individual coordinate system unique to the camera that outputs an image from which an object is to be detected, tracks the object in the individual coordinate system, detects the object on the basis of the position information represented in the individual coordinate system, and converts the position information of the object detected on the basis of the position information represented in the individual coordinate system, to the position information represented in the common coordinate system.
Patent Literature 1: Japanese Patent Application Laid-open No. 2020-107349
In a case where an object is detected, when a detection failure of the object occurs in a certain frame, there is a possibility that the same object is not determined appropriately, and the same object is detected as a different object. For example, even if a mobile device mounted with an object detection device is set such that a warning should not be issued for the same object (object that has already been detected), if the same object is detected as a different object, a warning is issued assuming that a new object is detected. Therefore, if the detection accuracy of the same object is low, work efficiency is reduced because a process for removing the warning is generated, or the work is temporarily interrupted by the alarm.
At least one embodiment of the present disclosure has been made to solve the problems described above, and an object of the present disclosure is to provide an object detection device, an object detection method, and a computer-readable storage medium that can prevent detection failure of an object and that can associate the same object at a high accuracy.
An object detection device according to the present disclosure includes: an image acquisition unit configured to acquire an image at a predetermined time interval; a first image processing unit configured to extract an object from the acquired image; a second image processing unit configured to extract a plurality of candidate areas of the object in the image, based on a position of the object acquired in a previous frame of the image; a comparison unit configured to compare the object extracted by the first image processing unit and the candidate areas with an object extracted from an image in the previous frame of the image; and a specification unit configured to specify a candidate area of a current frame that matches the object extracted from the image in the previous frame, from the candidate areas, based on a comparison result of the comparison unit.
An object detection method according to the present disclosure includes: acquiring an image at a predetermined time interval; extracting an object from the acquired image; extracting a plurality of candidate areas of the object in the image, based on a position of the object acquired in a previous frame of the image; comparing the extracted object and the candidate areas with an object extracted from an image in the previous frame of the image; and specifying a candidate area of a current frame that matches the object extracted from the image in the previous frame, from the candidate areas, based on a result of the comparing.
A non-transitory computer-readable storage medium according to the present disclosure stores a program for causing a computer to execute: acquiring an image at a predetermined time interval; extracting an object from the acquired image; extracting a plurality of candidate areas of the object in the image, based on a position of the object acquired in a previous frame of the image; comparing the extracted object and the candidate areas with an object extracted from an image in the previous frame of the image; and specifying a candidate area of a current frame that matches the object extracted from the image in the previous frame, from the candidate areas, based on a result of the comparing.
The configuration described above can advantageously prevent detection failure of an object and associate the same object at a high accuracy.
Hereinafter, an embodiment according to the present disclosure will be described in detail with reference to the accompanying drawings. Note that the invention is not limited to the embodiment. Moreover, components in the following embodiment include components that can be easily replaced by a person skilled in the art or components that are substantially the same. Furthermore, the components described below can be combined with one another as appropriate. Still furthermore, when there are a plurality of embodiments, the embodiments may be combined with one another.
Object Detection Device
As illustrated in
The camera unit 12 acquires an image included in an imaging area. The camera unit 12 acquires an image at a predetermined time interval. The camera unit 12 may continuously acquire images at a predetermined frame rate, or may acquire an image triggered by a certain operation.
The processing unit 14 includes an integrated circuit (processor) such as a central processing unit (CPU) and a graphics processing unit (GPU), and a memory serving as a work area. The processing unit 14 executes various processes by executing various computer programs using these hardware resources. Specifically, the processing unit 14 executes various processes by reading a computer program stored in the storage unit 16, developing the computer program in a memory, and causing the processor to execute the instruction included in the computer program developed in the memory. The processing unit 14 includes an image acquisition unit (image data acquisition unit) 26, an image correction unit 28, a first image processing unit 30, a second image processing unit 31, a comparison unit 32, and a specification unit 34. Prior to describing the units of the processing unit 14, the storage unit 16 will be described.
The storage unit 16 includes a nonvolatile storage device such as a magnetic storage device and a semiconductor storage device, and stores various computer programs and data. The storage unit 16 includes a detection program 36, an image correction program 37, a first image processing program 38, a second image processing program 39, a comparison program 40, and processing data 42.
Moreover, the data stored in the storage unit 16 includes the processing data 42. The processing data 42 includes image data acquired by the camera unit 12, and the position, the size, the comparison result, or the like of the object extracted from the image data. The processing data 42 can be classified and stored according to the positions of the objects. Moreover, the processing data 42 may include partially processed data. Furthermore, the processing conditions of each computer program and the like are stored in the storage unit 16.
The computer programs stored in the storage unit 16 include the detection program 36, the image correction program 37, the first image processing program 38, the second image processing program 39, and the comparison program 40. The detection program 36 integrates the operations of the image correction program 37, the first image processing program 38, the second image processing program 39, and the comparison program 40, and executes an object detection process. The detection program 36 executes a process of detecting an object from an image, comparing the object, and specifying each object. Moreover, the detection program 36 executes a notification process on the basis of the detection result.
The image correction program 37 performs image processing on an image acquired by the camera unit 12. The image processing includes various processes that improve the extraction accuracy of an object such as a distortion process.
The first image processing program 38 executes image processing on the image acquired by the camera unit 12, and extracts an object included in the image. Various programs can be used as the first image processing program 38, and a learned program that has learned to extract an object with a deep learning model can be used. The deep learning model can detect whether an object is included in an image, by setting bounding boxes or what are called anchors for an image, and by processing the feature amount in each of the anchors on the basis of the setting. The deep learning model to be used includes regions with convolutional neural networks (R-CNN), you only look once (YOLO), single shot multibox detector (SSD), and the like. The first image processing program 38 may also extract an object by pattern matching or the like. The first image processing program 38 calculates information on the area indicating the position where the object was extracted, and information indicating the characteristics within the area. The first image processing program 38 stores the extracted information in the processing data 42.
The second image processing program 39 determines a plurality of candidate areas, on the basis of the information on the position of the object that is extracted by the processing performed on the image acquired from the previous frame (previous point of time) of the image acquired by the camera unit 12. Each of the candidate areas is an area extracted as an area where the object may be located. The second image processing program 39 determines the candidate areas on the basis of the position information of the previous frame and the moving speed of the object. Moreover, the second image processing program 39 determines the candidate areas calculated by combining multiple moving speeds and multiple moving directions, while taking into account the change in the moving speed, the change in the moving direction, the change in the area size, and the change in the aspect ratio. On the basis of the position information of the object in the previous frame, the second image processing program 39 estimates the position of the object in the frame, by performing processing using a Kalman filter.
The comparison program 40 compares the object calculated in the previous frame with the object that is processed and calculated by the first image processing program 38 and the information on the candidate area calculated by the second image processing program 39. The comparison program 40 then specifies whether the same object is extracted from the frames, and specifies the identity of each object.
The detection program 36, the first image processing program 38, the second image processing program 39, and the comparison program 40 may be installed in the storage unit 16, by reading the detection program 36, the image correction program 37, the first image processing program 38, the second image processing program 39, and the comparison program 40 stored in a (non-transitory) computer-readable medium. The detection program 36, the first image processing program 38, the second image processing program 39, and the comparison program 40 may also be installed in the storage unit 16, by reading the detection program 36, the first image processing program 38, the second image processing program 39, and the comparison program 40 provided on the network.
The functions of the units of the processing unit 14 will now be described. Each of the units of the processing unit 14 performs a function by processing the computer program stored in the storage unit 16. The image acquisition unit 26 acquires data of the image acquired by the camera unit 12. The image correction unit 28 performs correction processing on the image acquired by the image acquisition unit 26. The first image processing unit 30 processes and executes the first image processing program 38. The first image processing unit 30 extracts an object from an image that is acquired by the image acquisition unit 26 and that is corrected by the image correction unit 28.
The second image processing unit 31 processes and executes the second image processing program 39. The second image processing unit 31 calculates the candidate areas, on the basis of the information on the position of the object calculated in the previous frame and the information on the set moving direction, moving speed, area size, and aspect ratio.
The comparison unit 32 is implemented by executing the process of the comparison program 40. The comparison unit 32 compares the detection result of the previous frame with the information processed by the first image processing unit 30 and the information within the candidate areas set by the second image processing unit 31, and outputs the information on the comparison result. The comparison unit 32 calculates the similarity between the object in the previous frame that has been compared, and each of the information processed by the first image processing unit 30 and information within the candidate areas set by the second image processing unit 31. In the present embodiment, the similarity is calculated using values from zero to one. As the value is closer to one, the similarity is increased, that is, there is a high possibility that the objects are the same object. The range of values of similarity is merely an example, and may be equal to or greater than one, or may be less than one. In this example, the comparison unit 32 calculates the similarity on the basis of pattern matching of the images in the area, the amount of change in the area, information on the feature amount obtained by filter processing, and the like. Specifically, the comparison unit 32 may calculate the intermediate feature amount of the deep learning model, for each of the areas to be compared, and may use the reciprocal of the difference between the Euclidean distances of the feature amount as the similarity. Alternatively, as in Siamese Network or the like, the comparison unit 32 may directly calculate the distance between the two areas by the deep learning model, and use the reciprocal of the calculated distance as the similarity. Moreover, the comparison unit 32 may calculate the similarity on the basis of pattern matching of the images in the area, the amount of change in the area, information on the feature amount obtained by filter processing, and the like.
The specification unit 34 is implemented by executing the process of the comparison program 40. On the basis of the comparison result of the comparison unit 32, the specification unit 34 specifies the same object (same subject) in the frames. On the basis of the comparison result of the comparison unit 32, the specification unit 34 specifies the candidate area in the current frame that matches the object extracted from the image in the previous frame, from the candidate areas. The specification unit 34 associates the object in the previous frame with the object in the current frame detected by the first image processing unit 30, and the candidate areas of the current frame calculated by the second image processing unit 31, that is, the specification unit 34 determines the area in the current frame where the same object as that in the previous frame is captured. To determine the same object, an association technique such as the Hungarian algorithm may be used, and the object with the highest similarity (or the shortest distance if the distance between the feature amounts described above is used as the similarity) may be selected, when the entire combination is taken into consideration. Moreover, to determine the optimal combination, if the distance is equal to or greater than a threshold, it is possible to consider that there is no similar feature and eliminate the candidate.
A notification processing unit 35 is implemented by executing the process of the detection program 36. The notification processing unit 35 executes the notification process on the basis of the specification result of the specification unit 34. The notification processing unit 35 performs a process of notifying the user of the specified result, and when the specification result satisfies the criteria of the notification, performs a process of notifying the user of the specification result, and the like. The criteria of the notification include when the object is within the set range or when a new object is detected. Moreover, it is possible to set not to notify the user, when the object that is specified in the past and that is excluded from the object to be notified, enters the set range. Note that, while in the present embodiment, the notification processing unit 35 is provided, the object detection device 10 may be a device that does not include the notification processing unit 35 and performs the detection process.
Next, with reference to
The object detection device 10 acquires image data acquired by the camera unit 12 through the image acquisition unit 26 (step S12). In the present embodiment, as illustrated in
The object detection device 10 performs a distortion correction process by the image correction unit 28 (step S14). In the present embodiment, while the distortion correction process is performed as an example, the process executed by the image correction unit 28 is not limited to the distortion correction. The object detection device 10 transmits the image to which image processing is applied, to the first image processing unit 30 and the second image processing unit 31. The object detection device 10 performs the processing of the first image processing unit 30 and the processing of the second image processing unit 31 in parallel.
The object detection device 10 extracts an object by the first image processing unit 30 (step S16). Specifically, as illustrated in
The object detection device 10 extracts the candidate areas detected by the second image processing unit 31 (step S18). Specifically, as illustrated in
The object detection device 10 performs an overlap elimination process using the detection result of the first image processing unit 30, by the second image processing unit 31 (step S20). The second image processing unit 31 detects whether there is any area overlapping with the area of the object 102a detected in the image 100a by the first image processing unit 30, among the candidate areas. The second image processing unit 31 then eliminates the area overlapping with the area of the object detected by the first image processing unit 30, from the candidate areas. In the case of the image 100 illustrated in
The object detection device 10 extracts a feature amount of the area where a person is detected and each of the candidate areas, by the comparison unit 32 (step S22). The object detection device 10 extracts information on the feature amount that serves as the basis for comparison, for the area 110 in the image 100a and the areas corresponding to the candidate areas 120a, 120b, 120c, 120d, 120e, and 120f in the image 100a.
The object detection device 10 compares the result with the past detection result by the comparison unit (step S24). In the present embodiment, the object detection device 10 compares the feature amount of the area 104 in the image 100 with the feature amount of the area 110 in the image 100a and each of the areas corresponding to the candidate areas 120a, 120b, 120c, 120d, 120e, and 120f in the image 100a.
On the basis of the comparison result, the object detection device 10 specifies the movement of a person, and manages the person in the image on the basis of the movement, by the specification unit 34 (step S26). On the basis of the comparison result calculated by the comparison unit 32, the specification unit 34 specifies the similarity between the object in the image 100 and the object in the image 100a, and specifies the movement of the object, to specify the movement of the position of the object, or the person in the present embodiment. The specification unit 34 determines whether the person in the previous frame is in the current frame or whether a new person is in the current frame. Specifically, the specification unit 34 compares the similarity of the person area in the previous frame with the person area in the current frame and the person area candidates, obtains the combination with the highest similarity, and calculates whether the person in the previous frame is associated with the person area in the current frame or any one of the person area candidates. If the person area in the previous frame does not associate with anything, the specification unit 34 determines that the person is hiding behind something in the current image frame or that the person has moved out from the image. If the person area in the current frame does not associate with anything, the specification unit 34 determines that a new person has appeared. If the person area candidates in the current frame do not associate with anything, the specification unit 34 determines that the area is not the person area and eliminates the area.
The object detection device 10 updates the data on the basis of the specification result (step S28). Specifically, the object detection device 10 updates the information on the area of the object in the image 100a corresponding to the previous frame during the next process. Moreover, the object detection device 10 updates the information on the moving speed and the moving direction on the basis of settings.
The object detection device 10 performs a notification process on the basis of the detection result by the notification processing unit 35 (step S30).
The object detection device 10 extracts an object by the first image processing unit 30, extracts a plurality of candidate areas to which the object may have moved on the basis of the detection result of the previous frame by the second image processing unit 31, and performs a process of determining whether there is the same object as that in the previous frame for each of the extraction results. Consequently, it is possible to prevent detection failure of the same object, and detect the same object at a high accuracy. That is, even if the same object cannot be extracted by the first image processing unit 30, it is possible to specify the same object from the candidate areas. Moreover, by extracting the candidate areas by the second image processing unit 31, it is possible to further reduce the possibility of detection failure.
Furthermore, when the object extracted by the image processing overlaps with the candidate area, the object detection device 10 can eliminate the candidate area. Accordingly, it is possible to reduce the candidate areas at which the feature amount calculation and the similarity calculation are to be performed, and reduce the calculation process. Note that, to reduce the amount of calculation, although it is preferable to perform the overlap elimination process at step S20 in
Still furthermore, the object detection device 10 may be configured to store the history of identity determination results (whether a current object has been extracted as the object or extracted in the candidate area), and may be configured not to perform association as the same object assume that there is no object in the detected area and the characteristics of the background are detected if association based on the candidate area continues for a specified number of times (for example, twice) or more.
By performing the distortion correction process as the image correction process, the object detection device 10 can increase the detection accuracy.
Specifically, as illustrated in
10 Object detection device
12 Camera unit
14 Processing unit
16 Storage unit
26 Image acquisition unit
28 Image correction unit
30 First image processing unit
31 Second image processing unit
32 Comparison unit
34 Specification unit
36 Detection program
37 Image correction program
38 First image processing program
39 Second image processing program
40 Comparison program
42 Processing data
Number | Date | Country | Kind |
---|---|---|---|
2021-208634 | Dec 2021 | JP | national |