Re: Rookie having problems with some filter code. Any help?



Don Bruder <dakidd@xxxxxxxxx> writes:

>However, you bring up a valid point - one which I've been struggling
>with - How to cope with (A) color values that go negative while being
>"cooked", and (B) values that overflow the available 8 bits while being
>cooked. For situation B, a simple "value % 256" leaps to mind as the
>proper treatment. But coping with values that land in "negative-ville"
>as a result of being cooked, whether they are or are not possible to fit
>into 8 bits, is something that has me completely stumped.

If you're just going to write out the image again, negative values
should be clamped to zero, and values greater than 255 should be clamped
to 255 - not wrapped around to zero. But if you're going to do a chain
of operations, and you don't have to convert back to 8 bits unsigned
between each operation, there is sometimes a benefit to carrying the
unclamped values through the whole sequence of steps and clamp only at
the end.

There are occasions (e.g. differencing) when keeping the result mod 256
is the right thing to do - but that's not usually the case.

Dave
.



Relevant Pages

  • Best fitting a range of data to a particular value
    ... I am struggling to find the answer to the following: ... I have three columns of data, consisting of up to ten values. ... possibly ZERO to THREE values from range B and possibly ZERO ... luck. ...
    (microsoft.public.excel)
  • Re: NSE / BR Southern Route Codes
    ... >displays will force a zero; they can't cope with a blank field ... digits are allowed in the destination field as a way round this? ... Prev by Date: ...
    (uk.railway)
  • Re: including . in a pattern match
    ... > I have tried a couple of things but I am struggling with how to optionally ... > zero or one decimal point followed by ... What you want is $REout of that package. ... Prev by Date: ...
    (perl.beginners)
  • Help me please
    ... script file to do the following but im struggling. ... the zero should then be determined to 4 decimal places.... ...
    (comp.soft-sys.matlab)