Object detection method and device
Provided is an object detection method including detecting a first object by using an object detection filter in an original image and images of which resolutions are downscaled and detecting a second object by using a neural network-based object detection model of which an input is a target image that is determined to be one of the original image and the images of which resolutions are downscaled.
1. An object detection method performed by an electronic device, the object detection method comprising:
generating a first image by downscaling an original image to a first resolution;
generating a second image by downscaling the original image to a second resolution that is different from the first resolution;
detecting at least one first object by scanning at least one of the original image, the first image, and the second image by using a preset object detection filter;
determining a target image among the original image, the first image, and the second image; and
detecting at least one second object in the target image by using a neural network-based object detection model,
wherein the determining the target image among the original image, the first image, and the second image comprises:
determining whether the number of previous objects detected in a previous target image prior to the target image is greater than or equal to a first threshold that is preset for a previous resolution of the previous target image; and
when the number of previous objects is greater than or equal to the first threshold, determining an image of a resolution that is lower than the previous resolution to be the target image.
2. The object detection method of claim 1 , further comprising:
storing the original image, the first image, and the second image, wherein
the detecting the at least one second object in the target image by using the neural network-based object detection model comprises:
detecting the second object in an image that is determined to be the target image among the original image, the first image, and the second image.
3. The object detection method of claim 1 , wherein
the neural network-based object detection model is based on a convolutional neural network (CNN).
4. The object detection method of claim 1 , wherein
the determining the target image among the original image, the first image, and the second image comprises:
determining, to be the target image, an image of a preset resolution among the original image, the first image, and the second image.
5. The object detection method of claim 1 , wherein
the determining the target image among the original image, the first image, and the second image further comprises:
determining whether the number of previous objects is less than a second threshold that is preset for the previous resolution of the previous target image; and
when the number of previous objects is less than the second threshold, determining an image of a resolution that is higher than the previous resolution to be the target image.
6. The object detection method of claim 1 , wherein
the electronic device is comprised in an autonomous driving vehicle or a vehicle supporting advanced driver assistance systems (ADAS).
7. A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the object detection method of claim 1 .
8. An electronic device for detecting an object, the electronic device comprising:
a processor configured to execute a program for detecting an object; and
a memory configured to store the program, wherein
the program comprises:
generating a first image by downscaling an original image to a first resolution;
generating a second image by downscaling the original image to a second resolution that is different from the first resolution;
detecting at least one first object by scanning at least one of the original image, the first image, and the second image by using a preset object detection filter;
determining a target image among the original image, the first image, and the second image; and
detecting at least one second object in the target image by using a neural network-based object detection model,
wherein the determining the target image among the original image, the first image, and the second image comprises:
determining whether the number of previous objects detected in a previous target image prior to the target image is less than a second threshold that is preset for the previous resolution of the previous target image; and
when the number of previous objects is less than the second threshold, determining an image of a resolution that is higher than the previous resolution to be the target image.
9. The electronic device of claim 8 , further comprising:
a camera configured to generate the original image.
10. The electronic device of claim 8 , wherein
the program is further configured to store the original image, the first image, and the second image in the memory, wherein
the detecting the at least one second object comprises:
detecting the second object in an image that is determined to be the target image among the original image, the first image, and the second image.
11. The electronic device of claim 8 , wherein
the neural network-based object detection model is based on a convolutional neural network (CNN).
12. The electronic device of claim 8 , wherein
the determining the target image among the original image, the first image, and the second image comprises:
determining, to be the target image, an image of a preset resolution among the original image, the first image, and the second image.
13. The electronic device of claim 8 , wherein
the electronic device is comprised in an autonomous driving vehicle or a vehicle supporting advanced driver assistance systems (ADAS).