Abstract:
A system and method for measuring and surface reconstruction of a 3D image of an object comprises a projector arranged to project a pattern onto a surface of an object to be imaged; and a processor stage arranged to examine distortion or distortions produced in the pattern by the surface. The processor stage is arranged to convert by, for example, a triangulation process the distortion or distortions produced in the pattern by the surface to a distance representation representative of the shape of the surface. The processor stage is also arranged to reconstruct electronically the surface shape of the object.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates to a system and method for 3D measurement and surface reconstruction of an image reconfigurable vision, and in particular to a reconfigurable vision system and method. 
       BACKGROUND OF THE INVENTION 
       [0002]    In many practical applications, such as reverse engineering, robotic exploration/navigation in clustered environments, model construction for virtual reality, human body measurements, and advanced product inspection and manipulation by robots, the automatic measurement and reconstruction of 3D shapes with high speed and accuracy is of critical importance. Currently, the devices widely used in industry for obtaining 3D measurements involve the mechanical scanning of a scene, for example in a laser scanning digitizer, which inevitably makes the measurement a slow process. Some advanced active vision systems using structured lighting have been explored and built. However, the existing systems lack the ability to change their settings, to calibrate by themselves and to reconstruct the 3D scene automatically. 
         [0003]    To reconstruct a complete and accurate 3D model of an unknown object, two fundamental issues must be addressed. The first issue is how to acquire the 3D data for reconstructing the object surface. Currently, a laser range finder/scanner [ 1 ] is widely used for 3D surface data acquisition in industry. However, due to the mechanical scanning involved, the acquisition speed is limited. To increase the efficiency in the 3D imaging, pattern projections can be employed [2]. Portable 3D imaging systems based a similar principle have also been designed recently. 
         [0004]    The second issue is how to determine the next viewpoint for each view so that all the information about the object surface can be acquired in an optimal way. This is also known as the NBV (Next Best View) problem, which determines the sensor direction (or pose) in the reconstruction process. The problem of viewpoint planning [3] for digitalization of 3D objects can be treated in different ways depending on whether or not the object&#39;s geometry is known beforehand [4,5]. For an unknown object, since the number of viewpoints and their viewing direction are unknown or cannot be determined prior to data acquisition, conventional 3D reconstruction processes typically involve an incremental iterative cycle of viewpoint planning, digitizing, registration and view integration and is conventionally based on a partial model reconstructed thus far. Based on a partial model reconstructed, the NBV algorithm then provides quantitative evaluations on the suitability of the remaining viewpoints. The evaluation for each viewpoint is based on all visible surface elements of the object that can be observed. The viewpoint with the highest visibility (evaluation score) is selected as the NBV. 
         [0005]    In general, there are two fundamental problems to be solved when determining the Next Best View. The first problem is to determine the areas of the object which need to be sensed next and the second is to determine how to position the sensor to sample those areas. As there is no prior knowledge about the object, it is impossible to obtain a complete description of an object when occlusion occurs. Therefore, it is not generally possible to obtain precisely the invisible portions from either the current viewpoint or the acquired partial description of the object, so only an estimation of the Next Best View may be derived. 
         [0006]    Various Next Best View algorithms have been proposed to date, for example Connolly [6] uses octree to represent object space, and the regions that have been scanned are labeled as seen, regions between the sensor and the surface are labeled as empty and all other regions are labeled as unseen. A set of candidate viewpoints is enumerated at fixed increments around the object. The Next Best View is calculated based on the evaluation of the visibility of each candidate viewpoint. This algorithm is computationally expensive and it does not incorporate the sensor geometry. 
         [0007]    Maver and Bajesy [7] presented a solution to the NBV problem for a specific scanning setup consisting of an active optical range scanner and a turntable. In this document, unseen regions of the objects are represented as polygons. Visibility constraints for the sensor to view the unseen region are computed from the polygon boundaries. However, this solution is limited to a particular sensor configuration. 
         [0008]    Pito [8] proposes an approach based on an intermediate position space representation of both sensor visibility constraints and unseen portions of the viewing volume. The NBV is determined as the sensor position that maximized the unseen portion of the object volume. This approach has been demonstrated to have achieved automatic viewpoint planning for a range sensor constrained to move on a cylindrical path around the object. 
         [0009]    Whaite and Ferrie [9] use the superellipsoid model to represent an object and define a shell of uncertainty. The Next Best View is selected at the sensor position where the uncertainty of the current model fitted to the partial data points is the largest. This algorithm enables uncertainty-driven exploration of an object to build a model. However, the superellipsoid cannot accurately represent objects with a complex surface shape. Furthermore, surface visibility constraints were not incorporated in the viewpoint planning process. 
         [0010]    Reed and Allen [10] propose a target-driven viewpoint planning method. The volume model is used to represent the object by extrusion and intersection operations. The constraints, such as sensor imaging constraints, model occlusion constraints and sensor placement constraints, are also represented as solid modeling volumes and are incorporated into the viewpoint planning. The algorithm involves expensive computation on the solid modeling and intersection operation. 
         [0011]    Scott [11] considers viewpoint planning as integer programing. However, in this system the object must be scanned before viewpoint planning to obtain prior knowledge about an unknown object. Given a rough model of an unknown object, a sequential set of viewpoints is calculated to cover all surface patches of the object with registration constraint. However, the object must be scanned before viewpoint planning to obtain the prior knowledge about unknown objects. 
         [0012]    In many applications, a vision sensor often needs to move from one place to another and change its configuration for perception of different object features. A dynamic reconfigurable vision sensor is useful in such applications to provide an active view of the features. 
         [0013]    Active robot vision, in which a vision sensor can move from one place to another for performing a multi-view vision task, is an active research area. A traditional vision sensor with fixed structure is often inadequate for the robot to perceive the object&#39;s features in an uncertain environment as the object distance and size are unknown before the robot sees the object. A dynamically reconfigurable sensor may assist the robot in controlling the configuration and gaze at the object surfaces. For example, with a structured light system, the camera needs to see the object surface illuminated by the projector, to perform the 3D measurement and reconstruction task. 
         [0014]    The system must be calibrated and traditionally, the calibration task is accomplished statically by manual operations. A calibration target/device is conventionally designed with a precision calibration fixture to provide a number of points whose world coordinates are precisely known [12]-[14]. With a planar calibration pattern, the target needs to be placed at several accurately known positions in front of the vision sensor. For dynamically reconfigurable vision systems, the vision system needs to have the ability of self-recalibration without requiring external 3D data provided by a precision calibration device. 
         [0015]    Self-calibration of vision sensors has been actively researched in the last decade. However, most of the conventionally available methods were developed for calibration of passive vision systems such as stereo vision and depth-from-motion [15]-[22]. Conventionally these systems require dedicated devices for calibrating the intrinsic and extrinsic parameters of the cameras. Due to the special calibration target needed, such a calibration is normally carried out off-line before a task begins. In many practical applications, on-line calibration during the execution of a task is needed. Over the years, efforts have been made in research to achieve efficient on-line calibrations. 
         [0016]    Maybank and Faugeras [23] suggested the calibration of a camera using image correspondences in a sequence of images from a moving camera. The kinds of constructions that could be achieved from a binocular stereo rig were further addressed in [24]. It was found that a unique projective representation of the scene up to an arbitrary projective transformation could be constructed if five arbitrary correspondences were chosen and an affine representation of the scene up to an arbitrary affine transformation could be constructed if four arbitrary correspondences were adopted. 
         [0017]    Hartly [25] gave a practical algorithm for Euclidean reconstruction from several views with the same camera based on Levenberg-Marquardt Minimization. A new approach based on stratification was introduced in [26]. 
         [0018]    In this context, much work has been conducted in Euclidean reconstruction up to a transformation. Pollefeys et al [27] proposed a method to obtain a Euclidean reconstruction from images taken with an uncalibrated camera with variable focal lengths. This method is based on an assumption that although the focal length is varied, the principal point of the camera remains unchanged. This assumption limits the range of applications of this method. 
         [0019]    A similar assumption was also made in the investigations in [28,29]. In practice, when the focal length is changed (e.g. by zooming), the principal point may vary as well. In the work by Heyden and Astrom [30], they proved that it is possible to obtain Euclidean reconstruction up to a scale using an uncalibrated camera with known aspect ratio and skew parameters of the camera. A special case of a camera with Euclidean image plane was used for their study. A crucial step in the algorithm is the initialization which will affect the convergence. How to obtain a suitable initialization was still an issue to solve [31]. Kahl [32] presented an approach to self-calibration and Euclidean reconstruction of a scene, assuming an affine model with zero skew for the camera. Other parameters such as the intrinsic parameters could be unknown or varied. The reconstruction which needed a minimum of three images was an approximation and was up to a scale. Pollefeys et al gave the minimum number of images needed for achieving metric reconstruction, i.e. to restrict the projective ambiguity to a metric one according to the set of constraints available from each view [31]. 
         [0020]    The above-mentioned reconstruction methods are based on passive vision systems. As a result, they suffer from the ambiguity of correspondences between the camera images, which is a difficult problem to solve especially when free-form surfaces [33] are involved in the scene. However, to avoid this problem, active vision may be adopted. Structured light or pattern projection systems have been used for this purpose. To reconstruct precisely a 3D shape with such a system, the active vision system consisting of a projector and a camera needs to be carefully calibrated [34, 35]. The traditional calibration procedure normally involves two separate stages: camera calibration and projector calibration. These individual calibrations are carried out off-line and they have to be repeated each time the setting is changed. As a result, the applications of active vision systems are limited, since the system configuration and parameters must be kept unchanged during the entire measurement process. 
         [0021]    For active vision systems using structured-light, the existing calibration methods are mostly based on static and manual operations. The available camera self-calibration methods cannot be applied directly to structured-light systems as they need more than two views for the calibration. Recently, there has been some work on self-calibration [36]-[40] of structured-light systems. Fofi et al. [36] investigated the self-calibration of structured-light systems, but the work was based on the assumption that a square projected onto a planar surface will most generally give a quadrilateral shape in the form of a parallelogram”. 
         [0022]    Jokinen [37] studied a self-calibration method based on multiple views, where the object is moved by steps. Several maps were acquired for the registration and calibration. The limitation of this method is that the object must be placed on a special device so that it can be precisely moved. 
         [0023]    Using a cube frame, Chu et al. [38] proposed a calibration free approach for recovering unified world coordinates. 
         [0024]    Chen and Li [39, 40] recently proposed a self-recalibration method for a structured-light system allowing changes in the system configuration in two degrees of freedom. 
         [0025]    In some applications, such as seabed metric reconstruction with an underwater robot, when the size or distance of the scene changes, the configuration and parameters of the vision system need to be changed to optimize the measurement. In such applications, uncalibrated reconstruction is needed. In this regard, efforts have been made in recent research. Fofi et al [41] studied the Euclidean reconstruction by means of an uncalibrated structured light system with a colour-coded grid pattern. They modeled the pattern projector as a pseudo camera and then the whole system as a two-camera system. Uncalibrated Euclidean reconstruction was performed with varying focus, zoom and aperture of the camera. The parameters of the structured light sensor were computed according to the stratified algorithm [26], [42]. However, it was not clear how many of the parameters of the camera and projector could be self-determined in the uncalibrated reconstruction process. 
         [0026]    Thus, there is a need for a reconfigurable vision system and method for 3D measurement and reconstruction in which recalibration may be conducted without having to use special calibration apparatus as required by traditional calibration methods. 
       SUMMARY OF THE INVENTION 
       [0027]    In general terms, the present invention provides a method and system for the measurement and surface reconstruction of a 3D image of an object comprising projecting a pattern onto the surface to be imaged, examining distortion produced in the pattern by the surface, converting for example by a triangulation process the distortions produced in the pattern by the surface to a distance representation representative of the shape of the surface. The surface shape of the 3D image may then be reconstructed, for example electronically such as digitally, for further processing. 
         [0028]    In a preferred embodiment, the object is firstly sliced into a number of cross section curves, with each cross-section to be reconstructed by a closed B-spline curve. Then, a Bayesian information criterion (BIC) is applied for selecting the control point number of B-spline models. Based on the selected model, entropy is used as the measurement of uncertainly of the B-spline model to predict the information gain for each cross section curve. After obtaining the predicted information gain of all the B-spline models, the information gain of the B-spline models may be mapped into a view space. The viewpoint that contains maximal information gain for the object is then selected as the Next Best View. A 3D surface reconstruction may then be carried out. 
         [0029]    An advantage of one or more preferred embodiments of the invention system is that the 3D information of a scene may be acquired at high speed by taking a single picture of the scene. 
         [0030]    With this method, a complex 3D shape may be divided into a series of cross section curves, each of which represents the local geometrical feature of the object. These cross section curves may be described by a set of parametric equations. For reconstruction purposes using parametric equations, the most common methods include spline function (e.g. B-spline) [43], implicit polynomial [44], [45] and superquadric (e.g. superellipsoid). [46]. Compared with implicit polynomial and superquadric, B-spline has the following main advantages: 
         [0000]    1. Smoothness and continuity, which allows a curve to consist of a concatenation of curve segments, yet be treated as a single unit;
 
2. Built-in boundedness, a property which is lacking in implicit or explicit polynomial representations whose zero set can shoot to infinity;
 
3. Parameterized representation. which decouples the x, y coordinates enabling them to be treated separately;
 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0031]    Preferred embodiments of the invention will now be described by way of example and with reference to the accompanying drawings, in which: 
           [0032]      FIG. 1  is a schematic block diagram of an active vision system according to an embodiment of the invention; 
           [0033]      FIG. 2  is a schematic diagram showing the geometrical relationships between the components of the vision system of the embodiment of  FIG. 1 ; 
           [0034]      FIG. 3  is a diagram illustrating the illumination projection in the embodiment of  FIG. 1 ; 
           [0035]      FIG. 4  is a block schematic illustrating the color encoding for identification of coordinates on the projector of the system of  FIG. 1 ; 
           [0036]      FIG. 5   a  illustrates an ideal step illumination curve of the blur area and its irradiant flux in the system of  FIG. 1 ; 
           [0037]      FIG. 5   b  illustrates a graph of illumination against distance showing an out of focus blur area and an irradiated area for the system of  FIG. 1 ; 
           [0038]      FIG. 6  illustrates a graph of illumination against distance showing the determination of the blur radius for the system of  FIG. 1 ; 
           [0039]      FIG. 7  illustrates a graph of the variation with distance of the point spread function showing the determination of the best-focused location; 
           [0040]      FIG. 8  is a schematic diagram of an apparatus incorporating the system of  FIG. 1 ; 
           [0041]      FIG. 9  is a flow diagram of a view planning strategy according to an embodiment of the invention; 
           [0042]      FIG. 10  is a flow diagram of information entropy calculation for viewpoint planning according to an embodiment of the invention; 
           [0043]      FIG. 11   a  is a schematic illustration of a view space with Q=16, and 
           [0044]      FIG. 11   b  is a schematic illustration of a viewpoint representation. 
       
    
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 
       [0045]      FIG. 1  shows an active vision system according to a preferred embodiment of the invention. The system comprises an LCD projector  1  adapted to cast a pattern of light onto an object  2  which is then viewed by a camera and processor unit  3 . The relative position between the projector  1  and the camera in the camera and processing unit  3  has six degrees of freedom (DOF). When a beam of light is cast from the projector  1  and viewed obliquely by the camera, the distortions in the beam line may be translated into height variations via triangulation if the system is calibrated including the relative position between the projector  1  and camera. The vision system may be self-recalibrated automatically if and when this relative position is changed. The camera and processor unit  3  preferably includes a processor stage, as well as the camera, for processing the observed distortions in the projected pattern caused by the object  2  and associated data and for enabling and carrying out reconstruction. In a further preferred embodiment, the processor stage may be remotely located from the camera and may be connectable thereto to receive the data for processing and carrying out the reconstruction process. 
         [0046]      FIG. 2  shows the geometrical relationship between the projector  1 , the object  2  and the camera of the system of  FIG. 1 , and, in particular, the pattern projected by the projector  1  onto the object  2  and viewed by the camera  3 . 
         [0047]    For the camera, 
         [0000]      x c =P c w c , 
         [0000]    where x c =[λx c  λy c  λ] 7  are the coordinates on the image sensor plane,
 
λεR is an uncertain scalar
 
w c =[X c  Y c  Z c  1] T  are the 3D coordinates of an object point from the view of the camera ( FIG. 2 ), and
 
P c  is the 3×4 perspective matrix
 
         [0000]    
       
         
           
             
               P 
               c 
             
             = 
             
               
                 
                   [ 
                   
                     
                       
                         
                           v 
                           c 
                         
                       
                       
                         
                           k 
                           xy 
                         
                       
                       
                         
                           x 
                           c 
                           0 
                         
                       
                       
                         0 
                       
                     
                     
                       
                         0 
                       
                       
                         
                           
                             s 
                             xy 
                           
                            
                           
                             v 
                             c 
                           
                         
                       
                       
                         
                           y 
                           c 
                           0 
                         
                       
                       
                         0 
                       
                     
                     
                       
                         0 
                       
                       
                         0 
                       
                       
                         1 
                       
                       
                         0 
                       
                     
                   
                   ] 
                 
                 
                   3 
                   × 
                   4 
                 
               
               . 
             
           
         
       
     
         [0000]    where
 
v c  is the distance between image plane and camera optical center,
 
s xy  is the ratio between the horizontal and vertical pixel cell sizes,
 
k xy  represents the placement perpendicularity of the cell grids,
 
and (x c   0 y c   0 ) is the center offset on the camera sensor.
 
         [0048]    Similarly, for the projector, 
         [0000]      x p =P p w p , 
         [0000]    where
 
x p =[κy p  κy p  κ] T  are the coordinates on the projector plane,
 
κεR is also an uncertain scalar,
 
w p =[x p  Y p  Z p  1] T  are the 3-D coordinates of the object point based on the view of projector (see  FIG. 2 ), and
 
