kopia lustrzana https://github.com/OpenDroneMap/ODM
Merge pull request #1696 from pierotofy/321
More memory efficient find_features_homographypull/1704/head
commit
2930927207
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
3.2.0
|
||||
3.2.1
|
||||
|
|
|
@ -504,6 +504,28 @@ def find_features_homography(image_gray, align_image_gray, feature_retention=0.7
|
|||
|
||||
# Detect SIFT features and compute descriptors.
|
||||
detector = cv2.SIFT_create(edgeThreshold=10, contrastThreshold=0.1)
|
||||
|
||||
h,w = image_gray.shape
|
||||
max_dim = max(h, w)
|
||||
|
||||
max_size = 2048
|
||||
if max_dim > max_size:
|
||||
if max_dim == w:
|
||||
f = max_size / w
|
||||
else:
|
||||
f = max_size / h
|
||||
image_gray = cv2.resize(image_gray, None, fx=f, fy=f, interpolation=cv2.INTER_AREA)
|
||||
h,w = image_gray.shape
|
||||
|
||||
if align_image_gray.shape[0] != image_gray.shape[0]:
|
||||
fx = image_gray.shape[1]/align_image_gray.shape[1]
|
||||
fy = image_gray.shape[0]/align_image_gray.shape[0]
|
||||
|
||||
align_image_gray = cv2.resize(align_image_gray, None,
|
||||
fx=fx,
|
||||
fy=fy,
|
||||
interpolation=(cv2.INTER_AREA if (fx < 1.0 and fy < 1.0) else cv2.INTER_LANCZOS4))
|
||||
|
||||
kp_image, desc_image = detector.detectAndCompute(image_gray, None)
|
||||
kp_align_image, desc_align_image = detector.detectAndCompute(align_image_gray, None)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue