CycloPos Header version 1.0.0
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
cyCamera.h
Go to the documentation of this file.
1//*****************************************************************************
2// File : cyCamera.h
3// Module : CycloPos
4// Description : Definition of a camera with a position
5// Author : Anders Modén
6// Product : CycloPos 1.0.0
7//
8// Copyright © 2011- ToolTech Software, Sweden
9//
10// NOTE: CycloPos is a generic VR and Tool positioning library for a mono camera
11//
12//
13// Revision History...
14//
15// Who Date Description
16//
17// AMO 110901 Created file
18//
19//******************************************************************************
20#ifndef __CY_CAMERA_H__
21#define __CY_CAMERA_H__
22
23#include "cyBase.h" // CycloPos generic include
24#include "cyFeature.h"
25#include "cyDisplay.h"
26
27class cyCamera : public gzReference , public gzNameInterface
28{
29public:
30
31 CY_EXPORT cyCamera(const gzString &name="Camera");
32
34
35 // ------ Utils --------------------------------
36
37 CY_EXPORT gzFloatXY undistort(const gzFloatXY &xy,const gzUInt32XY &imageSize,gzBool from_normalized,gzBool to_normalized);
38
39 // ------ Position ----------------------------
40
41 CY_EXPORT gzFloat calcBestPosition(cyDisplay *display,cyMatch *matches,gzBool camera_matched_with_display,gzFloat requiredMaxError=CY_DEFAULT_MIN_PIXEL_DIST,gzUInt32 iterations=CY_DEFAULT_RANSAC_MAX_ITERATIONS);
42
43 CY_EXPORT gzFloat calcBestPosition(gzRefList<cyPositionPattern> &patterns,cyFeature *feature,gzImage *image,gzInt32 singleIndex=-1);
44
45 // ----- Projections --------------------------
46
47 CY_EXPORT gzBool iterateProjection(cyDisplay *display,cyMatch *matches,gzBool camera_matched_with_display,gzFloat requiredMaxError=CY_DEFAULT_MIN_PIXEL_DIST);
48
49 CY_EXPORT gzBool calcProjection(cyDisplay *display,cyMatch *matches,gzBool camera_matched_with_display);
50
51 CY_EXPORT gzFloat getMaxProjectionError(cyDisplay *display,cyMatch *matches,gzBool camera_matched_with_display,gzUInt32 *maxIndex=NULL);
52
53 CY_EXPORT gzFloat estimateRansacProjection(cyDisplay *display,cyMatch *matches,gzBool camera_matched_with_display,gzUInt32 iterations=CY_DEFAULT_RANSAC_MAX_ITERATIONS,gzFloat maxError=CY_DEFAULT_MAX_OUTLIER_DIST);
54
55 CY_EXPORT gzBool updateOutliersFromProjection(cyDisplay *display,cyMatch *matches,gzBool camera_matched_with_display,gzFloat maxError=CY_DEFAULT_MAX_OUTLIER_DIST);
56
57 CY_EXPORT gzVoid setK(KVals k);
58
60
61 // ------ Properties ---------------------------
62
63 GZ_PROPERTY_EXPORT(gzFloat, FX, CY_EXPORT);
64 GZ_PROPERTY_EXPORT(gzFloat, FY, CY_EXPORT);
65
66 GZ_PROPERTY_EXPORT(gzFloat, S, CY_EXPORT);
67
68 GZ_PROPERTY_GET_EXPORT(KVals, K, CY_EXPORT);
69
70 GZ_PROPERTY_EXPORT(gzBool, Taylor, CY_EXPORT);
71
72 GZ_PROPERTY_EXPORT(gzFloat, X0, CY_EXPORT);
73 GZ_PROPERTY_EXPORT(gzFloat, Y0, CY_EXPORT);
74
75 GZ_PROPERTY_EXPORT(gzFloat, XC, CY_EXPORT);
76 GZ_PROPERTY_EXPORT(gzFloat, YC, CY_EXPORT);
77
78 // Calculated from projection
79
80 GZ_PROPERTY_GET_EXPORT(gzFloat, Heading, CY_EXPORT);
81 GZ_PROPERTY_GET_EXPORT(gzFloat, Pitch, CY_EXPORT);
82 GZ_PROPERTY_GET_EXPORT(gzFloat, Roll, CY_EXPORT);
83
84 GZ_PROPERTY_GET_EXPORT(gzVectorf, Position, CY_EXPORT);
85
86private:
87
88 gzMatrixf m_P;
89};
90
91GZ_DECLARE_REFPTR(cyCamera);
92
93
94#endif // __CY_OBSERVER_H__
95
96
97
98
99
100
gzFloat getMaxProjectionError(cyDisplay *display, cyMatch *matches, gzBool camera_matched_with_display, gzUInt32 *maxIndex=NULL)
cyCamera(const gzString &name="Camera")
gzMatrixf getIntrisicMatrix()
gzFloat estimateRansacProjection(cyDisplay *display, cyMatch *matches, gzBool camera_matched_with_display, gzUInt32 iterations=CY_DEFAULT_RANSAC_MAX_ITERATIONS, gzFloat maxError=CY_DEFAULT_MAX_OUTLIER_DIST)
gzBool iterateProjection(cyDisplay *display, cyMatch *matches, gzBool camera_matched_with_display, gzFloat requiredMaxError=CY_DEFAULT_MIN_PIXEL_DIST)
gzBool updateOutliersFromProjection(cyDisplay *display, cyMatch *matches, gzBool camera_matched_with_display, gzFloat maxError=CY_DEFAULT_MAX_OUTLIER_DIST)
gzFloat calcBestPosition(cyDisplay *display, cyMatch *matches, gzBool camera_matched_with_display, gzFloat requiredMaxError=CY_DEFAULT_MIN_PIXEL_DIST, gzUInt32 iterations=CY_DEFAULT_RANSAC_MAX_ITERATIONS)
gzVoid setK(KVals k)
gzFloatXY undistort(const gzFloatXY &xy, const gzUInt32XY &imageSize, gzBool from_normalized, gzBool to_normalized)
gzBool calcProjection(cyDisplay *display, cyMatch *matches, gzBool camera_matched_with_display)
virtual ~cyCamera()
gzFloat calcBestPosition(gzRefList< cyPositionPattern > &patterns, cyFeature *feature, gzImage *image, gzInt32 singleIndex=-1)
Basic include for all CycloPos files. Defines export structures and basic flags and builtin compiled ...
#define CY_EXPORT
Export control of dll functions.
Definition cyBase.h:50
#define CY_DEFAULT_MIN_PIXEL_DIST
Definition cyBase.h:94
#define CY_DEFAULT_RANSAC_MAX_ITERATIONS
Definition cyBase.h:93
#define CY_DEFAULT_MAX_OUTLIER_DIST
Definition cyBase.h:92