Laplacian filter

Omar21

Newbie
Joined
Apr 4, 2024
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
14
Hi, I am coding in Verilog for a Laplacian filter where I am using a kernel as the follow
is it correct to insert it like that?

Code:
// Define the Laplacian filter kernel
    reg [31:0] kernel [0:2][0:2];
    initial begin
        kernel[0][0] = 0; kernel[0][1] = 1; kernel[0][2] = 0;
        kernel[1][0] = 1; kernel[1][1] = -4; kernel[1][2] = 1;
        kernel[2][0] = 0; kernel[2][1] = 1; kernel[2][2] = 0;
    end
 

I don't know if values are your concern or the syntax, but Python uses this for a 5th order normalize array.

array([[ 0, 0, 0, 0, 0],
[ 0, 9, -2, -3, -4],
[ 0, -2, 16, -6, -8],
[ 0, -3, -6, 21, -12],
[ 0, -4, -8, -12, 24]])

FWIW.

No comment on syntax. Compiler is happy.
 

Cookies are required to use this site. You must accept them to continue using the site. Learn more…