Question: code outline and main code ( in attached image ) made by me is given complete the code Full compete it should work test it
code outline and main code in attached image made by me is given complete the code Full compete it should work test it with any pic
import numpy as np
from scipy.ndimage import convolve, maximumfilter
def derivativefilters:
Create derivative filters for x and y direction
Returns:
fx: derivative filter in x direction
fy: derivative filter in y direction
fx nparray
fy fxtranspose
return fx fy
def gaussdsigma fsize:
Create a D Gaussian filter
Args:
sigma: width of the Gaussian filter
fsize: h w dimensions of the filter
Returns:
normalized Gaussian filter as h w nparray
m n fsize
x nparangem m
y nparangen n
xx yy npmeshgridx y sparseTrue
g npexpxx yy sigma
return g npsumg
def computehessianimg gauss, fx fy:
Compute elements of the Hessian matrix
Args:
img: numpy array with the image
gauss: Gaussian filter
fx: derivative filter in x direction
fy: derivative filter in y direction
Returns:
Ixx: h w nparray of nd derivatives in x direction
Iyy: h w nparray of nd derivatives in y direction
Ixy: h w nparray of nd derivatives in xy direction
#
# You code here
#
def computecriterionIxx Iyy Ixy sigma:
Compute criterion function
Args:
Ixx: h w nparray of nd derivatives in x direction
Iyy: h w nparray of nd derivatives in y direction
Ixy: h w nparray of nd derivatives in xy direction
sigma: scaling factor
Returns:
criterion: h w nparray of scaled determinant of Hessian matrix
#
# You code here
#
def nonmaxsuppressioncriterion threshold:
Apply nonmaximum suppression to criterion values
and return Hessian interest points
Args:
criterion: h w nparray of criterion function values
threshold: criterion threshold
Returns:
rows: n nparray with ypositions of interest points
cols: n nparray with xpositions of interest points
#
# You code here
##
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
