Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started