0

Is there a mathematical expression that not only adds the corresponding pixels of an image but also handles the underflow and overflow of such an addition.E.g if we have a 8 bit image then if adding two corresponding pixel values return a sum greater than 255 then that output pixel value is set to 255 and same goes for underflow in which if the sum is less then 0 then the output value is set to 0.I need a single mathematical expression.Thanks

4

1 回答 1

2

这个怎么样:

min(255, max(0, a+b))

这是一个单一的数学表达式。

于 2013-01-15T17:33:22.787 回答