read_spa.h
Go to the documentation of this file.
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2009, Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of the Willow Garage nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 // convert a file in Freiburg's VERTEX / EDGE format into a set of constraints
36 
37 #ifndef SBA_READ_SPA_H
38 #define SBA_READ_SPA_H
39 
40 #ifndef EIGEN_USE_NEW_STDVECTOR
41 #define EIGEN_USE_NEW_STDVECTOR
42 #endif // EIGEN_USE_NEW_STDVECTOR
43 
44 #define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat(10)
45 #include <Eigen/Eigen>
46 #include <vector>
47 
48 struct tinfo
49 {
50  int pn; // index of point
51  int fn0, fn1; // index of frames
52  int fpn0, fpn1; // local point index in frame
53  double x0,y0,z0,u0,v0; // local XYZ coords and projection
54  double x1,y1,z1,u1,v1; // local XYZ coords and projection
55 };
56 
57 int
58 ReadSPAFile(char *fin, // input file
59  // node translation
60  std::vector< Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d> > &ntrans,
61  // node rotation
62  std::vector< Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d> > &nqrot,
63  // constraint indices
64  std::vector< Eigen::Vector2i, Eigen::aligned_allocator<Eigen::Vector2i> > &cind,
65  // constraint local translation
66  std::vector< Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d> > &ctrans,
67  // constraint local rotation as quaternion
68  std::vector< Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d> > &cqrot,
69  // constraint covariance
70  std::vector< Eigen::Matrix<double,6,6>, Eigen::aligned_allocator<Eigen::Matrix<double,6,6> > > &cvar,
71  // track info: point projections, see format description in IntelSeattle files
72  std::vector<struct tinfo> &tracks
73  );
74 
75 int
76 ReadSPA2dFile(char *fin, // input file
77  // node translation
78  std::vector< Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> > &ntrans,
79  // node rotation
80  std::vector< double > &nqrot,
81  // constraint indices
82  std::vector< Eigen::Vector2i, Eigen::aligned_allocator<Eigen::Vector2i> > &cind,
83  // constraint local translation
84  std::vector< Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> > &ctrans,
85  // constraint local rotation as quaternion
86  std::vector< double > &cqrot,
87  // constraint covariance
88  std::vector< Eigen::Matrix<double,3,3>, Eigen::aligned_allocator<Eigen::Matrix<double,3,3> > > &cvar,
89  // scan points
90  std::vector< std::vector< Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d> > > &scans
91  );
92 
93 #endif
double y1
Definition: read_spa.h:54
double u0
Definition: read_spa.h:53
int ReadSPAFile(char *fin, std::vector< Eigen::Vector3d, Eigen::aligned_allocator< Eigen::Vector3d > > &ntrans, std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d > > &nqrot, std::vector< Eigen::Vector2i, Eigen::aligned_allocator< Eigen::Vector2i > > &cind, std::vector< Eigen::Vector3d, Eigen::aligned_allocator< Eigen::Vector3d > > &ctrans, std::vector< Eigen::Vector4d, Eigen::aligned_allocator< Eigen::Vector4d > > &cqrot, std::vector< Eigen::Matrix< double, 6, 6 >, Eigen::aligned_allocator< Eigen::Matrix< double, 6, 6 > > > &cvar, std::vector< struct tinfo > &tracks)
int fn0
Definition: read_spa.h:51
double x0
Definition: read_spa.h:53
int ReadSPA2dFile(char *fin, std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > &ntrans, std::vector< double > &nqrot, std::vector< Eigen::Vector2i, Eigen::aligned_allocator< Eigen::Vector2i > > &cind, std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > &ctrans, std::vector< double > &cqrot, std::vector< Eigen::Matrix< double, 3, 3 >, Eigen::aligned_allocator< Eigen::Matrix< double, 3, 3 > > > &cvar, std::vector< std::vector< Eigen::Vector2d, Eigen::aligned_allocator< Eigen::Vector2d > > > &scans)
double v0
Definition: read_spa.h:53
int fpn1
Definition: read_spa.h:52
double u1
Definition: read_spa.h:54
int fpn0
Definition: read_spa.h:52
double z1
Definition: read_spa.h:54
double y0
Definition: read_spa.h:53
double v1
Definition: read_spa.h:54
Definition: read_spa.h:48
int pn
Definition: read_spa.h:50
double x1
Definition: read_spa.h:54
double z0
Definition: read_spa.h:53
int fn1
Definition: read_spa.h:51


sparse_bundle_adjustment
Author(s):
autogenerated on Fri Apr 3 2020 03:30:53