P p  is the inverse perspective matrix of the projector
 
         [0000]    
       
         
           
             
               P 
               p 
             
             = 
             
               
                 
                   [ 
                   
                     
                       
                         
                           v 
                           p 
                         
                       
                       
                         0 
                       
                       
                         
                           x 
                           p 
                           0 
                         
                       
                       
                         0 
                       
                     
                     
                       
                         0 
                       
                       
                         
                           v 
                           p 
                         
                       
                       
                         
                           y 
                           p 
                           0 
                         
                       
                       
                         0 
                       
                     
                     
                       
                         0 
                       
                       
                         0 
                       
                       
                         1 
                       
                       
                         0 
                       
                     
                   
                   ] 
                 
                 
                   3 
                   × 
                   4 
                 
               
               . 
             
           
         
       
     
         [0049]    The relationship between the camera coordinate system and projector coordinate system is 
         [0000]    
       
         
           
             
               
                 w 
                 p 
               
               = 
               
                 
                   Mw 
                   c 
                 
                 = 
                 
                   
                     [ 
                     
                       
                         
                           R 
                         
                         
                           t 
                         
                       
                       
                         
                           
                             0 
                             T 
                           
                         
                         
                           1 
                         
                       
                     
                     ] 
                   
                    
                   
                     w 
                     c 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where M is a 4×4 matrix and t is the translation vector, 
         [0000]        t=s[t   x    t   y    t   z ] T . 
         [0050]    Here s is a scaling factor to normalize t x   2 +t y   2 +t z   2 =1. 
         [0000]      x p =P p w p =P p Mw c . 
         [0051]    Let 
         [0000]    
       
         
           
             
               H 
               = 
               
                 
                   
                     P 
                     p 
                   
                    
                   M 
                 
                 = 
                 
                   
                     [ 
                     
                       
                         
                           
                             h 
                             1 
                           
                         
                       
                       
                         
                           
                             h 
                             2 
                           
                         
                       
                       
                         
                           
                             h 
                             3 
                           
                         
                       
                     
                     ] 
                   
                   
                     ( 
                     
                       3 
                       × 
                       4 
                     
                     ) 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where h 1 , h 2 , and h 3  are 4-dimensional vectors. We have 
         [0000]      κx p =h 1 w c , κy p =h 2 w, and κ=h 3 w c . 
         [0000]      So 
         [0000]      ( x   p   h   3   −h   1 ) w   c =0. 
         [0052]    Then the following can be derived: 
         [0000]    
       
         
           
             
               
                 
                   [ 
                   
                     
                       
                         
                           P 
                           c 
                         
                       
                     
                     
                       
                         
                           
                             
                               x 
                               p 
                             
                              
                             
                               h 
                               3 
                             
                           
                           - 
                           
                             h 
                             1 
                           
                         
                       
                     
                   
                   ] 
                 
                  
                 
                   w 
                   c 
                 
               
               = 
               
                 [ 
                 
                   
                     
                       
                         x 
                         c 
                       
                     
                   
                   
                     
                       0 
                     
                   
                 
                 ] 
               
             
             , 
           
         
       
     
         [0053]    Denote x c+ =[x c   T ,0] T  and 
         [0000]    
       
         
           
             Q 
             = 
             
               
                 [ 
                 
                   
                     
                       
                         P 
                         c 
                       
                     
                   
                   
                     
                       
                         
                           
                             x 
                             p 
                           
                            
                           
                             h 
                             3 
                           
                         
                         - 
                         
                           h 
                           1 
                         
                       
                     
                   
                 
                 ] 
               
               = 
               
                 
                   [ 
                   
                     
                       
                         
                           q 
                           11 
                         
                       
                       
                         
                           q 
                           12 
                         
                       
                       
                         
                           q 
                           13 
                         
                       
                       
                         0 
                       
                     
                     
                       
                         0 
                       
                       
                         
                           q 
                           22 
                         
                       
                       
                         
                           q 
                           23 
                         
                       
                       
                         0 
                       
                     
                     
                       
                         0 
                       
                       
                         0 
                       
                       
                         1 
                       
                       
                         0 
                       
                     
                     
                       
                         
                           q 
                           41 
                         
                       
                       
                         
                           q 
                           42 
                         
                       
                       
                         
                           q 
                           43 
                         
                       
                       
                         
                           q 
                           44 
                         
                       
                     
                   
                   ] 
                 
                 . 
               
             
           
         
       
     
         [0054]    The 3-dimensional world position of a point on the object surface can be determined by 
         [0000]      w c =Q −1 x c+ . 
         [0055]    As mentioned above, the relative positions of the camera  3  and the projector  1  may be changed dynamically during run-time of the system. As the camera (which is acting as a sensor) is reconfigurable during the run-time, it should be automatically recalibrated for 3-D perception tasks. Here the recalibration means that the camera (sensor) has been calibrated before installation in the system, but it should require calibrated again as the relative configuration changes. It is assumed for present purposes that the intrinsic parameters such as the focal lengths, scale factors, distortion coefficients will remain unchanged whereas the extrinsic parameters of the positions and orientations between the camera and projector have to be determined during the run-time of the system. 
       System Reconfiguration and Automatic Recalibration 
       [0056]    The whole calibration of the structured light system of  FIG. 1  may be divided into two parts. The first part concerns the calibration of the intrinsic parameters including the focal lengths and optical centers, this is called static calibration and may be performed off-line in a static manner. The second part deals with calibration of the extrinsic parameters of the relative position of the camera  3  and the projector  1 , and this is hereinafter referred to as self-recalibration. The static calibration needs to be performed only once. The self-recalibration is thus more important and needs to be performed online whenever the system configuration is changed during a measurement task. 
         [0057]    Once the perspective projection matrices of the camera  3  and the projector  1  relative to a global coordinate frame are computed from the static calibration, it is possible to obtain P c  and P p  which are the perspective projection matrices of the camera and the projector respectively relative to a global coordinate frame. The dynamic self-recalibration task requires the determination of the relative position M between the camera  3  and the projector  1 . There are 6 unknown parameters, three for 3-axis rotation and three for 3-dimensional translation (as shown in  FIG. 1 ). 
         [0058]    For a point on an object surface, it is known that its coordinates on the camera&#39;s sensor plane x c =[λx c  λy c  λ] T  and on the projector&#39;s source plane x p =[κx p  κy p  κ] T  are related via the following: 
         [0000]      x p   T Fx c =0, 
         [0000]    where F is a 3×3 essential matrix: 
         [0000]    
       
         
           
             
               F 
               = 
               
                 sRS 
                 = 
                 
                   s 
                    
                   
                     [ 
                     
                       
                         
                           
                             F 
                             11 
                           
                         
                         
                           
                             F 
                             12 
                           
                         
                         
                           
                             F 
                             13 
                           
                         
                       
                       
                         
                           
                             F 
                             21 
                           
                         
                         
                           
                             F 
                             22 
                           
                         
                         
                           
                             F 
                             23 
                           
                         
                       
                       
                         
                           
                             F 
                             31 
                           
                         
                         
                           
                             F 
                             32 
                           
                         
                         
                           
                             F 
                             33 
                           
                         
                       
                     
                     ] 
                   
                 
               
             
             , 
           
         
       
     
         [0059]    Here R is a 3-axis rotation matrix and S is a skew-symmetric matrix 
         [0000]    
       
         
           
             
               s 
               = 
               
                 [ 
                 
                   
                     
                       0 
                     
                     
                       
                         - 
                         
                           t 
                           z 
                         
                       
                     
                     
                       
                         t 
                         y 
                       
                     
                   
                   
                     
                       
                         t 
                         z 
                       
                     
                     
                       0 
                     
                     
                       
                         - 
                         
                           t 
                           x 
                         
                       
                     
                   
                   
                     
                       
                         - 
                         
                           t 
                           y 
                         
                       
                     
                     
                       
                         t 
                         x 
                       
                     
                     
                       0 
                     
                   
                 
                 ] 
               
             
             , 
           
         
       
     
         [0000]    based on the translation vector t. 
         [0060]    The recalibration task is to determine the 6 independent parameters in R and t ( FIG. 2 ). For each surface point, x p   T Fx c =0 may be expressed as: 
         [0000]      a i   T f=0. 
       Here 
       [0000]    
       
         
           
             f=[F 11  F 21  F 31  F 12  F 22  F 32  F 13  F 23  F 33 ] T , 
             a i =[x c x p  x c y p  x c y c  x p  y c y p  y c  x p  y p  1] T .
 
where (x c , y c ) is the coordinates on the camera&#39;s sensor and (x p , y p ) is the coordinates on the projector&#39;s LCD/DMD.
 
           
         
       
     
         [0063]    The projected patterns can be in black/white (b/w) or in colors. In either case, a coding method is in general needed. For b/w projections, gray codes can be used with the stripe light planes, which allows robust identifications of the stripe index ( FIG. 3 ). 
         [0064]    In a preferred embodiment of the invention, if an illumination pattern with colour-encoded grids is used, a cell&#39;s coordinates on the projector  1  can be immediately determined by the colours of adjacent neighbouring cells in addition to its own when projecting a source pattern. Via a table look-up, each cell&#39;s position can be uniquely identified. An example of such coded color pattern is shown in  FIG. 4 . The method of computing the values of blur diameters from an image has been proposed in [ 39 , 40 ] which is incorporated herein by reference. In a preferred embodiment, the system may comprise a Color Coded Pattern Projection system, a CCD camera, and a mini-platform for housing the components and providing the relative motion in 6DOF between the projector  1  and the camera  3 . The method for automatic system recalibration and uncalibrated 3D reconstruction according to one or more preferred embodiments of the present invention may be implemented using such a system. With the adaptively adjustable sensor settings, this system will provide enhanced automation and performance for the measurement and surface reconstruction of 3D objects. 
         [0065]    For n points observed, an n×9 matrix A can be obtained as the calibration data:
       A=[a 1 , a 2 , . . . , a n ] T ,   Af=0,       
 
         [0068]    If it is assumed that the structured light vision system has 6DOF in its relative pose, i.e. three position parameters and three orientation parameters, between the camera  3  and the projector  1 . The focal lengths of the projector  1  and the camera  3  are assumed to have been obtained in a previous static calibration stage. The optical centers are fixed or can be described by a function of the focal length. The projector  1  generates grid patterns with horizontal and vertical coordinates so that the projector&#39;s LCD/DMD can be considered an image of the scene. The relative position between the camera  3  and the projector  1  may be described by 
         [0000]    
       
         
           
             
               [ 
               
                 
                   
                     
                       X 
                       p 
                     
                   
                 
                 
                   
                     
                       Y 
                       p 
                     
                   
                 
                 
                   
                     
                       Z 
                       p 
                     
                   
                 
               
               ] 
             
             = 
             
               
                 R 
                  
                 
                   [ 
                   
                     
                       
                         
                           X 
                           c 
                         
                       
                     
                     
                       
                         
                           Y 
                           c 
                         
                       
                     
                     
                       
                         
                           Z 
                           c 
                         
                       
                     
                   
                   ] 
                 
               
               - 
               
                 Rt 
                 . 
               
             
           
         
       
     
         [0069]    If there are n (n&gt;5) points observed on a plane and they do not lie on the same line, we have proved that the rank of the calibration matrix A is six, i.e.
       Rank (A)=6.       
 
         [0071]    If the following 6-by-6 matrix is considered which is a sub-matrix of matrix A, 
         [0000]      A 6 =[r a1 , r a2 , r a3 , r a4 , r a5 , r a6 ,] T    
         [0000]    where r ai =[1x ci  y ci  x pi  y pi  x ci y ci ,] T  and x ci  is the x value of the ith point projected on the camera coordinate system. 
         [0072]    The matrix A 6  can be diagonalized by basic row-operations: 
         [0000]    D(A 6 )=diag (1,x c,2 -x c,1 , . . . )
 
Since x c,i   ≠x   c,j , y c,i ≠y c,j , x p,i ≠x p,j , y p,i ≠y p,j ,
 
