Systems and methods for automatic camera calibration
Methods and systems are provided for calibrating an on-board camera of a vehicle by detecting one or both of a lead vehicle geometry and a road lane width. In one example, a method includes identifying a known vehicle geometry of a lead vehicle; estimating a distance to the lead vehicle based on matching the known vehicle geometry to an image of the known vehicle geometry from the camera; and updating a calibration of the camera based on the estimated distance.
1 . A method for calibrating a camera mounted in a vehicle, comprising:
identifying a known vehicle geometry of a lead vehicle;
estimating a distance to the lead vehicle based on matching the known vehicle geometry to an image of the known vehicle geometry from the camera by:
measuring an apparent distance between tail lights of the lead vehicle in the image;
classifying the lead vehicle into a vehicle class of a plurality of vehicle classes by comparing the apparent distance to known vehicle geometries associated with the plurality of vehicle classes;
selecting the known vehicle geometry using the vehicle class;
calculating an estimated distance from the camera to a midpoint of tail light geometric centers using a geometric construction of the tail lights in the image and the known vehicle geometry for the vehicle class, wherein the geometric construction comprises identifying the tail light geometric centers based on color detection and resolving an angle between the tail light geometric centers as seen from the camera; and
updating a calibration of the camera based on the estimated distance, wherein the known vehicle geometry includes a known tail light width.
2 . The method of claim 1 , wherein the known vehicle geometry is a track width.
3 . The method of claim 1 , further comprising:
measuring the apparent distance between rear tires of the lead vehicle in the image;
classifying the lead vehicle into the vehicle class based on a combination of the apparent distance between the rear tires and the tail lights; and
calculating the estimated distance from the camera to both a midpoint of the tail light geometric centers and a midpoint of rear tire geometric centers using the geometric construction of the tail lights in the image, a geometric construction of the rear tires in the image, and the known vehicle geometry for the vehicle class by:
identifying the tail light geometric centers and the rear tire geometric centers based on color detection;
calculating the angle between imaginary lines extending from the camera to each geometric center; and
determining the estimated distance based on the angle and the known vehicle geometry; and
updating the calibration by:
determining a horizon line in the image;
calculating a camera height and orientation using the horizon line and estimated distance; and
adjusting a detection region of interest based on the camera height and orientation.
4 . The method of claim 1 , further comprising identifying a known lane width of a road on which the vehicle is traveling and calibrating the camera based on the known lane width.
5 . The method of claim 1 , wherein a class of the lead vehicle determines the known vehicle geometry.
6 . The method of claim 1 , further comprising adjusting a detection region of interest of the camera based on the updated calibration by:
identifying of a left tail light geometric center and a right tail light geometric center of the tail lights; resolving the angle between the left tail light geometric center and the right tail light geometric center; and using the angle and the known tail light width to calculate the estimated distance between the camera and a midpoint of the left tail light geometric center and the right tail light geometric center.
7 . The method of claim 1 , wherein identifying the known vehicle geometry is based on a trained network using images from the camera.
8 . The method of claim 1 , further comprising:
measuring the apparent distance between rear tires of the lead vehicle in the image;
classifying the lead vehicle into the vehicle class based on a combination of the apparent distance between the rear tires and the tail lights; and
calculating the estimated distance from the camera to both a midpoint of the tail light geometric centers and a midpoint of rear tire geometric centers using the geometric construction.
9 . The method of claim 1 , further comprising:
updating the calibration by:
determining a horizon line in the image;
calculating a camera height and orientation using the horizon line and estimated distance; and
adjusting a detection region of interest based on the camera height and orientation.
10 . A system for calibrating a camera mounted in a vehicle, comprising:
an image sensor;
a processor; and
memory storing instructions executable by the processor to:
identify a known vehicle geometry of a lead vehicle;
identify a known lane width on a road on which the vehicle is travelling;
estimate a distance to the lead vehicle based on matching the known vehicle geometry to an image of the known vehicle geometry obtained with the image sensor by measuring an apparent distance between features of the lead vehicle and comparing the apparent distance to known vehicle geometries to classify the lead vehicle; and
update a calibration of the camera based on one or both of the estimated distance and the known lane width,
wherein the features include one or both of tail lights and rear tires of the lead vehicle.
11 . The system of claim 10 , wherein updating the calibration of the camera comprises updating a height and/or orientation of the camera based on one or both of the estimated distance and the known lane width.
12 . The system of claim 11 , wherein the instructions are further executable to set a detection region of interest based on the updated height and/or orientation of the camera and to output a notification in response to detecting an object within the detection region of interest.
13 . The system of claim 10 , wherein the instructions are further executable to estimate the distance to the lead vehicle by:
measuring an apparent distance between tail lights of the lead vehicle in the image;
classifying the lead vehicle into a vehicle class of a plurality of vehicle classes by comparing the apparent distance to known vehicle geometries associated with the plurality of vehicle classes;
selecting the known vehicle geometry using the vehicle class; and
calculating the estimated distance from the camera to a midpoint of tail light geometric centers using a geometric construction of the tail lights in the image and the known vehicle geometry for the vehicle class.
14 . The system of claim 10 , wherein the known vehicle geometry includes a known track width of the lead vehicle, and wherein identifying the known track width of the lead vehicle includes classifying the lead vehicle into one of a plurality of vehicle types and selecting the known track width based on the classification of the lead vehicle.
15 . The system of claim 14 , wherein classifying the lead vehicle into one of the plurality of vehicle types includes entering the image as input to a trained network stored in the memory.