as shown in fig1 a vehicle 10 such as an automobile may have a seat 12 affixed to vehicle floor 14 by a track 16 . as is well known in the art , the position of seat 12 with respect to vehicle 10 is adjustable . as is also well known in the art , vehicle 10 may have an air bag 20 stored within dashboard in front of seat 12 to protect a passenger seated in seat 12 from internal collision with dashboard 18 or windshield 11 . in the event of a rapid deceleration of vehicle 10 , a sensor s within vehicle 10 initiates an output to cause an electrical signal to activate airbag 20 , which device rapidly expands to occupy the space between seat 12 and dashboard 18 . since it is useful for airbag 20 to deploy only when seat 12 is occupied , and studies have shown that an occupant is safe when airbag 20 deploys only if that person is properly restrained by a seat belt , not seated too close to the airbag , and weighs at least 66 pounds , in accordance with this invention , a controller 30 may be provided to disable the electrical connection between sensor s and airbag 20 or reduce the power of the air bag 20 upon receipt of video information from one or two cameras 26 affixed to vehicle 10 by bracket 28 at some location such as a front door pillar . the following sections describe four different embodiments of the invention . &# 34 ; occupant classification &# 34 ; refers to the classification of an image or images of the vehicle seat into categories &# 34 ; empty &# 34 ;, &# 34 ; occupied by rfis &# 34 ;, or &# 34 ; occupied by person &# 34 ;. classification into the first two categories will cause the air bag to be totally disabled . the section &# 34 ; occupant range determination &# 34 ; describes an embodiment to measure the distance between the occupant and landmark points in the vehicle , such as the dashboard . if the occupant is near a given landmark point , the air bag may be deployed at reduced power or totally disabled . the third section , &# 34 ; occupant weight determination &# 34 ;, describes a method for determining the weight of the occupant from a range image . the weight estimate can be used to reduce the power or totally disable the air bag . the final section , &# 34 ; occupant weight and position determination &# 34 ;, describes another method to determine the occupant &# 39 ; s weight and position simultaneously , which information can be used to reduce the power or totally disable the air bag . in accordance with a preferred embodiment of this invention , controller 30 includes a programmed computer . as outlined in fig2 controller 30 functions at block 34 to capture an image v i from tubular camera 26 and compare it in block 36 to a representation of stored images corresponding to known situations from block 40 , such as when seat 12 is empty or when it is occupied by a rfis . as set forth hereinafter , should a correlation be made between image v i and either of the known situations , controller 30 disarms airbag 20 . if image v i does not correlate to either known situation , seat 12 is assumed to be occupied and airbag 20 is armed . one problem that must be solved by a video system in this application is caused by the many possible variations in a scene for any situation . for example , an empty seat may be subjected to many variations of light and shade as both the vehicle and the earth move with respect to the sun . in addition , the position of the seat may be changed by its users . accordingly , the stored image must represent a great many possible variations of each known situation . however , since it is desirable to minimize the cost of controller 30 , its computing power is not likely to be substantial . a first step at reducing the variables is to histogram - equalize each image from camera 24 to remap the image &# 39 ; s intensities , thereby spreading them more evenly over available gray levels . using monotonically nondecreasing gray level mapping , histogram equalization helped recover acceptable images taken in dark conditions . fig3 outlines a set of steps for block 40 of fig2 that provides a solution to this problem . as set forth in blocks 41 - 43 , n images are taken of a known situation , such as an empty seat , with the seat in different positions and in different sunlight conditions . each image consisted of rows , r , and 64 columns , c , of pixels defining the image ; a typical image from an inexpensive video camera . each image was sequentially scanned to form a column vector , p i =( n c n r )× 1 . to simplify calculations , each vector is normalized whereby p i · p i = 1 . to avoid having to compare the captured image v i with each of the more than 100 images p i made of each known situation , the system analyzes the principle components of the vectors p i making up a given situation ( i . e ., rfis or empty ). as indicated in block 44 , the n prototype vectors in a given situation are assembled into a matrix p =| p 0 - a p 1 - a . . . p n - 1 - a |, where α is the scalar mean value of all the elements of all the p i &# 39 ; s of the prototype situation . as indicated in blocks 45 , the covariance matrix q = pp t is then determined . in block 46 , the eigenvectors of q , e 0 , e 1 , e 2 , . . . e n - 1 are determined to form an orthonormal basis set for the vectors of the known situation . p i can be expressed as a weighted sum of the eigenvectors : ## equ1 ## since the eigenvectors associated with the highest eigenvalues account for most of the variance of the prototype vectors , these vectors may be approximated with less than all n eigenvectors . accordingly , as denoted in block 47 , ## equ2 ## where n &# 39 ; is determined experimentally . for the instant invention , approximately 100 images each of an empty seat and a rfis yielded good results with n &# 39 ;= 18 . the c ij coefficients provide a compressed representation of the images in an n &# 39 ;- dimensional space . the unknown vector v can also be decomposed with the eigenvectors of the prototype situation , where ## equ3 ## the distance between two column vectors is given by ∥ v - p i ∥ 2 = 2 - 2 ( v · p i ), when both vectors are normalized . since ( v · p i ) is the correlation between the two vectors , minimizing the distance between the two vectors is the same as maximizing the correlation between them . the same calculation may be used to determine the correlation between the reconstructed vectors of equations 1 and 2 : ## equ4 ## because e j · e k = 1 when i = j and e j · e k = 0 when i ≠ j . in the preferred embodiment of this invention , the known situations ( empty and with rfis ) are classified with an off - line system by taking a number of images and determining eigenvectors e i and weighting coefficients c ij for each situation . for any predetermined configuration of vehicle , this data could be created at the factory and permanently loaded into controller 30 . each image from camera 24 is histogram - equalized and normalized to produce vector v . this vector is then projected onto both sets of eigenvectors to produce coefficients d j = v · e j for each of empty seat and rfis . in other words , this step projects the unclassified input image into the projection coefficient spaces of the two situations . the input image is compared to the prototype images in both situations by finding their nearest neighbor in both situations . this distance for each situation is : ## equ5 ## this distance is compared to an experimentally determined threshold to provide an indication whether or not an airbag should be activated . for the preferred embodiment , the airbag 20 is activated only when the minimum distance for each of the empty seat and the rfis situations is greater than their respective threshold distances , indicating that since the seat is neither empty nor containing a rfis , it is occupied . this system was tested in a vehicle that had been trained with approximately 100 images of each situation . for this test the empty seat threshold was set at 0 . 029 and the rfis threshold was set at 0 . 0191 , and each situation was classified with 18 eigenvectors . the empty seat class failed to recognize only 3 of 413 empty seat images as empty seats , and it misclassified only 1 of 101 occupied seats as empty . the rfis class failed to recognize only 1 of 396 rfis images as having a rfis , and it misclassified no rfis images as occupied . thus , this system made a correct decision regarding activation of the airbag on 99 . 5 % of tested situations . one potential problem with classifying intensity images , as described above , is that a class with large intensity variations may be difficult to characterize with a limited number of prototype images . furthermore , because of the great variety of shapes of and colors on the occupant of a seat , intensity could not be used to reliably recognize that a seat is occupied . accordingly , another embodiment of the invention utilizes binocular stereo images where the pixels represent range ( distance to surface ) rather than intensity . binocular stereo uses two cameras , generally side - by - side as shown in fig1 pointed at the same scene . computing range values from the two images is easiest if the corresponding rows of the cameras &# 39 ; two image planes are colinear . that is , each row of the right image should be pointed at the same horizontal slab of space as its corresponding row in the left image . as shown in fig1 a camera jig held the tubular cameras &# 39 ; optical axes approximately parallel and mounted the two cameras to the mounting holes of the driver &# 39 ; s side sun visor of a test vehicle . a test program showed that when the horizontal edge of each image was aligned , the vertical position was about nine pixels higher in one image than the other . for all subsequent stereo processing , the left image was shifted vertically by this amount to bring the left and right rows into alignment . since these images included a portion of the view through a window , a mask was provided to remove this distraction from each image . the geometry of the described binocular stereo system is shown in fig4 . the goal is to measure the distance to the 3d scene point . from the images , the following relationships exist between the image coordinates and scene coordinates : ## equ6 ## the quantity x 1 - x r is the difference between the positions of the projected 3d scene point in the left and right images , and it is called disparity . thus , the distance to the 3d scene point is inversely proportional to the disparity . although the disparity of points in the scene can then be used in equation 4 to compute range values for these points , this calculation is not necessary because disparity provides an invariant image for classification , the same as range . to compute disparity , points in the left and right images that correspond to the same point in the 3d scene must be found . this invention uses a &# 34 ; dense &# 34 ; disparity image -- one that gives disparity values at every point in the image rather than at just a few points . ( the system could be modified to use a smaller number of disparity points for the sake of more efficient computer processing .) the system finds a match in the right image for every pixel in the left image . the difference in the pixel coordinates of these matched points are stored in a disparity image . for a given pixel in the left image , it is known from the camera alignment described above that a corresponding point in the right image will be either on the same row or a constant offset from the row in the left image . if the two cameras are perfectly aligned , matching points in the left and right images are found by comparing the gray levels of small patches of pixels surrounding each point to be matched . for a given pixel point in the left image with integer coordinates ( x l , y ), a rectangular patch of pixels centered on this point is extracted whose integer dimensions are width x height =( 2l w + 1 )×( 2l h + 1 ). for example , in a system with a resolution of 128 × 120 pixels , l w = 3 pixels and l h = 2 pixels . this 35 pixel patch is compared with equally - sized patches in the right image for different disparities . as a function of disparity , the quality of the match between the two patches is given by : ## equ8 ## where f 1 ( x , y ) is the left image and f r ( x , y ) is the right image . the function of equation 5 is computed for every point in the left image that has a potential match in the right image , which excludes a vertical band of pixels on the left and right side of the left image for which it is known there is no match in the right image . in addition , the minimum and maximum disparity values are limited based on the maximum and minimum distances that are to be viewed in the scene . for this embodiment , disparities were limited to the range [ 2 , 5 ]. the value of disparity d when the function is minimized indicates the range from the cameras to the object represented by the patch of pixels . the disparities have only a limited range , and if their values are confined to integers , the resulting disparity images may not have sufficient discriminatory power . accordingly , subpixel disparities are determined based on a technique described by larry matthies , dynamic stereo vision , ( ph . d . thesis ), carnegie mellon university school of computer science , tech . rpt cmu - cs - 89 - 195 , october 1989 . after finding the integer disparity with the minimum sum of squared differences , s ( d 0 ; x 1 , y ), a parabola is fit to this value and its two neighbors , s ( d 0 + 1 ; x 1 , y ) and s ( d 0 - 1 ; x 1 , y ). the location of the minimum value of this parabola , d min , is the subpixel disparity , as illustrated in fig5 . this process is repeated for every pixel in the left image to make real - valued disparity images . the disparity images may be classified by nearly the same process as shown above for classifying intensity images . besides the obvious difference of using disparity instead of intensity , another difference is that the images may accurately be classified into three classes ( empty , rfis , occupied ) rather than just two ( empty , rfis ) as was the case with intensity images . to test this system , stereo images were collected over a period of seven days from the test vehicle . for the empty and rfis cases , a stereo pair was taken every five minutes throughout the day , for a total of 429 empty seat pairs and 386 rfis pairs . the images were split evenly into three seat positions : forward , middle , and back . the same rfis and doll baby was used for all the rfis images , except for 10 &# 34 ; minority &# 34 ; rfis images where a different rfis was used . in addition , 439 stereo pairs were taken of 22 regular occupants . of these images , 220 of the occupied seat pairs , 76 empty seat pairs and 68 rfis pairs were used for training , taken at 30 minute intervals . none of the 10 &# 34 ; minority &# 34 ; rfis were used for training . all the stereo pairs that were not used for training were used for testing . for the occupied seat , 11 pictured individuals were used for training , and 11 others were used for testing . all the stereo pairs were subjected to the stereo algorithm of equation 5 , and all subsequent processing was done on the real - valued disparity images . since disparity images are functions of 3d structure and not illumination , they do not need the preprocessing normalization and histogram steps utilized on the intensity images . however , the remainder of the processing is identical to the processing of the intensity images . for each of the three classes of disparity training images , a scalar mean was computed and subtracted from the respective disparity image . a sample covariance matrix was formed for each of the three classes and the eigenvectors were computed . the top 20 eigenvectors were used to project each processed training image into a 20 - dimensional point . in one trial for classifying disparity images , each image was projected onto the 20 eigenvectors of each training class , giving three 20 - dimensional points ( one for each potential class ). the euclidean distance was computed between this projection and all the projected training images . the input image was classified with the same class as its nearest neighbor . this method achieved a classification accuracy of 93 %. for another test the classification program was modified to give weights to the three euclidean distances for each of the three classes . after computing the distance between the projection of an unclassified image and the projection of a training image , this distance was scaled by a weighting factor for that training image &# 39 ; s class . the optimal weights for the empty , rfis , and occupied classes were 1 . 000 , 1 . 016 , and 0 . 792 , respectively . using these weights brought the classification accuracy up to 95 % over 890 tests . the data from these tests showed only one &# 34 ; fatal &# 34 ; airbag retention for 219 occurrences of an occupied seat . however , there was a 5 % unwanted deployment rate on rfis , and a 7 % unneeded deployment on empty seats . the weights could be adjusted to decrease the number of fatal errors ( fatal retention when occupied and fatal deployment with a rfis ) at the expense of unneeded deployments . other embodiments utilizing the teachings of this invention are also contemplated , as it is important not to deploy an air bag with too much force if the occupant is near the installed location of the undeployed air bag ( e . g . face near the dashboard ). for example , the range images could be used to measure the distance between the occupant and various features of the vehicle interior ( e . g . occupant to dashboard distance ), and measure the weight and position of the occupant . range images computed from stereo images allow an especially convenient method for measuring the distance between the occupant and interior features , because the silhouette of the occupant can be found by simply computing a numerical difference between a range image of the occupied seat and a previously taken range image of the unoccupied seat . on the range image of the unoccupied seat , there will be designated &# 34 ; landmark &# 34 ; points , which are points to which the occupant &# 39 ; s distance should be measured . for instance , the set of landmark points might include range points on the dashboard where the air bag is stored , because the air bag should not be deployed with full force when the occupant is near this region . the occupant classification technique described above used only stereo disparity images , because absolute range was not important . however , absolute range must be determined to compute occupant - to - landmark distances . given a disparity image of an empty seat , the corresponding range image is designated as z = u i ( x , y ), where ( x , y ) is a point on the range image in pixel coordinates . the range image of the occupied seat is designated as z = p ( x , y ). since the seat can be adjusted to different positions , there will be several different , prestored ranges images of the empty seat , u i ( x , y ), i = 1 , 2 , . . . , n , where n is the number of prestored empty seat range images , with each image representing the empty seat adjusted to a different position . in order to isolate the occupant &# 39 ; s range points from the rest of the occupant range image , it is necessary to first determine which empty seat range image to use . if we use an empty seat range image that has the seat adjusted to a different position that what the occupant has , then there will be significant range differences at points on the seat as well as points on the occupant . finding the right empty seat range image to use is accomplished by comparing each of the prestored range images of the empty seat , u i ( x , y ), to the range image of the occupied seat , p ( x , y ). the u i ( x , y ) that most closely resembles p ( x , y ) is chosen as the empty seat range image to use . the correct u i ( x , y ) is determined by computing a series of range difference indicator images , ## equ9 ## where t is a small range value accounting for the inevitable inaccuracies in the range measurements . the image d i ( x , y ) will contain a &# 34 ; 0 &# 34 ; wherever the range images u i ( x , y ) and p ( x , y ) have similar values . the image d i ( x , y ) with the most zeroes indicates which empty seat image to use , and is designated range image u *( x , y ). the range points on the occupant are computed by subtracting the background range image of the empty seat , u *( x , y ), from the range image of the occupant , p ( x , y ), yielding ## equ10 ## the image m ( x , y ) is essentially a mask image that shows which parts of the range image fall on the occupant and which range points are part of the background . any point marked with a &# 34 ; 1 &# 34 ; in m ( x , y ) indicates a point on the occupant . the next step is to compute the absolute 3d coordinates of points on the occupant . a 3d coordinate is calculated for every range point in z = p ( x , y ) that has a corresponding value of &# 34 ; 1 &# 34 ; in m ( x , y ). the absolute 3d coordinate ( x , y , z ) of a range point p ( x , y ) is given by : ## equ11 ## where ( x , y ) are pixel coordinates on the range image , ( x c , y c ) is the center of the image in pixel coordinates , and f is the focal length of the camera lens . for all the range points marked by a &# 34 ; 1 &# 34 ; in m ( x , y ), the absolute 3d coordinates are calculated from equation 6 and gathered into a set of 3d coordinates the absolute 3d coordinates of landmark points are based on the prestored empty seat range images . these points can be designated by picking them from a computer screen image with a mouse , and will include points on the dashboard and other landmark points inside the vehicle . the 3d coordinates of these points are gathered into a set the final air bag deployment decision is made by comparing the 3d points in l to the 3d points in p . if any of the occupant points falls too close to any of the landmark points , the air bag will not be deployed . however , a more sophisticated embodiment will adjust the power of the air bag deployment depending on which landmark points have been approached by the occupant and the distance separating them . one important parameter in air bag deployment is the weight of the occupant , as occupants of low weight may be injured by a deploying air bag . the video - based weight measurement system of this invention uses the same principles known to the operator of a &# 34 ; guess your weight &# 34 ; booth on a carnival midway . it has been extensively documented that body size ( e . g . height ) is correlated with body weight . using the range image of an occupant , certain body dimensions are measured and used as entry points into a correlation table giving weight as a function of body dimensions . the system uses the same procedure as described above for isolating range points on the occupant . a standard feature location algorithm can be used to identify range points corresponding to various features on the occupant ( e . g . top of head , shoulders , seat ). these points can be used to make dimensional measurements of the occupant &# 39 ; s body . some dimensions , such as torso circumference , are not suitable , because they could be easily inflated by heavy clothes . but other dimensions , such as the seat to the top of the head , should give consistent readings . given these dimensions , the occupant &# 39 ; s weight can be estimated from the correlation table . an advanced approach to air bag deployment is to measure both the occupant &# 39 ; s weight and position simultaneously . the essence of this method is to fit a computerized geometric model of an occupant to the actual 3d coordinates of the occupant . with a computerized model ( cad model ) having adjustable parameters to control the joint angles and body size , these parameters may be adjusted until the 3d points on the model are in close agreement with the measured 3d points on the occupant . the parameters are examined to determine the size ( giving weight ) and position of the occupant . the system uses the same procedure as described above for isolating range points on the occupant . these points are used to compute a set of 3d coordinates on the surface of the occupant , p ={( x p1 , y p1 , z p1 ),( x p2 , y p2 , z p2 ),( x p3 , y . sub . p3 , z p3 ), . . . }, which was also described above . the cad model of the occupant gives a set of 3d coordinates of the outer surface of the occupant . it is parameterized by a vector of joint angles j =( θ 1 , θ 2 , θ 3 , . . . ) ( e . g . knee angle , shoulder angle , waist angle ), body dimensions l =( l 1 , l 2 , l 3 , . . . ) ( e . g . neck to seat distance , torso width , upper leg length ), and overall body position , ( x , y , z ). depending on the accuracy required , there may be about 15 joint angles and 10 body dimensions . some body parts , such as the hands , do not have to be modeled in detail . the model is called s ( j , l , x , y , z ). the model parameters are adjusted until the surface model of the occupant , s ( j , l , x , y , z ), comes close to the actual coordinates on the occupant , p . the fit error is measured by the euclidian distance between the actual coordinates and the closest point on the model surface . the parameters are adjusted by a conventional fitting algorithm such as gradient descent . an initial starting guess of the model can be an average - sized human in a normal seating position . after this first model is fit , starting guesses for subsequent fits come from the previous fit . it is contemplated in the practice of this invention that the overall position of the occupant and the joint angles can be used to adjust the deployment of the air bag , and even to make deployment decisions about multiple air bags in the dashboard and doors . the body dimensions can also be used as described above to estimate the weight of the occupant , further impacting air bag deployment . the particular sizes and equipment discussed above are cited merely to illustrate particular embodiments of this invention . it is intended that the scope of the invention be defined by the claims appended hereto .