# Patent

## Title
Position detecting apparatus and method of correcting data therein

## Abstract

A first object and a second object arranged in an actual space with coordinates (Xn, Zn) and (Xn−D, Zn) are imaged, and respective coordinates x1* and x2* of the first object and the second object in the image are calculated. Then, a coordinate x1 of the first object in the image and a coordinate x2 of the second object in the image are calculated by equations:

x1=F·Xn/Zn 

x2=F·(Xn−D)/Zn 

where F is a design parameter of an imaging unit. An image distortion corrective value α to correct the design parameter F is calculated by equations:

α·x1*=x1

α·x2*=x2

using a difference between the coordinates x1 and x1* and a difference between the coordinates x2 and x2*.

## Background
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present invention relates to a position detecting apparatus which obtains an image of an object with an imaging unit for detecting the position in an actual space of the object, and a method of correcting data in the position detecting apparatus.
2. Description of the Related Art
There has been developed a vehicle vicinity monitoring apparatus for obtaining images of one object with two imaging units mounted on a vehicle, for example, either measuring the distance up to the object based on the parallax between the obtained images, or measuring the position in an actual space of the object with respect to the vehicle, and informing the driver of whether there is an obstacle ahead of the vehicle or not (see Japanese Laid-Open Patent Publication No. 2003-216937).
In this invention, assuming that the coordinates of the object in an actual space are defined as (Xn, Yn, Zn) and that a perspective transformation model is used, the coordinates (x, y) in the two-dimensional image obtained by each of the imaging units are calculated by equations (1), (2) below, where F is a camera parameter.

x=F·Xn/Zn  (1)

y=F·Yn/Zn  (2)

F is obtained by an equation (3) below, where f is a focal length of the imaging unit, and p is a pixel pitch of the imaging unit.

F=f/p  (3)

Generally, each of the imaging units has its individual differences in an actual focal length and an actual pixel pitch as errors for design values. Thus, the correct position in an actual space of the object cannot be calculated without correction of the errors.
SUMMARY OF THE INVENTION
It is a general object of the present invention to provide a position detecting apparatus and a method of correcting data in the position detecting apparatus, which is capable of correcting the variation of design parameters due to individual differences easily and calculating a measured position of the object highly accurately.
A primary object of the present invention is to provide a position detecting apparatus and a method of correcting data in the position detecting apparatus, which is capable of correcting an error in a measured position of the object due to the image distortion of the imaging unit.
The above and other objects, features, and advantages of the present invention will become more apparent from the following description when taken in conjunction with the accompanying drawings in which preferred embodiments of the present invention are shown by way of illustrative example.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a schematic perspective view of a night vision system which incorporates a position detecting apparatus and a method of correcting data in the position detecting apparatus;
FIG. 2 is a functional block diagram of an ECU of the night vision system shown in FIG. 1;
FIG. 3 is a perspective view of an aiming target control apparatus installed in a manufacturing plant;
FIG. 4 is a perspective view of a service aiming adjustment apparatus installed in a service factory or the like;
FIGS. 5 through 9 are flowcharts of an aiming process;
FIG. 10 is a diagram illustrative of a calculating process for an image distortion corrective value of a design parameter; and
FIG. 11 is a flowchart of an object searching process in a normal mode.



