This application claims priority of Taiwan Patent Application No. 109128001, filed on Aug. 18, 2020, the entirety of which is incorporated by reference herein.
The present disclosure relates to object recognition, and, in particular, to a computing device and a method of removing raindrops from video images.
The technology behind autonomous vehicle driving is advancing. Autonomous vehicle driving software often needs to judge road conditions based on the video images obtained by a camera built into the vehicle. However, when the weather is bad, the video image captured by the vehicle camera can be susceptible to raindrops, which can reduce the accuracy of the rear-end vehicle recognition and road condition recognition, which will affect the decision-making in autonomous vehicle driving.
In view of the above, a computation apparatus and a method of removing raindrops from video images are provided to solve the aforementioned problem.
In an exemplary embodiment, a method of removing raindrops from video images is provided. The method includes the following steps: training a raindrop-image-recognition model using a plurality of raindrop training images labeled in a plurality of rainy scene images; recognizing a plurality of raindrop images in a plurality of scene images of a video sequence using the raindrop-image-recognition model; and in response to a specific raindrop image in a current scene image among the scene images satisfying a predetermined condition, replacing the specific raindrop image in the current scene image with an image region corresponding to the specific raindrop image in a specific scene image prior to the current scene image to generate an output scene image.
In another exemplary embodiment, a computation apparatus is provided. The computation apparatus includes a non-volatile memory and a processor. The non-volatile memory stores a raindrop-removal program. The processor is configured to execute the raindrop-removal program to perform the following steps: training a raindrop-image-recognition model using a plurality of raindrop training images labeled in a plurality of rainy scene images; recognizing a plurality of raindrop images in a plurality of scene images of a video sequence using the raindrop-image-recognition model; and in response to a specific raindrop image in a current scene image among the scene images satisfying a predetermined condition, replacing the specific raindrop image in the current scene image with an image region corresponding to the specific raindrop image in a specific scene image prior to the current scene image to generate an output scene image.
The patent or application file contains at least one drawing executed in color. Copies of this patent or patent application publication with color drawing(s) will be provided by the Office upon request and payment of the necessary fee.
The present disclosure can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
The following description is made for the purpose of illustrating the general principles of the disclosure and should not be taken in a limiting sense. The scope of the disclosure is best determined by reference to the appended claims.
It should be understood that the words “comprising”, “including” and the like used in this specification are used to indicate the existence of specific technical characteristics, numerical values, method steps, work processes, components and/or components, but not It does not exclude that you can add more technical features, values, method steps, job processing, components, components, or any combination of the above.
The terms such as “first”, “second”, and “third” are used in the claims to modify the elements in the claims, and are not used to indicate that there is a priority order, prior relationship, or is a component before another component, or the time sequence when performing method steps, only used to distinguish components with the same name.
In an embodiment, the computation apparatus 100 may be implemented by, for example, a personal computer, a vehicle computer, a server, or a portable device, and can be installed on a vehicle. The computing apparatus 100 includes a computation unit 110, an image-capturing device 120, a storage unit 130, and a display unit 150. The computation unit 110 can be implemented in a variety of ways, such as dedicated hardware circuits or general-purpose hardware (e.g., a single processor, multi-processors with parallel processing capabilities, graphics processors or other processors with computing capabilities), and when executing the code or software related to the various models or processes of the present invention, the functions described later are provided. The image-capturing device 120 may be a camera, and the image-capturing device 120 is used to capture a scene image in a predetermined field of view (FOV) in front of the vehicle, such as a window of the vehicle. In some embodiments, the computation apparatus 100 may include a plurality of image-capturing devices 120, and each image-capturing device 120 can be disposed at different predetermined positions on the vehicle to capture scene images of different predetermined FOVs around the vehicle.
The storage unit 130 may include a volatile memory 131 and a non-volatile memory 132. The non-volatile memory 132 is configured to store a raindrop-image database 136, and data and various codes required in the object-recognition process, such as the raindrop-removal program 133, the raindrop-image-identification model 135 and so on. The non-volatile memory 132 may be, for example, a hard disk drive, a solid-state disk, a flash memory, or a read-only memory (ROM), but the invention is not limited thereto. The volatile memory 132 may be a random-access memory, such as a static random access memory (SRAM) or a dynamic random access memory (DRAM), but the invention is not limited thereto. The volatile memory 131 may be used to temporarily store the intermediate data and images in the object-recognition process.
In an embodiment, the non-volatile memory 132 may store a raindrop-removal program 133, and the computation unit 110 may load the raindrop-removal program 133 from the non-volatile memory 132 to the volatile memory 131 for execution.
The display unit 150 may be a display panel (e., a thin-film liquid-crystal display panel, an organic light-emitting diode (OLED) panel, or other panels having display capabilities), that is used to display a user interface provided by the application executed by the computation unit 110. In some embodiments, the display unit 150 may be integrated with a touch device to form a touch panel, and the user can perform touch operations on the user interface display by the display unit 150.
In an embodiment, the non-volatile memory 132 further includes a raindrop-image database 136 and a raindrop-image-recognition model 135. For example, the raindrop-image database 136 stores the labeled raindrop images among the plurality of rainy scene images. Each rainy scene image can be, for example, a rainy street view obtained in advance or taken in real time by the image-capturing device 120. It may or may not include vehicles on the street, which means that each rainy scene image contains multiple raindrop images, and the user can label (e.g., frame selection) the position and size of each raindrop image in each rainy scene image through the user interface of the raindrop-removal program 133.
As depicted in
After the labeling process is completed, the raindrop-removal program 133 can covert the position and size of each raindrop training image 210 in the rainy scene image 200 into a text file, as shown in the lower portion of
For example, as depicted in
When a sufficient amount of training data is input, the object-recognition model 300 has been trained to recognize raindrop images, so the object-recognition model 300 can be regarded as the raindrop-image-recognition model 135 at this time, and can be used to recognize the raindrop images of each scene image in the video sequence that is input to the object-recognition model 300.
As depicted in
After the raindrop-image-recognition model 400 has recognized all raindrop images in the current scene image, the number and position of each (recognized) raindrop image 421 in the current scene image can be known, and that can be removed (or replaced) according to a predetermined order or randomly as described below. It should be noted that the position and size of the original raindrop image 420 in each scene image are close to the position and size of the recognized raindrop image 421.
In some embodiments, the raindrop-image-recognition model 400 may set a stop condition to stop recognizing and replacing the raindrop images 421 in each scene image. The aforementioned stop condition can be, for example,: (1) the raindrop-image-recognition model 400 has recognized a predetermined amount of raindrop images 421 from the current scene image; or (2) the raindrop-image-recognition model 400 has recognized all raindrop images 421 (e.g., a first number N), and has successfully removed a predetermined ratio for the first number N of raindrop images 421, for example, half (i.e., N/2) of raindrop images 421 have been successfully removed.
If the scene image 405 is the current scene image, when the raindrop-image-recognition model 400 has recognized the raindrop image 421 from the scene image 405, the position and size of the raindrop image 421 will be recorded, such as the position and size information shown in the lower portion in
Specifically, the raindrop-removal program 133 may calculate the degree of overlapping between the raindrop image in the current scene image and the raindrop image 421 in any of previous scene images (e.g., scene images 401 to 404), wherein the degree of overlapping can be represented by “intersection over union (IoU)” which is a ratio of the overlapping area to the union area. For example, for ease of description, it is assumed that the size of the raindrop images 421 in the current scene image and previous scene image is A, and the overlapping area of the two raindrop images 421 occupies ⅔ of the area of the raindrop image 421, which means that the union area is 4/3 of the area of the raindrop image 421. At this time, the IoU of the raindrop images 421 in the current scene image and previous scene image can be calculated as
It should be noted that even if it is the same raindrop image, the size of the raindrop image in the scene images at different time points may be different because the vehicle camera is shooting while the vehicle is moving. However, by using the aforementioned method, the raindrop-removal program 133 can still calculate the IoU of the raindrop images in the current scene image and previous scene image.
In the embodiment, the raindrop-removal program 133 can further set a predetermined ratio threshold (e.g., 0.5), and determine whether the combined ratio of the raindrop image 421 is less than the predetermined ratio threshold. When the IoU is less than the predetermined ratio threshold, it indicates that the degree of overlapping of the raindrop images 421 in the current scene image and previous scene image is small, so the raindrop-removal program 133 can determine that the raindrop image 421 is revertible (i.e. the raindrop image 421 in the current scene image can be removed via replacing), and put the raindrop image 421 in the current scene image to the revertible candidate list. In other words, the raindrop-removal program 133 can replace the portion of the raindrop image 421 in the current scene image, that is not overlapped with the raindrop image 421 in the previous scene image, with the corresponding region (i.e., non-overlapping region) in the previous scene image. Accordingly, all or a portion of the raindrop image in the current scene image can be replaced by pixels in the corresponding region in the previous scene image.
In some embodiments, the raindrop-removal program 133 may first calculate the IoU between the raindrop image in the current scene image (e.g., scene image 405, t=n) and the raindrop image 421 in the previous scene image (e.g., scene image 404, t=n−1). If the raindrop-removal program 133 determines that the IoU is smaller than the predetermined ratio threshold, the raindrop-removal program 133 may put the raindrop image in the current scene image into the revertible candidate list, and record the information in the corresponding previous scene image 404. If the raindrop-removal program 133 determines that the IoU is greater than or equal to the predetermined ratio threshold, the raindrop-removal program 133 will calculate the IoU between the raindrop image in the current scene image (e.g., scene image 405, t=n) and the raindrop image 421 in the previous scene image (e.g., scene image 403, t=n−1). Similarly, if the raindrop-removal program 133 determines that the IoU is smaller than the predetermined ratio threshold, the raindrop-removal program 133 may put the raindrop image in the current scene image into the revertible candidate list, and record the information in the corresponding previous scene image 403. If the raindrop-removal program 133 determines that the IoU is greater than or equal to the predetermined ratio threshold, the raindrop-removal program 133 will calculate the IoU between the raindrop image in the current scene image (e.g., scene image 405, t=n) and the raindrop image 421 in the previous scene image (e.g., scene image 402, t=n−2).
The aforementioned process of determining whether the raindrop image in the current scene image can be put into the revertible candidate list can be repeated, and the raindrop-removal program 133 can compare with a predetermined number (e.g., 4) of previous scene images at most, but the invention is not limited thereto. Accordingly, the raindrop-removal program 133 may determine the trajectory of the raindrop image 421 according to the IoU between the raindrop image 421 in the current scene image and the raindrop image 421 in each previous scene image.
In other words, if the IoU between the raindrop image 421 in the current scene image (e.g., scene image 405) and the raindrop image 421 in any of the previous scene images is greater than or equal to the predetermined ratio threshold, the raindrop-removal program 133 will not put the raindrop image 421 in the current scene image to the revertible candidate list.
In some embodiments, if the IOUs between the raindrop image 421 in the current scene image (e.g., scene image 405) and the raindrop images 421 in multiple previous scene images are smaller than the predetermined ratio threshold, the raindrop-removal image will select the previous scene image at a time point closer to the current scene image as the previous scene image corresponding to the raindrop image 421 in the revertible candidate list.
In some other embodiments, when multiple IOUs between the raindrop image 421 in the current scene image (e.g., scene image 405) and the raindrop images 421 in multiple previous scene images are smaller than the predetermined ratio threshold, the raindrop-removal program 133 will compare the IOUs and select the previous scene image having the smallest IoU (i.e., least overlapping) as the previous scene image corresponding to the raindrop image in the revertible candidate list.
Specifically, when the raindrop image 421 in the current scene image is recognized by the raindrop-image-recognition model 400 and the raindrop-removal program 133 places the raindrop image 421 into the revertible candidate list, it indicates that the raindrop-removal program 133 may perform the raindrop-removal process on the raindrop image 421. As depicted in
As shown in
In some embodiments, the raindrop-removal program 133 can set a region of interest (ROI) or a priority region, such as setting a predetermined region around the center of the scene image as the ROI. If the height and width of the scene image are respectively H and W, the ROI can be, for example, the center of the scene image extending up and down by H/4 and left and right by W/4. This ROI is also the most concentrated region of the driver's attention, so it is necessary to remove raindrops in the scene image first to improve the accuracy and reliability of the back-end image processing and autonomous vehicle driving decisions.
When the number of raindrop images in the revertible candidate list corresponding to the current scene image is quite large, if the computation unit 110 has considerations of computing performance or power consumption, it is not necessary for the computation unit 110 to perform the raindrop-removal processing on all raindrop images in the current scene image. Accordingly, the raindrop-removal program 133 can preferentially perform the raindrop-removal processing on the raindrop images in the revertible candidate list and located in the ROI. If the number of raindrop images in the revertible candidate list and located in the ROI is still quite large, the raindrop-removal program 133 can select the raindrop images in the revertible candidate list in a predetermined order (e.g., sequential scanning) or randomly in the ROI, and perform the raindrop-removal processing on the selected raindrop images.
Similar to the aforementioned embodiment, in this embodiment, the raindrop-image-recognition model 400 can also set a stop condition to stop recognizing and replacing the raindrop images 421 in the current scene image, where the stop condition may be, for example: (1) the raindrop-image-recognition model 400 has recognized a predetermined number of raindrop images 421 in the ROI of the current scene image; (2) the raindrop-image-recognition model 400 has recognized all raindrop images in the ROI of the current scene image (e.g., the first number N), and the raindrop images 421 of a predetermined portion (e.g., 0.5) of the first number N have been successfully removed, that is, there are N/2 number of raindrop images 421 in the ROI that have been successfully removed.
In one embodiment, the non-volatile memory 132 in
Referring to
In step S620, the raindrop-image-recognition model is used to recognize a plurality of raindrop images in a plurality of scene images of a video sequence, and the position and size of each raindrop image in the current scene image is recorded. For example, the image-capturing device 120 can be used to capture the video sequence, as shown in
In step S630, in response to a specific raindrop image in the current scene image among the scene images meeting a predetermined condition, the specific raindrop image is replaced by the image area corresponding to a specific scene image prior to the current scene image to generate an output scene image. For example, the raindrop-removal program 133 may first analyze the trajectory of each raindrop image in the current scene image, such as calculating the degree of overlapping between the raindrop image in the current scene image and the raindrop image 421 in any of previous scene images (e.g., scene images 401 to 404), wherein the degree of overlapping can be represented by “intersection over union (IoU)” which is a ratio of the overlapping area to the union area. The raindrop-removal program 133 can repeatedly execute the process of judging whether the raindrop image in the current scene image can be put into the revertible candidate list, and the raindrop-removal program can compare up to a predetermined number (e.g., 4) of previous scene images, but the invention is not limited thereto. The predetermined condition, for example, may be that the IoU of the specific raindrop image in the current scene image and the specific raindrop image in the specific scene image is less than a predetermined ratio threshold (e.g., 0.5).
In addition, the raindrop-removal program 133 may perform the raindrop-removal processing on each raindrop image in the current scene image according to the trajectory of each raindrop image to obtain an output scene image after the raindrop images are removed. For example, the raindrop-removal program 133 may replace the raindrop image in the current scene image with the pixels in the corresponding region of the raindrop image in the previous region to obtain the output scene image which the raindrop images are removed. The mechanism of the raindrop images in the revertible candidate list can be adjusted according to different conditions, such as selecting the raindrop images in the revertible candidate list of the current scene image in a predetermined order (e.g., sequential scanning) or randomly, or selecting the raindrop images in the revertible candidate list of the ROI of the current scene image in a predetermined order or randomly.
In view of the above, a computation apparatus and a method of removing raindrops from video images are provided. For example, using scene images taken at different time points in the video sequence, and a more suitable region in the previous scene image can be found and used to replace the raindrop image in the current scene image. Accordingly, the method of removing raindrops from video images can achieve a better raindrop-removal effect. When the raindrops in the scene images are moved, the accuracy and reliability of back-end image processing and autonomous-vehicle-driving decisions can be further improved.
The methods, or certain aspects or portions thereof, may take the form of program code embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other machine-readable (e.g., computer-readable) storage medium, or computer program products without limitation in external shape or form thereof, wherein, when the program code is loaded into and executed by a machine such as a computer, the machine thereby becomes an apparatus for practicing the methods. The methods may also be embodied in the form of program code transmitted over some transmission medium, such as an electrical wire or a cable, or through fiber optics, or via any other form of transmission, wherein, when the program code is received and loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the disclosed methods. When implemented on a general-purpose processor, the program code combines with the processor to provide a unique apparatus that operates analogously to application specific logic circuits.
While the disclosure has been described by way of example and in terms of the preferred embodiments, it should be understood that the disclosure is not limited to the disclosed embodiments. On the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.
Number | Date | Country | Kind |
---|---|---|---|
109128001 | Aug 2020 | TW | national |