it can be proved that every element in D(A 6 ) is non-zero if no four points of the sampled data lie on the same line. Therefore det(A 6 )≠0 and,
 
         [0000]      Rank(A)≧Rank(A 6 )=6. 
         [0073]    On the other hand, based on the projection model of the camera  3  and projector model  1 , the coordinates of a surface point projected on the camera (sensor) may be given by (X/Z, Y/Z). For a point, (x c ,y c ) and (x p ,y p ) are related by: 
         [0000]    
       
         
           
             
               
                 Z 
                 p 
               
                
               
                 [ 
                 
                   
                     
                       
                         x 
                         p 
                       
                     
                   
                   
                     
                       
                         y 
                         p 
                       
                     
                   
                   
                     
                       1 
                     
                   
                 
                 ] 
               
             
             = 
             
               
                 
                   Z 
                   c 
                 
                  
                 
                   R 
                    
                   
                     [ 
                     
                       
                         
                           
                             x 
                             c 
                           
                         
                       
                       
                         
                           
                             y 
                             c 
                           
                         
                       
                       
                         
                           1 
                         
                       
                     
                     ] 
                   
                 
               
               - 
               
                 Rt 
                 . 
               
             
           
         
       
     
         [0000]    where Z c  and Z p  are the depth values based on the view of the camera  3  and projector  1 , respectively. 
         [0074]    For the camera  3  and projector  1 , the scene plane may be defined as follows: 
         [0000]    
       
         
           
             Z 
             = 
             
               
                 C 
                 3 
               
               
                 1 
                 - 
                 
                   
                     C 
                     1 
                   
                    
                   x 
                 
                 - 
                 
                   
                     C 
                     2 
                   
                    
                   y 
                 
               
             
           
         
       
     
         [0075]    Let r 1 , r 2 , and r 3  be the three rows in R, and then 
         [0000]    
       
         
           
             
               
                 
                   
                     C 
                     
                       3 
                        
                       c 
                     
                   
                   
                     1 
                     - 
                     
                       
                         C 
                         
                           1 
                            
                           c 
                         
                       
                        
                       
                         x 
                         p 
                       
                     
                     - 
                     
                       
                         C 
                         
                           2 
                            
                           c 
                         
                       
                        
                       
                         y 
                         p 
                       
                     
                   
                 
                  
                 
                   [ 
                   
                     
                       
                         
                           x 
                           p 
                         
                       
                     
                     
                       
                         
                           y 
                           p 
                         
                       
                     
                     
                       
                         1 
                       
                     
                   
                   ] 
                 
               
               = 
               
                 
                   
                     
                       
                         C 
                         
                           3 
                            
                           c 
                         
                       
                       
                         1 
                         - 
                         
                           
                             C 
                             
                               1 
                                
                               c 
                             
                           
                            
                           
                             x 
                             c 
                           
                         
                         - 
                         
                           
                             C 
                             
                               2 
                                
                               c 
                             
                           
                            
                           
                             y 
                             c 
                           
                         
                       
                     
                      
                     
                       [ 
                       
                         
                           
                             
                               r 
                               1 
                             
                           
                         
                         
                           
                             
                               r 
                               2 
                             
                           
                         
                         
                           
                             
                               r 
                               3 
                             
                           
                         
                       
                       ] 
                     
                   
                    
                   
                     [ 
                     
                       
                         
                           
                             x 
                             c 
                           
                         
                       
                       
                         
                           
                             y 
                             c 
                           
                         
                       
                       
                         
                           1 
                         
                       
                     
                     ] 
                   
                 
                 - 
                 
                   
                     [ 
                     
                       
                         
                           
                             r 
                             1 
                           
                         
                       
                       
                         
                           
                             r 
                             2 
                           
                         
                       
                       
                         
                           
                             r 
                             3 
                           
                         
                       
                     
                     ] 
                   
                    
                   t 
                 
               
             
             , 
           
         
       
     
         [0000]    which contains three equations and then, this equation may be considered to be equivalent to the following system: 
         [0000]    
       
         
           
             { 
             
               
                 
                   
                     
                       
                         
                           
                             
                               τ 
                               11 
                             
                              
                             
                               x 
                               c 
                             
                              
                             
                               x 
                               p 
                             
                           
                           + 
                           
                             
                               τ 
                               12 
                             
                              
                             
                               x 
                               c 
                             
                              
                             
                               y 
                               p 
                             
                           
                           + 
                           
                             
                               τ 
                               13 
                             
                              
                             
                               x 
                               p 
                             
                              
                             
                               y 
                               c 
                             
                           
                           + 
                           
                             
                               τ 
                               14 
                             
                              
                             
                               y 
                               c 
                             
                              
                             
                               y 
                               p 
                             
                           
                           + 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 τ 
                                 15 
                               
                                
                               
                                 x 
                                 c 
                               
                             
                             + 
                             
                               
                                 τ 
                                 16 
                               
                                
                               
                                 x 
                                 p 
                               
                             
                             + 
                             
                               
                                 τ 
                                 17 
                               
                                
                               
                                 y 
                                 c 
                               
                             
                             + 
                             
                               
                                 τ 
                                 18 
                               
                                
                               
                                 y 
                                 p 
                               
                             
                             + 
                             
                               τ 
                               19 
                             
                           
                           = 
                           0 
                         
                       
                     
                     
                       
                         
                           
                             
                               τ 
                               21 
                             
                              
                             
                               x 
                               c 
                             
                              
                             
                               x 
                               p 
                             
                           
                           + 
                           
                             
                               τ 
                               22 
                             
                              
                             
                               x 
                               c 
                             
                              
                             
                               y 
                               p 
                             
                           
                           + 
                           
                             
                               τ 
                               23 
                             
                              
                             
                               x 
                               p 
                             
                              
                             
                               y 
                               c 
                             
                           
                           + 
                           
                             
                               τ 
                               24 
                             
                              
                             
                               y 
                               c 
                             
                              
                             
                               y 
                               p 
                             
                           
                           + 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 τ 
                                 25 
                               
                                
                               
                                 x 
                                 c 
                               
                             
                             + 
                             
                               
                                 τ 
                                 26 
                               
                                
                               
                                 x 
                                 p 
                               
                             
                             + 
                             
                               
                                 τ 
                                 27 
                               
                                
                               
                                 y 
                                 c 
                               
                             
                             + 
                             
                               
                                 τ 
                                 28 
                               
                                
                               
                                 y 
                                 p 
                               
                             
                             + 
                             
                               τ 
                               29 
                             
                           
                           = 
                           0 
                         
                       
                     
                     
                       
                         
                           
                             
                               τ 
                               31 
                             
                              
                             
                               x 
                               c 
                             
                              
                             
                               x 
                               p 
                             
                           
                           + 
                           
                             
                               τ 
                               32 
                             
                              
                             
                               x 
                               c 
                             
                              
                             
                               y 
                               p 
                             
                           
                           + 
                           
                             
                               τ 
                               33 
                             
                              
                             
                               x 
                               p 
                             
                              
                             
                               y 
                               c 
                             
                           
                           + 
                           
                             
                               τ 
                               34 
                             
                              
                             
                               y 
                               c 
                             
                              
                             
                               y 
                               p 
                             
                           
                           + 
                         
                       
                     
                     
                       
                         
                           
                             
                               
                                 τ 
                                 35 
                               
                                
                               
                                 x 
                                 c 
                               
                             
                             + 
                             
                               
                                 τ 
                                 36 
                               
                                
                               
                                 x 
                                 p 
                               
                             
                             + 
                             
                               
                                 τ 
                                 37 
                               
                                
                               
                                 y 
                                 c 
                               
                             
                             + 
                             
                               
                                 τ 
                                 38 
                               
                                
                               
                                 y 
                                 p 
                               
                             
                             + 
                             
                               τ 
                               39 
                             
                           
                           = 
                           0 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   or 
                    
                   
                     
 
                   
                    
                   Γ 
                    
                   
                       
                   
                    
                   a 
                 
                 = 
                 0 
               
               , 
             
           
         
       
     
         [0000]    where Γ is a 3-by-9 matrix, a is described above, and {r ij } are constants. 
         [0076]    It can be proved that there is no linear relationship among the above three equations, i.e. rank(Γ)=3. 
         [0077]    Considering 9 points as the calibration data, then matrix A is 9-by-9 in size. Since it is constrained by Γa=0, the maximum rank of A is 6. 
         [0078]    Therefore the rank of matrix A must be 6. 
         [0079]    The general solution of the equation a i   R f=0 has the form of 
         [0000]        f=ξ   1   f   1 +ξ 1   f   2 +ξ 1   f   3 , 
         [0000]    where ξ 1 , ξ 2 , and ξ 3  are real numbers, f i  is a 9-dimensional vector, and [f 1 ; f 2 ; f 3 ] is the null-basis of A. 
         [0080]    Using singular value decomposition (SVD), we have 
         [0000]        B=svd ( A   T   A )= UDV   T , 
         [0000]    where A T A is a 9×9 matrix, D is a non-decreasing diagonal matrix, and U and V are orthogonal matrices. 
         [0081]    Then, f 1 , f 2 , and f 3  are the three vectors in V corresponding to the least eigenvalues. Theoretically, if there is no noise, matrix B is exactly as just described, i.e. of rank  6 . In such a case, there would be three vanishing/singular values in the diagonal matrix D and the sum and or mean of squared errors (SSE and/or MSE) would be zero, since the vector f lies exactly in the null-space of B. 
         [0082]    However, in a practical system, there maybe fewer than 3 singular values in the matrix D, as the matrix B can be perturbed. Since the data are from real measurements, B may have a rank of 7 or even higher. In such a case it is still possible to take the three column vectors from the matrix V as the basis vectors corresponding to the least values in D. It will still be the best in the sense B will have been tailored (with rank B&gt;6) to some other matrix C with rank C=6 in such a way that C is the “nearest” to B among all the n-by-9 matrices with rank  6  in terms of the spectral norm and Frobenius norm. 
       Define 
       [0083]      f=Hk, 
         [0000]    where k=[ξ 1  ξ 2  ξ 3 ] T  and H=[f 1  f 2  f 3 ]=[H u   T , H m   T , H l   T ] T . H u , H m , and H l  are 3×3 matrices and each for three rows in H. 
         [0084]    The above can be written as 
         [0000]      H u k=F c1 , H m  k=F c2 , and H l  k=F c3 , 
         [0000]    where F c1 , F c2 , and F c3  are the three columns in F. Therefore, 
         [0000]    
       
         
           
             G 
             = 
             
               
                 
                   F 
                   T 
                 
                  
                 F 
               
               = 
               
                 [ 
                 
                   
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           u 
                           T 
                         
                          
                         
                           H 
                           u 
                         
                          
                         k 
                       
                     
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           u 
                           T 
                         
                          
                         
                           H 
                           m 
                         
                          
                         k 
                       
                     
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           u 
                           T 
                         
                          
                         
                           H 
                           l 
                         
                          
                         k 
                       
                     
                   
                   
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           m 
                           T 
                         
                          
                         
                           H 
                           u 
                         
                          
                         k 
                       
                     
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           m 
                           T 
                         
                          
                         
                           H 
                           m 
                         
                          
                         k 
                       
                     
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           m 
                           T 
                         
                          
                         
                           H 
                           l 
                         
                          
                         k 
                       
                     
                   
                   
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           l 
                           T 
                         
                          
                         
                           H 
                           u 
                         
                          
                         k 
                       
                     
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           l 
                           T 
                         
                          
                         
                           H 
                           m 
                         
                          
                         k 
                       
                     
                     
                       
                         
                           k 
                           T 
                         
                          
                         
                           H 
                           l 
                           T 
                         
                          
                         
                           H 
                           l 
                         
                          
                         k 
                       
                     
                   
                 
                 ] 
               
             
           
         
       
     
         [0085]    As R is orthogonal, F T F can also be expressed as 
         [0000]    
       
         
           
             G 
             = 
             
               
                 
                   S 
                   T 
                 
                  
                 
                   R 
                   T 
                 
                  
                 RS 
               
               = 
               
                 
                   
                     S 
                     T 
                   
                    
                   S 
                 
                 = 
                 
                   
                     [ 
                     
                       
                         
                           
                             1 
                             - 
                             
                               t 
                               x 
                               2 
                             
                           
                         
                         
                           
                             
                               - 
                               
                                 t 
                                 x 
                               
                             
                              
                             
                               t 
                               y 
                             
                           
                         
                         
                           
                             
                               - 
                               
                                 t 
                                 x 
                               
                             
                              
                             
                               t 
                               z 
                             
                           
                         
                       
                       
                         
                           
                             
                               - 
                               
                                 t 
                                 x 
                               
                             
                              
                             
                               t 
                               y 
                             
                           
                         
                         
                           
                             1 
                             - 
                             
                               t 
                               y 
                               2 
                             
                           
                         
                         
                           
                             
                               - 
                               
                                 t 
                                 y 
                               
                             
                              
                             
                               t 
                               z 
                             
                           
                         
                       
                       
                         
                           
                             
                               - 
                               
                                 t 
                                 x 
                               
                             
                              
                             
                               t 
                               z 
                             
                           
                         
                         
                           
                             
                               - 
                               
                                 t 
                                 y 
                               
                             
                              
                             
                               t 
                               z 
                             
                           
                         
                         
                           
                             1 
                             - 
                             
                               t 
                               z 
                               2 
                             
                           
                         
                       
                     
                     ] 
                   
                   . 
                 
               
             
           
         
       
     
         [0086]    The three unknowns of k=[ξ 1  ξ 2  ξ 3 ] T  can be determined. The normalized relative position t n =[t x  t y  t z ] T  can then be solved: 
         [0000]    
       
         
           
               
             
               { 
               
                 
                   
                     
                       
                         t 
                         x 
                       
                       = 
                       
                         ± 
                         
                           
                             1 
                             - 
                             
                               
                                 k 
                                 T 
                               
                                
                               
                                 H 
                                 u 
                                 T 
                               
                                
                               
                                 H 
                                 u 
                               
                                
                               k 
                             
                           
                         
                       
                     
                   
                 
                 
                   
                     
                       
                         t 
                         y 
                       
                       = 
                       
                         ± 
                         
                           
                             1 
                             - 
                             
                               
                                 k 
                                 T 
                               
                                
                               
                                 H 
                                 m 
                                 T 
                               
                                
                               
                                 H 
                                 m 
                               
                                
                               k 
                             
                           
                         
                       
                     
                   
                 
                 
                   
                     
                       
                         t 
                         z 
                       
                       = 
                       
                         ± 
                         
                           
                             1 
                             - 
                             
                               
                                 k 
                                 T 
                               
                                
                               
                                 H 
                                 l 
                                 T 
                               
                                
                               
                                 H 
                                 l 
                               
                                
                               k 
                             
                           
                         
                       
                     
                   
                 
               
             
           
         
       
     
         [0087]    It should be noted that multiple solutions exist. In fact, if [k t] T  is a solution of the system, [±k ±t] T  must also be the solutions. One of these solutions is correct for a real system setup. To find this, the re-projection method can be used. 
         [0088]    When k and t are known, the rotation matrix R can be determined by 
         [0000]    
       
         
           
             R 
             = 
             
               
                 [ 
                 
                   
                     
                       
                         r 
                         1 
                       
                     
                   
                   
                     
                       
                         r 
                         2 
                       
                     
                   
                   
                     
                       
                         r 
                         3 
                       
                     
                   
                 
                 ] 
               
               = 
               
                 [ 
                 
                   
                     
                       
                         
                           
                             F 
                             
                               c 
                                
                               
                                   
                               
                                
                               1 
                             
                           
                           × 
                           t 
                         
                         + 
                         
                           
                             ( 
                             
                               
                                 F 
                                 
                                   c 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                               
                               × 
                               t 
                             
                             ) 
                           
                           × 
                           
                             ( 
                             
                               
                                 F 
                                 
                                   c 
                                    
                                   
                                       
                                   
                                    
                                   3 
                                 
                               
                               × 
                               t 
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           
                             F 
                             
                               c 
                                
                               
                                   
                               
                                
                               2 
                             
                           
                           × 
                           t 
                         
                         + 
                         
                           
                             ( 
                             
                               
                                 F 
                                 
                                   c 
                                    
                                   
                                       
                                   
                                    
                                   3 
                                 
                               
                               × 
                               t 
                             
                             ) 
                           
                           × 
                           
                             ( 
                             
                               
                                 F 
                                 
                                   c 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                 
                               
                               × 
                               t 
                             
                             ) 
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           
                             F 
                             
                               c 
                                
                               
                                   
                               
                                
                               3 
                             
                           
                           × 
                           t 
                         
                         + 
                         
                           
                             ( 
                             
                               
                                 F 
                                 
                                   c 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                 
                               
                               × 
                               t 
                             
                             ) 
                           
                           × 
                           
                             ( 
                             
                               
                                 F 
                                 
                                   c 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                               
                               × 
                               t 
                             
                             ) 
                           
                         
                       
                     
                   
                 
                 ] 
               
             
           
         
       
     
         [0000]    where “x” is the cross product of two vectors. 
         [0089]    Among the six unknown parameters, the five in R and t n  have been determined so far and reconstruction can be performed but up to a scaling factor. The last unknown, s in t, may be determined here by a method using a constraint derived from the best-focused location (BFL). This is based on the fact that for a lens with a specified focal length, the object surface point is perfectly focused only at a special distance. 
         [0090]    For an imaging system, the mathematical model for standard linear degradation caused by blurring and additive noise is usually described by 
         [0000]    
       
         
           
             
               
                 g 
                  
                 
                   ( 
                   
                     i 
                     , 
                     j 
                   
                   ) 
                 
               
               = 
               
                 
                   
                     ∑ 
                     
                       k 
                       = 
                       1 
                     
                     m 
                   
                    
                   
                     
                       ∑ 
                       
                         l 
                         = 
                         1 
                       
                       n 
                     
                      
                     
                       
                         h 
                          
                         
                           ( 
                           
                             
                               i 
                               - 
                               k 
                             
                             , 
                             
                               j 
                               - 
                               l 
                             
                           
                           ) 
                         
                       
                        
                       
                         f 
                          
                         
                           ( 
                           
                             k 
                             , 
                             l 
                           
                           ) 
                         
                       
                     
                   
                 
                 + 
                 
                   n 
                    
                   
                     ( 
                     
                       i 
                       , 
                       j 
                     
                     ) 
                   
                 
               
             
             , 
             or 
           
         
       
       
         
           
             g 
             = 
             
               
                 h 
                 ⊗ 
                 f 
               
               + 
               n 
             
           
         
       
     
         [0000]    where f is the original image, h is the point spread function, n is the additive noise, m×n is the image size. The operation           represents two-dimensional convolution. The blur can be used as a cue to find the perfectly focused distance. 
         [0091]    For the projector in such a system, the most significant blur is the out-of-focus blur. This results from the fact that for a lens with a specific focal length the illumination pattern will be blurred on the object surface unless it is projected on the perfectly focused distance. Since the noise n only affects the accuracy of the result, it will not be considered in the following deduction. The illumination pattern on the source plane (LCD or DMD) to be projected is described as 
         [0000]    
       
         
           
             
               
                 I 
                 s 
               
                
               
                 ( 
                 x 
                 ) 
               
             
             = 
             
               { 
               
                 
                   
                     
                       
                         
                           L 
                           a 
                         
                         , 
                       
                     
                     
                       
                         
                           ( 
                           
                             
                               - 
                               
                                 T 
                                 2 
                               
                             
                             &lt; 
                             
                               x 
                               - 
                               
                                 2 
                                  
                                 nT 
                               
                             
                             &lt; 
                             
                               T 
                               2 
                             
                           
                           ) 
                         
                         , 
                         
                           n 
                           ∈ 
                           N 
                         
                       
                     
                   
                   
                     
                       
                         0 
                         , 
                       
                     
                     
                       otherwise 
                     
                   
                 
                 , 
               
             
           
         
       
     
         [0000]    where T is the stripe width of the source pattern. 
         [0092]    The scene irradiance caused by a light source is inversely proportional to the square of the distance from the light source. On the other hand, the image intensity on the camera sensor is independent of the scene distance and is only proportional to the scene irradiance. Therefore, the image intensity can be described as 
         [0000]    
       
         
           
             
               l 
               = 
               
                 
                   
                     C 
                     c 
                   
                    
                   
                     C 
                     l 
                   
                 
                 
                   l 
                   2 
                 
               
             
             , 
           
         
       
     
         [0000]    where C c  is the sensing constant of the camera and C l  is the irradiant constant of light projection. They are related to many factors, such as the diameter of sensor&#39;s aperture, the focal length, and properties of surface materials. 
         [0093]    Assume that the intensity at the point where the best-focused plane intersects the principal axis of the lens is l 0  (x=0, z=z 0 ), where z 0  is the best-focused distance. That is 
         [0000]    
       
         
           
             
               
                 l 
                 0 
               
               = 
               
                 
                   
                     C 
                     c 
                   
                    
                   
                     C 
                     I 
                   
                 
                 
                   
                     ( 
                     
                       
                         z 
                         0 
                       
                       + 
                       
                         v 
                         p 
                       
                     
                     ) 
                   
                   2 
                 
               
             
             , 
           
         
       
     
         [0000]    where v p  is the focal length, i.e. the distance between the source plane and optical center of the projector lens. 
         [0094]    Consider a straight-line in the scene projected on the X-Z coordinate system: 
         [0000]        z=c   1   x+c   0 . 
         [0095]    For an arbitrary point, we have l=√{square root over (x 2 +(z+v p ) 2 )} and thus 
         [0000]    
       
         
           
             I 
             = 
             
               
                 
                   
                     
                       ( 
                       
                         
                           z 
                           0 
                         
                         + 
                         
                           v 
                           p 
                         
                       
                       ) 
                     
                     2 
                   
                    
                   
                     I 
                     0 
                   
                 
                 
                   l 
                   2 
                 
               
               . 
             
           
         
       
     
         [0096]    In the view of the projector, when the illumination pattern casts on a line, the intensity distribution becomes nonlinear and is given by 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         l 
                         i 
                       
                        
                       
                         ( 
                         x 
                         ) 
                       
                     
                     = 
                     
                       
                         
                           
                             ( 
                             
                               
                                 z 
                                 0 
                               
                               + 
                               
                                 v 
                                 p 
                               
                             
                             ) 
                           
                           2 
                         
                         
                           
                             
                               ( 
                               
                                 z 
                                 + 
                                 
                                   v 
                                   p 
                                 
                               
                               ) 
                             
                             2 
                           
                           + 
                           
                             
                               
                                 x 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   1 
                                   + 
                                   
                                     
                                       v 
                                       p 
                                     
                                     z 
                                   
                                 
                                 ) 
                               
                             
                             2 
                           
                         
                       
                        
                       
                         I 
                         0 
                       
                     
                   
                   , 
                   
                     
 
                   
                    
                   
                     ( 
                     
                       
                         - 
                         
                           T 
                           2 
                         
                       
                       &lt; 
                       
                         
                           
                             
                               v 
                               p 
                             
                             z 
                           
                            
                           x 
                         
                         - 
                         
                           2 
                            
                           nT 
                         
                       
                       &lt; 
                       
                         T 
                         2 
                       
                     
                     ) 
                   
                   , 
                   
                     n 
                     ∈ 
                     
                       N 
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0097]    Transforming the x-axis to align with the observed line, we have: 
         [0000]        x   l =√{square root over (1+ c   1   2 )} x.    
         [0098]    The above gives 
         [0000]    
       
         
           
             
               
                 
                   I 
                   i 
                 
                  
                 
                   ( 
                   
                     x 
                     I 
                   
                   ) 
                 
               
               = 
               
                 
                   
                     
                       ( 
                       
                         
                           z 
                           0 
                         
                         + 
                         
                           v 
                           p 
                         
                       
                       ) 
                     
                     2 
                   
                   
                     
                       
                         [ 
                         
                           I 
                           + 
                           
                             
                               ( 
                               
                                 
                                   
                                     c 
                                     2 
                                   
                                    
                                   
                                     x 
                                     l 
                                   
                                 
                                 
                                   
                                     
                                       c 
                                       2 
                                     
                                      
                                     
                                       x 
                                       l 
                                     
                                   
                                   + 
                                   
                                     c 
                                     0 
                                   
                                 
                               
                               ) 
                             
                             2 
                           
                         
                         ] 
                       
                        
                       
                         [ 
                         
                           
                             
                               ( 
                               
                                 
                                   c 
                                   2 
                                 
                                 + 
                                 I 
                               
                               ) 
                             
                              
                             
                               x 
                               l 
                             
                           
                           + 
                           
                             c 
                             0 
                           
                         
                         ] 
                       
                     
                     2 
                   
                 
                  
                 
                   I 
                   0 
                 
               
             
             , 
             
               
 
             
              
             
               
                 where 
                  
                 
                     
                 
                  
                 
                   c 
                   2 
                 
               
               = 
               
                 
                   
                     c 
                     1 
                   
                   
                     
                       1 
                       + 
                       
                         c 
                         1 
                         2 
                       
                     
                   
                 
                 . 
               
             
           
         
       
     
         [0099]    The illumination will be blurred unless it is projected on a plane at the perfectly focused distance: 
         [0000]    
       
         
           
             
               
                 z 
                 0 
               
               = 
               
                 
                   
                     v 
                     p 
                   
                    
                   
                     f 
                     p 
                   
                 
                 
                   
                     v 
                     p 
                   
                   - 
                   
                     f 
                     p 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where f p  is the intrinsic focus length of the projector. For all other points in the scene, the z-displacement of a surface point to the best-focused location is: 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               z 
             
             = 
             
               
                  
                 
                   z 
                   - 
                   
                     z 
                     0 
                   
                 
                  
               
               = 
               
                 
                    
                   
                     z 
                     - 
                     
                       
                         
                           v 
                           p 
                         
                          
                         
                           f 
                           p 
                         
                       
                       
                         
                           v 
                           p 
                         
                         - 
                         
                           f 
                           p 
                         
                       
                     
                   
                    
                 
                 . 
               
             
           
         
       
     
         [0000]    where v p  is the distance to from the image plane to the optical center. 
         [0100]    The corresponding blur radius is proportional to Δz: 
         [0000]    
       
         
           
             
               σ 
               = 
               
                 
                   
                     
                       v 
                       p 
                     
                     - 
                     
                       f 
                       p 
                     
                   
                   
                     
                       v 
                       p 
                     
                      
                     
                       F 
                       num 
                     
                   
                 
                  
                 Δ 
                  
                 
                     
                 
                  
                 z 
               
             
             , 
             
               
 
             
              
             
               
                 where 
                  
                 
                     
                 
                  
                 
                   F 
                   num 
                 
               
               = 
               
                 
                   f 
                   p 
                 
                 r 
               
             
           
         
       
     
         [0000]    is the f-number of the lens setting. 
         [0101]    For out-of-focus blur, the effect of blurring can be described via a point spread function (PSF) to account for the diffraction effect of light wave. A Gaussian model is normally used. 
         [0102]    With our light stripes, the one-dimensional PSF is 
         [0000]    
       
         
           
             
               
                 h 
                 σ 
               
                
               
                 ( 
                 x 
                 ) 
               
             
             = 
             
               
                 1 
                 
                   
                     
                       2 
                        
                       π 
                     
                   
                    
                   σ 
                 
               
                
               
                 
                    
                   
                     - 
                     
                       
                         x 
                         2 
                       
                       
                         2 
                          
                         
                           σ 
                           2 
                         
                       
                     
                   
                 
                 . 
               
             
           
         
       
     
         [0103]    The brightness of the illumination from the projector is the convolution of the ideal illumination intensity curve with the PSF blur model: 
         [0000]    
       
         
           
             
               I 
                
               
                 ( 
                 x 
                 ) 
               
             
             = 
             
               
                 
                   
                     I 
                     i 
                   
                    
                   
                     ( 
                     x 
                     ) 
                   
                 
                 ⊗ 
                 
                   
                     h 
                     σ 
                   
                    
                   
                     ( 
                     x 
                     ) 
                   
                 
               
               = 
               
                 
                   ∫ 
                   
                     - 
                     ∞ 
                   
                   
                     + 
                     ∞ 
                   
                 
                  
                 
                   
                     
                       I 
                       i 
                     
                      
                     
                       ( 
                       u 
                       ) 
                     
                   
                    
                   
                     
                       h 
                       σ 
                     
                      
                     
                       ( 
                       
                         x 
                         - 
                         u 
                       
                       ) 
                     
                   
                    
                   
                     
                        
                       u 
                     
                     . 
                   
                 
               
             
           
         
       
     
         [0104]    The Fourier transform of the above is 
         [0000]        I   F (ω)= I   F   i (ω) H   σ (ω),  (18) 
         [0000]    where H σ (ω) is the Fourier transform of the Gaussian function 
         [0000]    
       
         
           
             
               
                 H 
                 σ 
               
                
               
                 ( 
                 ω 
                 ) 
               
             
             = 
             
               
                 
                   ∫ 
                   
                     - 
                     ∞ 
                   
                   
                     + 
                     ∞ 
                   
                 
                  
                 
                   
                     1 
                     
                       
                         
                           2 
                            
                           π 
                         
                       
                        
                       σ 
                     
                   
                    
                   
                      
                     
                       - 
                       
                         
                           x 
                           2 
                         
                         
                           2 
                            
                           
                             σ 
                             2 
                           
                         
                       
                     
                   
                    
                   
                      
                     
                       
                         - 
                         jω 
                       
                        
                       
                           
                       
                        
                       x 
                     
                   
                    
                   
                      
                     x 
                   
                 
               
               = 
               
                 
                    
                   
                     - 
                     
                       
                         
                           σ 
                           2 
                         
                          
                         
                           ω 
                           2 
                         
                       
                       2 
                     
                   
                 
                 . 
               
             
           
         
       
     
         [0105]    Without significant loss of accuracy, l i (x) may be approximated by averaging the intensity on a light stripe to simplify the Fourier transform, I i (x)=Ī(x). If a coordinate system with its origin at the center of the bright stripe is used, this intensity can be written as 
         [0000]    
       
         
           
             
               
                 
                   I 
                   _ 
                 
                  
                 
                   ( 
                   x 
                   ) 
                 
               
               = 
               
                 
                   I 
                   0 
                 
                  
                 
                   [ 
                   
                     
                       ɛ 
                        
                       
                         ( 
                         
                           x 
                           + 
                           
                             T 
                             2 
                           
                         
                         ) 
                       
                     
                     - 
                     
                       ɛ 
                        
                       
                         ( 
                         
                           x 
                           - 
                           
                             T 
                             2 
                           
                         
                         ) 
                       
                     
                   
                   ] 
                 
               
             
             , 
           
         
       
     
         [0000]    where ε is a unit step function. 
         [0106]    The Fourier transform of the above is 
         [0000]    
       
         
           
             
               
                 I 
                 F 
                 i 
               
                
               
                 ( 
                 ω 
                 ) 
               
             
             = 
             
               
                 
                   I 
                   0 
                 
                  
                 T 
                  
                 
                   
                     sin 
                      
                     
                       ( 
                       
                         
                           ω 
                            
                           
                               
                           
                            
                           T 
                         
                         2 
                       
                       ) 
                     
                   
                   
                     
                       ω 
                        
                       
                           
                       
                        
                       T 
                     
                     2 
                   
                 
               
               = 
               
                 
                   I 
                   0 
                 
                  
                 
                   
                     
                       TS 
                       a 
                     
                      
                     
                       ( 
                       
                         
                           ω 
                            
                           
                               
                           
                            
                           T 
                         
                         2 
                       
                       ) 
                     
                   
                   . 
                 
               
             
           
         
       
     
         [0107]    Since l(x) is measured by the camera, its Fourier transform l F (ω) can be calculated. Using integration, we have 
         [0000]    
       
         
           
             
               ∫ 
               
                 
                    
                   
                     - 
                     
                       
                         
                           σ 
                           2 
                         
                          
                         
                           ω 
                           2 
                         
                       
                       2 
                     
                   
                 
                  
                 
                    
                   ω 
                 
               
             
             = 
             
               
                 I 
                 0 
               
                
               T 
                
               
                 ∫ 
                 
                   
                     
                       
                         I 
                         F 
                       
                        
                       
                         ( 
                         ω 
                         ) 
                       
                     
                     
                       
                         S 
                         a 
                       
                        
                       
                         ( 
                         
                           
                             ω 
                              
                             
                                 
                             
                              
                             T 
                           
                           2 
                         
                         ) 
                       
                     
                   
                    
                   
                     
                        
                       ω 
                     
                     . 
                   
                 
               
             
           
         
       
     
         [0108]    The left side is found to be 
         [0000]    
       
         
           
             Left 
             = 
             
               
                 
                   
                     2 
                   
                   σ 
                 
                  
                 
                   
                     ∫ 
                     
                       - 
                       ∞ 
                     
                     
                       + 
                       ∞ 
                     
                   
                    
                   
                     
                        
                       
                         - 
                         
                           
                             ( 
                             
                               
                                 σ 
                                  
                                 
                                     
                                 
                                  
                                 ω 
                               
                               
                                 2 
                               
                             
                             ) 
                           
                           2 
                         
                       
                     
                      
                     
                        
                       
                         ( 
                         
                           σω 
                           
                             2 
                           
                         
                         ) 
                       
                     
                   
                 
               
               = 
               
                 
                   
                     
                       2 
                     
                      
                     
                       π 
                     
                   
                   σ 
                 
                 . 
               
             
           
         
       
     
         [0109]    Therefore the blur radius can be computed by 
         [0000]    
       
         
           
             σ 
             = 
             
               
                 
                   [ 
                   
                     
                       
                         
                           I 
                           0 
                         
                          
                         T 
                       
                       
                         
                           2 
                            
                           π 
                         
                       
                     
                      
                     
                       ∫ 
                       
                         
                           
                             
                               I 
                               F 
                             
                              
                             
                               ( 
                               ω 
                               ) 
                             
                           
                           
                             
                               S 
                               a 
                             
                              
                             
                               ( 
                               
                                 
                                   ω 
                                    
                                   
                                       
                                   
                                    
                                   T 
                                 
                                 2 
                               
                               ) 
                             
                           
                         
                          
                         
                            
                           ω 
                         
                       
                     
                   
                   ] 
                 
                 
                   - 
                   1 
                 
               
               . 
             
           
         
       
     
         [0110]    Neglecting the effect of blurring caused by multiple illumination stripes, we have the following theorem to determine the blur radius with low computational cost and high precision. 
         [0111]    Theorem 1. With the projection of a step illumination on the object surface, the blur radius is proportional to the time rate flow of irradiant light energy in the blurred area: 
         [0000]    
       
         
           
             
               σ 
               = 
               
                 
                   
                     
                       2 
                        
                       π 
                     
                   
                   
                     I 
                     0 
                   
                 
                  
                 S 
               
             
             , 
           
         
       
     
         [0000]    where l 0  is the ideal intensity and S is the area size as illustrated in  FIG. 5   b.    
         [0112]    This means that the blur radius σ[m] is proportional to the area size under the blurring curve: σ=√{square root over (2π)}S/l 0 . The time rate flow of radiant light energy, i.e. the irradiant power or irradiant flux Φ [watt], is also the area size S [watt] under the blurring curve (or surface, in the case of two-dimensional analysis) illustrated in  FIG. 5   b.    
         [0113]    Therefore, we only need to compute the area size S for every stripe to determine the blur radius. In a simple way, the edge position (x=0) can be detected by a gradient method, and S is then determined by summating the intensity function from 0 to x 1 . However, even using a sub-pixel method for the edge detection, errors are still considerable since l(x) changes sharply near the origin. 
         [0114]    To solve this problem, we propose an accurate method in the sense of energy minimization. As illustrated in  FIG. 6 , we have 
         [0000]    
       
         
           
             
               
                 F 
                 s 
               
                
               
                 ( 
                 
                   x 
                   o 
                 
                 ) 
               
             
             = 
             
               
                 
                   
                     S 
                     1 
                   
                    
                   
                     ( 
                     
                       x 
                       o 
                     
                     ) 
                   
                 
                 + 
                 
                   
                     S 
                     2 
                   
                    
                   
                     ( 
                     
                       x 
                       o 
                     
                     ) 
                   
                 
               
                
               
                 
 
               
                
               
                   
               
               = 
               
                 
                   
                     
                       I 
                       0 
                     
                     
                       π 
                     
                   
                    
                   
                     
                       ∫ 
                       
                         
                           x 
                           o 
                         
                         
                           
                             2 
                           
                            
                           σ 
                         
                       
                       
                         + 
                         ∞ 
                       
                     
                      
                     
                       
                          
                         
                           - 
                           
                             y 
                             2 
                           
                         
                       
                        
                       
                          
                         y 
                       
                     
                   
                 
                 + 
                 
                   I 
                   0 
                 
                 - 
                 
                   
                     
                       I 
                       0 
                     
                     
                       π 
                     
                   
                    
                   
                     
                       ∫ 
                       
                         - 
                         ∞ 
                       
                       
                         
                           x 
                           o 
                         
                         
                           
                             2 
                           
                            
                           σ 
                         
                       
                     
                      
                     
                       
                          
                         
                           - 
                           
                             y 
                             2 
                           
                         
                       
                        
                       
                         
                            
                           y 
                         
                         . 
                       
                     
                   
                 
               
             
           
         
       
     
         [0115]    It can be proved that the derivative of the above function is 
         [0000]      F s ′≧0, if x o ≧0, 
         [0000]    where “=” holds if and only if x o =0. 
         [0116]    The same situation occurs when x o ≦0. Therefore, at x o =0, we have 
         [0000]        S =min( F   s )/2. 
         [0117]    This means that the same quantity of light energy flows from S 2  to S 1 . This method for computing S is more stable than traditional methods and it yields high accuracy. 
         [0118]    Now the best-focused location can be computed by analyzing the blur information in an image. With Theorem 1, by integrating the blurring curve on each stripe edge, the blur radius σ i  can be calculated. These blur radiuses are recorded as a set 
         [0000]        D ={( i,σ   i )| iεN},    
         [0000]    where i is the stripe index on the projector&#39;s source pattern. 
         [0119]    The blur size is proportional to the displacement of a scene point from the BFL, σ=k j Δz. Since the blur diameters are unsigned, a minimum value σ min  in the data set D can be found. For a line in the scene, in order to obtain a straight line corresponding to the linearly changing depth in the scene, we separate D into two parts and apply linear best-fit to obtain two straight lines: 
         [0000]      σ i ( x )= k   1   x+k   2  and σ r ( x )= k   3   x+k   4 . 
         [0120]    Finding the intersection of the two lines gives a best-focused location (as shown in  FIG. 7 ) 
         [0000]    
       
         
           
             
               
                 x 
                 b 
               
               = 
               
                 
                   
                     k 
                     4 
                   
                   - 
                   
                     k 
                     2 
                   
                 
                 
                   
                     k 
                     1 
                   
                   - 
                   
                     k 
                     3 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    which corresponds to Δz=0 or 
         [0000]    
       
         
           
             
               z 
                
               
                 ( 
                 
                   x 
                   b 
                 
                 ) 
               
             
             = 
             
               
                 
                   
                     v 
                     p 
                   
                    
                   
                     f 
                     p 
                   
                 
                 
                   
                     v 
                     p 
                   
                   - 
                   
                     f 
                     p 
                   
                 
               
               . 
             
           
         
       
     
         [0000]    The corresponding coordinates on the image are (x h ,y h ), where y b  is determined according to the scanning line on the image. 
         [0121]    From the above analysis, there exists a point which represents the best-focused location for a line in the scene. Now consider the blur distribution on a plane in the scene. This happens when we analyze multiple scan lines crossing the light stripes or when the source illumination is a grid pattern. 
         [0122]    For a plane in scene, z=c 1 x+c 2 y+c 3 , the blur radius is 
         [0000]    
       
         
           
             
               
                 
                   
                     σ 
                      
                     
                       ( 
                       
                         x 
                         , 
                         y 
                       
                       ) 
                     
                   
                   = 
                     
                    
                   
                     
                       
                         
                           v 
                           p 
                         
                         - 
                         
                           f 
                           p 
                         
                       
                       
                         
                           v 
                           p 
                         
                          
                         
                           F 
                           num 
                         
                       
                     
                      
                     
                        
                       
                         z 
                         - 
                         
                           
                             
                               v 
                               p 
                             
                              
                             
                               f 
                               p 
                             
                           
                           
                             
                               v 
                               p 
                             
                             - 
                             
                               f 
                               p 
                             
                           
                         
                       
                        
                     
                   
                 
               
             
             
               
                 
                   = 
                     
                    
                   
                     
                        
                       
                         
                           
                             
                               ( 
                               
                                 
                                   v 
                                   p 
                                 
                                 - 
                                 
                                   f 
                                   p 
                                 
                               
                               ) 
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     c 
                                     1 
                                   
                                    
                                   x 
                                 
                                 + 
                                 
                                   
                                     c 
                                     2 
                                   
                                    
                                   y 
                                 
                                 + 
                                 
                                   c 
                                   3 
                                 
                               
                               ) 
                             
                           
                           - 
                           
                             
                               v 
                               p 
                             
                              
                             
                               f 
                               p 
                             
                           
                         
                         
                           
                             v 
                             p 
                           
                            
                           
                             F 
                             num 
                           
                         
                       
                        
                     
                     . 
                   
                 
               
             
           
         
       
     
         [0123]    The best focused locations form a straight line which is the intersection of two planes. A valley line can be found since the blur radius is unsigned. 
         [0124]    For a freeform surface in the scene, the best-focused location can be determined by extending the above method making some minor modifications. For each light stripe, we can also compute its blur diameter and obtain a pair (Z ri , σ i ), where iεN is the stripe index and z ri  iε[0, 1] is its relative depth in the camera view. Plotting these pairs in a coordinate system with σ as the vertical axis and z r  as the horizontal axis, we can also find a valley to be the best focused distance, z rb . 
         [0125]    For the point with minimum blur value, i.e. the best-focused location (Δz=0), is constrained by 
         [0000]    
       
         
           
             
               
                 
                   
                     Z 
                     c 
                   
                    
                   
                     [ 
                     
                       
                         
                           
                             x 
                             c 
                           
                         
                       
                       
                         
                           
                             y 
                             c 
                           
                         
                       
                       
                         
                           1 
                         
                       
                     
                     ] 
                   
                 
                 - 
                 
                   s 
                    
                   
                     [ 
                     
                       
                         
                           
                             t 
                             x 
                           
                         
                       
                       
                         
                           
                             t 
                             y 
                           
                         
                       
                       
                         
                           
                             t 
                             z 
                           
                         
                       
                     
                     ] 
                   
                 
               
               = 
               
                 
                   
                     
                       
                         v 
                         p 
                       
                        
                       
                         f 
                         p 
                       
                     
                     
                       
                         v 
                         p 
                       
                       - 
                       
                         f 
                         p 
                       
                     
                   
                    
                   
                     
                       R 
                       
                         - 
                         1 
                       
                     
                      
                     
                       [ 
                       
                         
                           
                             
                               x 
                               p 
                             
                           
                         
                         
                           
                             
                               y 
                               p 
                             
                           
                         
                         
                           
                             1 
                           
                         
                       
                       ] 
                     
                   
                 
                 = 
                 
                   [ 
                   
                     
                       
                         
                           b 
                           1 
                         
                       
                     
                     
                       
                         
                           b 
                           2 
                         
                       
                     
                     
                       
                         
                           b 
                           3 
                         
                       
                     
                   
                   ] 
                 
               
             
             , 
           
         
       
     
         [0126]    The scaling factor s can thus be determined: 
         [0000]    
       
         
           
             s 
             = 
             
               
                 
                   
                     
                       x 
                       c 
                     
                      
                     
                       b 
                       2 
                     
                   
                   - 
                   
                     
                       y 
                       c 
                     
                      
                     
                       b 
                       1 
                     
                   
                 
                 
                   
                     
                       y 
                       c 
                     
                      
                     
                       t 
                       x 
                     
                   
                   - 
                   
                     
                       x 
                       c 
                     
                      
                     
                       t 
                       y 
                     
                   
                 
               
               . 
             
           
         
       
     
         [0127]    The procedures for self-recalibration of a structured light vision sensor are given as follows:
       Step 1: projecting grid encoded patterns onto the scene;   Step 2: determining t n  and R for 5 unknowns;   Step 3: computing the blur distribution and determining the best-focused location;   Step 4: determining the scaling factor s; and   Step 5: combining the relative matrix for 3-D reconstruction.       
 
         [0133]    The method presented here automatically resolves six parameters of a color-encoded structured light system. When the internal parameters of the camera  3  and the projector  1  are known via pre-calibration, the 6 DOF relative placement of the active vision system can be automatically recalibrated with neither manual operations nor assistance of a calibration device. This feature is very important for many situations when the vision sensor needs to be reconfigured online during a measurement or reconstruction task. 
         [0134]    The method itself does not require the six parameters all to be the external ones. In fact, only if the number of unknown parameters of the system does not exceed six, the method can still be applied. For example, if the two focal lengths, v c  and v p , are variable during the system reconfiguration and the relative structure has 4DOFs, we may solve them in a similar way, by replacing the matrix F by F=(P c   −1 ) T RSP p   −1  and modifying the decomposition method accordingly. 
         [0135]    When the unknown parameters exceed six, the above-described method may not solve them directly. However, a 2-step method may be used to solve this problem. That is, before the internal parameters are reconfigured, we take an image firstly to obtain the 6DOF external parameters. Then after changing the sensors&#39; internal parameters, we take an image again to recalibrate them. 
         [0136]    Special features of a method according to a preferred embodiment of the invention the invented method include:
       The single image based recalibration allows measurement or reconstruction to be performed immediately after reconfiguration in the software, without requiring any extra requirement.   Metric measurement of the absolute geometry of the 3D shape may be obtained by replacing r(x b , y b ) with z rb . This is different from most of the currently available conventional methods where the 3D reconstruction supported is up to a certain transformation.       
 
       Automatic Viewpoint Planning 
       [0139]    To obtain a complete 3D model of an object  2  with the vision system as shown in  FIG. 1 , multiple views may be required, e.g. via robot vision as shown in  FIG. 8  which illustrates the components of  FIG. 1  housed in a robot apparatus. The viewpoint planning is charged with the task of determining the position and orientation and system configuration parameters for each view to be taken. It is assumed for the purposes of this description that we are dealing with an unknown object, i.e. assuming no prior knowledge about the object model. It is also assumed here that the object is general free-form surfaced. The approach is preferably to model a 3D object via a series of cross section curves. These cross section curves can be described by a set of parametric equations of B-spline curves. A criterion is proposed to select the optimal model structure for the available data points on the cross section curve. 
         [0140]    For object reconstructions, two conventional approaches are volume reconstruction and surface reconstruction. The volume based technique is concerned with the manipulation of the volumetric objects stored in a volume raster of voxels. Surface reconstruction may be approached in one of the two ways: 1) representing the surface with a mosaic of flat polygon titles, usually triangles: and 2) representing the surface with a series of curved patches joined with some order of continuity. However, as mentioned above, a preferred reconstruction method for embodiments of the present invention is to model a 3D object via a series of cross section curves. 
       Model Selection for Reconstruction 
       [0141]    The object  2  is sliced into a number of cross section curves, each of which represents the local geometrical features of the object. These cross section curves may be described by a set of parametric equations. For reconstruction of cross section curves, compared with implicit polynomial [47] and superquadric, B-spline has the following main advantages: 
         [0000]    1) Smoothness and continuity, which allows any curve to be composed of a concatenation of curve segments and yet be treated as a single unit,
 