DESCRIPTION OF THE PREFERRED EMBODIMENTS
A position detecting apparatus and a method of correcting data in the position detecting apparatus according to preferred embodiments of the present invention will be described below with reference to the accompanying drawings.
As shown in FIG. 1, a night vision system (vehicle vicinity monitoring apparatus) 10 according to an embodiment of the present invention is installed on a vehicle 12. The night vision system 10 has an ECU (Electronic Control Unit) 14 serving as a main controller, a pair of left and right infrared cameras (imaging units) 16R, 16L, an HUD (Head-Up Display) 18 for displaying a detected image, a speaker 20 for outputting an alarm sound, a speed sensor 22 for detecting a running speed, a yaw rate sensor 24 for detecting a yaw rate of the vehicle 12 when the vehicle 12 is driven, a solar radiation sensor 26, a headlight switch 28, a main switch 30 for selectively activating and inactivating the night vision system 10, and a connector 32 for connecting the night vision system 10 to an external computer system. These components of the night vision system 10 may be connected to each other by intravehicular communication lines that are used by other systems on the vehicle 12.
The infrared cameras 16R, 16L are mounted respectively in the right and left ends of a horizontal grill hole defined in a lower bumper region. The infrared cameras 16R, 16L are oriented forwardly at respective symmetrical positions and horizontally spaced from each other by an inter-camera distance (also referred to as “base length”) B. Each of the infrared cameras 16R, 16L detects far-infrared radiation to obtain an infrared image in which higher-temperature areas represent higher luminance, and supplies the obtained image to the ECU 14.
The HUD 18 is disposed on an upper surface of an instrumental panel at a position directly in front of the driver seated on a driver's seat of the vehicle 12, while trying not to obstruct the front vision of the driver. When the night vision system 10 is turned off, the HUD 18 is retracted down in the instrumental panel. If it is judged that the present time is nighttime based on information from the solar radiation sensor 26 and also that the headlights (or fog lamps) are turned on based on information from the headlight switch 28, then the HUD 18 pops up from the instrumental panel when the main switch 30 is turned on. The HUD 18 has an image display panel comprising a concave mirror for reflecting and projecting an image sent from within the instrumental panel. The night vision system 10 may be automatically activated by an automatic lighting function regardless of whether the main switch 30 is operated or not. The luminance of the image display panel of the HUD 18 may be made adjustable by a suitable switch.
The ECU 14 processes two infrared images obtained by the respective infrared cameras 16R, 16L to detect heat-source objects based on the parallax between the infrared images, and displays the detected heat-source objects as white silhouettes on the HUD 18. When the ECU 14 identifies a pedestrian among the heat-source objects, the ECU 14 controls the speaker 20 to output an alarm sound and also controls the HUD 18 to highlight the identified pedestrian with a surrounding frame having a striking color for thereby drawing the driver's attention. The ECU 14 performs such an attention drawing function at such good timing to allow the driver to take a sufficient danger avoiding action, by predicting a period of time until the vehicle 12 reaches the position of the pedestrian in a predetermined speed range.
In order for the infrared cameras 16R, 16L to be able to accurately determine the positions, distances, and shapes of far heat-source objects, the infrared cameras 16R, 16L are subject to an adjustment process called an aiming process (which will be described later) when they are manufactured in the manufacturing plant or when they are inspected at regular intervals.
As shown in FIG. 2, the ECU 14 comprises an image input unit 40 for converting analog infrared images obtained by the respective infrared cameras 16R, 16L into digital gray-scale images, a binarizer 42 for generating binary images from the gray-scale images based on a threshold value, an image memory 44 for storing the binary images and the gray-scale images, an aiming mode execution unit 48 for storing camera parameters produced as a result of the aiming process into a camera parameter memory 46, a normal mode execution unit 50 for performing a normal image processing process while referring to sensors including the speed sensor 22, etc. and the camera parameters stored in the camera parameter memory 46, and controlling the HUD 18 and the speaker 20, and a mode selector 52 for selecting either an aiming mode or a normal mode at a time based on an instruction transmitted from an external computer system through the connector 32.
The normal mode execution unit 50 functions as a correcting unit for correcting projected coordinates of the imaged object by using a corrective coefficient representing a camera parameter stored in the camera parameter memory 46.
The aiming mode execution unit 48 has a manufacturing plant mode unit 70 for performing the aiming process with an aiming target control apparatus 100 (see FIG. 3) as the external computer system in the manufacturing plant in which the vehicle 12 is manufactured, and a service mode unit 72 for performing the aiming process with a service aiming adjustment apparatus 120 (see FIG. 4) as the external computer system in a service factory or the like. Either the manufacturing plant mode unit 70 or the service mode unit 72 is selected at a time based on an instruction from a corresponding one of the external computer systems.
The aiming mode execution unit 48 has a parameter input unit 74 for inputting certain parameters from the external computer system when the aiming process is initiated, an initializing unit 76 for making initial settings required by the aiming process, a template matching unit 78 for performing template matching on the gray-scale images stored in the image memory 44, a luminance adjustment LUT setting unit 80 for setting a luminance adjustment LUT for adjusting the luminance of image signals produced by the infrared cameras 16R, 16L, a camera image distortion correcting unit 82 for calculating an image distortion corrective value (a corrective coefficient) to correct image distortions caused due to individual differences as to focal lengths, pixel pitches, etc. between the infrared cameras 16R, 16L, a camera mounting angle calculating unit 84 for calculating respective mounting angles (a pan angle and a pitch angle) of the infrared cameras 16R, 16L, a camera image clipping coordinate calculating unit 86 for calculating clipping coordinates used as a reference for clipping processed ranges from images, and a parallax offset value calculating unit 88 for calculating a parallax offset value as an error which is contained in the parallax between object images because the optical axes of the infrared cameras 16R, 16L are not parallel to each other.
The camera image distortion correcting unit 82 functions as: a position-in-image calculating unit for calculating the position (or coordinates) of an object in the image obtained by the infrared cameras 16R, 16L; and a corrective coefficient calculating unit for calculating a corrective coefficient representing an image distortion corrective value.
The initializing unit 76 has a template setting unit 94 for selecting one of six templates TP1, TP2, TP3, TP4, TP5, TP6 (collectively also referred to as “template TP”) that have been prepared depending on the distance up to objects. The ECU 14 has a model memory 96 for storing, as a formula, a perspective transformation model for determining the position of an object. The aiming mode execution unit 48 and the normal mode execution unit 50 calculate the position of an imaged object using the perspective transformation model stored in the model memory 96. The model memory 96 stores a short-distance model for objects at short distances and a long-distance model for objects at long distances.
The ECU 14 has a CPU (Central Processing Unit) as a main controller, a RAM (Random Access Memory) and a ROM (Read Only Memory) as a memory device, and other components. The above functions of the ECU 14 are implemented in software when the CPU reads a program and executes the program in cooperation with the memory device.
As shown in FIG. 3, the aiming target control apparatus 100 has positioning devices 102 for positioning the vehicle 12, a gate 104 disposed in a given position in front of the infrared cameras 16R, 16L on the vehicle 12 that is positioned by the positioning devices 102, and a main control device 106 for communicating with the ECU 14 through the connector 32 and controlling the gate 104. The gate 104 has two vertical posts 108 horizontally spaced from each other by a distance which is slightly greater than the width of the vehicle 12, and a horizontally elongate aiming target plate 110 having left and right ends movably supported respectively by the posts 108. The aiming target plate 110 is vertically movable along the posts 108 by the main control device 106. The aiming target plate 110 supports thereon an array of eight aiming targets 112a through 112h (collectively also referred to as “aiming target(s) 112”) as heat sources that are successively arranged horizontally from the left in the order named.
The four left aiming targets 112a through 112d are spaced at relatively small intervals W and belong to a left target group 114. The four right aiming targets 112e through 112h are also spaced at the intervals W and belong to a right target group 116. The aiming target 112d on the right end of the left target group 114 and the aiming target 112e on the left end of the right target group 116 are spaced from each other by a distance which is equal to the base length B (W<B). These aiming targets 112d, 112e are positioned just in front of the infrared cameras 16L, 16R, respectively.
As shown in FIG. 4, the service aiming adjustment apparatus 120 has positioning markers 122 for positioning the vehicle 12, a headlight tester 124 disposed in a given position in front of the infrared cameras 16R, 16L on the vehicle 12 that is positioned based on the positioning markers 122, and a main control device 126 for communicating with the ECU 14 through the connector 32. The headlight tester 124 is movable along a rail 128 in directions parallel to the transverse direction of the vehicle 12 and has a lifter table 130 which is vertically movable. The lifter table 130 supports thereon a target plate 132 having three aiming targets 134a through 134c (collectively also referred to as “aiming target(s) 134”) as heat sources that are successively arranged horizontally. The aiming targets 134a through 134c are spaced at the intervals W (W<B). The aiming target 134 may be identical to or substantially the same as the aiming target 112 of the gate 104 shown in FIG. 3.
The aiming process to be performed on the night vision system 10 using the aiming target control apparatus 100 or the service aiming adjustment apparatus 120 will be described below.
The aiming process includes a manufacturing plant aiming mode to be performed using the aiming target control apparatus 100 and a service aiming mode to be performed using the service aiming adjustment apparatus 120.
In the manufacturing plant aiming mode, the vehicle 12 is positioned by the positioning devices 102, and the main control device 106 is connected to the connector 32 of the vehicle 12. The main control device 106 sends an instruction for performing the manufacturing plant aiming mode using the aiming target control apparatus 100 to the ECU 14. The aiming targets 112a through 112h are positionally adjusted to the same height as the infrared cameras 16R, 16L depending on the type of the vehicle 12.
In the service aiming mode, the vehicle 12 is positioned with the wheels aligned with the respective positioning markers 122, and the main control device 126 is connected to the connector 32 of the vehicle 12. The main control device 126 sends an instruction for performing the service aiming mode using the service aiming adjustment apparatus 120 to the ECU 14. The aiming targets 134a through 134c are positionally adjusted to a predetermined height.
FIGS. 5 through 9 show the aiming process that is mainly performed by the aiming mode execution unit 48 of the ECU 14. The aiming process will be described in detail below with reference to FIGS. 5 through 9.
In step S1 shown in FIG. 5, an analog stereographic infrared image is input from the infrared cameras 16R, 16L to the image input unit 40. The image input unit 40 converts the analog stereographic infrared image into a digital gray-scale image in step S2. The gray-scale image is stored in the image memory 44. The gray-scale image is converted by the binarizer 42 into a binary image, which is also stored in the image memory 44.
In step S3, the mode selector 52 determines whether the aiming mode or the normal mode is to be executed according to an instruction from the main control device 106 or 126. If the normal mode is to be executed, then control goes to step S5. If the aiming mode is to be executed, then control goes to step S4.
In the normal mode in step S5, the normal mode execution unit 50 operates to refer to the camera parameters stored in the camera parameter memory 46, and controls the HUD 18 and the speaker 20 to search for an object and draw the driver's attention, as described later. Thereafter, control goes back to step S1.
In the aiming mode in step S4, the mode selector 52 determines which of the aiming target control apparatus 100 and the service aiming adjustment apparatus 120 is to be used. If it is judged that the aiming target control apparatus 100 is to be used, then control goes to step S6 in order for the manufacturing plant mode unit 70 to perform the manufacturing plant aiming mode. If it is judged that the service aiming adjustment apparatus 120 is to be used, then control goes to step S30 (see FIG. 7) in order for the service mode unit 72 to perform the service aiming mode. The manufacturing plant aiming mode and the service aiming mode will successively be described below.
In the manufacturing plant aiming mode, a distance Zn from the infrared cameras 16R, 16L to the aiming target plate 110 is set in step S6.
In step S7, the template setting unit 94 selects a reference template from the templates TP1 through TP6 corresponding to the aiming target 112 positioned at the distance Zn.
In step S8, in order to calculate the position of the aiming target 112 using a perspective transformation model corresponding to the distance up to the aiming target 112 disposed at a short distance, a focusing distance (focal length) of the infrared cameras 16R, 16L which matches the perspective transformation model is set.
In step S9, a template matching process is performed based on the template TP selected in step S7. Specifically, correlative calculations are performed on a gray-scale image of the aiming target 112 obtained by the infrared cameras 16R, 16L and the template TP, and coordinates of a gray-scale image or a target for which the results of the correlative calculations are minimum are calculated and stored in step S10.
In step S11, it is confirmed whether the number of acquired gray-scale images has reached a predetermined number N or not. If the number of acquired gray-scale images has reached the predetermined number N, then control goes to step S12. If the number of acquired gray-scale images is smaller than the predetermined number N, then control goes back to step S1 to acquire another gray-scale image and calculate and store target coordinates.
In step S12, the N sets of target coordinates are averaged. If it is judged that target coordinates are properly calculated in step S13, then control goes to step S14 (see FIG. 6). If it is judged that target coordinates are not properly calculated in step S13, then control goes back to step S3.
In step S14, a luminance adjustment LUT is set. Specifically, in order to reliably perform the template matching process based on correlative calculations, the levels of luminance signals of the aiming target 112 which are detected by the infrared cameras 16R, 16L are compared with each other, for example, and a luminance adjustment LUT is set such that the luminance signal from the infrared camera 16R, which is used as a reference for the correlative calculations, will be greater at all times than the luminance signal from the infrared camera 16L at each of the luminance levels. If it is judged that the process of setting a luminance adjustment LUT is properly performed in step S15, then control goes to step S16.
In step S16, an image distortion corrective value for correcting image distortions caused due to individual differences as to focal lengths, pixel pitches, etc. between the infrared cameras 16R, 16L is calculated. Detailed calculation process of the image distortion corrective value will be described later. If it is judged that an image distortion corrective value is properly calculated in step S17, then control goes to step S18.
In step S18, a pan angle and a pitch angle, which serve as mounting angles of the left and right cameras, i.e., the infrared cameras 16R, 16L, are calculated. If it is judged that mounting angles of the left and right cameras are properly calculated in step S19, then control goes to step S20.
In step S20, clipping coordinates for clipping image areas to be processed from the images obtained by the infrared cameras 16R, 16L are calculated. If it is judged that clipping coordinates are properly calculated in step S21, then control goes to step S22.
In step S22, a parallax offset value, which represents an error contained in the parallax between object images because the optical axes of the infrared cameras 16R, 16L are not parallel to each other, is calculated. If it is judged that a parallax offset value is properly calculated in step S23, then control goes to step S24.
In step S24, the luminance adjustment LUT, the image distortion corrective value, the pan angle and the pitch angle, the clipping coordinates, and the parallax offset value which are determined respectively in steps S14, S16, S18, S20, and S22 are stored in the camera parameter memory 46. If these parameters are properly stored, then the manufacturing plant aiming mode is finished. At this time, the ECU 14 sends a signal indicating that the manufacturing plant aiming mode is finished to the main control device 106. If the normal mode is to be subsequently executed, then a predetermined restarting process may be performed. If the answers to the branching processes in steps S17, S19, S21, S23, and S25 are negative, then control goes back to step S3 as when the answer to the branching process in step S13 is negative.
The service aiming mode will be described below. In the service aiming mode, steps S1 through S3 (see FIG. 5) are executed in the same manner as with the manufacturing plant aiming mode. Control then branches from step S4 to step S30 for the service mode unit 72 to perform a processing sequence shown in FIGS. 7 through 9.
In step S30 shown in FIG. 7, a distance from the infrared cameras 16R, 16L to the target plate 132 is set. The distance from the infrared cameras 16R, 16L to the target plate 132 is determined by the position of the aiming target 134 installed in a service factory where the service aiming mode is performed. The distance is input from the main control device 126 to the ECU 14.
In step S31, the height H (see FIG. 1) of the infrared cameras 16R, 16L is confirmed and input.
In step S32, the template setting unit 94 selects one of the templates TP1 through TP6 which corresponds to the distance to the aiming target 134 set in step S30.
In step S33, a focusing distance matching the perspective transformation model which corresponds to the distance to the aiming target 134 is set in the same manner as with step S8.
In step S34, the position of the target plate 132 is confirmed. Specifically, in the service aiming mode, the target plate 132 is placed successively in a central position PC, a left position PL, and a right position PR (see FIG. 4). When step S34 is executed for the first time, a signal for positional confirmation is sent to the main control device 126 to place the target plate 132 in the central position PC. In response to the signal, the main control device 126 displays a message “PLACE TARGET IN CENTRAL POSITION PC AND PRESS “Y” KEY” on the monitor screen, for example. According to the message, the operator moves the headlight tester 124 along the rail 128 either manually or with a given actuator until the target plate 132 is placed in the central position PC.
In step S35, control is branched depending on the position of the target plate 132 at the time. If the target plate 132 is placed in the central position PC (in first through 30 cycles), then control goes to step S36. If the target plate 132 is placed in the left position PL (in 31st through 60th cycles), then control goes to step S41 (see FIG. 8). If the target plate 132 is placed in the right position PR (in 61st and subsequent cycles), then control goes to step S46 (see FIG. 9).
In step S36, a template matching process is performed in the same manner as with step S9.
In step S37, target coordinates of the aiming target 134 are calculated and stored in the same manner as with step S10.
In step S38, the number of acquired gray-scale images is confirmed in the same manner as with step S11. If the number of acquired gray-scale images is N or more, then control goes to step S39. If the number of acquired gray-scale images is smaller than N, then control goes back to step S1. In the second and subsequent cycles, steps S3 through S8 and steps S30 through S35 are skipped.
In step S39, the target coordinates at the central position PC are averaged in the same manner as with step S12. If it is judged that target coordinates are normally calculated in step S40, then control goes back to step S1. If target coordinates are not normally calculated in step S40, then control goes back to step S3.
The target plate 132 is placed in the left position PL, and steps S41 through S45 shown in FIG. 8 are similarly executed.
Then, the target plate 132 is placed in the right position PR, and steps S46 through S50 shown in FIG. 9 are similarly executed.
If it is judged that target coordinates are normally calculated in final step S50, then control goes back to step S14 (see FIG. 6). Subsequently, the same process as the manufacturing plant aiming mode is performed, and camera parameters are stored in the camera parameter memory 46.
Next, the calculation of the image distortion corrective value in step S16 will be described below in detail with reference to FIG. 10.
Assuming the center O of the lens in the infrared camera 16R or 16L as the origin, two objects T1, T2 are arranged in an actual space with the coordinates (Xn, Zn) and (Xn−D, Zn), respectively. That is, the objects T1, T2 are away from the infrared camera 16R or 16L by a distance Zn, and the object T1 is away from the object T2 by a distance D. Then, these objects T1, T2 are imaged by the infrared camera 16R or 16L. For example, two arbitrary targets of the aiming targets 112 shown in FIG. 3 may be selected as the objects T1, T2.
Respective projected X-coordinates x1 and x2 of obtained images T1* and T2* of the objects T1 and T2 are calculated by equations (4) and (5) below, using a perspective transformation model with a design parameter F (=f/p) that is determined by a design focal length f and a design pixel pitch p, and assuming that the infrared camera 16R or 16L has no image distortion.

