Blender V4.3
libmv/simple_pipeline/tracks.h
Go to the documentation of this file.
1// Copyright (c) 2011 libmv authors.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to
5// deal in the Software without restriction, including without limitation the
6// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7// sell copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19// IN THE SOFTWARE.
20
21#ifndef LIBMV_SIMPLE_PIPELINE_TRACKS_H_
22#define LIBMV_SIMPLE_PIPELINE_TRACKS_H_
23
24#include "libmv/base/vector.h"
26
27namespace libmv {
28
44// TODO(sergey): Consider using comment for every member separately
45// instead of having one giantic comment block.
46struct Marker {
47 int image;
48 int track;
49 double x, y;
50 double weight;
51};
52
65class Tracks {
66 public:
67 Tracks() {}
68
69 // Copy constructor for a tracks object.
70 Tracks(const Tracks& other);
71
73 explicit Tracks(const vector<Marker>& markers);
74
88 // TODO(sergey): Consider using InsetWeightedMarker istead of using
89 // stupid default value?
90 void Insert(int image, int track, double x, double y, double weight = 1.0);
91
94
96 vector<Marker> MarkersForTrack(int track) const;
97
99 vector<Marker> MarkersInImage(int image) const;
100
102 vector<Marker> MarkersInBothImages(int image1, int image2) const;
103
110 vector<Marker> MarkersForTracksInBothImages(int image1, int image2) const;
111
113 Marker MarkerInImageForTrack(int image, int track) const;
114
116 void RemoveMarkersForTrack(int track);
117
119 void RemoveMarker(int image, int track);
120
122 int MaxImage() const;
123
125 int MaxTrack() const;
126
128 int NumMarkers() const;
129
130 private:
131 vector<Marker> markers_;
132};
133
135 int image,
136 Mat* coordinates);
137
138} // namespace libmv
139
140#endif // LIBMV_SIMPLE_PIPELINE_MARKERS_H_
void RemoveMarker(int image, int track)
Removes the marker in image belonging to track.
vector< Marker > MarkersInImage(int image) const
Returns all the markers visible in image.
vector< Marker > MarkersInBothImages(int image1, int image2) const
Returns all the markers visible in image1 and image2.
void RemoveMarkersForTrack(int track)
Removes all the markers belonging to track.
int MaxTrack() const
Returns the maximum track identifier used.
vector< Marker > AllMarkers() const
Returns all the markers.
vector< Marker > MarkersForTracksInBothImages(int image1, int image2) const
int MaxImage() const
Returns the maximum image identifier used.
void Insert(int image, int track, double x, double y, double weight=1.0)
vector< Marker > MarkersForTrack(int track) const
Returns all the markers belonging to a track.
int NumMarkers() const
Returns the number of markers.
Marker MarkerInImageForTrack(int image, int track) const
Returns the marker in image belonging to track.
const vector< Marker > & markers
Eigen::MatrixXd Mat
Definition numeric.h:60
void CoordinatesForMarkersInImage(const vector< Marker > &markers, int image, Mat *coordinates)