2) Built-in boundedness. a property which is lacking in implicit or explicit polynomial representation whose zero set can shoot to infinity; and
 
3) Parameterized representation, which decouples the x, z coordinates to be treated separately.
 
       2.1 Closed B-spline Curve Approximation 
       [0142]    A closed cubic B-spline curve consisting of n+1 curve segments may be defined by 
         [0000]    
       
         
           
             
               
                 
                   
                     p 
                      
                     
                       ( 
                       t 
                       ) 
                     
                   
                   = 
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         0 
                       
                       
                         n 
                         + 
                         3 
                       
                     
                      
                     
                       
                         
                           B 
                           
                             j 
                             , 
                             4 
                           
                         
                          
                         
                           ( 
                           t 
                           ) 
                         
                       
                       · 
                       
                         Φ 
                         j 
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where p(t)=[x(t), z(t)] is a point on B-spline curve with location parameter t. In this section we use the chord length method for parameterization. In (1), B j,4 (t) is the jth normalized cubic B-spline basis function, which is defined over the uniform knots vector 
         [0000]      [u −3 , u −2 , . . . U n+4 ,]=[−3, −2, . . . , n+4] 
         [0143]    In addition, the amplitude of B j,4 (t) is in the range of (0.0, 1.0), and the support region of B j,4 (t) is compact and nonzero for tε[u j , u j+4 ]. The (Φ j ) j=0   n+3  are cyclical control points satisfying the following conditions: 
         [0000]      Φ n+1 =Φ 0 , Φ n+2 =Φ 1 , Φ n+3 =Φ 2    
         [0144]    By factorization of the B-spline model, the parameters of B-spline model can be represented as: 
         [0000]      [Φ x   τ , Φ z   τ ] τ =[Φ x0 , . . . Φ xn , Φ z0 , . . . Φ zn ] τ   
         [0145]    For a set of m data points r=(r i ) i=1   m =([x i , y i ]) i=1   m , let d 2  be the sum of the squared residual errors between the data points and their corresponding points on the B-spline curve, ie 
         [0000]    
       
         
           
             
               
                 
                   
                     d 
                     2 
                   
                   = 
                     
                    
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       m 
                     
                      
                     
                       
                          
                         
                           
                             r 
                             i 
                           
                           - 
                           
                             p 
                              
                             
                               ( 
                               
                                 t 
                                 i 
                               
                               ) 
                             
                           
                         
                          
                       
                       2 
                     
                   
                 
               
             
             
               
                 
                   = 
                     
                    
                   
                     
                       
                         ∑ 
                         
                           i 
                           = 
                           1 
                         
                         m 
                       
                        
                       
                         
                           [ 
                           
                             
                               x 
                               i 
                             
                             - 
                             
                               
                                 ∑ 
                                 
                                   j 
                                   = 
                                   0 
                                 
                                 
                                   n 
                                   + 
                                   3 
                                 
                               
                                
                               
                                 
                                   
                                     B 
                                     
                                       j 
                                       , 
                                       4 
                                     
                                   
                                    
                                   
                                     ( 
                                     
                                       t 
                                       i 
                                     
                                     ) 
                                   
                                 
                                 · 
                                 
                                   Φ 
                                   xj 
                                 
                               
                             
                           
                           ] 
                         
                         2 
                       
                     
                     + 
                     
                       
                         ∑ 
                         
                           i 
                           = 
                           1 
                         
                         m 
                       
                        
                       
                         
                           [ 
                           
                             
                               y 
                               i 
                             
                             - 
                             
                               
                                 ∑ 
                                 
                                   j 
                                   = 
                                   0 
                                 
                                 
                                   n 
                                   + 
                                   3 
                                 
                               
                                
                               
                                 
                                   
                                     B 
                                     
                                       j 
                                       , 
                                       4 
                                     
                                   
                                    
                                   
                                     ( 
                                     
                                       t 
                                       i 
                                     
                                     ) 
                                   
                                 
                                 · 
                                 
                                   Φ 
                                   yj 
                                 
                               
                             
                           
                           ] 
                         
                         2 
                       
                     
                   
                 
               
             
           
         
       
     
         [0146]    From the cyclical condition of control points in the equation Φ n+1 =Φ 0 , Φ n+2 =Φ 1 , Φ n+3 =Φ 2 , there are only n+1 control points to be estimated. The LS estimation method of the n+1 control points may be obtained from the curve points by minimizing d 2  above with respect to Φ=[Φ x   T , Φ y   T ] T =[Φ x0 , . . . Φ xn , Φ y0 , . . . , Φ yn ] T . 
         [0147]    The following estimation of Φ may then be obtained by factorization of the B-spline: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               Φ 
                               x 
                             
                             = 
                             
                               
                                 
                                   [ 
                                   
                                     
                                       B 
                                       τ 
                                     
                                      
                                     B 
                                   
                                   ] 
                                 
                                 
                                   - 
                                   1 
                                 
                               
                                
                               
                                 B 
                                 τ 
                               
                                
                               x 
                             
                           
                         
                       
                       
                         
                           
                             
                               Φ 
                               y 
                             
                             = 
                             
                               
                                 
                                   [ 
                                   
                                     
                                       B 
                                       τ 
                                     
                                      
                                     B 
                                   
                                   ] 
                                 
                                 
                                   - 
                                   1 
                                 
                               
                                
                               
                                 B 
                                 τ 
                               
                                
                               y 
                             
                           
                         
                       
                     
                     } 
                   
                    
                   
                     
 
                   
                    
                   where 
                    
                   
                     
 
                   
                    
                   
                     
                       x 
                       = 
                       
                         
                           [ 
                           
                             
                               x 
                               1 
                             
                             , 
                             … 
                              
                             
                                 
                             
                             , 
                             
                               x 
                               m 
                             
                           
                           ] 
                         
                         τ 
                       
                     
                     , 
                     
                       y 
                       = 
                       
                         
                           [ 
                           
                             
                               y 
                               1 
                             
                             , 
                             … 
                              
                             
                                 
                             
                             , 
                             
                               y 
                               m 
                             
                           
                           ] 
                         
                         τ 
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     B 
                     = 
                     
                       [ 
                       
                         
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   0 
                                   , 
                                   4 
                                 
                                 1 
                               
                               + 
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   
                                     n 
                                     + 
                                     1 
                                   
                                   , 
                                   4 
                                 
                                 1 
                               
                             
                           
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   1 
                                   , 
                                   4 
                                 
                                 1 
                               
                               + 
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   
                                     n 
                                     + 
                                     2 
                                   
                                   , 
                                   4 
                                 
                                 1 
                               
                             
                           
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   2 
                                   , 
                                   4 
                                 
                                 1 
                               
                               + 
                               
                                 
                                   
                                     B 
                                     _ 
                                   
                                   
                                     
                                       n 
                                       + 
                                       3 
                                     
                                     , 
                                     4 
                                   
                                   1 
                                 
                                  
                                 
                                     
                                 
                                  
                                 … 
                               
                             
                           
                           
                             
                               
                                 B 
                                 _ 
                               
                               
                                 n 
                                 , 
                                 4 
                               
                               1 
                             
                           
                         
                         
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   0 
                                   , 
                                   4 
                                 
                                 2 
                               
                               + 
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   
                                     n 
                                     + 
                                     1 
                                   
                                   , 
                                   4 
                                 
                                 2 
                               
                             
                           
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   1 
                                   , 
                                   4 
                                 
                                 2 
                               
                               + 
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   
                                     n 
                                     + 
                                     2 
                                   
                                   , 
                                   4 
                                 
                                 2 
                               
                             
                           
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   2 
                                   , 
                                   4 
                                 
                                 2 
                               
                               + 
                               
                                 
                                   
                                     B 
                                     _ 
                                   
                                   
                                     
                                       n 
                                       + 
                                       3 
                                     
                                     , 
                                     4 
                                   
                                   2 
                                 
                                  
                                 
                                     
                                 
                                  
                                 … 
                               
                             
                           
                           
                             
                               
                                 B 
                                 _ 
                               
                               
                                 n 
                                 , 
                                 4 
                               
                               2 
                             
                           
                         
                         
                           
                             ⋮ 
                           
                           
                             ⋮ 
                           
                           
                             ⋮ 
                           
                           
                             ⋮ 
                           
                         
                         
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   0 
                                   , 
                                   4 
                                 
                                 m 
                               
                               + 
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   
                                     n 
                                     + 
                                     1 
                                   
                                   , 
                                   4 
                                 
                                 m 
                               
                             
                           
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   1 
                                   , 
                                   4 
                                 
                                 m 
                               
                               + 
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   
                                     n 
                                     + 
                                     2 
                                   
                                   , 
                                   4 
                                 
                                 m 
                               
                             
                           
                           
                             
                               
                                 
                                   B 
                                   _ 
                                 
                                 
                                   2 
                                   , 
                                   4 
                                 
                                 m 
                               
                               + 
                               
                                 
                                   
                                     B 
                                     _ 
                                   
                                   
                                     
                                       n 
                                       + 
                                       3 
                                     
                                     , 
                                     4 
                                   
                                   m 
                                 
                                  
                                 
                                     
                                 
                                  
                                 … 
                               
                             
                           
                           
                             
                               
                                 B 
                                 _ 
                               
                               
                                 n 
                                 , 
                                 4 
                               
                               m 
                             
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0000]    and  B   j,4   i =B j,4 (τ i ). 
         [0148]    The chord length method may preferably be used for the parameterization of the B-spline. The chord length L of a curve may be calculated as follows: 
         [0000]    
       
         
           
             L 
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   2 
                 
                 
                   m 
                   + 
                   1 
                 
               
                
               
                  
                 
                   
                     r 
                     i 
                   
                   - 
                   
                     r 
                     
                       i 
                       - 
                       1 
                     
                   
                 
                  
               
             
           
         
       
     
         [0000]    where r m+1 =r 1  for a closed curve. The t i  associated with point q i  may be given as: 
         [0000]    
       
         
           
             
               t 
               i 
             
             = 
             
               
                 t 
                 
                   i 
                   - 
                   1 
                 
               
               + 
               
                 
                   
                      
                     
                       
                         r 
                         i 
                       
                       - 
                       
                         r 
                         
                           i 
                           - 
                           1 
                         
                       
                     
                      
                   
                   L 
                 
                 · 
                 
                   t 
                   max 
                 
               
             
           
         
       
     
         [0000]    where t 1 =0 and t max =n+l
 