x1=F·Xn/Zn  (4)

x2=F·(Xn−D)/Zn  (5)

In FIG. 10, the images T1* and T2* are supposed to be arranged at conjugate positions with respect to the center O of the lens.
Practically, the infrared cameras 16R and 16L have individual differences in the focal length and the pixel pitch. Thus, each X-coordinate is measured as a coordinate determined by the multiplication of the theoretical projected coordinates x1, x2 by a predetermined enlargement or reduction ratio. Then, the relationships between the theoretical projected coordinates x1, x2 and measured projected coordinates (projected positions) x1*, x2* of the actual images T1*, T2* are obtained by equations (6), (7) below, where α is an image distortion corrective value relating to individual differences.

α·x1*=x1  (6)

α·x2*=x2  (7)

Thus, errors d1, d2 included in the projected coordinates x1*, x2* of the actual images T1*, T2* corresponding to the theoretical projected coordinates x1, x2 are obtained by equations (8), (9) below, by using the equations (6), (7).

d1=x1*−x1=(1−α)·x1*  (8)

d2=x2*−x2=(1−α)·x2  (9)

Accordingly, the image distortion corrective value a is obtained by an equation (10) below, by using the equations (4), (5), (6), (7).

α=F·D/Zn·(1/(x1*−x2*))  (10)

