当前位置:网站首页>图像处理5:膨胀
图像处理5:膨胀
2022-07-23 07:20:00 【刘颜儿】
前言
正文
module dilation
(
//global clock
input clk, //cmos video pixel clock
input rst_n, //global reset
//Image data prepred to be processd
input per_frame_vsync, //Prepared Image data vsync valid signal
input per_frame_href, //Prepared Image data href vaild signal
input per_frame_clken, //Prepared Image data output/capture enable clock
input per_img_Bit, //Prepared Image brightness input
//Image data has been processd
output post_frame_vsync, //Processed Image data vsync valid signal
output post_frame_href, //Processed Image data href vaild signal
output post_frame_clken, //Processed Image data output/capture enable clock
output post_img_Bit //Processed Image Bit flag outout(1: Value, 0:inValid)
);
//----------------------------------------------------
//Generate 8Bit 3X3 Matrix for Video Image Processor.
//Image data has been processd
wire matrix_frame_vsync; //Prepared Image data vsync valid signal
wire matrix_frame_href; //Prepared Image data href vaild signal
wire matrix_frame_clken; //Prepared Image data output/capture enable clock
wire [7:0] matrix_p11, matrix_p12, matrix_p13; //3X3 Matrix output
wire [7:0] matrix_p21, matrix_p22, matrix_p23;
wire [7:0] matrix_p31, matrix_p32, matrix_p33;
Shift_RAM_3X3 Shift_RAM_3X3_inst
(
//global clock
.clk (clk), //cmos video pixel clock
.rst_n (rst_n), //global reset
.per_frame_vsync (per_frame_vsync), //Prepared Image data vsync valid signal
.per_frame_href (per_frame_href), //Prepared Image data href vaild signal
.per_frame_clken (per_frame_clken), //Prepared Image data output/capture enable clock
.per_img_Y ({
7'b0,per_img_Bit}), //Prepared Image brightness input
//Image data has been processd
.matrix_frame_vsync (matrix_frame_vsync), //Prepared Image data vsync valid signal
.matrix_frame_href (matrix_frame_href), //Prepared Image data href vaild signal
.matrix_frame_clken (matrix_frame_clken), //Prepared Image data output/capture enable clock
.matrix_p11(matrix_p11), .matrix_p12(matrix_p12), .matrix_p13(matrix_p13), //3X3 Matrix output
.matrix_p21(matrix_p21), .matrix_p22(matrix_p22), .matrix_p23(matrix_p23),
.matrix_p31(matrix_p31), .matrix_p32(matrix_p32), .matrix_p33(matrix_p33)
);
//Eonsion with or operation
//Step 1
reg post_img_Bit1, post_img_Bit2, post_img_Bit3;
[email protected](posedge clk or negedge rst_n)begin
if(!rst_n)
begin
post_img_Bit1 <= 1'b0;
post_img_Bit2 <= 1'b0;
post_img_Bit3 <= 1'b0;
end
else
begin
post_img_Bit1 <= matrix_p11[0] | matrix_p12[0] | matrix_p13[0];
post_img_Bit2 <= matrix_p21[0] | matrix_p22[0] | matrix_p23[0];
post_img_Bit3 <= matrix_p21[0] | matrix_p32[0] | matrix_p33[0];
end
end
//Step 2
reg post_img_Bit_r;
[email protected](posedge clk or negedge rst_n)begin
if(!rst_n)
post_img_Bit_r <= 1'b0;
else
post_img_Bit_r <= post_img_Bit1 | post_img_Bit2 | post_img_Bit3;
end
//------------------------------------------
//lag 2 clocks signal sync
reg [1:0] per_frame_vsync_r;
reg [1:0] per_frame_href_r;
reg [1:0] per_frame_clken_r;
[email protected](posedge clk or negedge rst_n)begin
if(!rst_n)
begin
per_frame_vsync_r <= 0;
per_frame_href_r <= 0;
per_frame_clken_r <= 0;
end
else
begin
per_frame_vsync_r <= {
per_frame_vsync_r[0], matrix_frame_vsync};
per_frame_href_r <= {
per_frame_href_r [0], matrix_frame_href};
per_frame_clken_r <= {
per_frame_clken_r[0], matrix_frame_clken};
end
end
assign post_frame_vsync = per_frame_vsync_r[1];
assign post_frame_href = per_frame_href_r [1];
assign post_frame_clken = per_frame_clken_r[1];
assign post_img_Bit = post_frame_href ? post_img_Bit_r : 1'b0;
endmodule
边栏推荐
- Redis常用命令
- Introduction to radar part vii 2 imaging method
- Power bi - Comprehensive Application
- General contents of radar introduction column
- prometheus+node-exporter+grafana 监控服务器系统资源
- 微信小程序--动态设置导航栏颜色
- Événements courants de la souris et du clavier
- LeetCode_46_全排列
- Method of entering mathematical formula into mark down document
- 数据库系统原理与应用教程(041)—— MySQL 查询(三):设置查询条件
猜你喜欢
随机推荐
Unity about local loading pictures involves webrequest or byte
【Ardunio】2种方法控制舵机
Point target simulation of SAR imaging (III) -- Analysis of simulation results
Research on hardware architecture of Ti single chip millimeter wave radar xwr1642
Typora 修改表格宽度
LeetCode_51_N皇后
数据库系统原理与应用教程(044)—— MySQL 查询(六):使用 LIMIT 选项实现分页查询
【深入浅出玩转FPGA学习10------简单的Testbench设计】
[图形学]ASTC纹理压缩格式
数据库系统原理与应用教程(042)—— MySQL 查询(四):使用通配符构造查询条件
Reference and output message types in ROS
建立STM32F103C8T6工程模板和STM32 ST-LINK Utilit烧录hex文件
数据库系统原理与应用教程(045)—— MySQL 查询(七):聚合函数
ES6 - weekly examination questions
QT creator.Pro file adds the corresponding library according to the kit
十大券商开户风险性大吗,安全吗?
数据库系统原理与应用教程(046)—— MySQL 查询(八):分组查询(GROUP BY)
数据库系统原理与应用教程(041)—— MySQL 查询(三):设置查询条件
freemarker
常用的鼠標事件和鍵盤事件









