Question: in julia code: Similarly, define a new subtype EdgeStencil which applies the same operation as maxabsgradfilter in the lecture notes. function image _ maxabsgradfilter (

in julia code: Similarly, define a new subtype EdgeStencil which applies the same operation as maxabsgradfilter in the lecture notes.
function image_maxabsgradfilter(A)
B =0*A
for i =2:size(A,1)-1, j =2:size(A,2)-1
a = A[i-1:i+1, j-1:j+1]
B[i,j]= max(abs(a[3,2]- a[1,2]), abs(a[2,3]- a[2,1]))
end
return B
end
already have
abstract type AbstractStencil end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!