In this case, the image distortion corrective value α can be calculated easily with parameters: the distance Zn from the infrared camera 16R or 16L; the distance D between the objects T1 and T2; and the design parameter F, assuming that the X-coordinate Xn of the objects T1 and T2 is arbitrary. Thus, the position in an actual space of the object can be calculated highly accurately, by correcting the design parameter F with the image distortion corrective value α to be 1/α·F (F←1/α·F).
In the above description, the image distortion corrective value α is calculated for the X-coordinate of the design parameter. Also, the image distortion corrective value for the Y-coordinate can be calculated in a similar manner. If errors in the design parameter of the infrared cameras 16R, 16L are included isotropically, the image distortion corrective value for the X-coordinate may be the same as the image distortion corrective value for the Y-coordinate.
The calculated image distortion corrective value α of each of the infrared cameras 16R and 16L is stored in the camera parameter memory 46 as a camera parameter.
After the camera parameters are set in the aiming mode, the normal mode is carried out using the camera parameters.
An object searching process and, when necessary, an attention drawing process, in the normal mode will be described below with reference to a flowchart shown in FIG. 11.
An image of an area in front of the vehicle 12 is obtained as a reference image by the infrared camera 16R, and an image of an area in front of the vehicle 12 is obtained as a searching image by the infrared camera 16L. The obtained images are converted into respective gray-scale images, which are stored in the image memory 44, and the image from the infrared camera 16R is converted by the binarizer 42 into a binary image, which is also stored in the image memory 44, in steps S101, S102.
The normal mode execution unit 50 extracts an object from the binary image of the reference image obtained by the infrared camera 16R in step S103. Then, the normal mode execution unit 50 searches for an object in the searching image 152, which corresponds to the object in the reference image 146, according to correlative calculations on the gray-scale images. Finally, the normal mode execution unit 50 calculates a parallax on the images 146, 152 between the objects that have been searched for, and determines a distance to the object in step S104.
Prior to the correlative calculations, the luminance signal of the reference image 146 or the searching image 152 is adjusted using the luminance adjustment LUT representative of camera parameters, such that the luminance signal of the reference image 146 obtained by the infrared camera 16R is greater than the luminance signal of the searching image 152 obtained by the infrared camera 16L. Then, correlative calculations are performed on the adjusted gray-scale images to search for the object certainly. The design parameter F is corrected by the image distortion corrective value α which is calculated as a camera parameter of each of the infrared cameras 16R and 16L, so that the value 1/α·F is used for the design parameter F (F←1/α·F). The coordinates of the object in the reference image 146 and the searching image 152 can be obtained highly accurately by substituting the corrected design parameter F into the equations (1), (2). The parallax between the objects that have been searched for is corrected highly accurately by using a parallax offset value which represents a camera parameter due to a relative pan angle. The distance from the vehicle 12 to the actual object is calculated highly accurately.
Then, the two-dimensional coordinates of the object in the reference image 146 are corrected by an absolute pan angle and an absolute pitch angle of the infrared cameras 16R, 16L obtained in step S18, and a relative position represented by three-dimensional coordinates of the object in the actual space, including the distance calculated in step S104, is calculated in step S105.
The three-dimensional coordinates of the object in the actual space in step S105 are repeatedly calculated at small time intervals to calculate a moving vector of the object in step S106. Using the moving vector, road structures and vehicles are removed from the object in step S107. Then, it is determined whether there is a pedestrian or not from the shape of the remaining object in step S108.
If it is judged that there is a pedestrian in step S108, then the reference image 146 obtained by the infrared camera 16R is displayed on the HUD 18, and the image of the pedestrian is enclosed by a highlighting frame in step S109. The speaker 20 is energized to draw the driver's attention in step silo.
Although certain preferred embodiments of the present invention have been shown and described in detail, it should be understood that various changes and modifications may be made therein without departing from the scope of the appended claims.

