实现图像的二值化
源文件
`timescale 1ns / 1ps
module binarization(//module clockinput clk , // 时钟信号input rst_n , // 复位信号(低有效)//图像处理前的数据接口input ycbcr_vsync , // vsync信号input ycbcr_hsync , // hsync信号input ycbcr_de , // data enable信号input [7:0] luminance ,//图像处理后的数据接口output post_vsync, // vsync信号output post_hsync, // hsync信号output post_de , // data enable信号output reg monoc // monochrome( 1=白, 0=黑));//reg definereg ycbcr_vsync_d;reg ycbcr_hsync_d;reg ycbcr_de_d ;//*****************************************************//** main code//*****************************************************assign post_vsync = ycbcr_vsync_d ;assign post_hsync = ycbcr_hsync_d ;assign post_de = ycbcr_de_d ;//二值化
always @(posedge clk or negedge rst_n)
beginif(!rst_n)monoc <= 1'b0;else if(luminanc