SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
vector_image_ref.h
Go to the documentation of this file.
1 /*
2  This file is part of the CVD Library.
3 
4  Copyright (C) 2005 The Authors
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 #ifndef CVD_VECTOR_IMAGE_REF_H
22 #define CVD_VECTOR_IMAGE_REF_H
23 
24 #include "TooN.h"
25 #include "image_ref.h"
26 
27 namespace CVD
28 {
32  inline TooN::Vector<2> vec(const ImageRef& ir)
33  {
35  r[0] = ir.x;
36  r[1] = ir.y;
37  return r;
38  }
39 
43  inline ImageRef ir(const TooN::Vector<2>& v)
44  {
45  return ImageRef((int)v[0], (int)v[1]);
46  }
47 
52  {
53  return ImageRef(
54  static_cast<int>(v[0] > 0.0 ? v[0] + 0.5 : v[0] - 0.5),
55  static_cast<int>(v[1] > 0.0 ? v[1] + 0.5 : v[1] - 0.5));
56  }
57 }
58 
59 
60 #endif
int y
The y co-ordinate.
Definition: image_ref.h:180
int x
The x co-ordinate.
Definition: image_ref.h:179
TooN::Vector< 2 > vec(const ImageRef &ir)
ImageRef ir_rounded(const TooN::Vector< 2 > &v)
Definition: abs.h:24
ImageRef ir(const TooN::Vector< 2 > &v)