blob: 5fef5f37ef9e7b5e15e4f1d0029096bbb7493ca0 [file] [log] [blame]
Sascha Haeberling8bddf8c2013-08-14 11:20:34 -07001/*
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/*!
36Find scale, rotation and translation of the similarity that
37takes the nr_points inhomogenous 3D points X to Xp
38(left to right according to Horn), i.e. for the homogenous equivalents
39Xp and X we would have
40\code
41 Xp~
42 [sR t]*X
43 [0 1]
44\endcode
45If orientation_preserving is true, R is restricted such that det(R)>0.
46allow_scaling, allow_rotation and allow_translation allow s,R and t
47to differ from 1,Identity and 0
48
49Full similarity takes the following on 550MHz:
50\code
514.5 microseconds with 3 points
524.7 microseconds with 4 points
535.0 microseconds with 5 points
545.2 microseconds with 6 points
555.8 microseconds with 10 points
5620 microseconds with 100 points
57205 microseconds with 1000 points
582.9 milliseconds with 10000 points
5950 milliseconds with 100000 points
600.5 seconds with 1000000 points
61\endcode
62Without orientation_preserving:
63\code
644 points is minimal for (s,R,t) (R,t)
653 points is minimal for (s,R) (R)
662 points is minimal for (s,t)
671 point is minimal for (s) (t)
68\endcode
69With orientation_preserving:
70\code
713 points is minimal for (s,R,t) (R,t)
722 points is minimal for (s,R) (s,t) (R)
731 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*/
87DB_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 */