Image detection method, electronic device, and storage medium
AssigneeHon Hai Precision Industry Co., Ltd.
InventorShiaw-Herng Liu
Life of this patent
Estimating the term…
Abstract
An image detection method determines a target object. A plurality of original images of a scene in front of a vehicle are obtained. An object in one original image is detected, and a degree of similarity between the object in the original image and the target object in a preset image is calculated. If the degree of similarity is greater than a preset similarity threshold, it is determined that the original image is a target image and the object is the target object. A position of the target object relative to the vehicle is determined and output. The method can recognize objects of interest in front of a driver.
Claims15
An image detection method for a vehicle, comprising:
- determining a target object;
- obtaining a plurality of original images of a scene in front of the vehicle;
- detecting a target image comprising the target object from the plurality of original images, comprising:
- detecting an object in one original image of the plurality of original images, calculating a degree of similarity between the object in the original image and the target object in a preset image, and comprising:
- adjusting a size of the original image and normalizing the original image by adjusting a center point of the original image and setting the center point to zero (0), extracting features of the object in the original image, and performing preset operations on the features to exclude the features with less information;
- and calculating a structural similarity index between the features of the object and the target object as the degree of similarity by a structural similarity index algorithm;
- and determining that the original image is the target image and the object is the target object when the degree of similarity is greater than a preset similarity threshold;
- determining a position of the target object relative to the vehicle, comprising obtaining first parameters of an image capturing device that captures the plurality of original images and second parameters of the target object in the target image, the image capturing device comprising two monocular cameras, the first parameters comprising internal parameters of the monocular cameras and a relative position of the monocular cameras, and the second parameters comprising a width of the target object in the target image;
- performing binocular correction according to the first parameters and the second parameters, matching corresponding pixels in two images captured by the two monocular cameras to obtain a disparity map, calculating disparity data of the two images according to the disparity map;
- according to the disparity data, calculating a distance of the position by using a similar triangle principle;
- outputting the position of the target object relative to the vehicle;
- and
- notifying a driver of the vehicle of the position of the target object relative to the vehicle.
An electronic device installed in a vehicle comprising:
- at least one processor;
- and
- a storage device storing computer-readable instructions, which when executed by the at least one processor, cause the at least one processor to:
- determine a target object;
- obtain a plurality of original images of a scene in front of the vehicle;
- detect a target image comprising the target object from the plurality of original images, comprising:
- detecting an object in one original image of the plurality of original images, calculate a degree of similarity between the object in the original image and the target object in a preset image, and comprising:
- adjusting a size of the original image and normalizing the original image by adjusting a center point of the original image and setting the center point to zero, extracting features of the object in the original image, and performing preset operations on the features to exclude the features with less information;
- and calculating a structural similarity index between the features of the object and the target object as the degree of similarity by a structural similarity index algorithm;
- and determine that the original image is the target image and the object is the target object when the degree of similarity is greater than a preset similarity threshold;
- determine a position of the target object relative to the vehicle, comprising obtaining first parameters of an image capturing device that captures the plurality of original images and second parameters of the target object in the target image, the image capturing device comprising two monocular cameras, the first parameters comprising internal parameters of the monocular cameras and a relative position of the monocular cameras, and the second parameters comprising a width of the target object in the target image;
- perform binocular correction according to the first parameters and the second parameters, match corresponding pixels in two images captured by the two monocular cameras to obtain a disparity map, calculate disparity data of the two images according to the disparity map;
- according to the disparity data, calculate a distance of the position by using a similar triangle principle;
- output the position of the target object relative to the vehicle;
- and
- notify a driver of the vehicle of the position of the target object relative to the vehicle.
A non-transitory storage medium having stored thereon computer-readable instructions that, when the computer-readable instructions are executed by a processor to implement the following method:
- determining a target object;
- obtaining a plurality of original images of a scene in front of a vehicle;
- detecting a target image comprising the target object from the plurality of original images, comprising:
- detecting an object in one original image of the plurality of original images, calculating a degree of similarity between the object in the original image and the target object in a preset image, and comprising:
- adjusting a size of the original image and normalizing the original image by adjusting a center point of the original image and setting the center point to zero, extracting features of the object in the original image, and performing preset operations on the features to exclude the features with less information;
- and calculating a structural similarity index between the features of the object and the target object as the degree of similarity by a structural similarity index algorithm;
- and determining that the original image is the target image and the object is the target object when the degree of similarity is greater than a preset similarity threshold;
- determining a position of the target object relative to the vehicle, comprising obtaining first parameters of an image capturing device that captures the plurality of original images and second parameters of the target object in the target image, the image capturing device comprising two monocular cameras, the first parameters comprising internal parameters of the monocular cameras and a relative position of the monocular cameras, and the second parameters comprising a width of the target object in the target image;
- performing binocular correction according to the first parameters and the second parameters, matching corresponding pixels in two images captured by the two monocular cameras to obtain a disparity map, calculating disparity data of the two images according to the disparity map;
- according to the disparity data, calculating a distance of the position by using a similar triangle principle;
- outputting the position of the target object relative to the vehicle;
- and
- notifying a driver of the vehicle of the position of the target object relative to the vehicle.
Dependencies are inferred from the claim text.