EPI_H/EPI_V(边缘保持指数,matlab 矢量化编程)

EPI: edge preservation index,衡量对原始图像的操作(目标图像)对图像边缘的保持能力。

  • EPI_H:horizontal ,水平方向;
  • EPI_V:vertical,垂直方向;

EPIH=ijI^(i,j+1)I^(i,j)ij|I(i,j+1)I(i,j)|EPIV=ijI^(i+1,j)I^(i,j)ij|I(i+1,j)I(i,j)|

I, I2;          % 分别表示原始图像,和处理后图像
imU = I(1:end-1, :);  imD = I(2:end, :)         % 上部,下部
imL = I(:, 1:end-1); imR = I(:, 2:end);         % 左部,右部;
% 同理可以定义,I2 的上下左右,四部;

EPI_H = sum(sum(abs(imR - imL)))/sum(sum(abs(im2R - im2L)));
EPI_V = sum(sum(abs(imU - imD)))/sum(sum(abs(im2D - im2D)));
module pwm ( CLK, RSTn, AddDuty_In, SubDuty_In, AddPeriod_In, SubPeriod_In, Count_D_Display, Count_P_Display, Digitron_Out, DigitronCS_Out, PWM_LED_Out, PWM_EPI_Out ); input CLK; input RSTn; //SW0 input AddDuty_In; //KEY3 input SubDuty_In; //KEY2 input AddPeriod_In; //KEY1 input SubPeriod_In; //KEY0 input Count_D_Display; //SW1 input Count_P_Display; //SW2 output [7:0]Digitron_Out; output [5:0]DigitronCS_Out; output PWM_LED_Out; //LED0 output PWM_EPI_Out; //A6 assign PWM_EPI_Out = PWM_LED_Out; wire [7:0]Duty; wire [23:0]Count_P; wire [23:0]Count_D; Duty_Period_Adjust_module U1 ( .CLK( CLK ) , .RSTn( RSTn ) , .AddDuty_In( AddDuty_In ) , // input - from top .SubDuty_In( SubDuty_In ) , // input - from top .AddPeriod_In( AddPeriod_In ) , // input - from top .SubPeriod_In( SubPeriod_In ) , // input - from top .Duty( Duty ) , // output [7:0] - to U2, U3 .Count_P( Count_P ) // output [23:0] - to U2, U3 ); PWM_Generate_module U2 ( .CLK( CLK ) , .RSTn( RSTn ) , .Duty( Duty ) , // input [7:0] - from U1 .Count_P( Count_P ) , // input [23:0] - from U1 .PWM_Out( PWM_LED_Out ), // output - to top .Count_D( Count_D ) // output [23:0] - to U3 ); Digitron_NumDisplay_module U3 ( .CLK( CLK ) , .RSTn( RSTn ) , .Count_D_Display( Count_D_Display ) , // input - from top .Count_P_Display( Count_P_Display ) , // input - from top .Count_D( Count_D ) , // input [23:0] - from U2 .Count_P( Count_P ) , // input [23:0] - from U1 .Duty( Duty ) , // input [7:0] - from U1 .Digitron_Out( Digitron_Out ) , // output [7:0] - to top .DigitronCS_Out( DigitronCS_Out ) // output [5:0] - to top ); endmodule
06-11
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

五道口纳什

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值