You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
I'm trying to use AKAZE with Delphi, but I haven't been successful so far.
I would appreciate any advice you can provide.
Ultimately, I'd like to achieve the following, but I'm stumbling at the beginning with
akaze = cv2.AKAZE_create().
ref_matched_kpts = np.float32(
[float_kp[m[0].queryIdx].pt for m in good_matches]).reshape(-1, 1, 2)
sensed_matched_kpts = np.float32(
[ref_kp[m[0].trainIdx].pt for m in good_matches]).reshape(-1, 1, 2)
H, status = cv2.findHomography(
ref_matched_kpts, sensed_matched_kpts, cv.RANSAC, 5.0)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
I'm trying to use AKAZE with Delphi, but I haven't been successful so far.
I would appreciate any advice you can provide.
Ultimately, I'd like to achieve the following, but I'm stumbling at the beginning with
akaze = cv2.AKAZE_create().
import numpy as np
import cv2
ref_img = cv2.imread('Lenna.bmp')
float_img = cv2.imread('Lenna45.bmp')
akaze = cv2.AKAZE_create()
float_kp, float_des = akaze.detectAndCompute(float_img, None)
ref_kp, ref_des = akaze.detectAndCompute(ref_img, None)
bf = cv2.BFMatcher()
matches = bf.knnMatch(float_des, ref_des, k=2)
good_matches = []
for m, n in matches:
if m.distance < 0.5 * n.distance:
good_matches.append([m])
matches_img = cv2.drawMatchesKnn(
float_img,
float_kp,
ref_img,
ref_kp,
good_matches,
None,
flags=cv2.DrawMatchesFlags_NOT_DRAW_SINGLE_POINTS)
cv2.imwrite('matches.jpg', matches_img)
ref_matched_kpts = np.float32(
[float_kp[m[0].queryIdx].pt for m in good_matches]).reshape(-1, 1, 2)
sensed_matched_kpts = np.float32(
[ref_kp[m[0].trainIdx].pt for m in good_matches]).reshape(-1, 1, 2)
H, status = cv2.findHomography(
ref_matched_kpts, sensed_matched_kpts, cv.RANSAC, 5.0)
warped_image = cv2.warpPerspective(
float_img, H, (float_img.shape[1], float_img.shape[0]))
cv2.imwrite('warped.jpg', warped_image)
Beta Was this translation helpful? Give feedback.
All reactions