-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
non_gps: added feature matching and offset calculation #62
base: master
Are you sure you want to change the base?
Conversation
kp2, des2 = sift.detectAndCompute(img2,None) | ||
FLANN_INDEX_KDTREE = 1 | ||
index_params = dict(algorithm = FLANN_INDEX_KDTREE, trees = 5) | ||
search_params = dict(checks = 50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you plan to run this to run at a regular rate, it might be wise to iteratively adjust the checks over time to optimize the computation time against the desired output rate. It might depend if you want to run this algorithm on every frame, or skip frames in order to get higher checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood sir! You mean it could be better to do frequent checks on image frames rather than continuous checks on frames, I'll make it to check for features at frequent intervals
if len(good)>MIN_MATCH_COUNT: | ||
src_pts = np.float32([ kp1[m.queryIdx].pt for m in good ]).reshape(-1,1,2) | ||
dst_pts = np.float32([ kp2[m.trainIdx].pt for m in good ]).reshape(-1,1,2) | ||
M, mask = cv.findHomography(src_pts, dst_pts, cv.RANSAC,5.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For finding homography, since the images are in quick succession and not arbitrarily different transforms, are there any algorithms that may be optimized based on an initial guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ryanf55 I am not sure if it is what you are mentioning, but Iterative Closest Point algorithm can serve the purpose. If it is required, I'll add it in the main algorithm
Made code modular and corrected offset and zoom scaling
This is a draft PR, referenced to the #23471 by @rmackay9. As of now, PR provides basic outline for the image feature detection and getting offsets, orientation and zoom. Alongside, we are able to extract new lat and long based on pixel offset. Functions to store old lat and log, alongside altitude data is also added.
Two test images are added for testing purposes.
This is a small part to the whole solution for the issue and it'll be updated frequently under this PR for the complete feature development.