一个sobel边缘检测器
所属分类:源码/资料
开发工具:Quartus II
文件大小:58KB
下载次数:0
上传日期:2022-06-02 15:42:00
上 传 者:
WangSangSang
说明: 一个sobel边缘检测器,较为详细,算法实现
文件列表:
Material (0, 2017-03-11)
Material\Simulation.png (63806, 2017-03-11)
source (0, 2017-03-11)
source\conv.v (2448, 2017-03-11)
source\mac.v (217, 2017-03-11)
source\shift.v (1879, 2017-03-11)
tests (0, 2017-03-11)
tests\conv_test.v (1238, 2017-03-11)
tests\shift_testbench.v (396, 2017-03-11)
# Implementation of Sobel Filter on Verilog
The code currently computes convolution of an image with a fixed kernel to find a gradient. By extending the logic to two gradients along x and y axes, and computing the square root of the squared sums, Sobel filter can be implemented.
The convolution approach has been adopted from [this paper](http://ieeexplore.ieee.org/document/5272559/).
## Example
Assume we have a 5*5 image.
| 1 | 2 | 3 | 4 | 5 |
| ------------- |:-------------:| -----:|:-------------:| -----:|
| 0 | 1 | 0 | 1 | 0 |
| 1 | 2 | 3 | 4 | 5 |
| 0 | 1 | 0 | 1 | 0 |
| 1 | 2 | 3 | 4 | 5 |
and a 3*3 kernel
| 1 | 2 | 1 |
| ------------- |:-------------:| -----:|
| 0 | 0 | 0 |
| 1 | 2 | 1 |
The output result would be
| 7 | 12 | 16 |
| ------------- |:-------------:| -----:|
| 4 | 4 | 4 |
| 7 | 12 | 16 |
## Simulation
The result can be verified from the screenshot here. Note that the pxl_out bits are considered only when the valid bit is `1`.
![alt tag](Material/Simulation.png)
近期下载者:
相关文件:
收藏者: