forked from AlisaLC/CVFeatureMatching
-
Notifications
You must be signed in to change notification settings - Fork 0
/
homography.py
64 lines (46 loc) · 2.12 KB
/
homography.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import cv2
class Homography:
def __init__(self):
pass
def findHomography(self):
raise NotImplementedError
class DefaultHomography(Homography):
def __init__(self):
super().__init__()
def findHomography(self, src_pts, dst_pts, ransacReprojThreshold=5.0):
return cv2.findHomography(src_pts, dst_pts, 0, ransacReprojThreshold)
class LMEDSHomography(Homography):
def __init__(self):
super().__init__()
def findHomography(self, src_pts, dst_pts, ransacReprojThreshold=5.0):
return cv2.findHomography(src_pts, dst_pts, cv2.LMEDS, ransacReprojThreshold)
class RANSACHomography(Homography):
def __init__(self):
super().__init__()
def findHomography(self, src_pts, dst_pts, ransacReprojThreshold=5.0):
return cv2.findHomography(src_pts, dst_pts, cv2.RANSAC, ransacReprojThreshold)
class USACMAGSACHomography(Homography):
def __init__(self):
super().__init__()
def findHomography(self, src_pts, dst_pts, ransacReprojThreshold=5.0):
return cv2.findHomography(src_pts, dst_pts, cv2.USAC_MAGSAC, ransacReprojThreshold)
class RHOHomography(Homography):
def __init__(self):
super().__init__()
def findHomography(self, src_pts, dst_pts, ransacReprojThreshold=5.0):
return cv2.findHomography(src_pts, dst_pts, cv2.RHO, ransacReprojThreshold)
class USACPARALLELHomography(Homography):
def __init__(self):
super().__init__()
def findHomography(self, src_pts, dst_pts, ransacReprojThreshold=5.0):
return cv2.findHomography(src_pts, dst_pts, cv2.USAC_PARALLEL, ransacReprojThreshold)
class USACFASTHomography(Homography):
def __init__(self):
super().__init__()
def findHomography(self, src_pts, dst_pts, ransacReprojThreshold=5.0):
return cv2.findHomography(src_pts, dst_pts, cv2.USAC_FAST, ransacReprojThreshold)
class USACACCURATEHomography(Homography):
def __init__(self):
super().__init__()
def findHomography(self, src_pts, dst_pts, ransacReprojThreshold=5.0):
return cv2.findHomography(src_pts, dst_pts, cv2.USAC_ACCURATE, ransacReprojThreshold)