Question: Write a function that saves the image as a specified file. ( 1 5 % ) - In the parameter list, it supplies two
Write a function that saves the image as a specified file.
In the parameter list, it supplies two image filenames, k ratio and output filename
Suppose the first image is the query, the second image is the scene
Load the images and convert them to grayscale
Run SIFT detectors on both grayscale images
Use knnMatch with the value of k to compare the SIFT descriptors
Use a ratio test with the value of ratio to identify the common descriptors
Use drawMatchesKnn to draw the list of matches onto the images
Stack the two images horizontally
Save the plots as the specified output filename. Do not show the plots.
This problem is about image processing and data visualization.
Note: You may refer to cvBFMatcher:
Code:
# Problem
def problemimageA imageB, outputqjpg:
# write your logic here
pltsavefigoutput # do not show the plt
Execution:
imageA "imageajpg
imageB "imagebjpg
problemimageA imageB, qpng
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