## Claims

1. An apparatus for detecting a position in an actual space of an object by imaging said object with an imaging unit, comprising:
said imaging unit for obtaining an image of a plurality of objects;
a position-in-image calculating unit for calculating respective projected coordinates x1* and x2* of a first object and a second object in said image obtained by said imaging unit, said first and second objects being separate from each other and arranged in an actual space with coordinates (Xn, Zn) and (Xn−D, Zn) so that said first and second objects are away from said imaging unit by a distance Zn and that said first object is away from said second object by a distance D, where said coordinate Xn is arbitrary; and
a corrective coefficient calculating unit for calculating a corrective coefficient c to correct a design parameter F of said imaging unit,
wherein said corrective coefficient calculating unit calculates a coordinate x1 in said image of a design position of said first object and a coordinate x2 in said image of a design position of said second object by using the design parameter F determined based on a design focal length (f) of the imaging unit and a design pixel pitch (p) of the imaging unit and equations:


x1=F·Xn/Zn 



x2=F·(Xn−D)/Zn 



and then said corrective coefficient calculating unit calculates said corrective coefficient α by equations:


α·x1*=x1



α·x2*=x2


using said coordinates x1 and x1* and said coordinates x2 and x2*, and
wherein said design parameter F is corrected to be 1/α·F with said corrective coefficient α, and said projected coordinates of said objects imaged by said imaging unit are corrected.

