A system and method for controlling the in situ orientation of the headlamps
of
a vehicle, from a camera that is mounted in the headlamp, as a function of the
attitude of the vehicle. A camera is secured to a reflector of the headlamp so
as to film the road extending in front of the vehicle. An image processing unit
processes at least two successive images in order to detennine a measured horizon
line of the road scene in front of the vehicle. A setpoint horizon line has been
determined beforehand during initial adjustment of the headlamp. The real horizon
line is then brought closer to the setpoint horizon line by modifying the orientation
of the headlamp, until the distance between the measured line and the setpoint
line tends towards zero.