Model Selection with Improved BIC Criterion
 
         [0149]    For a given set of measurement data, there exists a model of optimal complexity corresponding to the smallest prediction (generalization) error for further data. The complexity of a B-spline model of a surface is related to its control point (parameter) number [43],[48]. If the B-spline model is too complicated, the approximated B-spline surface tends to over-fit noisy measurement data. If the model is too simple, then it is not capable of fitting the measurement data, making the approximation results under-fitted. In general, both over- and under-fitted surfaces have poor generalization capability. Therefore, the problem of finding an appropriate model, referred to as model selection, is important for achieving a high level generalization capability. 
         [0150]    Model selection has been studied from various standpoints in the field of statistics. Examples include information statistics [49]-[51] Bayesian statistics [52]-[54], and structural risk minimization [55]. The Bayesian approach is a preferred model selection method. Based on posterior model probabilities, the Bayesian approach estimates a probability distribution over an ensemble of models. The prediction is accomplished by averaging over the ensemble of models. Accordingly, the uncertainty of the models is taken into account, and complex models with more degrees of freedom are penalized. 
         [0151]    For a given set of models {M k , k=1, .2, . . . } and data r, there exists a model of optimal model structure corresponding to smallest generalization error for further data and the Bayesian approach may be used to select the model with the largest (maximum) posterior probability to account for the data acquired so far. 
         [0152]    In a first preferred method, the model M may be denoted by: 
         [0000]        M =arg M     k,k=1 . . . k max   max{ p ( r|M   K )} 
         [0000]    where the posterior probability of model M k  may be denoted by 
         [0000]    
       
         
           
             
               
                 
                   
                     p 
                      
                     
                       ( 
                       
                         r 
                          
                         
                           M 
                           k 
                         
                       
                       ) 
                     
                   
                   = 
                     
                    
                   
                     
                       ∫ 
                       
                         Φ 
                         k 
                       
                     
                      
                     
                       
                         p 
                          
                         
                           ( 
                           
                             
                               r 
                                
                               
                                 Φ 
                                 k 
                               
                             
                             , 
                             
                               M 
                               k 
                             
                           
                           ) 
                         
                       
                        
                       
                         p 
                          
                         
                           ( 
                           
                             
                               Φ 
                               k 
                             
                              
                             
                               M 
                               k 
                             
                           
                           ) 
                         
                       
                        
                       
                           
                       
                        
                       
                          
                         
                           Φ 
                           k 
                         
                       
                     
                   
                 
               
             
             
               
                 
                   ≅ 
                     
                    
                   
                     
                       
                         ( 
                         
                           2 
                            
                           
                               
                           
                            
                           π 
                         
                         ) 
                       
                       
                         
                           d 
                           k 
                         
                         / 
                         2 
                       
                     
                      
                     
                       
                          
                         
                           H 
                            
                           
                             ( 
                             
                               
                                 Φ 
                                 ^ 
                               
                               k 
                             
                             ) 
                           
                         
                          
                       
                       
                         
                           - 
                           1 
                         
                         / 
                         2 
                       
                     
                      
                     
                       p 
                        
                       
                         ( 
                         
                           
                             r 
                              
                             
                               
                                 Φ 
                                 ^ 
                               
                               k 
                             
                           
                           , 
                           
                             M 
                             k 
                           
                         
                         ) 
                       
                     
                      
                     
                       p 
                        
                       
                         ( 
                         
                           
                             
                               Φ 
                               ^ 
                             
                             k 
                           
                            
                           
                             M 
                             k 
                           
                         
                         ) 
                       
                     
                   
                 
               
             
           
         
       
     
         [0153]    Neglecting the term p({circumflex over (Φ)} k |M k ), the posterior probability of model M k  becomes [11]: 
         [0000]    
       
         
           
             M 
             = 
             
               arg 
                
               
                   
               
                
               
                 
                   max 
                   
                     
                       M 
                       k 
                     
                     , 
                     
                       k 
                       = 
                       1 
                     
                     , 
                     
                       … 
                        
                       
                           
                       
                        
                       
                         k 
                         max 
                       
                     
                   
                 
                  
                 
                   { 
                   
                     
                       log 
                        
                       
                           
                       
                        
                       
                         p 
                          
                         
                           ( 
                           
                             
                               r 
                                
                               
                                 
                                   Φ 
                                   ^ 
                                 
                                 k 
                               
                             
                             , 
                             
                               M 
                               k 
                             
                           
                           ) 
                         
                       
                     
                     - 
                     
                       
                         1 
                         2 
                       
                        
                       log 
                        
                       
                          
                         
                           H 
                            
                           
                             ( 
                             
                               
                                 Φ 
                                 ^ 
                               
                               k 
                               ′ 
                             
                             ) 
                           
                         
                          
                       
                     
                   
                   } 
                 
               
             
           
         
       
     
         [0000]    where {circumflex over (Φ)} k  is the maximum likelihood estimate of Φ k , and  d   k  is the parameter number of model M k , H({circumflex over (Φ)} k ) is the Hessian matrix of −log p(r|Φ k ,M k ) evaluated at {circumflex over (Φ)} k . 
         [0154]    The likelihood function p(r|{circumflex over (Φ)} k ,M k ) of closed B-spline cross section curves can be factored into x and y components as 
         [0000]        p ( r|{circumflex over (Φ)}   k   ,M   k )= p ( x|{circumflex over (Φ)}   kz   ,M   l )· p ( y|{circumflex over (Φ)}   ky   ,M   k ) 
         [0000]    where {circumflex over (Φ)} kz  and {circumflex over (Φ)} ky  can be calculated by 
         [0000]    
       
         
           
             { 
             
               
                 
                   
                     
                       Φ 
                       x 
                     
                     = 
                     
                       
                         
                           [ 
                           
                             
                               B 
                               T 
                             
                              
                             B 
                           
                           ] 
                         
                         
                           - 
                           1 
                         
                       
                        
                       
                         B 
                         T 
                       
                        
                       x 
                     
                   
                 
               
               
                 
                   
                     
                       Φ 
                       y 
                     
                     = 
                     
                       
                         
                           [ 
                           
                             
                               B 
                               T 
                             
                              
                             B 
                           
                           ] 
                         
                         
                           - 
                           1 
                         
                       
                        
                       
                         B 
                         T 
                       
                        
                       y 
                     
                   
                 
               
             
           
         
       
     
         [0155]    Consider, for example, the x component. Assuming the residual error sequence to be zero mean and white Gaussian with variance σ kx   2 ({circumflex over (Φ)} kx ), we have the following likelihood function: 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   
                     x 
                      
                     
                       
                         Φ 
                         ^ 
                       
                       kx 
                     
                   
                   , 
                   
                     M 
                     k 
                   
                 
                 ) 
               
             
             = 
             
               
                 
                   
                     ( 
                     
                       1 
                       
                         2 
                          
                         
                             
                         
                          
                         π 
                          
                         
                             
                         
                          
                         
                           
                             σ 
                             kx 
                             2 
                           
                            
                           
                             ( 
                             
                               
                                 Φ 
                                 ^ 
                               
                               kx 
                             
                             ) 
                           
                         
                       
                     
                     ) 
                   
                   
                     m 
                     / 
                     2 
                   
                 
                 · 
                 exp 
               
                
               
                 { 
                 
                   
                     - 
                     
                       1 
                       
                         2 
                          
                         
                             
                         
                          
                         
                           
                             σ 
                             kx 
                             2 
                           
                            
                           
                             ( 
                             
                               
                                 Φ 
                                 ^ 
                               
                               kx 
                             
                             ) 
                           
                         
                       
                     
                   
                    
                   
                     
                       ∑ 
                       
                         k 
                         = 
                         0 
                       
                       
                         m 
                         - 
                         1 
                       
                     
                      
                     
                       
                         [ 
                         
                           
                             x 
                             k 
                           
                           - 
                           
                             
                               B 
                               k 
                             
                              
                             
                               
                                 Φ 
                                 ^ 
                               
                               kx 
                             
                           
                         
                         ] 
                       
                       2 
                     
                   
                 
                 } 
               
             
           
         
       
       
         
           
             and σ kx   2 ({circumflex over (Φ)} kx ,M k ) is estimated by: 
           
         
       
     
         [0000]    
       
         
           
             
               
                 
                   σ 
                   ^ 
                 
                 kx 
                 2 
               
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   kx 
                 
                 ) 
               
             
             = 
             
               
                 1 
                 m 
               
                
               
                 
                   ∑ 
                   
                     k 
                     = 
                     0 
                   
                   
                     m 
                     - 
                     1 
                   
                 
                  
                 
                   
                     [ 
                     
                       
                         x 
                         k 
                       
                       - 
                       
                         
                           B 
                           k 
                         
                          
                         
                           
                             Φ 
                             ^ 
                           
                           kx 
                         
                       
                     
                     ] 
                   
                   2 
                 
               
             
           
         
       
     
         [0157]    In a similar way, the likelihood function of the y component can also be obtained. The corresponding Hessian matrix insert Ĥ k  of −log p(r|Φ k ,M k ) evaluated at {circumflex over (Φ)} k  may be denoted by: 
         [0000]    
       
         
           
             
               H 
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   k 
                 
                 ) 
               
             
             = 
             
               [ 
               
                 
                   
                     
                       
                         
                           B 
                           T 
                         
                          
                         B 
                       
                       
                         
                           
                             σ 
                             ^ 
                           
                           kx 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               Φ 
                               ^ 
                             
                             kx 
                           
                           ) 
                         
                       
                     
                   
                   
                     0 
                   
                 
                 
                   
                     0 
                   
                   
                     
                       
                         
                           B 
                           T 
                         
                          
                         B 
                       
                       
                         
                           
                             σ 
                             ^ 
                           
                           ky 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               Φ 
                               ^ 
                             
                             ky 
                           
                           ) 
                         
                       
                     
                   
                 
               
               ] 
             
           
         
       
     
         [0158]    By approximating 
         [0000]    
       
         
           
             
               1 
               2 
             
              
             log 
              
             
                
               
                 H 
                  
                 
                   ( 
                   
                     
                       Φ 
                       ^ 
                     
                     k 
                   
                   ) 
                 
               
                
             
           
         
       
     
         [0000]    by the asymptotic expected value of Hessian 
         [0000]    
       
         
           
             
               
                 1 
                 2 
               
                
               
                 ( 
                 
                   
                     d 
                     kx 
                   
                   + 
                   
                     d 
                     ky 
                   
                 
                 ) 
               
                
               
                 log 
                  
                 
                   ( 
                   m 
                   ) 
                 
               
             
             , 
           
         
       
     
         [0000]    we can obtain the BIC criterion for B-spline model selection as follows: 
         [0000]    
       
         
           
             M 
             = 
             
               arg 
                
               
                   
               
                
               
                 
                   max 
                   
                     
                       M 
                       k 
                     
                     , 
                     
                       k 
                       = 
                       1 
                     
                     , 
                     
                         
                     
                      
                     
                       … 
                        
                       
                           
                       
                        
                       
                         k 
                         max 
                       
                     
                   
                 
                  
                 
                   { 
                   
                     
                       
                         
                           
                             
                               - 
                               
                                 m 
                                 2 
                               
                             
                              
                             log 
                              
                             
                                 
                             
                              
                             
                               
                                 
                                   σ 
                                   ^ 
                                 
                                 kx 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   
                                     Φ 
                                     ^ 
                                   
                                   kx 
                                 
                                 ) 
                               
                             
                           
                           - 
                           
                             
                               m 
                               2 
                             
                              
                             log 
                              
                             
                                 
                             
                              
                             
                               
                                 
                                   σ 
                                   ^ 
                                 
                                 ky 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   
                                     Φ 
                                     ^ 
                                   
                                   ky 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             - 
                             
                               1 
                               2 
                             
                           
                            
                           
                             ( 
                             
                               
                                 d 
                                 kx 
                               
                               + 
                               
                                 d 
                                 ky 
                               
                             
                             ) 
                           
                            
                           
                             log 
                              
                             
                               ( 
                               m 
                               ) 
                             
                           
                         
                       
                     
                   
                   } 
                 
               
             
           
         
       
     
         [0000]    where d kx  and d ky  are the number of control points in the x and y directions respectively, and m is the number of data points. 
         [0159]    In the above equation, the first two terms {circumflex over (σ)} kx   2  and {circumflex over (σ)} ky   2    
         [0000]    measure the prediction accuracy of the B-spline model, which increases with the complexity of the model. 
         [0160]    In contrast, the second term decreases and acts as a penalty for using additional parameters to model the data. However, since the {circumflex over (σ)} kx   2  and {circumflex over (σ)} ky   2  only depend on the training sample for model estimation, they are insensitive when under fitting or over fitting occurs. In the above equation, only penalty terms prevent the occurrence of over-fitting. In fact, an honest estimate of σ kx   2  and σ ky   2  should be based on a re-sampling procedure. Here, the available data may be divided into a training sample and a prediction sample. The training sample is used only for model estimation, whereas the prediction sample is used only for estimating the prediction data noise {circumflex over (σ)} kx   2  and {circumflex over (σ)} ky   2 . That is, the training sample is used to estimate the model parameter {circumflex over (Φ)} k  by: {circumflex over (Φ)} z =[B T B] −1 B T x, Φ y =[B T B] −1 B T   y  while the prediction sample is used to predict data noise σ k   2  by 
         [0000]    
       
         
           
             
               
                 
                   σ 
                   ^ 
                 
                 kx 
                 2 
               
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   kx 
                 
                 ) 
               
             
             = 
             
               
                 1 
                 m 
               
                
               
                 
                   ∑ 
                   
                     k 
                     = 
                     0 
                   
                   
                     m 
                     - 
                     1 
                   
                 
                  
                 
                   
                     
                       [ 
                       
                         
                           x 
                           k 
                         
                         - 
                         
                           
                             B 
                             k 
                           
                            
                           
                             
                               Φ 
                               ^ 
                             
                             kx 
                           
                         
                       
                       ] 
                     
                     2 
                   
                   . 
                 
               
             
           
         
       
     
         [0000]    In fact, if the model {circumflex over (Φ)} k  fitted to the training data is valid, then the estimated variance {circumflex over (ρ)} k  from a prediction sample should also be a valid estimate of data noise. 
         [0161]    In another preferred embodiment, for a given a set of models insert p51 and data r, the Bayesian approach selects the model with the largest posterior probability. The posterior probability of model M k  may be denoted by: 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   
                     M 
                     k 
                   
                    
                   r 
                 
                 ) 
               
             
             = 
             
               
                 
                   p 
                    
                   
                     ( 
                     
                       r 
                        
                       
                         M 
                         k 
                       
                     
                     ) 
                   
                 
                  
                 
                   p 
                    
                   
                     ( 
                     
                       M 
                       k 
                     
                     ) 
                   
                 
               
               
                 
                   ∑ 
                   
                     L 
                     = 
                     1 
                   
                   
                     k 
                     max 
                   
                 
                  
                 
                   
                     p 
                      
                     
                       ( 
                       
                         r 
                          
                         
                           M 
                           L 
                         
                       
                       ) 
                     
                   
                    
                   
                     p 
                      
                     
                       ( 
                       
                         M 
                         L 
                       
                       ) 
                     
                   
                 
               
             
           
         
       
     
         [0000]    where p(r|M k ) is the integrated likelihood of model M k  and p(M k ) is the prior probability of model M k . To find the model with the largest posterior probability, evaluate 
         [0000]      p(M k |r) for k=1, 2, . . . , k max          and select the model that has the maximum p(M k |r), that is         
         [0000]    
       
         
           
             
               
                 
                   M 
                   = 
                     
                    
                   
                     arg 
                      
                     
                         
                     
                      
                     
                       
                         max 
                         
                           
                             M 
                             k 
                           
                           , 
                           
                             k 
                             = 
                             1 
                           
                           , 
                           
                               
                           
                            
                           
                             … 
                              
                             
                                 
                             
                              
                             
                               k 
                               max 
                             
                           
                         
                       
                        
                       
                         { 
                         
                           p 
                            
                           
                             ( 
                             
                               
                                 M 
                                 k 
                               
                                
                               r 
                             
                             ) 
                           
                         
                         } 
                       
                     
                   
                 
               
             
             
               
                 
                   = 
                     
                    
                   
                     arg 
                      
                     
                         
                     
                      
                     
                       
                         max 
                         
                           
                             M 
                             k 
                           
                           , 
                           
                             k 
                             = 
                             1 
                           
                           , 
                           
                               
                           
                            
                           
                             … 
                              
                             
                                 
                             
                              
                             
                               k 
                               max 
                             
                           
                         
                       
                        
                       
                         { 
                         
                           
                             
                               p 
                                
                               
                                 ( 
                                 
                                   r 
                                    
                                   
                                     M 
                                     k 
                                   
                                 
                                 ) 
                               
                             
                              
                             
                               p 
                                
                               
                                 ( 
                                 
                                   M 
                                   k 
                                 
                                 ) 
                               
                             
                           
                           
                             
                               ∑ 
                               
                                 L 
                                 = 
                                 1 
                               
                               
                                 k 
                                 max 
                               
                             
                              
                             
                               
                                 p 
                                  
                                 
                                   ( 
                                   
                                     r 
                                      
                                     
                                       M 
                                       L 
                                     
                                   
                                   ) 
                                 
                               
                                
                               
                                 p 
                                  
                                 
                                   ( 
                                   
                                     M 
                                     L 
                                   
                                   ) 
                                 
                               
                             
                           
                         
                         } 
                       
                     
                   
                 
               
             
           
         
       
     
         [0163]    Here, we assume that the models have the same likelihood a priori, so that p(Mk)=1/k max , (k=1 . . . k max ). Therefore, the model selection in 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   
                     M 
                     k 
                   
                    
                   r 
                 
                 ) 
               
             
             = 
             
               
                 
                   p 
                    
                   
                     ( 
                     
                       r 
                        
                       
                         M 
                         k 
                       
                     
                     ) 
                   
                 
                  
                 
                   p 
                    
                   
                     ( 
                     
                       M 
                       k 
                     
                     ) 
                   
                 
               
               
                 
                   ∑ 
                   
                     L 
                     = 
                     1 
                   
                   
                     k 
                     max 
                   
                 
                  
                 
                   
                     p 
                      
                     
                       ( 
                       
                         r 
                          
                         
                           M 
                           L 
                         
                       
                       ) 
                     
                   
                    
                   
                     p 
                      
                     
                       ( 
                       
                         M 
                         L 
                       
                       ) 
                     
                   
                 
               
             
           
         
       
     
         [0000]    will not be affected by p(M k ). This is also the case with 
         [0000]    
       
         
           
             
               ∑ 
               
                 L 
                 = 
                 1 
               
               
                 k 
                 max 
               
             
              
             
               
                 p 
                  
                 
                   ( 
                   
                     r 
                      
                     
                       M 
                       L 
                     
                   
                   ) 
                 
               
                
               
                 p 
                  
                 
                   ( 
                   
                     M 
                     L 
                   
                   ) 
                 
               
             
           
         
       
     
         [0000]    since it is not a function of M k . Consequently, the factors p(M k ) and 
         [0000]    
       
         
           
             
               ∑ 
               
                 L 
                 = 
                 1 
               
               
                 k 
                 max 
               
             
              
             
               
                 p 
                  
                 
                   ( 
                   
                     r 
                      
                     
                       M 
                       L 
                     
                   
                   ) 
                 
               
                
               
                 p 
                  
                 
                   ( 
                   
                     M 
                     L 
                   
                   ) 
                 
               
             
           
         
       
     
         [0000]    may be ignored in computing the model criteria. 
         [0164]    Equation 
         [0000]    
       
         
           
             
               
                 
                   M 
                   = 
                     
                    
                   
                     arg 
                      
                     
                         
                     
                      
                     
                       
                         max 
                         
                           
                             M 
                             k 
                           
                           , 
                           
                             k 
                             = 
                             1 
                           
                           , 
                           
                               
                           
                            
                           
                             … 
                              
                             
                                 
                             
                              
                             
                               k 
                               max 
                             
                           
                         
                       
                        
                       
                         { 
                         
                           p 
                            
                           
                             ( 
                             
                               
                                 M 
                                 k 
                               
                                
                               r 
                             
                             ) 
                           
                         
                         } 
                       
                     
                   
                 
               
             
             
               
                 
                   = 
                     
                    
                   
                     arg 
                      
                     
                         
                     
                      
                     
                       
                         max 
                         
                           
                             M 
                             k 
                           
                           , 
                           
                             k 
                             = 
                             1 
                           
                           , 
                           
                               
                           
                            
                           
                             … 
                              
                             
                                 
                             
                              
                             
                               k 
                               max 
                             
                           
                         
                       
                        
                       
                         { 
                         
                           
                             
                               p 
                                
                               
                                 ( 
                                 
                                   r 
                                    
                                   
                                     M 
                                     k 
                                   
                                 
                                 ) 
                               
                             
                              
                             
                               p 
                                
                               
                                 ( 
                                 
                                   M 
                                   k 
                                 
                                 ) 
                               
                             
                           
                           
                             
                               ∑ 
                               
                                 L 
                                 = 
                                 1 
                               
                               
                                 k 
                                 max 
                               
                             
                              
                             
                               
                                 p 
                                  
                                 
                                   ( 
                                   
                                     r 
                                      
                                     
                                       M 
                                       L 
                                     
                                   
                                   ) 
                                 
                               
                                
                               
                                 p 
                                  
                                 
                                   ( 
                                   
                                     M 
                                     L 
                                   
                                   ) 
                                 
                               
                             
                           
                         
                         } 
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    then becomes 
         [0000]    
       
         
           
             M 
             = 
             
               arg 
                
               
                   
               
                
               
                 
                   max 
                   
                     
                       M 
                       k 
                     
                     , 
                     
                       k 
                       = 
                       1 
                     
                     , 
                     
                         
                     
                      
                     
                       … 
                        
                       
                           
                       
                        
                       
                         k 
                         max 
                       
                     
                   
                 
                  
                 
                   { 
                   
                     p 
                      
                     
                       ( 
                       
                         r 
                          
                         
                           M 
                           k 
                         
                       
                       ) 
                     
                   
                   } 
                 
               
             
           
         
       
     
         [0165]    To calculate the posterior probability of model M k , we need to evaluate the marginal density of data for each model p(r|M k ) which requires multidimensional integration: 
         [0000]        p ( r|M   k )=∫ Φ     k     p ( r|Φ   k   ,M   k ) p (Φ k   |M   k ) dΦ   k    
         [0000]    where Φ k  is the parameter vector for model M k, p(r|φ k ,M k ) is the likelihood and p(Φ k |M k ) is the prior distribution for model M k . 
         [0166]    In practice, calculating the multidimensional integration is very difficult, especially for obtaining a closed form analytical solution. The research in this area has resulted in many approximation methods for achieving this. The Laplace&#39;s approximation method for the integration appears to be a simple one and has become a standard method for calculating the integration of multi-variable Gaussians [53]. This gives: 
         [0000]    
       
         
           
             
               
                 
                   
                     p 
                      
                     
                       ( 
                       
                         r 
                          
                         
                           M 
                           k 
                         
                       
                       ) 
                     
                   
                   = 
                     
                    
                   
                     
                       ∫ 
                       
                         Φ 
                         k 
                       
                     
                      
                     
                       
                         p 
                          
                         
                           ( 
                           
                             
                               r 
                                
                               
                                 Φ 
                                 k 
                               
                             
                             , 
                             
                               M 
                               k 
                             
                           
                           ) 
                         
                       
                        
                       
                         p 
                          
                         
                           ( 
                           
                             
                               Φ 
                               k 
                             
                              
                             
                               M 
                               k 
                             
                           
                           ) 
                         
                       
                        
                       
                           
                       
                        
                       
                          
                         
                           Φ 
                           k 
                         
                       
                     
                   
                 
               
             
             
               
                 
                   ≅ 
                     
                    
                   
                     
                       
                         ( 
                         
                           2 
                            
                           
                               
                           
                            
                           π 
                         
                         ) 
                       
                       
                         
                           d 
                           k 
                         
                         / 
                         2 
                       
                     
                      
                     
                       
                          
                         
                           H 
                            
                           
                             ( 
                             
                               
                                 Φ 
                                 ^ 
                               
                               k 
                             
                             ) 
                           
                         
                          
                       
                       
                         
                           - 
                           1 
                         
                         / 
                         2 
                       
                     
                      
                     
                       p 
                        
                       
                         ( 
                         
                           
                             r 
                              
                             
                               
                                 Φ 
                                 ^ 
                               
                               k 
                             
                           
                           , 
                           
                             M 
                             k 
                           
                         
                         ) 
                       
                     
                      
                     
                       p 
                        
                       
                         ( 
                         
                           
                             
                               Φ 
                               ^ 
                             
                             k 
                           
                            
                           
                             M 
                             k 
                           
                         
                         ) 
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    where {circumflex over (Φ)} k  is the maximum likelihood estimate of Φ k , d k  denotes the number of parameters (control points for B-spline model) in model M K , and H({circumflex over (Φ)}52 is the Hessian matrix of −log p(r|Φ k ,M k ) evaluated at {circumflex over (Φ)} k , 
         [0000]    
       
         
           
             
               H 
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   k 
                 
                 ) 
               
             
             = 
             
               
                 
                   
                     
                       ∂ 
                       2 
                     
                      
                     log 
                   
                    
                   
                       
                   
                    
                   
                     p 
                      
                     
                       ( 
                       
                         
                           r 
                            
                           
                             Φ 
                             k 
                           
                         
                         , 
                         
                           M 
                           k 
                         
                       
                       ) 
                     
                   
                 
                 
                   
                     ∂ 
                     
                       Φ 
                       k 
                     
                   
                    
                   
                     ∂ 
                     
                       Φ 
                       k 
                       T 
                     
                   
                 
               
                
               
                  
                 
                   
                     Φ 
                     k 
                   
                   = 
                   
                     
                       Φ 
                       ^ 
                     
                     k 
                   
                 
               
             
           
         
       
     
         [0167]    This approximation is particularly good when the likelihood function is highly peaked around {circumflex over (Φ)} k . This is usually the case when the number of data samples is large. Neglecting the terms of P({circumflex over (Φ)} k |M k ) and using log in the calculation, the posterior probability of model M k  becomes: 
         [0000]    
       
         
           
             M 
             = 
             
               arg 
                
               
                   
               
                
               
                 
                   max 
                   
                     
                       M 
                       k 
                     
                     , 
                     
                       k 
                       = 
                       1 
                     
                     , 
                     
                         
                     
                      
                     
                       … 
                        
                       
                           
                       
                        
                       
                         k 
                         max 
                       
                     
                   
                 
                  
                 
                   { 
                   
                     
                       log 
                        
                       
                           
                       
                        
                       
                         p 
                          
                         
                           ( 
                           
                             
                               r 
                                
                               
                                 
                                   Φ 
                                   ^ 
                                 
                                 k 
                               
                             
                             , 
                             
                               M 
                               k 
                             
                           
                           ) 
                         
                       
                     
                     - 
                     
                       
                         1 
                         2 
                       
                        
                       log 
                        
                       
                          
                         
                           H 
                            
                           
                             ( 
                             
                               
                                 Φ 
                                 ^ 
                               
                               k 
                             
                             ) 
                           
                         
                          
                       
                     
                   
                   } 
                 
               
             
           
         
       
     
         [0168]    The likelihood function p(r|{circumflex over (Φ)} k ,M k ) of a closed B-spline cross section curve may be factored into x and y components as 
         [0000]        p ( r|{circumflex over (Φ)}   k   ,M   k )= p ( x|{circumflex over (Φ)}   kz   ,M   k )· p ( y|{circumflex over (Φ)}   ky   ,M   k ) 
         [0000]    where {circumflex over (Φ)} kx  and {circumflex over (Φ)} ky  may be calculated by 
         [0000]    
       
         
           
             { 
             
               
                 
                   
                     
                       Φ 
                       k 
                     
                     = 
                     
                       
                         
                           [ 
                           
                             
                               B 
                               T 
                             
                              
                             B 
                           
                           ] 
                         
                         
                           - 
                           1 
                         
                       
                        
                       
                         B 
                         T 
                       
                        
                       x 
                     
                   
                 
               
               
                 
                   
                     
                       Φ 
                       y 
                     
                     = 
                     
                       
                         
                           [ 
                           
                             
                               B 
                               T 
                             
                              
                             B 
                           
                           ] 
                         
                         
                           - 
                           1 
                         
                       
                        
                       
                         B 
                         T 
                       
                        
                       y 
                     
                   
                 
               
             
           
         
       
     
         [0169]    Consider the x component. Assuming that the residual error sequence is zero mean and white Gaussian with a variance σ kx   2 ({circumflex over (φ)} kx ). The likelihood function may be denoted as follows: 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   
                     x 
                      
                     
                       
                         Φ 
                         ^ 
                       
                       k 
                     
                   
                   , 
                   
                     M 
                     k 
                   
                 
                 ) 
               
             
             = 
             
               
                 ( 
                 
                   1 
                   
                     2 
                      
                     
                         
                     
                      
                     π 
                      
                     
                         
                     
                      
                     
                       
                         σ 
                         kx 
                         2 
                       
                        
                       
                         ( 
                         
                           
                             Φ 
                             ^ 
                           
                           kx 
                         
                         ) 
                       
                     
                   
                 
                 ) 
               
               
                 m 
                 / 
                 2 
               
             
           
         
       
       
         
           
             exp 
              
             
               { 
               
                 
                   - 
                   
                     1 
                     
                       2 
                        
                       
                           
                       
                        
                       π 
                        
                       
                           
                       
                        
                       
                         
                           σ 
                           kx 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               Φ 
                               ^ 
                             
                             kx 
                           
                           ) 
                         
                       
                     
                   
                 
                  
                 
                   
                     ∑ 
                     
                       k 
                       = 
                       0 
                     
                     
                       m 
                       - 
                       1 
                     
                   
                    
                   
                     
                       [ 
                       
                         
                           x 
                           k 
                         
                         - 
                         
                           
                             B 
                             k 
                           
                            
                           
                             
                               Φ 
                               ^ 
                             
                             kx 
                           
                         
                       
                       ] 
                     
                     2 
                   
                 
               
               } 
             
           
         
       
       
         
           with 
         
       
       
         
           
             
               
                 σ 
                 kx 
                 2 
               
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   kx 
                 
                 ) 
               
             
             = 
             
               
                 1 
                 m 
               
                
               
                 
                   ∑ 
                   
                     k 
                     = 
                     0 
                   
                   
                     m 
                     - 
                     1 
                   
                 
                  
                 
                   
                     [ 
                     
                       
                         x 
                         k 
                       
                       - 
                       
                         
                           B 
                           k 
                         
                          
                         
                           
                             Φ 
                             ^ 
                           
                           kx 
                         
                       
                     
                     ] 
                   
                   2 
                 
               
             
           
         
       
     
         [0170]    Similarly, the likelihood function of the y component may also be obtained. The corresponding Hessian matrix Ĥ k  of −log p(r|Φ k ,M k ) 
         [0171]    Evaluated at {circumflex over (Φ)} k  is 
         [0000]    
       
         
           
             
               H 
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   k 
                 
                 ) 
               
             
             = 
             
               [ 
               
                 
                   
                     
                       
                         
                           B 
                           T 
                         
                          
                         B 
                       
                       
                         
                           
                             σ 
                             ^ 
                           
                           kx 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               Φ 
                               ^ 
                             
                             kx 
                           
                           ) 
                         
                       
                     
                   
                   
                     0 
                   
                 
                 
                   
                     0 
                   
                   
                     
                       
                         
                           B 
                           T 
                         
                          
                         B 
                       
                       
                         
                           
                             σ 
                             ^ 
                           
                           ky 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               Φ 
                               ^ 
                             
                             ky 
                           
                           ) 
                         
                       
                     
                   
                 
               
               ] 
             
           
         
       
     
         [0172]    Approximating 
         [0000]    
       
         
           
             
               
                 1 
                 2 
               
                
               log 
                
               
                  
                 
                   H 
                    
                   
                     ( 
                     
                       
                         Φ 
                         ^ 
                       
                       k 
                     
                     ) 
                   
                 
                  
               
             
              
             
               
 
             
           
         
       
     
         [0000]    by the asymptotic expected value of Hessian insert 
         [0000]    
       
         
           
             
               1 
               2 
             
              
             
               ( 
               
                 
                   d 
                   kx 
                 
                 + 
                 
                   d 
                   ky 
                 
               
               ) 
             
              
             
               log 
                
               
                 ( 
                 m 
                 ) 
               
             
           
         
       
     
         [0000]    the Bayesian information criterion (BEC) for selecting the structure of a B-spline curve is            
         [0000]    
       
         
           
             M 
             = 
             
               arg 
                
               
                   
               
                
               
                 
                   max 
                   
                     
                       M 
                       k 
                     
                     , 
                     
                       k 
                       = 
                       1 
                     
                     , 
                     
                       …k 
                       max 
                     
                   
                 
                  
                 
                   { 
                   
                     
                       
                         
                           
                             
                               - 
                               
                                 m 
                                 2 
                               
                             
                              
                             log 
                              
                             
                               
                                 
                                   σ 
                                   ^ 
                                 
                                 kx 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   
                                     Φ 
                                     ^ 
                                   
                                   kx 
                                 
                                 ) 
                               
                             
                           
                           - 
                           
                             
                               m 
                               2 
                             
                              
                             log 
                              
                             
                               
                                 
                                   σ 
                                   ^ 
                                 
                                 ky 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   
                                     Φ 
                                     ^ 
                                   
                                   ky 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             - 
                             
                               1 
                               2 
                             
                           
                            
                           
                             ( 
                             
                               
                                 d 
                                 kx 
                               
                               + 
                               
                                 d 
                                 ky 
                               
                             
                             ) 
                           
                            
                           
                             log 
                              
                             
                               ( 
                               m 
                               ) 
                             
                           
                         
                       
                     
                   
                   } 
                 
               
             
           
         
       
     
         [0000]    where d kx  and d ky  are the number of control points in x and y directions respectively, and m is the number of data points. 
         [0173]    In the conventional BIC criterion as shown in the above equation, the first two terms measure the estimation accuracy of the B-spline model. In general, the variance {circumflex over (σ)} k   2  estimated from 
         [0000]    
       
         
           
             
               
                 
                   σ 
                   ^ 
                 
                 kx 
                 2 
               
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   kx 
                 
                 ) 
               
             
             = 
             
               
                 1 
                 m 
               
                
               
                 
                   ∑ 
                   
                     k 
                     = 
                     0 
                   
                   
                     m 
                     - 
                     1 
                   
                 
                  
                 
                   
                     [ 
                     
                       
                         x 
                         k 
                       
                       - 
                       
                         
                           B 
                           k 
                         
                          
                         
                           
                             Φ 
                             ^ 
                           
                           kx 
                         
                       
                     
                     ] 
                   
                   2 
                 
               
             
           
         
       
     
         [0000]    tends to decrease with the increase in the number of control points. The smaller the variance value in {circumflex over (σ)} k   2 , the bigger the value of the first two terms (as the variance is much smaller than one) and therefore the higher the order (i.e. the more control points) of the model resulting from 
         [0000]    
       
         
           
             M 
             = 
             
               arg 
                
               
                 
                   max 
                   
                     
                       M 
                       k 
                     
                     , 
                     
                       k 
                       = 
                       1 
                     
                     , 
                     
                         
                     
                      
                     
                       … 
                        
                       
                           
                       
                        
                       
                         k 
                         max 
                       
                     
                   
                 
                  
                 
                   { 
                   
                     
                       
                         
                           
                             
                               - 
                               
                                 m 
                                 2 
                               
                             
                              
                             log 
                              
                             
                               
                                 
                                   σ 
                                   ^ 
                                 
                                 kx 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   
                                     Φ 
                                     ^ 
                                   
                                   kx 
                                 
                                 ) 
                               
                             
                           
                           - 
                           
                             
                               m 
                               2 
                             
                              
                             log 
                              
                             
                               
                                 
                                   σ 
                                   ^ 
                                 
                                 ky 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   
                                     Φ 
                                     ^ 
                                   
                                   ky 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             - 
                             
                               1 
                               2 
                             
                           
                            
                           
                             ( 
                             
                               
                                 d 
                                 kx 
                               
                               + 
                               
                                 d 
                                 ky 
                               
                             
                             ) 
                           
                            
                           
                             log 
                              
                             
                               ( 
                               m 
                               ) 
                             
                           
                         
                       
                     
                   
                   } 
                 
               
             
           
         
       
     
         [0174]    However, if too many control points are used, the b-spline model will over-fit noisy data points. An over-fitted B-spline model will have poor generalization capability. Model selection thus should achieve a proper tradeoff between the approximation accuracy and the number of control points of the B-spline model. With a conventional BIC criterion, the same data set is used for estimating both the control points of the B-spline model and the variances. Thus the first two terms in the above equation cannot detect the occurrence of over fitting in the B-spline model selected. 
         [0175]    In theory, the third term in the above equation could penalize over-fitting as it appears directly proportional to the number of control points used. In practice, however, it may be noted that the effect of this penalty term is insignificant compared with that of the first two terms. As a result, the conventional BIC criterion is rather insensitive to the occurrence of over-fitting and tends to select more control points in the B-spline model to approximate the data point, which normally results in a model with poor generalization capability. 
         [0176]    The reason for the occurrence of over-fitting in conventional BIC criterion lies in the way the variances σ kx   2  and σ ky   2  are obtained. A reliable estimate of σ kx   2  and σ ky   2  should be based on re-sampling of the data, in other words, the generalization capability of a B-spline model should be validated using another set of data points rather than the same data used in obtaining the model. 
         [0177]    To achieve this, the available data may be divided into two sets: a training sample and a prediction sample. The training sample may be used only for model estimation, whereas the prediction sample may be used only for estimating data noise σ kx   2  and σ ky   2 . 
         [0178]    For a candidate B-spline model M k  with d kx  and d ky  control points in the x and y directions, the BIC may be evaluated via the following steps: 
         [0000]    1) Estimate the model parameter {circumflex over (Φ)} k  using the training sample by 
         [0000]    
       
         
           
               
             
               { 
               
                 
                   
                     
                       
                         Φ 
                         x 
                       
                       = 
                       
                         
                           
                             [ 
                             
                               
                                 B 
                                 T 
                               
                                
                               B 
                             
                             ] 
                           
                           
                             - 
                             1 
                           
                         
                          
                         
                           B 
                           T 
                         
                          
                         x 
                       
                     
                   
                 
                 
                   
                     
                       
                         Φ 
                         y 
                       
                       = 
                       
                         
                           
                             [ 
                             
                               
                                 B 
                                 T 
                               
                                
                               B 
                             
                             ] 
                           
                           
                             - 
                             1 
                           
                         
                          
                         
                           B 
                           T 
                         
                          
                         y 
                       
                     
                   
                 
               
             
           
         
       
     
         [0000]    2) Estimate the data noise σ k   2  using the prediction sample by equation 
         [0000]    
       
         
           
             
               
                 
                   σ 
                   ^ 
                 
                 kx 
                 2 
               
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   kx 
                 
                 ) 
               
             
             = 
             
               
                 1 
                 m 
               
                
               
                 
                   ∑ 
                   
                     k 
                     = 
                     0 
                   
                   
                     m 
                     - 
                     1 
                   
                 
                  
                 
                   
                     [ 
                     
                       
                         x 
                         k 
                       
                       - 
                       
                         
                           B 
                           k 
                         
                          
                         
                           
                             Φ 
                             ^ 
                           
                           kx 
                         
                       
                     
                     ] 
                   
                   2 
                 
               
             
           
         
       
     
         [0179]    If the model {circumflex over (Φ)} k  fitted to the training data is valid, then the estimated variance {circumflex over (σ)} k   2  from the prediction sample should also be a valid estimate of the data noise. It may be seen that the data noise σ k   2  estimated from the prediction sample may be more sensitive to the quality of the model than one directly estimated from a training sample, as the variance σ k   2  estimated from the prediction sample may also have the capability of detecting the occurrence of over-fitting. 
         [0180]    Thus, in one or more preferred embodiments, a Bayesian based approach may be adopted as the model selection method. Based on the posterior model probabilities, the Bayesian based approach estimates a probability distribution over an ensemble of models. The prediction is accomplished by averaging over the ensemble of models. Accordingly, the uncertainty of the models is taken into account, and complex models with more degrees of freedom are penalized. Given a set of models {M k ,k=1, 2, . . . , k max } and data r, the Bayesian approach selects the model with the largest posterior probability. To find the model with the largest posterior probability, we evaluate p(M k |r) for k=1, 2, . . . , k max  and select the model that has the maximum p(M k |r), that is 
         [0000]    
       
         
           
             
               
                 
                   M 
                   = 
                     
                    
                   
                     arg 
                      
                     
                       
                         max 
                         
                           
                             M 
                             k 
                           
                           , 
                           
                             k 
                             = 
                             1 
                           
                           , 
                           
                               
                           
                            
                           
                             … 
                              
                             
                                 
                             
                              
                             
                               k 
                               max 
                             
                           
                         
                       
                        
                       
                         { 
                         
                           p 
                            
                           
                             ( 
                             
                               
                                 M 
                                 k 
                               
                                
                               r 
                             
                             ) 
                           
                         
                         } 
                       
                     
                   
                 
               
             
             
               
                 
                   = 
                     
                    
                   
                     arg 
                      
                     
                       
                         max 
                         
                           
                             M 
                             k 
                           
                           , 
                           
                             k 
                             = 
                             1 
                           
                           , 
                           
                               
                           
                            
                           
                             … 
                              
                             
                                 
                             
                              
                             
                               k 
                               max 
                             
                           
                         
                       
                        
                       
                         { 
                         
                           
                             
                               p 
                                
                               
                                 ( 
                                 
                                   r 
                                    
                                   
                                     M 
                                     k 
                                   
                                 
                                 ) 
                               
                             
                              
                             
                               p 
                                
                               
                                 ( 
                                 
                                   M 
                                   k 
                                 
                                 ) 
                               
                             
                           
                           
                             
                               ∑ 
                               
                                 L 
                                 = 
                                 1 
                               
                               
                                 k 
                                 max 
                               
                             
                              
                             
                               
                                 p 
                                  
                                 
                                   ( 
                                   
                                     r 
                                      
                                     
                                       M 
                                       L 
                                     
                                   
                                   ) 
                                 
                               
                                
                               
                                 p 
                                  
                                 
                                   ( 
                                   
                                     M 
                                     L 
                                   
                                   ) 
                                 
                               
                             
                           
                         
                         } 
                       
                     
                   
                 
               
             
           
         
       
     
         [0181]    Assuming that the models have the same likelihood a priori, so that p(M k )=1/k max , (k=1, . . . , k max ), the model selection will not be affected by p(M k ). This is also the case with 
         [0000]    
       
         
           
             
               ∑ 
               
                 L 
                 = 
                 1 
               
               
                 k 
                 max 
               
             
              
             
               
                 p 
                  
                 
                   ( 
                   
                     r 
                      
                     
                       M 
                       L 
                     
                   
                   ) 
                 
               
                
               
                 p 
                  
                 
                   ( 
                   
                     M 
                     L 
                   
                   ) 
                 
               
             
           
         
       
     
         [0000]    since it is not a function of M k . Consequently, we have 
         [0000]    
       
         
           
             M 
             = 
             
               arg 
                
               
                 
                   max 
                   
                     
                       M 
                       k 
                     
                     , 
                     
                       k 
                       = 
                       1 
                     
                     , 
                     
                         
                     
                      
                     
                       … 
                        
                       
                           
                       
                        
                       
                         k 
                         max 
                       
                     
                   
                 
                  
                 
                   { 
                   
                     p 
                      
                     
                       ( 
                       
                         r 
                          
                         
                           M 
                           k 
                         
                       
                       ) 
                     
                   
                   } 
                 
               
             
           
         
       
     
         [0182]    Using Laplace&#39;s approximation for calculating the integration of multi-variable Gaussians, we can obtain the Bayesian information criterion (BIC) for selecting the structure of B-spline curve 
         [0000]    
       
         
           
             M 
             = 
             
               arg 
                
               
                 
                   max 
                   
                     
                       M 
                       k 
                     
                     , 
                     
                       k 
                       = 
                       1 
                     
                     , 
                     
                         
                     
                      
                     
                       … 
                        
                       
                           
                       
                        
                       
                         k 
                         max 
                       
                     
                   
                 
                  
                 
                   { 
                   
                     
                       
                         
                           
                             
                               - 
                               
                                 m 
                                 2 
                               
                             
                              
                             log 
                              
                             
                               
                                 
                                   σ 
                                   ^ 
                                 
                                 kx 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   
                                     Φ 
                                     ^ 
                                   
                                   kx 
                                 
                                 ) 
                               
                             
                           
                           - 
                           
                             
                               m 
                               2 
                             
                              
                             log 
                              
                             
                               
                                 
                                   σ 
                                   ^ 
                                 
                                 ky 
                                 2 
                               
                                
                               
                                 ( 
                                 
                                   
                                     Φ 
                                     ^ 
                                   
                                   ky 
                                 
                                 ) 
                               
                             
                           
                         
                       
                     
                     
                       
                         
                           
                             - 
                             
                               1 
                               2 
                             
                           
                            
                           
                             ( 
                             
                               
                                 d 
                                 ky 
                               
                               + 
                               
                                 d 
                                 ky 
                               
                             
                             ) 
                           
                            
                           
                             log 
                              
                             
                               ( 
                               m 
                               ) 
                             
                           
                         
                       
                     
                   
                   } 
                 
               
             
           
         
       
     
         [0000]    where d k , and  d   k , are the number of control points in x and y directions respectively, m is the number of data points. 
         [0183]    Here we divide the available data into two sets: a training sample and a prediction sample. The training sample is used only for model estimation, whereas the prediction sample is used only for estimating data noise. For a candidate B-spline model with its control points, the BIC is evaluated via the following steps:
       1) Estimate the model parameter using the training sample;   2) Estimate the data noise using the prediction sample.       
 
         [0186]    If the model fitted to the training data is valid, then the estimated variances from the prediction sample should also be a valid estimate of the data noise. If the variances found from the prediction sample are unexpectedly large, we have reasons to believe that the candidate model fits the data badly. It is seen that the data noise estimated from the prediction sample will thus be more sensitive to the quality of the model than the one directly estimated from training sample, as the variance estimated from the prediction sample also has the capability of detecting the occurrence of over-fitting. 
         [0187]    We further define an entropy function which measures the information about the model, given the available data points. The entropy can be used as the measurement of the uncertainty of the model parameter. 
       Uncertainty Analysis 
       [0188]    In this section, we will analyze the uncertainty of the B-spline model for guiding data selection so that new data points will maximize information on the B-spline model&#39;s parameter Φ. Here Φ k  is replaced by Φ to simplify the descriptions and to show that we may deal with the selected “best” B-spline model with d kx  and d ky  control points. 
         [0189]    To obtain the approximate B-spline model, we will predict the distribution of the information gain about the model&#39;s parameter Φ along each cross section curve. A measure of the information gain will be obtained whose expected value will be maximal when the new measurement data are acquired. The measurement is based on Shannon&#39;s entropy whose properties make it a sensible information measure here. We will describe the information entropy of the B-spline model and how to use it to achieve maximal information gain about the parameters of the B-spline model Φ. 
       Information Entropy of a B-spline Model 
       [0190]    In a first preferred embodiment, given Φ and the data points r(r i ) i=1   m  are assumed to be statistically independent, with Gaussian noise of zero mean and variance σ 2  the joint probability of r=(r i ) i=1   m  may be denoted by 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   r 
                    
                   Φ 
                 
                 ) 
               
             
             = 
             
               
                 1 
                 
                   
                     ( 
                     
                       2 
                        
                       
                         πσ 
                         2 
                       
                     
                     ) 
                   
                   
                     m 
                     / 
                     2 
                   
                 
               
               · 
               
                 exp 
                  
                 
                   [ 
                   
                     
                       - 
                       
                         1 
                         
                           2 
                            
                           
                             σ 
                             2 
                           
                         
                       
                     
                      
                     
                       
                         ( 
                         
                           r 
                           - 
                           
                             B 
                             · 
                             Φ 
                           
                         
                         ) 
                       
                       T 
                     
                      
                     
                       ( 
                       
                         r 
                         - 
                         
                           B 
                           · 
                           Φ 
                         
                       
                       ) 
                     
                   
                   ] 
                 
               
             
           
         
       
     
         [0191]    The above equation has an asymptotic approximation representation defined by [27] 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   r 
                    
                   Φ 
                 
                 ) 
               
             
             ≈ 
             
               
                 p 
                  
                 
                   ( 
                   
                     r 
                      
                     
                       Φ 
                       ^ 
                     
                   
                   ) 
                 
               
                
               
                 exp 
                 [ 
                 
                   
                     - 
                     
                       1 
                       2 
                     
                   
                    
                   
                     
                       ( 
                       
                         Φ 
                         - 
                         
                           Φ 
                           ^ 
                         
                       
                       ) 
                     
                     T 
                   
                    
                   
                     
                       H 
                       m 
                     
                     ( 
                     
                       Φ 
                       - 
                       
                         Φ 
                         ^ 
                       
                     
                     ) 
                   
                 
                 ] 
               
             
           
         
       
     
         [0000]    where {circumflex over (Φ)} is the maximum likelihood estimation of Φ given the data points and H m  p53] is the Hessian matrix of −log p(r|Φ) evaluated at {circumflex over (Φ)} given data points r=(r i ) i=1   m . The posteriori distribution p(Φ|r) of the given data is approximately proportional to 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   Φ 
                    
                   r 
                 
                 ) 
               
             
             ≈ 
             
               
                 
                   p 
                    
                   
                     ( 
                     
                       r 
                        
                       
                         Φ 
                         ^ 
                       
                     
                     ) 
                   
                 
                 · 
                 
                   exp 
                    
                   
                     [ 
                     
                       
                         - 
                         
                           1 
                           2 
                         
                       
                        
                       
                         
                           ( 
                           
                             Φ 
                             - 
                             
                               Φ 
                               ^ 
                             
                           
                           ) 
                         
                         T 
                       
                        
                       
                         
                           H 
                           m 
                         
                          
                         
                           ( 
                           
                             Φ 
                             - 
                             
                               Φ 
                               ^ 
                             
                           
                           ) 
                         
                       
                     
                     ] 
                   
                 
               
                
               
                 p 
                  
                 
                   ( 
                   Φ 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where the p(Φ) is the priori probability of the B-spline model parameters. 
         [0192]    If the priori has a Gaussian distribution with mean {circumflex over (Φ)} and covariance H m   −1 , we have 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   Φ 
                    
                   r 
                 
                 ) 
               
             
             ∝ 
             
               exp 
               [ 
               
                 
                   - 
                   
                     1 
                     2 
                   
                 
                  
                 
                   
                     ( 
                     
                       Φ 
                       - 
                       
                         Φ 
                         ^ 
                       
                     
                     ) 
                   
                   T 
                 
                  
                 
                   
                     H 
                     m 
                   
                   ( 
                   
                     Φ 
                     - 
                     
                       Φ 
                       ^ 
                     
                   
                   ) 
                 
               
               ] 
             
           
         
       
     
         [0193]    From Shannon&#39;s information entropy, the conditional entropy of p(Φ|r) is defined by 
         [0000]        E   m (Φ)=· p (Φ| r )·log  p (Φ| r ) dΦ   
         [0000]    If p(Φ|r) obeys Gaussian distribution, the corresponding entropy is [28] 
         [0000]    
       
         
           
             
               E 
               m 
             
             = 
             
               Δ 
               + 
               
                 
                   1 
                   2 
                 
                  
                 
                   log 
                    
                   
                     ( 
                     
                       det 
                        
                       
                           
                       
                        
                       
                         H 
                         m 
                         
                           - 
                           1 
                         
                       
                     
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    where Δ is a constant. 
         [0194]    The entropy measures the information about the B-spline model parameters, given data points (r 1 , . . . , r m ,). The more information about Φ the smaller the entropy will be. In this work, we use the entropy as the measurement of the uncertainty of the model parameter Φ. Thus, to minimize E m , we will make det H m   −1  as small as possible. 
         [0195]    In a further preferred embodiment, for parameter Φ, the joint probability of r=(r i ) i=1   m  has an asymptotic approximation representation 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   r 
                    
                   Φ 
                 
                 ) 
               
             
             ≈ 
             
               
                 p 
                 ( 
                 
                   r 
                    
                   
                     Φ 
                     ^ 
                   
                 
                 ) 
               
                
               
                 exp 
                 [ 
                 
                   
                     - 
                     
                       1 
                       2 
                     
                   
                    
                   
                     
                       ( 
                       
                         Φ 
                         - 
                         
                           Φ 
                           ^ 
                         
                       
                       ) 
                     
                     T 
                   
                    
                   
                     
                       H 
                       m 
                     
                     ( 
                     
                       Φ 
                       - 
                       
                         Φ 
                         ^ 
                       
                     
                     ) 
                   
                 
                 ] 
               
             
           
         
       
     
         [0000]    where H m  is the Hessian matrix given points r=(r i ) i=1   m . 
         [0196]    Therefore, the posteriori distribution [seep1511] of given data may be approximately given as 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   Φ 
                    
                   r 
                 
                 ) 
               
             
             ≈ 
             
               
                 
                   p 
                   ( 
                   
                     r 
                      
                     
                       Φ 
                       ^ 
                     
                   
                   ) 
                 
                 · 
                 
                   exp 
                   [ 
                   
                     
                       - 
                       
                         1 
                         2 
                       
                     
                      
                     
                       
                         ( 
                         
                           Φ 
                           - 
                           
                             Φ 
                             ^ 
                           
                         
                         ) 
                       
                       T 
                     
                      
                     
                       
                         H 
                         m 
                       
                       ( 
                       
                         Φ 
                         - 
                         
                           Φ 
                           ^ 
                         
                       
                       ) 
                     
                   
                   ] 
                 
               
                
               
                 p 
                  
                 
                   ( 
                   Φ 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where the p(Φ) is the priori probability of B-spline model parameters. If we assume that the priori probability over the B-spline model parameters is initialized as uniform distribution in the interval which they lie in, we have 
         [0000]    
       
         
           
             
               p 
                
               
                 ( 
                 
                   Φ 
                    
                   r 
                 
                 ) 
               
             
             ∝ 
             
               exp 
                
               
                 [ 
                 
                   
                     - 
                     
                       1 
                       2 
                     
                   
                    
                   
                     
                       ( 
                       
                         Φ 
                         - 
                         
                           Φ 
                           ^ 
                         
                       
                       ) 
                     
                     T 
                   
                    
                   
                     
                       H 
                       m 
                     
                      
                     
                       ( 
                       
                         Φ 
                         - 
                         
                           Φ 
                           ^ 
                         
                       
                       ) 
                     
                   
                 
                 ] 
               
             
           
         
       
     
         [0197]    It is easy to confirm that if p(Φ|r) obeys Gaussian distribution, the correspond rig entropy is [12] 
         [0000]    
       
         
           
             
               E 
               m 
             
             = 
             
               Δ 
               + 
               
                 
                   1 
                   2 
                 
                  
                 
                   log 
                    
                   
                     ( 
                     
                       det 
                        
                       
                           
                       
                        
                       
                         H 
                         m 
                         
                           - 
                           1 
                         
                       
                     
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    where Δ m  is the constant. 
         [0198]    The entropy measures the information about B-spline model parameters, given data points, (r 1 , . . . r m ). 
         [0199]    Thus, in a preferred embodiment, we select the entropy as the measurement of uncertainty of the model parameter Φ. 
       Information Gain 
       [0200]    In order to predict the distribution of the information gain, a new data point r m+1  may be assumed to have been collected along a contour. The potential information gain is determined by incorporating the new data point r m+1 . If we move the new point r m+1  along the contour, the distribution of the potential information gain along the whole contour may be obtained. 
         [0201]    To derive the relationship between the information gain and the new data point {seep54}, firstly we may assume that a new data point {seep54} has been collected. Then, let P(Φ|r 1 , . . . , r m , r m+1 ) the probability distribution of model parameter Φ after a new point r m+1  is added. Its corresponding entropy is 
         [0000]    
       
         
           
             
               E 
               
                 m 
                 + 
                 1 
               
             
             = 
             
               Δ 
               + 
               
                 
                   1 
                   2 
                 
                  
                 
                   
                     log 
                      
                     
                       ( 
                       
                         det 
                          
                         
                             
                         
                          
                         
                           
                             H 
                             ^ 
                           
                           
                             m 
                             + 
                             1 
                           
                           
                             - 
                             1 
                           
                         
                       
                       ) 
                     
                   
                   . 
                 
               
             
           
         
       
     
         [0000]    The information gain then is 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               E 
             
             = 
             
               
                 
                   E 
                   m 
                 
                 - 
                 
                   E 
                   
                     m 
                     + 
                     1 
                   
                 
               
               = 
               
                 
                   1 
                   2 
                 
                  
                 log 
                  
                 
                   
                     det 
                      
                     
                         
                     
                      
                     
                       H 
                       m 
                       
                         - 
                         1 
                       
                     
                   
                   
                     det 
                      
                     
                         
                     
                      
                     
                       H 
                       
                         m 
                         + 
                         1 
                       
                       
                         - 
                         1 
                       
                     
                   
                 
               
             
           
         
       
     
       From 
       [0202]    
       
         
           
             
               H 
                
               
                 ( 
                 
                   
                     Φ 
                     ^ 
                   
                   k 
                 
                 ) 
               
             
             = 
             
               [ 
               
                 
                   
                     
                       
                         
                           B 
                           T 
                         
                          
                         B 
                       
                       
                         
                           
                             σ 
                             ^ 
                           
                           kx 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               Φ 
                               ^ 
                             
                             kx 
                           
                           ) 
                         
                       
                     
                   
                   
                     0 
                   
                 
                 
                   
                     0 
                   
                   
                     
                       
                         
                           B 
                           T 
                         
                          
                         B 
                       
                       
                         
                           
                             σ 
                             ^ 
                           
                           kx 
                           2 
                         
                          
                         
                           ( 
                           
                             
                               Φ 
                               ^ 
                             
                             ky 
                           
                           ) 
                         
                       
                     
                   
                 
               
               ] 
             
           
         
       
     
         [0000]    the new data point r m+1  will incrementally update the Hessian matrix as follows: 
         [0000]    
       
         
           
             
               H 
               
                 m 
                 + 
                 1 
               
             
             ≈ 
             
               
                 H 
                 m 
               
               + 
               
                 [ 
                 
                   
                     
                       
                         
                           
                             1 
                             
                               σ 
                               x 
                               2 
                             
                           
                           · 
                           
                             
                               B 
                               _ 
                             
                             
                               m 
                               + 
                               1 
                             
                             T 
                           
                         
                          
                         
                           
                             B 
                             _ 
                           
                           
                             m 
                             + 
                             1 
                           
                         
                       
                     
                     
                       0 
                     
                   
                   
                     
                       0 
                     
                     
                       
                         
                           
                             1 
                             
                               σ 
                               y 
                               2 
                             
                           
                           · 
                           
                             
                               B 
                               _ 
                             
                             
                               m 
                               + 
                               1 
                             
                             T 
                           
                         
                          
                         
                           
                             B 
                             _ 
                           
                           
                             m 
                             + 
                             1 
                           
                         
                       
                     
                   
                 
                 ] 
               
             
           
         
       
     
         [0000]    where {circumflex over (σ)} m+1   2 ≈{circumflex over (σ)} m   2 ·  B   m+1  is defined by 
         [0000]          B     m+1   =[  B     0,4   m+1   +  B     n+1,4   m+1   ,  B     1,4   m+1   +  B     n+2,4   m+1   , . . . ,  B     n,4   m+1 ]. 
         [0000]    The determinant of H m+1   
         [0000]    
       
         
           
             
               det 
                
               
                   
               
                
               
                 H 
                 
                   m 
                   + 
                   1 
                 
               
             
             ≈ 
             
               
                 
                   det 
                    
                   
                     [ 
                     
                       I 
                       + 
                       
                         
                           [ 
                           
                             
                               
                                 
                                   
                                     
                                       1 
                                       
                                         
                                           σ 
                                           ^ 
                                         
                                         x 
                                         2 
                                       
                                     
                                     · 
                                     
                                       
                                         B 
                                         _ 
                                       
                                       
                                         m 
                                         + 
                                         1 
                                       
                                       T 
                                     
                                   
                                    
                                   
                                     
                                       B 
                                       _ 
                                     
                                     
                                       m 
                                       + 
                                       1 
                                     
                                   
                                 
                               
                               
                                 0 
                               
                             
                             
                               
                                 0 
                               
                               
                                 
                                   
                                     
                                       1 
                                       
                                         
                                           σ 
                                           ^ 
                                         
                                         y 
                                         2 
                                       
                                     
                                     · 
                                     
                                       
                                         B 
                                         _ 
                                       
                                       
                                         m 
                                         + 
                                         1 
                                       
                                       T 
                                     
                                   
                                    
                                   
                                     
                                       B 
                                       _ 
                                     
                                     
                                       m 
                                       + 
                                       1 
                                     
                                   
                                 
                               
                             
                           
                           ] 
                         
                          
                         
                           H 
                           m 
                           
                             - 
                             1 
                           
                         
                       
                     
                     ] 
                   
                 
                 · 
                 det 
               
                
               
                   
               
                
               
                 H 
                 m 
               
             
           
         
       
     
         [0000]    can be simplified to 
         [0000]      det  H   m+1 ≈(1+   B     m+1   ·[B   T   B]   −1   ·  B     m+1   T ) 2 ·det H m    
         [0203]    Since det H −1 =1/det H 
         [0000]    
       
         
           
             
               Δ 
                
               
                   
               
                
               E 
             
             = 
             
               
                 
                   E 
                   m 
                 
                 - 
                 
                   E 
                   
                     m 
                     + 
                     1 
                   
                 
               
               = 
               
                 
                   1 
                   2 
                 
                  
                 log 
                  
                 
                   
                     det 
                      
                     
                         
                     
                      
                     
                       H 
                       m 
                       
                         - 
                         1 
                       
                     
                   
                   
                     det 
                      
                     
                         
                     
                      
                     
                       H 
                       
                         m 
                         + 
                         1 
                       
                       
                         - 
                         1 
                       
                     
                   
                 
               
             
           
         
       
       
         
           
             can be simplified to 
           
         
       
     
         [0000]      Δ E =log(1 +  B     m+1   ·[B   T   B]   −1   ·  B     m+1   T ) 
         [0205]    Assuming that the new additional data point rm+1 travels along the contour, the resulting potential information gain of the B-spline model will change according to ΔE above. In order to reduce the uncertainty of the model, it may be desirable to have the new data point at such location that the potential information gain attainable is largest. Therefore, after reconstructing the section curve by fitting partial data acquired from previous viewpoints, the Next Best Viewpoint should be selected as the one that senses those new data points which give the largest possible potential information gain for the B-spline model. 
         [0206]    Thus, in order to predict the distribution of the information gain, we assume a new data point collected along a contour. The potential information gain is determined by incorporating the new data point. If we move the new point along the contour, the distribution of the potential information gain along the whole contour can be obtained. Now, we will derive the relationship between the information gain and the new data point. 
         [0207]    As mentioned above, the new data points will incrementally update the Hessian matrix. In order to reduce the uncertainty of the model, we would like to have the new data point at such location that the potential information gain attainable is largest. Therefore, after reconstructing the section curve by fitting partial data acquired from previous viewpoints, the Next Best Viewpoint should be selected as the one that sense those new data points which give the largest possible potential information gain for the model. 
       Next Best View 
       [0208]    The task in the view planning here is to obtain the visibility regions in the viewing space that contain the candidate viewpoints where the missing information about the 3D object can be obtained. The NBV should be the viewpoint that can give maximum information about the object. We need to map the predicted information gain to the view space for viewpoint planning. For a viewpoint, we say that a data point on the object is visible if the angle between its normal and the view direction is smaller than a breakdown angle of the sensor. The view space for each data point is the set of all possible viewpoints that can see it. The view space can be calculated via the following procedure:
       1) Calculating the normal vector of a point on the object, using a least square error fitting of a local surface patch in its neighbourhood.   2) Extracting viewpoints from which the point is visible. These viewpoints are denoted as view space.       
 
         [0211]    After the view space is extracted, we construct a measurement matrix. The components of the measurement matrix is given as 
         [0000]    
       
         
           
             
               
                 
                   
                     m 
                     
                       k 
                       , 
                       j 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             〈 
                             
                               
                                 n 
                                 k 
                               
                               · 
                               
                                 v 
                                 j 
                               
                             
                             〉 
                           
                         
                         
                           
                             if 
                              
                             
                                 
                             
                              
                             
                               r 
                               k 
                             
                              
                             
                                 
                             
                              
                             is 
                              
                             
                                 
                             
                              
                             visible 
                              
                             
                                 
                             
                              
                             to 
                              
                             
                                 
                             
                              
                             
                               v 
                               j 
                             
                           
                         
                       
                       
                         
                           0 
                         
                         
                           otherwise 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   30 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where v j  is the direction vector of viewpoint v j . 
         [0212]    Then, for each view, we define a global measure of the information gain as the criterion to be summed over all visible surface points seen under this view of the sensor. This measure is defined by 
         [0000]    
       
         
           
             
               
                 I 
                 j 
               
                
               
                 ( 
                 
                   p 
                   j 
                 
                 ) 
               
             
             = 
             
               
                 ∑ 
                 
                   k 
                   ∈ 
                   
                     R 
                     j 
                   
                 
               
                
               
                 
                   
                     m 
                     
                       k 
                       , 
                       j 
                     
                   
                   · 
                   Δ 
                 
                  
                 
                     
                 
                  
                 
                   E 
                   k 
                 
               
             
           
         
       
     
         [0000]    where p j  contains the location parameters at a viewpoint, ΔE k  is the information gain at surface point r k , which is weighted by m k,j . 
         [0213]    Therefore, the Next Best View p* is one that maximizes the information gain function of l(p) 
         [0000]      ( p *)=max  l   j ( p   j ) 
         [0214]    At the new viewpoint, another set of data is acquired, registered, and integrated with the previous partial model. This process is repeated until all data are acquired to build a complete model of the 3D surface. The terminating condition is defined via the information gain. When there are missing data, the information gain will have outstanding peaks where data are missing. When all data are obtained, there will be no obvious peaks. Rather, the information gain will appear noise like indicating that the terminating condition is satisfied. 
         [0215]    In planning the viewpoint, we can also specify the vision system&#39;s configuration parameters. The configuration parameters can include optical settings of the camera and projector as well as the relative position and orientation between the camera and projector. The planning needs to satisfy multiple constraints including visibility, focus, field of view, viewing angle, resolution, overlap, occlusion, and some operational constraints such as kinematic reachability of the sensor pose and robot-environment collision. A complete cycle in the incremental modeling process is illustrated in  FIG. 9 . As shown in  FIG. 9 , in a first stage static calibration and first view acquisition is carried out. In a second stage, 3D reconstruction via a single view is performed. Next, 3D model registration and fusion is performed followed by the determination of a next viewpoint decision and terminating condition. Sensor reconfiguration follows this step and recalibration is performed. The process may then be repeated from the 3D reconstruction stage. 
         [0216]      FIG. 10  shows a flow diagram of information entropy based viewpoint planning for digitization of a 3D object according to a preferred embodiment. In a first stage, 3D data is acquired from another viewpoint. Next, multiple view range images are registered. In the next stage, a B-spline model is selected and the model parameters of each cross section curve are estimated. Following this, the uncertainty of each cross section B-spline curve is analyzed and the information gain of the object is predicted. Next, information gain about the object is mapped into a view space. Candidate viewpoints are then evaluated and the NBV selected. The process may then repeated. 
         [0217]    In a preferred embodiment, the candidate viewpoints may be represented in a tessellated spherical view space by subdividing recursively each triangular facet of an icosahedron. If we assume that view space is centered at the object, arid its radius is equal to a priori specified distance from the sensor to the object, each viewpoint may be represented by pan-tilt angles φ ([−180°, 180°]) and θ ([−90°, 90°]), denoted as v(θ,φ). 
         [0218]    For a viewpoint v(θ,φ) on the object, it may be considered to be visible if the angle between its normal and the view direction is smaller than a breakdown angle α for the ranger sensor being used. The view space V k  for each point r k  (k=1, 2, . . . ) to be sensed by the range sensor is the set of all possible directions that can access to r k . The view space V k  may be calculated via the following procedure: 
         [0000]    1) Calculating the normal vector n k  of one point r k  (k−=,2, . . . ) using on the object, a least square error fitting of a 3×3 local surface patch in its neighborhood.
 