2. An apparatus according to claim 1, wherein said design parameter F is set by an equation:


F=f/p.

3. An apparatus according to claim 1, wherein said apparatus for detecting a position of an object is installed on a vehicle and corrects said projected coordinates of said objects with respect to said vehicle.

4. A method of correcting data in an apparatus that detects a position in an actual space of an object by imaging said object with an imaging unit, said method comprising the steps of:
arranging separate first and second objects in an actual space with coordinates (Xn, Zn) and (Xn−D, Zn), respectively, so that said first and second objects are away from said imaging unit by a distance Zn and that said first object is away from said second object by a distance D, where said coordinate Xn is arbitrary, and then obtaining an image of said first and second objects with said imaging unit;
calculating respective projected coordinates x1* and x2* of said first object and said second object in said image;
calculating a coordinate x1 in said image of a design position of said first object and a coordinate x2 in said image of a design position of said second object by using a design parameter F determined based on a design focal length (f) of the imaging unit and a design pixel pitch (p) of the imaging unit and equations:


x1=F·Xn/Zn 



x2=F·(Xn−D)/Zn 


calculating a corrective coefficient α to correct said design parameter by equations:


α·x1*=x1



α·x2*=x2



using said coordinates x1 and x1* and said coordinates x2 and x2;
correcting said design parameter F to be 1/α·F with said corrective coefficient α, and correcting said projected coordinates of said objects imaged by said imaging unit, and wherein said steps are effected by a programmed computer.

5. A method according to claim 4, wherein said corrective coefficient α is an image distortion corrective value of said imaging unit for a direction in which said first object and said second object are arranged.

6. An apparatus according to claim 1, wherein said distance D is predetermined.

7. An apparatus according to claim 1, wherein said corrective coefficient calculating unit calculates said corrective coefficient α in an aiming process for said imaging unit where D and Zn are preset.