1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /* $Id: db_framestitching.h,v 1.2 2011/06/17 14:03:31 mbansal Exp $ */
18 
19 #ifndef DB_FRAMESTITCHING_H
20 #define DB_FRAMESTITCHING_H
21 /*!
22  * \defgroup FrameStitching Frame Stitching (2D and 3D homography estimation)
23  */
24 /*\{*/
25 
26 
27 /*****************************************************************
28 *    Lean and mean begins here                                   *
29 *****************************************************************/
30 /*!
31  * \defgroup LMFrameStitching (LM) Frame Stitching (2D and 3D homography estimation)
32  */
33 /*\{*/
34 
35 /*!
36 Find scale, rotation and translation of the similarity that
37 takes the nr_points inhomogenous 3D points X to Xp
38 (left to right according to Horn), i.e. for the homogenous equivalents
39 Xp and X we would have
40 \code
41     Xp~
42     [sR t]*X
43     [0  1]
44 \endcode
45 If orientation_preserving is true, R is restricted such that det(R)>0.
46 allow_scaling, allow_rotation and allow_translation allow s,R and t
47 to differ from 1,Identity and 0
48 
49 Full similarity takes the following on 550MHz:
50 \code
51 4.5 microseconds with       3 points
52 4.7 microseconds with       4 points
53 5.0 microseconds with       5 points
54 5.2 microseconds with       6 points
55 5.8 microseconds with      10 points
56 20  microseconds with     100 points
57 205 microseconds with    1000 points
58 2.9 milliseconds with   10000 points
59 50  milliseconds with  100000 points
60 0.5 seconds      with 1000000 points
61 \endcode
62 Without orientation_preserving:
63 \code
64 4 points is minimal for (s,R,t) (R,t)
65 3 points is minimal for (s,R) (R)
66 2 points is minimal for (s,t)
67 1 point is minimal for  (s) (t)
68 \endcode
69 With orientation_preserving:
70 \code
71 3 points is minimal for (s,R,t) (R,t)
72 2 points is minimal for (s,R) (s,t) (R)
73 1 point is minimal for  (s) (t)
74 \endcode
75 
76 \param scale                    scale
77 \param R                        rotation
78 \param t                        translation
79 \param Xp                       inhomogenouse 3D points in first coordinate system
80 \param X                        inhomogenouse 3D points in second coordinate system
81 \param nr_points                number of points
82 \param orientation_preserving   if true, R is restricted such that det(R)>0.
83 \param allow_scaling            estimate scale
84 \param allow_rotation           estimate rotation
85 \param allow_translation        estimate translation
86 */
87 DB_API void db_StitchSimilarity3DRaw(double *scale,double R[9],double t[3],
88                             double **Xp,double **X,int nr_points,int orientation_preserving=1,
89                             int allow_scaling=1,int allow_rotation=1,int allow_translation=1);
90 
91 
92 /*\}*/
93 
94 #endif /* DB_FRAMESTITCHING_H */
95