FPGA二值图像边界提取算法实现.doc
《FPGA二值图像边界提取算法实现.doc》由会员分享,可在线阅读,更多相关《FPGA二值图像边界提取算法实现.doc(2页珍藏版)》请在三一文库上搜索。
1、FPGA二值图像边界提取算法实现1 背景知识如图1 所示,图1 a为一幅简单的二值图像,经过边界提取后形成如图1 b 所示的图像,显示出了白色区域的轮廓。2 边界提取算法使用黑色提取,背景为白色,1表示白色,0表示黑色。我们使用3x3模板进行边界提取,所以当3x3九个点都是1的时候,输出为1,当九个点都是0的时候,输出为1,其他情况输出均为0。3 FPGA二值图像边界提取算法实现图2中我们使用串口传图传入的是二值图像。FPGA源码:/*Module name: boundary_extracTIon.vDescripTIon: binary image boundary extracTIon*
2、/TImescale 1ns/1psmodule boundary_extraction( input clk, /pixel clkinput rst_n,input hs_in,input vs_in,input 15:0 data_in,input data_in_en,output hs_out,output vs_out,output reg 15:0 data_out,output data_out_en);wire 15:0 line0;wire 15:0 line1;wire 15:0 line2;reg 15:0 line0_data0;reg 15:0 line0_data
3、1;reg 15:0 line0_data2;reg 15:0 line1_data0;reg 15:0 line1_data1;reg 15:0 line1_data2;reg 15:0 line2_data0;reg 15:0 line2_data1;reg 15:0 line2_data2;reg data_out_en0;reg data_out_en1;reg data_out_en2;reg hs_r0;reg hs_r1;reg hs_r2;reg vs_r0;reg vs_r1;reg vs_r2;wire18:0 result_data;line3x3 line3x3_ins
4、t( .clken(data_in_en), .clock(clk), .shiftin(data_in), .shiftout(), .taps0x(line0), .taps1x(line1), .taps2x(line2) );/-/ Form an image matrix of three multiplied by three/-always (posedge clk or negedge rst_n) begin if(!rst_n) begin line0_data0 = 16b0;line0_data1 = 16b0;line0_data2 = 16b0;line1_data
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- FPGA 图像 边界 提取 算法 实现
链接地址:https://www.31doc.com/p-3251600.html