您现在的位置:首页 >> 图像处理 >> 内容

基于FPGA的图像sobel边缘提取算法实现,包含testbench和matlab验证程序

时间:2023/3/31 22:41:56 点击:

  核心提示:A805,包括程序操作录像...

1.完整项目描述和程序获取

>面包多安全交易平台:https://mbd.pub/o/bread/ZZWUk59s

>如果链接失效,可以直接打开本站店铺搜索相关店铺:

点击店铺

>如果链接失效,程序调试报错或者项目合作可以加微信或者QQ联系。

2.部分仿真图预览



3.算法概述

      Soble边缘检测算法比较简,实际应用中效率比canny边缘检测效率要高,但是边缘不如Canny检测的准确,但是很多实际应用的场合,sobel边缘却是首选,尤其是对效率要求较高,而对细纹理不太关心的时候。Soble边缘检测通常带有方向性,可以只检测竖直边缘或垂直边缘或都检测。

4.部分源码

.........................................................................

reg signed[10:0]Sobel1;

reg signed[10:0]Sobel2;

reg signed[10:0]Sobel3;

reg signed[10:0]Sobel4;

always @(posedge i_clk or posedge i_rst)

begin

     if(i_rst)

     begin

     Sobel1 <= 11'd0;

     Sobel2 <= 11'd0;

     Sobel3 <= 11'd0;

     Sobel4 <= 11'd0;

     end

else begin

     Sobel1 <= {3'd0,sobelxy13} + {3'd0,sobelxy23} + {3'd0,sobelxy23} + {3'd0,sobelxy33};

     Sobel2 <= {3'd0,sobelxy11} + {3'd0,sobelxy21} + {3'd0,sobelxy21} + {3'd0,sobelxy31};

     Sobel3 <= {3'd0,sobelxy11} + {3'd0,sobelxy12} + {3'd0,sobelxy12} + {3'd0,sobelxy13};

     Sobel4 <= {3'd0,sobelxy31} + {3'd0,sobelxy32} + {3'd0,sobelxy32} + {3'd0,sobelxy33};

     end

end 

 

 

reg signed[11:0]Sobel12;

reg signed[11:0]Sobel34;

 

always @(posedge i_clk or posedge i_rst)

begin

     if(i_rst)

     begin

     Sobel12 <= 12'd0;

     Sobel34 <= 12'd0;

     end

else begin

     Sobel12 <= {Sobel1[10],Sobel1}-{Sobel2[10],Sobel2};

     Sobel34 <= {Sobel3[10],Sobel3}-{Sobel4[10],Sobel4};

     end

end 

 

reg signed[11:0]absSobel12;

reg signed[11:0]absSobel34;

 

always @(posedge i_clk or posedge i_rst)

begin

     if(i_rst)

     begin

     absSobel12 <= 12'd0;

     absSobel34 <= 12'd0;

     end

else begin

     if(Sobel12[11]==0)

     absSobel12 <= Sobel12;

     else

     absSobel12 <= ~Sobel12+1'b1;  

     

     if(Sobel34[11]==0)

     absSobel34 <= Sobel34;

     else

     absSobel34 <= ~Sobel34+1'b1;  

     end

end

.....................................................

A805

作者:我爱C编程 来源:我爱C编程
本站最新成功开发工程项目案例
相关文章
  • 没有相关文章
相关评论
发表我的评论
  • 大名:
  • 内容:
本类固顶
  • 没有
  • FPGA/MATLAB商业/科研类项目合作(www.store718.com) © 2025 版权所有 All Rights Reserved.
  • Email:1480526168@qq.com 站长QQ: 1480526168