mirror of
https://github.com/balajsra/EECS-442-WN19-DIC-Project.git
synced 2025-09-04 09:53:19 +00:00
Reorganize Sift_Distance.py
* Put Shift_Distance code into sift_distance function * Add import statements for numpy and opencv
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
sift = cv.xfeatures2d.SIFT_create()
|
import numpy as np
|
||||||
|
import cv2
|
||||||
|
|
||||||
|
|
||||||
|
def sift_distance():
|
||||||
|
sift = cv2.xfeatures2d.SIFT_create()
|
||||||
original_kp, original_des = sift.detectAndCompute(left,None)
|
original_kp, original_des = sift.detectAndCompute(left,None)
|
||||||
new_kp, new_des = sift.detectAndCompute(right,None)
|
new_kp, new_des = sift.detectAndCompute(right,None)
|
||||||
|
|
||||||
@@ -21,4 +26,3 @@ z2 = np.array([[complex(c[0],c[1]) for c in pts2]])
|
|||||||
|
|
||||||
# Distance between featured matched keypoints
|
# Distance between featured matched keypoints
|
||||||
FM_dist = abs(z2 - z1)
|
FM_dist = abs(z2 - z1)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user