Hugin trunk
0.1
Loading...
Searching...
No Matches
hugin_cpfind
localfeatures
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
29
namespace
lfeat
30
{
31
32
struct
PointMatch
33
{
34
35
PointMatch
(
KeyPointPtr
&
aPM1
,
KeyPointPtr
&
aPM2
) :
36
_img1_x
(
aPM1
->_x),
_img1_y
(
aPM1
->_y),
_img2_x
(
aPM2
->_x),
_img2_y
(
aPM2
->_y),
37
_img1_kp
(
aPM1
),
_img2_kp
(
aPM2
) {};
38
39
double
_img1_x
,
_img1_y
,
_img2_x
,
_img2_y
;
40
41
// hold a reference to original keypoint
42
KeyPointPtr
_img1_kp
;
43
KeyPointPtr
_img2_kp
;
44
45
//void print()
46
//{
47
// std::cout << _img1_x << " " << _img2_x << " " << _img1_y << " " << _img2_y << std::endl;
48
//}
49
50
};
51
52
typedef
std::shared_ptr<PointMatch>
PointMatchPtr
;
53
typedef
std::vector<PointMatchPtr>
PointMatchVector_t
;
54
55
class
PointMatchPtrSort
56
{
57
public
:
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
KeyPoint.h
lfeat::PointMatchPtrSort
Definition
PointMatch.h:56
lfeat::PointMatchPtrSort::operator()
bool operator()(const PointMatchPtr &a, const PointMatchPtr &b) const
Definition
PointMatch.h:58
lfeat
Definition
TestCode.h:27
lfeat::KeyPointPtr
std::shared_ptr< KeyPoint > KeyPointPtr
Definition
KeyPoint.h:110
lfeat::PointMatchPtr
std::shared_ptr< PointMatch > PointMatchPtr
Definition
PointMatch.h:52
lfeat::PointMatchVector_t
std::vector< PointMatchPtr > PointMatchVector_t
Definition
PointMatch.h:53
lfeat::PointMatch
Definition
PointMatch.h:33
lfeat::PointMatch::_img1_x
double _img1_x
Definition
PointMatch.h:39
lfeat::PointMatch::_img1_y
double _img1_y
Definition
PointMatch.h:39
lfeat::PointMatch::_img2_y
double _img2_y
Definition
PointMatch.h:39
lfeat::PointMatch::_img2_x
double _img2_x
Definition
PointMatch.h:39
lfeat::PointMatch::PointMatch
PointMatch(KeyPointPtr &aPM1, KeyPointPtr &aPM2)
Definition
PointMatch.h:35
lfeat::PointMatch::_img1_kp
KeyPointPtr _img1_kp
Definition
PointMatch.h:42
lfeat::PointMatch::_img2_kp
KeyPointPtr _img2_kp
Definition
PointMatch.h:43
threshold
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
Generated on Tue Sep 1 2026 20:52:07 for Hugin trunk by
1.9.8