I want to implement laplacian edge detection in verilog HDl. Since it is a second order derivative, can anyone please tell me in what way can I implement it in verilog HDL language to a frame?
-
Here's what you need first, learn about [image edge detection](https://en.wikipedia.org/wiki/Edge_detection). Second, learn [digital design using verilog](http://www.asic-world.com/verilog/veritut.html). Third, implement your algorithm in Verilog and when you get stuck show us your code so we can help you. – e19293001 Dec 09 '15 at 07:45
-
I have read the documents regarding the edge detection for an image.I know that there are various methods of finding edges like Roberts, Sobel,laplacian etc. These have kernals and operators. But as far as verilog code is concerned , I don't understand how can I implement the laplacian edge detection in a verilog code. – Sara Dec 10 '15 at 05:17
-
@sharvil111 : I am planning on using shift approach , by shifting pixels to rectangular window. But I have no idea whether the 2-Dimensional array will be synthesizable inside generate block or not. – Sara Dec 12 '15 at 07:10
-
@Sara This depends on the synthesis tool. For an array declared like `[7:0] array [10]`, many synthesizers create a RAM like structure. – sharvil111 Dec 12 '15 at 07:37
2 Answers
There are a few papers about it that could help you implement it: http://sciencepublication.org/ijast/documents/proceeding/46.pdf, http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5647070&tag=1

- 84
- 9
I have used a long shift register as a buffer. in every clock pixel data shifts right and new data enters.
for a 5*5 mask we can define a (5 - 1) * rowsize + maskwidth
array register.
then the center data in shift register as pixel (n) could be added or subtracted by pixel numbers. for example for a mean filter n + 1
, n - 1
, n + rowsize
, n - rowsize
.
generally using a for loop for x and y to calculate a 2D mask this formula could be useful.
buffer[centerpixel + y*rowsize+x]) * mymask[(x+masklim)+(y+masklim)*maskwidth];
this referes to every window pixel multiplied by corresponding mask vaule. maxlim is (maskwidth-1)/2 that is 2 for a 5*5 mask size. having a summation on x and y can solve for pixel n.
the result could be sent to lcd or saved to ram.