图像运算(二)——减法(Subtraction)

描述:图像的减法即两幅输入图像同意位置像素相减,得到一个输出图像的过程。

公式描述:

O(i,j) = I1(i,j) - I2(i,j)  OR  O(i,j) = |I1(i,j) - I2(i,j)|

注意1:常值问题,输入图像也可以有一个是常量,即 O(i,j) = I(i,j) - C   OR  O(i,j) =| I(i,,j) - C|

注意2:下限问题,如果两幅图像相减得出的像素低于0,则一律统统归为0.

注意3:循环问题,如果图像格式支持循环问题,则不存在下限问题,即如果输出的像素为-20,则,系统自动把它变成236.


Code:

Similarity, displayed to the kernel function:

 /**
   *Applies the image difference operator on the specified image arrays, with the specified offset and scale value
   *@param src1_1d The first source image as a pixel array
   *@param src2_1d The second source image as a pixel array
   *@param width width of the destination image in pixels
   *@param height height of the destination image in pixels
   *@param oset The offset value
   *@param scale T
  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值