Abstract:
An adaptive error measure, weights and sampling criterion for 3D registration algorithms. Adjusting a sampling criterion for each entity of the 3D model by a factor controlled by a value associated with the expected error for the particular entity, derived from parameters such as accuracy and local 3D model density. Similar adjusted error measure that evaluates the quality of the 3D registration result at different regions of the 3D models, and an adjusted weighting scheme, that assign weight for each entity of the 3D model, are also discussed. In an iterative 3D registration algorithm, adjusted outlier detection criterion after each iteration according to the convergence rate of the algorithm is presented, therefore allowing iterative 3D registration algorithms to escape areas of slow convergence rate and local minima.

Description:
TECHNOLOGICAL FIELD 
       [0001]    The invention relates to 3D processing and to 3D registration. 
       BACKGROUND 
       [0002]    As is known by those versed in the art, 3D registration involves an attempt to align two or more 3D models, by finding or applying spatial transformations over the 3D models. 3D registration is useful in many imaging, graphical, image processing, computer vision, medical imaging, robotics, and pattern matching applications. 
         [0003]    Examples of scenarios were 3D registration involves significant challenges include: a moving 3D camera, or multiple 3D cameras with different positions and directions and generating a plurality of 3D models of a static scene from different viewpoints. In these examples, the 3D registration process may involve recovering the relative positions and directions of the different viewpoints. Recovering the relative positions and directions of the different viewpoints can further enable merging of the plurality of 3D models into a single high quality 3D model of the scene. Alternatively, the recovered positions and directions can be used in a calibration process of a multiple 3D camera system, or to reconstruct the trajectory of a single moving camera. 
         [0004]    Another scenario were 3D registration can present some challenges is where a static 3D camera is used to generate a series of 3D models of a moving object or scene. Here, the 3D registration process recovers the relative positions and orientations of the object or scene in each 3D model. Recovering the relative positions and orientations of the object or scene in each 3D model can further enables merging of the plurality of 3D models into a single high quality 3D model of the object or scene. Alternatively, the trajectory of the moving object or scene can be reconstructed. 
         [0005]    A moving 3D camera, or multiple moving 3D cameras, capturing 3D images of a scene that may include several moving objects. As an example, consider one or more 3D cameras attached to a vehicle, where the vehicle is moving, the relative positions and orientations of the 3D cameras to the vehicle are changing, and objects in the scene are moving. In the above scenario, the 3D registration results can be used to assemble a map or a model of the environment, for example as input to motion segmentation algorithms, and so forth. 
         [0006]    When the 3D registration process involves a pair of 3D models, the goal of the 3D registration process is to find a spatial transformation between the two models. This can include rigid and non-rigid transformations. The two 3D models may include coinciding parts that correspond to the same objects in the real world, and parts that do not coincide, corresponding to objects (or parts of objects) in the real world that are modeled in only one of the 3D models. Removing the non-coinciding parts speeds up the convergence of the 3D registration process, and can improve the 3D registration result. This same principal extends naturally to the case of three or more 3D models. 
         [0007]    In addition, the 3D registration may be instable due to the geometry of the 3D models that allows two 3D models to “slide” against each other in regions which do not contain enough information to fully constrain the registration, for example, due to uniformity in the appearance of a surface in a certain direction. In such case, selecting, or increasing the weights of, the parts of the 3D models that do constrain the registration in the unconstrained direction, allows these parts to control the convergence of 3D registration algorithm, may also speed up the convergence of the 3D registration algorithm, and may improve the 3D registration result. 
       SUMMARY 
       [0008]    According to an aspect of the presently disclosed subject matter there is provided a method, a computer implementing a method that include: using an adaptive sampling criterion for a 3D registration algorithm. The proposed method is capable of adjusting the sampling criterion at each step of an iterative 3D registration algorithm (or at least at various steps of an iterative 3D registration algorithm) according to the convergence rate of the algorithm. According to examples of the presently disclosed subject matter, the adaptive sampling criterion can be adjusted so as to allow an iterative 3D registration algorithm that is used in a 3D registration process to escape areas of slow convergence rate (such as around inflection points) and local minima. In addition, the iterative 3D registration algorithm enables setting an expected convergence time, and the sampling criterion can be responsive to the defined convergence time for adjusting the subsequent steps of the 3D registration algorithm accordingly. By way of example, the adjustment of the sampling criterion can be controlled manually, by or a user, and/or in another example, the adjustment of the sampling criterion can be controlled by a computerized process, such as a service utilizing the 3D registration algorithm. 
         [0009]    In addition, the sampling criterion for each entity of the 3D model can be adjusted by a controlling factor that is controlled by a controlling value associated with the expected error for the particular entity. By way of example, the sampling criterion can be associated with a control value that is derived from different parameters, including geometrical parameters that relates to the entity, capturing parameters that relates to the entity, and so forth, for example, accuracy and local 3D model density. 
         [0010]    According to a further aspect of the presently disclosed subject matter, there is provided a method, a computer implementing a method that includes: an adaptive error measure that can be used to evaluate the quality of a 3D registration result at different regions of 3D models. According to a further aspect of the presently disclosed subject matter, there is provided a method, a computer implementing a method that includes: assigning an adaptive weight function to different entities of the 3D model. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0011]    In order to understand the invention and to see how it may be carried out in practice, a preferred embodiment will now be described, by way of non-limiting example only, with reference to the accompanying drawings, in which: 
           [0012]      FIG. 1  is a simplified block diagram of an example for one possible implementation of a mobile communication device with 3D capturing capabilities. 
           [0013]      FIG. 2  is a simplified block diagram of an example for one possible implementation of a system that includes a mobile communication device with 3D capturing capabilities and a cloud platform. 
           [0014]      FIG. 3  is an illustration of a possible scenario in which a plurality of 3D models is generated by a single 3D camera. 
           [0015]      FIG. 4  is an illustration of a possible scenario in which a plurality of 3D models is generated by a plurality of 3D cameras. 
       
    
    
       [0016]    It will be appreciated that for simplicity and clarity of illustration, elements shown in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity. Further, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements. 
       DESCRIPTION 
       [0017]    In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be understood by those with ordinary skill in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, and components have not been described in detail so as not to obscure the present invention. 
         [0018]    Unless specifically stated otherwise, as apparent from the following discussions, it is appreciated that throughout the specification discussions utilizing terms such as “processing”, “calculating”, “computing”, “determining”, “generating”, “setting”, “configuring”, “selecting”, “defining”, “applying”, “obtaining”, or the like, include action and/or processes of a computer that manipulate and/or transform data into other data, said data represented as physical quantities, e.g. such as electronic quantities, and/or said data representing the physical objects. The terms “computer”, “processor”, “controller”, “processing unit”, and “computing unit” should be expansively construed to cover any kind of electronic device, component or unit with data processing capabilities, including, by way of non-limiting example, a personal computer, a tablet, a smartphone, a server, a computing system, a communication device, a processor (for example, digital signal processor (DSP), and possibly with embedded memory), a microcontroller, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a graphics processing unit (GPU), and so on), a core within a processor, any other electronic computing device, and or any combination thereof. 
         [0019]    The operations in accordance with the teachings herein may be performed by a computer specially constructed for the desired purposes or by a general purpose computer specially configured for the desired purpose by a computer program stored in a computer readable storage medium. 
         [0020]    As used herein, the phrase “for example,” “such as”, “for instance” and variants thereof describe non-limiting embodiments of the presently disclosed subject matter. Reference in the specification to “one case”, “some cases”, “other cases” or variants thereof means that a particular feature, structure or characteristic described in connection with the embodiment(s) is included in at least one embodiment of the presently disclosed subject matter. Thus the appearance of the phrase “one case”, “some cases”, “other cases” or variants thereof does not necessarily refer to the same embodiment(s). 
         [0021]    It is appreciated that certain features of the presently disclosed subject matter, which are, for clarity, described in the context of separate embodiments, may also be provided in combination in a single embodiment. Conversely, various features of the presently disclosed subject matter, which are, for brevity, described in the context of a single embodiment, may also be provided separately or in any suitable sub-combination. 
         [0022]    In embodiments of the presently disclosed subject matter one or more stages illustrated in the figures may be executed in a different order and/or one or more groups of stages may be executed simultaneously and vice versa. The figures illustrate a general schematic of the system architecture in accordance with an embodiment of the presently disclosed subject matter. Each module in the figures can be made up of any combination of software, hardware and/or firmware that performs the functions as defined and explained herein. The modules in the figures may be centralized in one location or dispersed over more than one location. 
         [0023]    The term “3D model” is recognized by those with ordinary skill in the art and refers to any kind of representation of any 3D surface, 3D object, 3D scene, 3D prototype, 3D shape, 3D design and so forth, either static or moving. A 3D model can be represented in a computer in different ways. Some example includes the popular range image, where one associate a depth for pixels of a regular 2D image. Another simple example is the point cloud, where the model consists of a set of 3D points. A different example is using polygons, where the model consists of a set of polygons. Special types of polygon based models include: (i) polygon soup, where the polygons are unsorted; (ii) mesh, where the polygons are connected to create a continuous surface; (iii) subdivision surface, where a sequence of meshes is used to approximate a smooth surface; (iv) parametric surface, where a set of formulas are used to describe a surface; (v) implicit surface, where one or more equations are used to describe a surface; (vi) and so forth. Another example is to represent a 3D model as a skeleton model, where a graph of curves with radii is used. Additional examples include a mixture of any of the above methods. There are also many variants on the above methods, as well as a variety of other methods. It is important to note that one may convert one kind of representation to another, at the risk of losing some information, or by making some assumptions to complete missing information. 
         [0024]    The term “3D registration process” is recognized by those with ordinary skill in the art and refers to the process of finding one or more spatial transformations that aligns two or more 3D models, and/or for transforming two or more 3D models into a single coordinate system. 
         [0025]    The term “3D registration algorithm” is recognized by those with ordinary skill in the art and refers to any process, algorithm, method, procedure, and/or technique, for solving and/or approximating one or more solutions to the 3D registration process. Some examples for 3D registration algorithms include the Iterative Closest Point algorithm, the Robust Point Matching algorithm, the Kernel Correlation algorithm, the Coherent Point Drift algorithm, RANSAC based algorithms, any graph and/or hypergraph matching algorithm, any one of the many variants of these algorithms, and so forth. 
         [0026]    The term “iterative 3D registration algorithm” is recognized by those with ordinary skill in the art and refers to a 3D registration algorithm that repeatedly adjusts an estimation of the 3D registration until convergence, possibly starting from an initial guess for the 3D registration. 
         [0027]    The term “3D registration result” is recognized by those with ordinary skill in the art and refers to the product of a 3D registration algorithm. This may be in the form of: spatial transformations between pairs of 3D models; spatial transformations for transforming all the 3D models into a single coordinate system; representation of all the 3D models in a single coordinate system; and so forth. 
         [0028]    The term “estimated 3D registration” is recognized by those with ordinary skill in the art and refers to any estimation of 3D registration result. In one example, the estimation may be a random guess for the 3D registration result. In an iterative 3D registration algorithm, each iteration updates an estimation of 3D registration result to obtain a new estimation. A 3D registration result by itself can also be an estimated 3D registration. And so forth. 
         [0029]    The term “3D camera” is recognized by those with ordinary skill in the art and refers to any type of device, including a camera and/or a sensor, which is capable of capturing 3D images, 3D videos, and/or 3D models. Examples include: stereoscopic cameras, time-of-flight cameras, obstructed light sensors, structured light sensors, and so forth. 
         [0030]    It should be noted that some examples of the presently disclosed subject matter are not limited in application to the details of construction and the arrangement of the components set forth in the following description or illustrated in the drawings. The invention can be capable of other embodiments or of being practiced or carried out in various ways. Also, it is to be understood that the phraseology and terminology employed herein is for the purpose of description and should not be regarded as limiting. 
         [0031]    In this document, an element of a drawing that is not described within the scope of the drawing and is labeled with a numeral that has been described in a previous drawing has the same use and description as in the previous drawings. Similarly, an element that is identified in the text by a numeral that does not appear in the drawing described by the text, has the same use and description as in the previous drawings where it was described. 
         [0032]    The drawings in this document may not be to any scale. Different figures may use different scales and different scales can be used even within the same drawing, for example different scales for different views of the same object or different scales for the two adjacent objects. 
         [0033]      FIG. 1  is a simplified block diagram of an example for one possible implementation of a mobile communication device with 3D capturing capabilities. The mobile communication device  100  can includes a 3D camera  10  that is capable of providing 3D depth or range data. In the example of  FIG. 1  there is shown a configuration of an active stereo 3D camera, but in further examples of the presently disclosed subject matter other known 3D cameras can be used. Those versed in the art can readily apply the teachings provided in the examples of the presently disclosed subject matter to other 3D camera configurations and to other 3D capture technologies. 
         [0034]    By way of example, the 3D camera  10  can include: a 3D capture sensor  12 , a driver  14 , a 3D capture processor  16  and a flash module  18 . In this example, the flash module  18  is configured to project a structured light pattern and the 3D capture sensor  12  is configured to capture an image which corresponds to the reflected pattern, as reflected from the environment onto which the pattern was projected. U.S. Pat. No. 8,090,194 to Gordon et. al. describes an example structured light pattern that can be used in a flash component of a 3D camera, as well as other aspects of active stereo 3D capture technology and is hereby incorporated into the present application in its entirety. International Application Publication No. WO2013/144952 describes an example of a possible flash design and is hereby incorporated by reference in its entirety. 
         [0035]    By way of example, the flash module  18  can include an IR light source, such that it is capable of projecting IR radiation or light, and the 3D capture sensor  12  can be and IR sensor, that is sensitive to radiation in the IR band, and such that it is capable of capturing the IR radiation that is returned from the scene. The flash module  18  and the 3D capture sensor  12  are calibrated. According to examples of the presently disclosed subject matter, the driver  14 , the 3D capture processor  16  or any other suitable component of the mobile communication device  100  can be configured to implement auto-calibration for maintaining the calibration among the flash module  18  and the 3D capture sensor  12 . 
         [0036]    The 3D capture processor  16  can be configured to perform various processing functions, and to run computer program code which is related to the operation of one or more components of the 3D camera. The 3D capture processor  16  can include memory  17  which is capable of storing the computer program instructions that are executed or which are to be executed by the processor  16 . 
         [0037]    The driver  14  can be configured to implement a computer program which operates or controls certain functions, features or operations that the components of the 3D camera  10  are capable of carrying out. 
         [0038]    According to examples of the presently disclosed subject matter, the mobile communication device  100  can also include hardware components in addition to the 3D camera  10 , including for example, a power source  20 , storage  30 , a communication module  40 , a device processor  50  and memory  60 , device imaging hardware  110 , a display unit  120 , and other user interfaces  130 . It should be noted that in some examples of the presently disclosed subject matter, one or more components of the mobile communication device  100  can be implemented as distributed components. In such examples, a certain component can include two or more units distributed across two or more interconnected nodes. Further by way of example, a computer program, possibly executed by the device processor  50 , can be capable of controlling the distributed component and can be capable of operating the resources on each of the two or more interconnected nodes. 
         [0039]    It is known to use various types of power sources in a mobile communication device. The power source  20  can include one or more power source units, such as a battery, a short-term high current source (such as a capacitor), a trickle-charger, etc. 
         [0040]    The device processor  50  can include one or more processing modules which are capable of processing software programs. The processing module can each have one or more processors. In this description, the device processor  50  may include different types of processors which are implemented in the mobile communication device  100 , such as a main processor, an application processor, etc. The device processor  50  or any of the processors which are generally referred to herein as being included in the device processor can have one or more cores, internal memory or a cache unit. 
         [0041]    The storage unit  30  can be configured to store computer program code that is necessary for carrying out the operations or functions of the mobile communication device  100  and any of its components. The storage unit  30  can also be configured to store one or more applications, including 3D applications  80 , which can be executed on the mobile communication device  100 . In a distributed configuration one or more 3D applications  80  can be stored on a remote computerized device, and can be consumed by the mobile communication device  100  as a service. In addition or as an alternative to application program code, the storage unit  30  can be configured to store data, including for example 3D data that is provided by the 3D camera  10 . 
         [0042]    The communication module  40  can be configured to enable data communication to and from the mobile communication device. By way of example, examples of communication protocols which can be supported by the communication module  40  include, but are not limited to cellular communication (3G, 4G, etc.), wired communication protocols (such as Local Area Networking (LAN)), and wireless communication protocols, such as Wi-Fi, wireless personal area networking (PAN) such as Bluetooth, etc. 
         [0043]    It should be noted that that according to some examples of the presently disclosed subject matter, some of the components of the 3D camera  10  can be implemented on the mobile communication hardware resources. For example, instead of having a dedicated 3D capture processor  16 , the device processor  50  can be used. Still further by way of example, the mobile communication device  100  can include more than one processor and more than one type of processor, e.g., one or more digital signal processors (DSP), one or more graphical processing units (GPU), etc., and the 3D camera can be configured to use a specific one (or a specific set or type) processor(s) from the plurality of device  100  processors. 
         [0044]    The mobile communication device  100  can be configured to run an operating system  70 . Examples of mobile device operating systems include but are not limited to: such as Windows Mobile™ by Microsoft Corporation of Redmond, Wash., and the Android operating system developed by Google Inc. of Mountain View, Calif. 
         [0045]    The 3D application  80  can be any application which uses 3D data. Examples of 3D applications include a virtual tape measure, 3D video, 3D snapshot, 3D modeling, etc. It would be appreciated that different 3D applications can have different requirements and features. A 3D application  80  may be assigned to or can be associated with a 3D application group. In some examples, the device  100  can be capable of running a plurality of 3D applications  80  in parallel. 
         [0046]    Imaging hardware  110  can include any imaging sensor, in a particular example, an imaging sensor that is capable of capturing visible light images can be used. According to examples of the presently disclosed subject matter, the imaging hardware  110  can include a sensor, typically a sensor that is sensitive at least to visible light, and possibly also a light source (such as one or more LEDs) for enabling image capture in low visible light conditions. According to examples of the presently disclosed subject matter, the device imaging hardware  110  or some components thereof can be calibrated to the 3D camera  10 , and in particular to the 3D capture sensor  12  and to the flash  18 . It would be appreciated that such a calibration can enable texturing of the 3D image and various other co-processing operations as will be known to those versed in the art. 
         [0047]    In yet another example, the imaging hardware  110  can include a RGB-IR sensor that is used for capturing visible light images and for capturing IR images. Still further by way of example, the RGB-IR sensor can serve as the 3D capture sensor  12  and as the visible light camera. In this configuration, the driver  14  and the flash  18  of the 3D camera, and possibly other components of the device  100 , are configured to operate in cooperation with the imaging hardware  110 , and in the example given above, with the RGB-IR sensor, to provide the 3D depth or range data. 
         [0048]    The display unit  120  can be configured to provide images and graphical data, including a visual rendering of 3D data that was captured by the 3D camera  10 , possibly after being processed using the 3D application  80 . The user interfaces  130  can include various components which enable the user to interact with the mobile communication device  100 , such as speakers, buttons, microphones, etc. The display unit  120  can be a touch sensitive display which also serves as a user interface. 
         [0049]    According to some examples of the presently disclosed subject matter, any processing unit, including the 3D capture processor  16  or the device processor  50  and/or any sub-components or CPU cores, etc. of the 3D capture processor  16  and/or the device processor  50 , can be configured to read 3D images and/or frames of 3D video clips stored in storage unit  30 , and/or to receive 3D images and/or frames of 3D video clips from an external source, for example through communication module  40 ; produce 3D models out of said 3D images and/or frames. By way of example, the produced 3D models can be stored in storage unit  30 , and/or sent to an external destination through communication module  40 . According to further examples of the presently disclosed subject matter, any such processing unit can be configured to execute 3D registration on a plurality of 3D models. 
         [0050]      FIG. 2  is a simplified block diagram of an example for one possible implementation of a system  200 , that includes a mobile communication device with 3D capturing capabilities  100 , and a could platform  210  which includes resources that allows the execution of 3D registration. 
         [0051]    According to examples of the presently disclosed subject matter, the cloud platform  210  can include hardware components, including for example, one or more power sources  220 , one or more storage units  230 , one or more communication modules  240 , one or more processors  250 , optionally one or more memory units  260 , and so forth. 
         [0052]    The storage unit  230  can be configured to store computer program code that is necessary for carrying out the operations or functions of the cloud platform  210  and any of its components. The storage unit  230  can also be configured to store one or more applications, including 3D applications, which can be executed on the cloud platform  210 . In addition or as an alternative to application program code, the storage unit  230  can be configured to store data, including for example 3D data. 
         [0053]    The communication module  240  can be configured to enable data communication to and from the cloud platform. By way of example, examples of communication protocols which can be supported by the communication module  240  include, but are not limited to cellular communication (3G, 4G, etc.), wired communication protocols (such as Local Area Networking (LAN)), and wireless communication protocols, such as Wi-Fi, wireless personal area networking (PAN) such as Bluetooth, etc. 
         [0054]    The one or more processors  250  can include one or more processing modules which are capable of processing software programs. The processing module can each have one or more processing units. In this description, the device processor  250  may include different types of processors which are implemented in the cloud platform  210 , such as general purpose processing units, graphic processing units, physics processing units, etc. The device processor  250  or any of the processors which are generally referred to herein can have one or more cores, internal memory or a cache unit. 
         [0055]    According to examples of the presently disclosed subject matter, the one or more memory units  260  may include several memory units. Each unit may be accessible by all of the one or more processors  250 , or only by a subset of the one or more processors  250 . 
         [0056]    According to some examples of the presently disclosed subject matter, any processing unit, including the one or more processors  250  and/or any sub-components or CPU cores, etc. of the one or more processors  250 , can be configured to read 3D images and/or frames of 3D video clips stored in storage unit  230 , and/or to receive 3D images and/or frames of 3D video clips from an external source, for example through communication module  240 , where, by a way of example, the communication module may be communicating with the mobile communication device  100 , with another cloud platform, and so forth. By a way of example, the processing unit can be further configured to produce 3D models out of said 3D images and/or frames. Further by a way of example, the produced 3D models can be stored in storage unit  230 , and/or sent to an external destination through communication module  240 . According to further examples of the presently disclosed subject matter, any such processing unit can be configured to execute 3D registration on a plurality of 3D models. 
         [0057]      FIG. 3  is an illustration of a possible scenario in which a plurality of 3D models is generated by a single 3D camera. A moving object is captured at two sequential points in time. We will denote the earliest point in time as T 1 , and the later point in time as T 2 .  311  is the object at T 1 , and  312  is the object at T 2 .  321  is the single 3D camera at time T 1 , which generates a 3D model  331  of the object at time T 1  ( 311 ). Similarly, at time T 2  the single 3D camera ( 322 ) generates the 3D model  332  of the object ( 312 ). 
         [0058]    According to further examples of the presently disclosed subject matter, 3D registration is used to align 3D model  331  with 3D model  332 . Further by a way of example, the 3D registration result can be used to reconstruct the trajectory of the moving object  311  and  312 . 
         [0059]      FIG. 4  is an illustration of a possible scenario in which a plurality of 3D models is generated by a plurality of 3D cameras. A single object  410  is captured by two 3D cameras: 3D camera  421  generates the 3D model  431 , and 3D camera  422  generates the 3D model  432 . 
         [0060]    According to further examples of the presently disclosed subject matter, 3D registration is used to align 3D model  431  with 3D model  432 . Further by a way of example, the 3D registration result can be used to reconstruct a single combined 3D model of the object  410  from the two 3D models  431  and  432 . 
         [0061]    It is hereby assumed that a 3D registration algorithm treats at least one of the 3D models as a group of separated entities, possibly while holding additional information about the relations among the entities. For example: when representing the 3D model as a point cloud, an entity can be a point; when representing the 3D model as a group of polygons, the entity may be a polygon; when representing the 3D model as a skeleton model, each curve and/or a radii may be an entity; when representing the 3D model as a graph or a hypergraph, each node and/or vertex may be an entity; and so forth. In such case, at each point in time an error for each entity can be estimated. 
         [0062]    There are many different possible error measures that can be used in accordance with examples of the presently disclosed subject matter. One straightforward possibility is to take any distance measure and treat it as an error measure. For example, when dealing with two point cloud 3D models, the distance between the point and the point closest to it in the second point cloud can be obtained and used as an error measure. Note that the distance can be measured using any distance measure, including Euclidean distance, Manhattan distance, and so forth. As another example, when dealing with one point cloud 3D model and one polygon based 3D model, the distance between the point and the polygon closest to it can be used. In a different example, when dealing with two polygon based 3D models, any non-negative similarity measure can be used between polygons to convert it to distance, for example if the similarity of two polygons is s, a possible distance is exp(-s), and again the distance from a polygon to the nearest polygon in the second 3D model can be obtained and used as error measure. 
         [0063]    According to examples of the presently disclosed subject matter, the error measures can be utilized for many different usages. For example, the error measure can be used in evaluating the different entities to identify outliers. These outliers may be removed from the calculation before applying a 3D registration algorithm. In an iterative 3D registration algorithm, after each iteration the error measure can be recalculated and more outliers can be identified. Further by way of example, the identified outlier can possibly be removed from the calculation before further iterations take place. As another example, the error measure can be used to estimate the convergence rate and/or as a stopping condition for an iterative 3D registration algorithm. 
         [0064]    Still further by way of example, an outlier detection criterion can be thought as a condition on a function of the entities error. For example, assume n entities with errors e 1 , . . . , e n . A possible outliers detection criterion can be based on the following formula (formula (1)), 
         [0000]        e   i   &gt;f ( e   1   , . . . , e   n ),   formula (1)
 
         [0000]    where f(e 1 , . . . , e n ) is a function of e 1 , . . . , e n . Formula (1) uses the function, f(e 1 , . . . , e n ), as a threshold, and treat any entity corresponding to an error greater than the threshold as an outlier. Some possible examples for the function f(e 1 , . . . , e n ) includes: the mean function, the median function, a function of the mean and/or median together with the standard deviation and/or the variance, any other statistical function of the errors, e 1 , . . . , e n , and so on. 
         [0065]    According to examples of the presently disclosed subject matter, another usage of the error measure can be in setting weights for the different entities. For example, giving different weights to different entities can guide the algorithm towards a solution that favors lower error on these entities. As another example, assigning different weights to different entities can control the effect of each entity on an iterative 3D registration algorithm stopping criterion. According to further examples of the presently disclosed subject matter, the weight of an entity can be set as a function of the entities error. For example, given n entities with errors e 1 , . . . , e n , the weight w i  of the i-th entity can be set according to the following formula (formula (2)), 
         [0000]        w   i   =z ( e   i   , e   1   , . . . , e   n ),   formula (2)
 
         [0000]    where z(e i , e 1 , . . . , e n ) is a function of, e 1 , . . . , e n , and the weighting policy is to assign to the i-th entity the weight z(e i , e 1 , . . . , e n ). As a possible example for the function z(e i , e 1 , . . . , e n ) consider the following formula (formula (3)), 
         [0000]    
       
         
           
             
               
                 
                   
                     w 
                     i 
                   
                   = 
                   
                     
                       z 
                        
                       
                         ( 
                         
                           
                             e 
                             i 
                           
                           , 
                           
                             e 
                             1 
                           
                           , 
                           … 
                            
                           
                               
                           
                           , 
                           
                             e 
                             n 
                           
                         
                         ) 
                       
                     
                     = 
                     
                       
                         
                           exp 
                            
                           
                             ( 
                             
                               - 
                               
                                 
                                   e 
                                   
                                     i 
                                      
                                     
                                         
                                     
                                   
                                 
                                 
                                   f 
                                    
                                   
                                     ( 
                                     
                                       
                                         e 
                                         1 
                                       
                                       , 
                                       … 
                                        
                                       
                                           
                                       
                                       , 
                                       
                                         e 
                                         n 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                             ) 
                           
                         
                         
                           
                             ∑ 
                             
                               j 
                               = 
                               1 
                             
                             n 
                           
                            
                           
                             exp 
                              
                             
                               ( 
                               
                                 - 
                                 
                                   
                                     e 
                                     j 
                                   
                                   
                                     f 
                                      
                                     
                                       ( 
                                       
                                         
                                           e 
                                           1 
                                         
                                         , 
                                         … 
                                          
                                         
                                             
                                         
                                         , 
                                         
                                           e 
                                           n 
                                         
                                       
                                       ) 
                                     
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     3 
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    As another example for the function z(e i , e 1 , . . . , e n ) consider the following formula (formula (4)), 
         [0000]    
       
         
           
             
               
                 
                   
                     w 
                     i 
                   
                   = 
                   
                     
                       z 
                        
                       
                         ( 
                         
                           
                             e 
                             i 
                           
                           , 
                           
                             e 
                             1 
                           
                           , 
                           … 
                            
                           
                               
                           
                           , 
                           
                             e 
                             n 
                           
                         
                         ) 
                       
                     
                     = 
                     
                       
                         
                           
                             ( 
                             
                               
                                 e 
                                 
                                   i 
                                    
                                   
                                       
                                   
                                 
                               
                               
                                 f 
                                  
                                 
                                   ( 
                                   
                                     
                                       e 
                                       1 
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       e 
                                       n 
                                     
                                   
                                   ) 
                                 
                               
                             
                             ) 
                           
                           
                             - 
                             1 
                           
                         
                         
                           
                             ∑ 
                             
                               j 
                               = 
                               1 
                             
                             n 
                           
                            
                           
                             
                               ( 
                               
                                 
                                   e 
                                   j 
                                 
                                 
                                   f 
                                    
                                   
                                     ( 
                                     
                                       
                                         e 
                                         1 
                                       
                                       , 
                                       … 
                                        
                                       
                                           
                                       
                                       , 
                                       
                                         e 
                                         n 
                                       
                                     
                                     ) 
                                   
                                 
                               
                               ) 
                             
                             
                               
                                 - 
                                 1 
                               
                                
                               
                                   
                               
                             
                           
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     4 
                     ) 
                   
                 
               
             
           
         
       
     
         [0066]    According to further examples of the presently disclosed subject matter, in an iterative 3D registration algorithm, it is also possible to update an entity weight instead of completely recalculating it, or in other words, to take into account previous values of the entity&#39;s weight in the calculation of the new weight for the entity. For example, let w i   t  be the weight of the i-th entity at iteration t, the weight can be updated and a weight w i   t+1  for can be obtained for the entity in iteration t+1 according to the following formula (formula (5)), 
         [0000]        w   i   t+1   =y ( w   i   t   , e   i   , e   1   , . . . , e   n ),   formula (5)
 
         [0000]    where y(w i   t , e i , e 1 , . . . , e n ) is a function of the previous weight for the i-th entity, w i   t , and the errors, e 1 , . . . , e n , and the weighting policy is to assign to the i-th entity the weight y(w i   t , e i , e 1 , . . . , e n ). As a possible example for the function y(w i   t , e i , e 1 , . . . , e n ) consider the following formula (formula (6)), 
         [0000]    
       
         
           
             
               
                 
                   
                     w 
                     i 
                     
                       t 
                       + 
                       1 
                     
                   
                   = 
                   
                     
                       y 
                        
                       
                         ( 
                         
                           
                             w 
                             i 
                             t 
                           
                           , 
                           
                             e 
                             i 
                           
                           , 
                           
                             e 
                             1 
                           
                           , 
                           … 
                            
                           
                               
                           
                           , 
                           
                             e 
                             n 
                           
                         
                         ) 
                       
                     
                     = 
                     
                       
                         w 
                         i 
                         t 
                       
                       · 
                       
                         
                           exp 
                            
                           
                             ( 
                             
                               - 
                               
                                 
                                   e 
                                   
                                     i 
                                      
                                     
                                         
                                     
                                   
                                 
                                 
                                   f 
                                    
                                   
                                     ( 
                                     
                                       
                                         e 
                                         1 
                                       
                                       , 
                                       … 
                                       , 
                                       
                                         e 
                                         n 
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                             ) 
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     6 
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    As another example for the function y(w i   t , e i , e 1 , . . . , e n ) consider the following formula (formula (7)), 
         [0000]    
       
         
           
             
               
                 
                   
                     w 
                     i 
                     
                       t 
                       + 
                       1 
                     
                   
                   = 
                   
                     
                       y 
                        
                       
                         ( 
                         
                           
                             w 
                             i 
                             t 
                           
                           , 
                           
                             e 
                             i 
                           
                           , 
                           
                             e 
                             1 
                           
                           , 
                           … 
                            
                           
                               
                           
                           , 
                           
                             e 
                             n 
                           
                         
                         ) 
                       
                     
                     = 
                     
                       
                         w 
                         i 
                         t 
                       
                       · 
                       
                         
                           
                             ( 
                             
                               
                                 e 
                                 
                                   i 
                                    
                                   
                                       
                                   
                                 
                               
                               
                                 f 
                                  
                                 
                                   ( 
                                   
                                     
                                       e 
                                       1 
                                     
                                     , 
                                     … 
                                     , 
                                     
                                       e 
                                       n 
                                     
                                   
                                   ) 
                                 
                               
                             
                             ) 
                           
                           
                             - 
                             1 
                           
                         
                         . 
                       
                     
                   
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     7 
                     ) 
                   
                 
               
             
           
         
       
     
         [0067]    According to further examples of the presently disclosed subject matter, another usage of the measure can be in the evaluation of different entities at the end of a 3D registration algorithm, as a way to evaluate the quality of the 3D registration result for each entity, or the overall 3D registration result, for example by using the sum of all the entities error, by using the weighted sum, and so forth. For example, given n entities with errors e 1 , . . . , e n , a possible measure of quality associated with the i-th entity, q i , can be calculated according to the following formula (formula (8)), 
         [0000]        q   i   =v ( e   i   , e   1   , . . . , e   n ),   formula (8)
 
         [0000]    where v(e i , e 1 , . . . , e n ) is a function of, e 1 , . . . , e n . As a possible example for the function v(e i , e 1 , . . . , e n ) consider the following formula (formula (9)), 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       q 
                       i 
                     
                     = 
                     
                       
                         v 
                          
                         
                           ( 
                           
                             
                               e 
                               i 
                             
                             , 
                             
                               e 
                               1 
                             
                             , 
                             … 
                              
                             
                                 
                             
                             , 
                             
                               e 
                               n 
                             
                           
                           ) 
                         
                       
                       = 
                       
                         exp 
                          
                         
                           ( 
                           
                             - 
                             
                               
                                 e 
                                 
                                   i 
                                    
                                   
                                       
                                   
                                 
                               
                               
                                 f 
                                  
                                 
                                   ( 
                                   
                                     
                                       e 
                                       1 
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       e 
                                       n 
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     9 
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    where a higher value corresponds to a higher quality and vice versa. Another possible example is as follows (formula (10)), 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       q 
                       i 
                     
                     = 
                     
                       
                         v 
                          
                         
                           ( 
                           
                             
                               e 
                               i 
                             
                             , 
                             
                               e 
                               1 
                             
                             , 
                             … 
                              
                             
                                 
                             
                             , 
                             
                               e 
                               n 
                             
                           
                           ) 
                         
                       
                       = 
                       
                         
                           ( 
                           
                             
                               e 
                               
                                 i 
                                  
                                 
                                     
                                 
                               
                             
                             
                               f 
                                
                               
                                 ( 
                                 
                                   
                                     e 
                                     1 
                                   
                                   , 
                                   … 
                                    
                                   
                                       
                                   
                                   , 
                                   
                                     e 
                                     n 
                                   
                                 
                                 ) 
                               
                             
                           
                           ) 
                         
                         
                           - 
                           1 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     10 
                     ) 
                   
                 
               
             
           
         
       
     
         [0068]    It would be noted that the error can depend on the neighborhood of the entity. Assume for example the Euclidean distance to the closest entity in the second entity as an error measure. A misaligned entity in a dense region may have smaller distance than a correctly aligned entity in a sparse region. Examples of the presently disclosed subject matter, include an error adjustment feature, as described below. 
         [0069]    According to examples of the presently disclosed subject matter, each entity error can be adjusted based on parameters extracted from a neighborhood of the entity in the 3D model. According to examples of the presently disclosed subject matter, when a 3D registration result or an estimated 3D registration is available, the error adjustment may also be based on parameters extracted from the neighborhood or region of the second 3D model that the entity is nearest to. Further by a way of example, the adjustment can also be based on other parameters related to the entity, such as accuracy estimation provided by the 3D model capturing process for this entity, and so forth. 
         [0070]    Let p i  be parameters corresponding to the i-th entity, and let  e i    be the original error associated with the i-th entity. According to examples of the presently disclosed subject matter,  e i    can be replaced with an adjusted error as defined in the following formula (formula (11)), 
         [0000]        e   i   =g (   e   i   , p   i ),   formula (11)
 
         [0000]    where g is a function that takes the original error and parameters related to the entity, and provides a new error that is adjusted according to these parameters. Using this adjusted error, formula (1) for the outliers detection criterion becomes, 
         [0000]        g (   e   i   , p   i )&gt; f ( g (   e   1   , p   1 ), . . . ,  g (   e   n   , p   n )).   formula (12)
 
         [0000]    Similarly, plugging formula (11) into formulas formula (2)-formula (10) produce new formulas for assigning weights and measuring quality. For instance, plugging formula (11) into formula (3) produce the following weight assignment formula (formula (13)), 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       w 
                       i 
                     
                     = 
                     
                       
                         exp 
                          
                         
                           ( 
                           
                             - 
                             
                               
                                 g 
                                  
                                 
                                   ( 
                                   
                                     
                                       
                                         e 
                                         i 
                                       
                                       _ 
                                     
                                     , 
                                     
                                       p 
                                       i 
                                     
                                   
                                   ) 
                                 
                               
                               
                                 f 
                                  
                                 
                                   ( 
                                   
                                     
                                       g 
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               e 
                                               1 
                                             
                                             _ 
                                           
                                           , 
                                           
                                             p 
                                             1 
                                           
                                         
                                         ) 
                                       
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       g 
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               e 
                                               n 
                                             
                                             _ 
                                           
                                           , 
                                           
                                             p 
                                             n 
                                           
                                         
                                         ) 
                                       
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                           ) 
                         
                       
                       
                         
                           ∑ 
                           
                             j 
                             = 
                             1 
                           
                           n 
                         
                          
                         
                           exp 
                            
                           
                             ( 
                             
                               - 
                               
                                 
                                   g 
                                    
                                   
                                     ( 
                                     
                                       
                                         
                                           e 
                                           j 
                                         
                                         _ 
                                       
                                       , 
                                       
                                         p 
                                         j 
                                       
                                     
                                     ) 
                                   
                                 
                                 
                                   f 
                                    
                                   
                                     ( 
                                     
                                       
                                         g 
                                          
                                         
                                           ( 
                                           
                                             
                                               
                                                 e 
                                                 1 
                                               
                                               _ 
                                             
                                             , 
                                             
                                               p 
                                               1 
                                             
                                           
                                           ) 
                                         
                                       
                                       , 
                                       … 
                                        
                                       
                                           
                                       
                                       , 
                                       
                                         g 
                                          
                                         
                                           ( 
                                           
                                             
                                               
                                                 e 
                                                 n 
                                               
                                               _ 
                                             
                                             , 
                                             
                                               p 
                                               n 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     13 
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    plugging formula (11) into formula (6) produce the following weight update formula (formula (14)), 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       w 
                       i 
                       
                         t 
                         + 
                         1 
                       
                     
                     = 
                     
                       
                         w 
                         i 
                         t 
                       
                       · 
                       
                         exp 
                          
                         
                           ( 
                           
                             - 
                             
                               
                                 g 
                                  
                                 
                                   ( 
                                   
                                     
                                       
                                         e 
                                         i 
                                       
                                       _ 
                                     
                                     , 
                                     
                                       p 
                                       i 
                                     
                                   
                                   ) 
                                 
                               
                               
                                 f 
                                  
                                 
                                   ( 
                                   
                                     
                                       g 
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               e 
                                               1 
                                             
                                             _ 
                                           
                                           , 
                                           
                                             p 
                                             1 
                                           
                                         
                                         ) 
                                       
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       g 
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               e 
                                               n 
                                             
                                             _ 
                                           
                                           , 
                                           
                                             p 
                                             n 
                                           
                                         
                                         ) 
                                       
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     14 
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    plugging formula (11) into formula (9) produce the following quality measure formula (formula (15)), 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       q 
                       i 
                     
                     = 
                     
                       exp 
                        
                       
                         ( 
                         
                           - 
                           
                             
                               g 
                                
                               
                                 ( 
                                 
                                   
                                     
                                       e 
                                       i 
                                     
                                     _ 
                                   
                                   , 
                                   
                                     p 
                                     i 
                                   
                                 
                                 ) 
                               
                             
                             
                               f 
                                
                               
                                 ( 
                                 
                                   
                                     g 
                                      
                                     
                                       ( 
                                       
                                         
                                           
                                             e 
                                             1 
                                           
                                           _ 
                                         
                                         , 
                                         
                                           p 
                                           1 
                                         
                                       
                                       ) 
                                     
                                   
                                   , 
                                   … 
                                    
                                   
                                       
                                   
                                   , 
                                   
                                     g 
                                      
                                     
                                       ( 
                                       
                                         
                                           
                                             e 
                                             n 
                                           
                                           _ 
                                         
                                         , 
                                         
                                           p 
                                           n 
                                         
                                       
                                       ) 
                                     
                                   
                                 
                                 ) 
                               
                             
                           
                         
                         ) 
                       
                     
                   
                   , 
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     15 
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    and so forth. 
         [0071]    According to examples of the presently disclosed subject matter, as an example, in case distance is used as an error measure, p i  can be set to be the distance to the second nearest entity in the second entity, and use, e i =ġ( e i   ,p i )= e i   /p i , which produces an adjusted error, 0&lt;e i ≦1, that is higher when the difference between the two distances is smaller. As another example, p i  can be set to be a positive measure of the density around the matched entities in the two or more 3D models, and use, e i ={umlaut over (g)}( e i   ,p i )= e i   /p i , or, 
         [0000]    
       
         
           
             
               
                 e 
                 i 
               
               = 
               
                 
                   
                     g 
                     … 
                   
                    
                   
                     ( 
                     
                       
                         
                           e 
                           i 
                         
                         _ 
                       
                       , 
                       
                         p 
                         i 
                       
                     
                     ) 
                   
                 
                 = 
                 
                   
                     
                       e 
                       i 
                     
                     _ 
                   
                   
                     p 
                     
                       i 
                        
                       
                           
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where both produce an adjusted error e i  that is higher when the density is smaller. An additional example includes setting p i  to a non-negative estimate of the accuracy of the entity, for example when such estimate is provided by the capturing mechanism. In such case, e i =ĝ( e i   /p i )= e i   /p i  can be used, which produces an adjusted error, e i , that is lower when the accuracy estimation is higher. Other possibilities include any combination of the above, and so forth. 
         [0072]    When dealing with an iterative 3D registration algorithm, the error adjustment process can be repeated after each iteration. In such case, denote the process can take place prior to the first iteration with t=0, and the variables in that process can be denoted by a superscript zero. For example, the notation e i  becomes e i   0 , p i  becomes p i   0 ,  e i    becomes  e i   0   , w i  becomes w i   0 , and so on. Denote the process that takes place after the t-th iteration with a superscript t. For example, the notation e i  becomes e i   t , p i  becomes p i   t ,  e i    becomes  e i   t   , w i  becomes w i   t , and so on. 
         [0073]    According to examples of the presently disclosed subject matter, in the case of iterative 3D registration algorithm, t can be added as an additional parameter to our error adjustment process. Therefore the error adjustment becomes, 
         [0000]        e   i   t   =g (   e   i   t   , p   i   t   ,t ),   formula (16)
 
         [0000]    where g is a function that takes the original error and parameters related to the entity, and produce a new error that is adjust according to these parameters. Plugging the adjusted error from formula (16) into the outliers detection criterion of formula (1), the outliers detection criterion becomes, 
         [0000]        g (   e   i   t   , p   i   t   ,t )&gt; f ( g (   e   1   t   , p   1   t   ,t ), . . . ,  g (   e   n   t   , p   n   t   ,t )).   formula (17)
 
         [0000]    Similarly, plugging formula (16) into formulas formula (2)-formula (7) produce new formulas for assigning weights. For instance, plugging formula (16) into formula (3) produce the following weight assignment formula (formula (18)), 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       w 
                       i 
                       t 
                     
                     = 
                     
                       
                         exp 
                          
                         
                           ( 
                           
                             - 
                             
                               
                                 g 
                                  
                                 
                                   ( 
                                   
                                     
                                       
                                         e 
                                         i 
                                         t 
                                       
                                       _ 
                                     
                                     , 
                                     
                                       p 
                                       i 
                                       t 
                                     
                                     , 
                                     t 
                                   
                                   ) 
                                 
                               
                               
                                 f 
                                  
                                 
                                   ( 
                                   
                                     
                                       g 
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               e 
                                               1 
                                               t 
                                             
                                             _ 
                                           
                                           , 
                                           
                                             p 
                                             1 
                                             t 
                                           
                                           , 
                                           t 
                                         
                                         ) 
                                       
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       g 
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               e 
                                               n 
                                               t 
                                             
                                             _ 
                                           
                                           , 
                                           
                                             p 
                                             n 
                                             t 
                                           
                                           , 
                                           t 
                                         
                                         ) 
                                       
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                           ) 
                         
                       
                       
                         
                           ∑ 
                           
                             j 
                             = 
                             1 
                           
                           n 
                         
                          
                         
                           exp 
                            
                           
                             ( 
                             
                               - 
                               
                                 
                                   g 
                                    
                                   
                                     ( 
                                     
                                       
                                         
                                           e 
                                           j 
                                           t 
                                         
                                         _ 
                                       
                                       , 
                                       
                                         p 
                                         j 
                                         t 
                                       
                                       , 
                                       t 
                                     
                                     ) 
                                   
                                 
                                 
                                   f 
                                    
                                   
                                     ( 
                                     
                                       
                                         g 
                                          
                                         
                                           ( 
                                           
                                             
                                               
                                                 e 
                                                 1 
                                               
                                               _ 
                                             
                                             , 
                                             
                                               p 
                                               1 
                                               t 
                                             
                                             , 
                                             t 
                                           
                                           ) 
                                         
                                       
                                       , 
                                       … 
                                        
                                       
                                           
                                       
                                       , 
                                       
                                         g 
                                          
                                         
                                           ( 
                                           
                                             
                                               
                                                 e 
                                                 n 
                                               
                                               _ 
                                             
                                             , 
                                             
                                               p 
                                               n 
                                               t 
                                             
                                             , 
                                             t 
                                           
                                           ) 
                                         
                                       
                                     
                                     ) 
                                   
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     18 
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    plugging formula (16) into formula (6) produce the following weight update formula (formula (19)), 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       w 
                       i 
                       
                         t 
                         + 
                         1 
                       
                     
                     = 
                     
                       
                         w 
                         i 
                         t 
                       
                       · 
                       
                         exp 
                          
                         
                           ( 
                           
                             - 
                             
                               
                                 g 
                                  
                                 
                                   ( 
                                   
                                     
                                       
                                         e 
                                         i 
                                         t 
                                       
                                       _ 
                                     
                                     , 
                                     
                                       p 
                                       i 
                                       t 
                                     
                                     , 
                                     t 
                                   
                                   ) 
                                 
                               
                               
                                 f 
                                  
                                 
                                   ( 
                                   
                                     
                                       g 
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               e 
                                               1 
                                               t 
                                             
                                             _ 
                                           
                                           , 
                                           
                                             p 
                                             1 
                                             t 
                                           
                                           , 
                                           t 
                                         
                                         ) 
                                       
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       g 
                                        
                                       
                                         ( 
                                         
                                           
                                             
                                               e 
                                               n 
                                               t 
                                             
                                             _ 
                                           
                                           , 
                                           
                                             p 
                                             n 
                                             t 
                                           
                                           , 
                                           t 
                                         
                                         ) 
                                       
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   formula 
                    
                   
                       
                   
                    
                   
                     ( 
                     19 
                     ) 
                   
                 
               
             
           
         
       
     
         [0000]    and so forth. 
         [0074]    According to examples of the presently disclosed subject matter, in the case of iterative 3D registration algorithm, the parameters related to an entity may also be based on information from previous iterations. For example, p i   t  can be set to be a measure of the change in estimated location after transformation of an entity caused by the last iteration, and, e i   t ={hacek over (g)}( e i   t   ,p i   t ,t)= e i   t   +p i   t  can be used, therefore increasing the error of entities with a wide change in estimated location, assuming that a wide change is evidence to uncertainty in the location estimation. As another example, p i   t  can be set to be the original error in the previous iteration, p i   t = e i   t−1   , and use, e i   t ={tilde over (g)}( e i   t   ,p i   t ,t)= e i   t   +p i   t /2, therefore balancing the current error estimation with the previous one. Other possibilities include any combination of the above, and so forth. 
         [0075]    According to further examples of the presently disclosed subject matter, as example of using the parameter t, consider an adjustment function that is a linear sum of two components, where the coefficients are controlled by t in order to change the weight of the two functions based on the number of iterations, 
         [0000]        e   i   t   =a ( t )· g ′(   e   i   t   , p   i   t   ,t )+ b ( t )· g ″(   e   i   t   , p   i   t   ,t ).   formula (20)
 
         [0076]    Consider an outliers detection criterion of the form, 
         [0000]      e i   t &gt;θ,   formula (21)
 
         [0000]    where e i   t  is an error associated with the i-th entity after the t-th iteration, possibly after adjustment as described above or by any other method, and θ is a threshold calculated in any way and using any set of parameters, possibly as described in formula (17) where, θ=f(g( e 1   t   ,p 1   t ,t), . . . , g( e n   t   ,p n   t ,t)). According to examples of the presently disclosed subject matter, in the case of an iterative 3D registration algorithm, any criterion such the one in formula (21) can be adjusted to, 
         [0000]        e   i   t   +h ( p   i   t   ,t )&gt;θ.   formula (22)
 
         [0000]    Note that since h(p i   t ,t) is not part of the adjusted error, it does not affect the value of the threshold θ. 
         [0077]    According to examples of the presently disclosed subject matter, p i   t  can, for example, be set to be a measure of the overall change in estimated location after transformation of an entity caused by the last m iteration, where m is a constant number, and use, h(p i   t ,t)={dot over (h)}(p i   t ,t)=p i   t ·k(t), where k(t) can be a monotonically increasing function, k(0)≦k(1)≦k(2)≦ . . . . This assumes that large changes in the estimated location of an entity in the last iterations are evidence that the entity estimated location is far from convergence, and therefore promotes disregarding such entities. Multiplying it with the function k(t) increases the susceptibility of entities with larger changes in their estimated location to the outliers detection criterion as the algorithm progresses, therefore promoting the removal of such points as time passes. As another example, p i   t  can be set to be the decrease in the original error from the previous iteration, p i   t = e i   t−1   − e i   t   , and use, h(p i   t ,t)={umlaut over (h)}(p i   t ,t)=k(t)/p i   t , therefore promoting the disregard of entities with smaller decrease in error. Again, multiplying it with the function k(t) increases the susceptibility of entities with larger changes in their estimated location to the outliers detection criterion as the algorithm progresses, therefore promoting the removal of such points as time passes. Other possibilities include any combination of the above, and so forth. 
         [0078]    In a further aspect, the above scheme can also be applied to 2D models. Here, the algorithm is a 2D registration algorithm. Assuming that at least one of the 2D model is constructed out of entities, an error is calculated for each entity. The error can then be adjusted, used in the assignment of weights and/or update of weights for the different entities, used in the calculation of quality associated with each entity, and so forth. 
         [0079]    In a further aspect, the above scheme can also be applied to a registration of one or more 2D models, and one or more 3D models. 
         [0080]    In a further aspect, the adjusted errors can be used in a stopping criterion for an iterative 3D registration algorithm, replacing the original errors with the adjusted errors in the stopping criterion.