2) Extracting viewpoints from which q k  is visible. These viewpoints are denoted as view space V k .
 
         [0219]    After the view space V k , (k=1, 2, . . . ), has been extracted, the measurement matrix may be constructed M The column vector M RJ  of the measurement matrix corresponds to the set R j  of points visible for viewpoint v j  while the row vector M k,v , corresponds to view space V k  of the next best point q k . The components M kj  of l-by-w measure matrix may be defined as follows: 
         [0000]    
       
         
           
             
               m 
               
                 k 
                 , 
                 j 
               
             
             = 
             
               { 
               
                 
                   
                     
                       〈 
                       
                         
                           n 
                           k 
                         
                         · 
                         
                           v 
                           j 
                         
                       
                       〉 
                     
                   
                   
                     
                       if 
                        
                       
                           
                       
                        
                       
                         r 
                         k 
                       
                        
                       
                           
                       
                        
                       is 
                        
                       
                           
                       
                        
                       visible 
                        
                       
                           
                       
                        
                       to 
                        
                       
                           
                       
                        
                       
                         v 
                         j 
                       
                     
                   
                 
                 
                   
                     0 
                   
                   
                     otherwise 
                   
                 
               
             
           
         
       
     
         [0000]    where v; is the direction vector of viewpoint vj. 
         [0220]    Then, for each view v(θ,φ), the View Space visibility may be defined which may measure the global information gain l(θ,φ) by 
         [0000]    
       
         
           
             
               
                 I 
                 j 
               
                
               
                 ( 
                 
                   
                     θ 
                     j 
                   
                   , 
                   
                     φ 
                     j 
                   
                 
                 ) 
               
             
             = 
             
               
                 ∑ 
                 
                   k 
                   ∈ 
                   
                     R 
                     j 
                   
                 
               
                
               
                 
                   
                     m 
                     
                       k 
                       , 
                       j 
                     
                   
                   · 
                   Δ 
                 
                  
                 
                     
                 
                  
                 
                   E 
                   k 
                 
               
             
           
         
       
     
         [0000]    where ΔE k  is the information gain at surface point r k , which is weighted by m k,j    
         [0221]    Therefore, the Next Best View (θ*,φ*) may be considered to be the one that maximizes the information gain function of I(θ,φ) 
         [0000]    
       
         
           
             
               ( 
               
                 
                   θ 
                   * 
                 
                 , 
                 
                   φ 
                   * 
                 
               
               ) 
             
             = 
             
               
                 max 
                 
                   
                     θ 
                     j 
                   
                   , 
                   
                     φ 
                     j 
                   
                 
               
                
               
                 
                   I 
                   j 
                 
                  
                 
                   ( 
                   
                     
                       θ 
                       j 
                     
                     , 
                     
                       φ 
                       j 
                     
                   
                   ) 
                 
               
             
           
         
       
     
       View Space Representation 
       [0222]    View space is a set of 3D positions where the sensor (vision system) takes measurements. If we assume that the 3D object is within the field of view and time depth of view of the vision system and the optical settings of the vision system are fixed, based on these assumptions, the parameters of the vision system to be planned are the time viewing positions of the sensor. As in the embodiment described above, in this embodiment, the candidate viewpoints are represented in a spherical viewing space. The viewing space is usually a continuous spherical surface. To reduce the number of viewpoints used in practice, it is necessary to discretize the surface by some kind of tessellation. 
         [0223]    In general, there are two methods for tessellating a view sphere, namely latitude-longitude based methods and icosahedron based methods. For a latitude-longitude based tessellation, the distribution of viewpoints varies considerably from time poles to the equator. For this reason, uniformly segmented geodesic tessellation is widely used [29,30,31]. This method tessellates the sphere by subdividing recursively each triangular facet of the icosahedrons. Using the geodesic dome construction technique, the constructed dome contains 20× Q 2  triangles and 10× Q 2 +2 vertices, where Q is the frequency of the geodesic division. The vertices of the triangles represent the candidate viewpoints. 
         [0224]    By way of example, a rhombus-shaped array data structure may be used [30]. For example, we may calculate the view space with Q=16 as shown in  FIG. 11(   a ). In addition, if we assume that the view space is centered around the object, and its radius is equal to a priori specified distance from the sensor to the object, as shown in  FIG. 11(   b ), since the optical axis of the sensor passes through the center of the object, the viewpoint may be represented by pan-tilt angles φ([−180°, 180°]) and θ([−90°, 90°]). 
         [0225]    According to the representation of the viewing space, the fundamental task in the view planning here is to obtain the visibility regions in the viewing space that contain the candidate viewpoints where the missing information about the 3D object can be obtained without occlusions. The NBV should be the viewpoint that can give maximum information about the object. 
         [0226]    With the above view space representation, we can now map the predicted information gain to the view space for viewpoint planning. For a viewpoint v(θ,φ), we say one data point on the object is visible if the angle between its normal and the view direction is smaller than a breakdown angle α of the sensor. The view space V k  for each data point r k , (k 1, 2, . . . ) is the set of all possible viewpoints that can see r k . The view space V k  can be calculated via the following procedure: 
         [0000]    1) Calculating the normal vector n k  of a point r k  (k=1, 2, . . . ) on the object, using a least square error fitting of a 3×3 local surface patch in its neighborhood.
 
