Hugin trunk 0.1
Loading...
Searching...
No Matches
PointMatch.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2007-2008 Anael Orlinski
3*
4* This file is part of Panomatic.
5*
6* Panomatic is free software; you can redistribute it and/or modify
7* it under the terms of the GNU General Public License as published by
8* the Free Software Foundation; either version 2 of the License, or
9* (at your option) any later version.
10*
11* Panomatic 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
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with Panomatic; if not, write to the Free Software
18* <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef __lfeatPointMatch_h
22#define __lfeatPointMatch_h
23
24#include <memory>
25#include <vector>
26
27#include "KeyPoint.h"
28
29namespace lfeat
30{
31
33{
34
38
40
41 // hold a reference to original keypoint
44
45 //void print()
46 //{
47 // std::cout << _img1_x << " " << _img2_x << " " << _img1_y << " " << _img2_y << std::endl;
48 //}
49
50};
51
52typedef std::shared_ptr<PointMatch> PointMatchPtr;
53typedef std::vector<PointMatchPtr> PointMatchVector_t;
54
56{
57public:
58 inline bool operator() (const PointMatchPtr& a, const PointMatchPtr& b) const
59 {
60 if (a->_img1_kp->_score < b->_img1_kp->_score)
61 {
62 return true;
63 }
64 else if (a->_img1_kp->_score > b->_img1_kp->_score)
65 {
66 return false;
67 }
68 else
69 {
70 // same score, order by _x coordinate (this also removes duplicate matches)
71 return (a->_img1_kp->_y < b->_img1_kp->_y);
72 }
73 }
74};
75
76}
77
78#endif // __lfeatPointMatch_h
bool operator()(const PointMatchPtr &a, const PointMatchPtr &b) const
Definition PointMatch.h:58
std::shared_ptr< KeyPoint > KeyPointPtr
Definition KeyPoint.h:110
std::shared_ptr< PointMatch > PointMatchPtr
Definition PointMatch.h:52
std::vector< PointMatchPtr > PointMatchVector_t
Definition PointMatch.h:53
PointMatch(KeyPointPtr &aPM1, KeyPointPtr &aPM2)
Definition PointMatch.h:35
KeyPointPtr _img1_kp
Definition PointMatch.h:42
KeyPointPtr _img2_kp
Definition PointMatch.h:43
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41