2) Extracting viewpoints from which r k  is visible. These viewpoints are denoted as view space V k .
 
         [0227]    After the view space V k , (k=1, 2, . . . ), is extracted, we construct a measurement matrix M. The components m k,j  of an l-by-w measurement matrix may be given as 
         [0000]    
       
         
           
             
               m 
               
                 k 
                 , 
                 j 
               
             
             = 
             
               { 
               
                 
                   
                     
                       〈 
                       
                         
                           n 
                           k 
                         
                         · 
                         
                           v 
                           j 
                         
                       
                       〉 
                     
                   
                   
                     
                       if 
                        
                       
                           
                       
                        
                       
                         r 
                         k 
                       
                        
                       
                           
                       
                        
                       is 
                        
                       
                           
                       
                        
                       visible 
                        
                       
                           
                       
                        
                       to 
                        
                       
                           
                       
                        
                       
                         v 
                         j 
                       
                     
                   
                 
                 
                   
                     0 
                   
                   
                     otherwise 
                   
                 
               
             
           
         
       
     
         [0000]    where v; is the direction vector of viewpoint v j . 
         [0228]    Then, for each view v(θ,φ), we define a global measure of the information gain I(θ,φ) as the criterion to be summed over all visible surface points seen under this view of the sensor. |I(θ,φ) is defined by 
         [0000]    
       
         
           
             
               
                 I 
                 j 
               
                
               
                 ( 
                 
                   
                     θ 
                     j 
                   
                   , 
                   
                     φ 
                     j 
                   
                 
                 ) 
               
             
             = 
             
               
                 ∑ 
                 
                   k 
                   ∈ 
                   
                     R 
                     j 
                   
                 
               
                
               
                 
                   
                     m 
                     
                       k 
                       , 
                       j 
                     
                   
                   · 
                   Δ 
                 
                  
                 
                     
                 
                  
                 
                   E 
                   k 
                 
               
             
           
         
       
     
         [0000]    where ΔE k  is the information gain at surface point r k , which is weighted by m k,j . 
         [0229]    Therefore, the Next Best View (θ*,φ*) is one that maximizes the information gain function of I(θ,φ). 
         [0000]    
       
         
           
             
               ( 
               
                 
                   θ 
                   * 
                 
                 , 
                 
                   φ 
                   * 
                 
               
               ) 
             
             = 
             
               
                 max 
                 
                   
                     θ 
                     j 
                   
                   , 
                   
                     φ 
                     j 
                   
                 
               
                
               
                 
                   I 
                   j 
                 
                  
                 
                   ( 
                   
                     
                       θ 
                       j 
                     
                     , 
                     
                       φ 
                       j 
                     
                   
                   ) 
                 
               
             
           
         
       
     
         [0230]    In summary, one or more preferred embodiments of the present invention provide a viewpoint planning method by reducing incrementally the uncertainty of a closed B-spline curve. Also proposed is an improved BIC criterion for model selection, which accounts for acquired data well. By representing the object with a series of relatively simple cross section curves, it is possible to define entropy as a measurement of uncertainty to predict the information gain for a cross section B-spline model. Based on that, it is possible to establish View Space Visibility and select the viewpoint with maximum visibility as the Next Best View. 
         [0231]    One or more embodiments of the present invention may find particular application in the following fields but application of the invention is not to be considered limited to the following:
       in reverse engineering, to obtain a digitized 3D data/model of a physical product;   human body measurements for the apparel industry or for tailor made clothing design;   advanced object recognition, product inspection and manipulation;   environment model construction for virtual reality;   as a 3D sensor for robotic exploration/navigation in clustered environments.       
 
         [0237]    One or more preferred embodiments of the invention may have particular advantages in that by using encoded patterns projected over an area on the object surface, high speed 3D imaging may be achieved. Also, automated self-recalibration of the system may be performed when the system&#39;s configuration is changed or perturbed. In a further preferred embodiment, uncalibrated 3D reconstruction may be performed. Furthermore, in a preferred embodiment real Euclidean reconstruction of a 3D surface may be achieved. 
         [0238]    It will be appreciated that the scope of the present invention is not restricted to the described embodiments. For example, whilst the embodiments have been described in terms of four sensors and four variable gain control components, a different number of such components may be used. Numerous other modifications, changes, variations, substitutions and equivalents will therefore occur to those skilled in the art without departing from the spirit and scope of the present invention. 
         [0239]    The results of a series of experiments conducted in respect of a number of preferred embodiments according to the present invention are set out in the attached Schedule 1, the contents of which is incorporated herein in total. Furthermore, details of the application of a number of preferred embodiments of the present invention to uncalibrated Euchlidean 3D reconstruction using an active vision system according to an embodiment of the present invention is set out in Schedule 2, the contents of which is incorporated herein in total.