Re: Selective Gaussian -> Early test app posted



On Mon, 18 Jul 2005 21:23:42 +0200, "Mattias Andersson"
<mattias@xxxxxxxxxxxxx> wrote:

>Lord Crc wrote:
>> On Thu, 14 Jul 2005 02:36:08 +0200, "Mattias Andersson"
>> <mattias@xxxxxxxxxxxxx> wrote:
>>
>> I belive the Selective Gaussian is not separable, because you do not
>> use all pixels when computing it (hence the name of the algorithm :).
>> Since you've lost this, you might aswell allow arbitrary kernels.

[snip]

>What one could do instead, which I implemented in my optimized algorithm, is
>to cache the convolved values (the horizontal sums) for each reference color
>at a certain coordinate. This does not correspond to the same kind of
>optimization as in ordinary gaussian blur, where you would get complexity in
>the order Theta(pixels * r). Actually, if you have a completely solid image
>(with only a single color), then you would get this complexity too. However,
>as a worst case scenario one would still get O(pixels * r^2).

So how exactly does this caching work? From what you say, you compute
the horizontal sums for a given coordinate, ie hs[x,y,j] = kernel[i] *
a[x-i,y-j] * p[x-i,y-j], for i,j = -r to r ? If so, how do you use
this later?. And how exactly do you handle the weight scaling? This is
what I'm having trouble with, I can't see a way to separate it while
including the right pixels with the right weights, or the equivalent.

I've tried to implement what you say, but I do not get correct
results.

>> Which you can easily find out when you fill in the kernel. Simply keep
>> on going until the weights are less than 1 / NumLevels. However you
>> might want to be slightly less correct for the sake of speed (as it
>> would have a drastic impact on the kernel size).
>
>Well, not really true. Even if the weight is less than 1 / NumLevels, it
>will still have an impact on the result. I should have said "without any
>considerable impact" in my post, because although a single pixel might not
>make a difference, there will certainly be a difference if a larger number
>of pixels are convolved with a weight less than 1 / NumLevels. I think the
>best approach is really to plot the curve and decide on threshold value that
>seems reasonable. Alternatively one could test different threshold values
>and look at how the output image is affected.

But you'd need over 128 pixels with level 255 for it to change the
result _1_ level, and that's the worst case. I'd say the error
introduced by capping it at 1/255 is well within acceptable levels.

- Asbjørn
.



Relevant Pages

  • Re: Weighting regression points?
    ... I should probably explain what I'm doing, to understand why I want to weight ... certain points stronger than others as opposed to getting rid of those ... we are generating a set of pairs of pixels (one from the reference, ... the BULK of the signal will be along the regression ...
    (sci.stat.math)
  • Re: maintain the size of an image file (jpeg)
    ... Hmm - *saving* an image, in and of itself, does nothing to reduce the weight ... since you are removing pixels when you do that. ... One of the worst things you can do to a JPG image, by the way, is to JPG it ...
    (microsoft.public.frontpage.programming)
  • Re: CENTER OF GRAVITY METHOD FOR IMAGE SMOOTHING
    ... the x or y coordinate before accumulating them into the sum. ... its "shape" into the X and Y axes, i.e., taking the sum of pixels by rows and by columns and then ... The reason is that the human eye gives more "weight" to one channel and less to ... It should be noted that most color models are designed to be as simpel as possible. ...
    (sci.image.processing)
  • Re: Nikon D70s image size
    ... Only when talking about binary is the power of 2 system ... million pixels is a million pixels. ... who count the weight of their cottage cheese in octal because ...
    (rec.photo.digital.slr-systems)
  • Re: Changing all red pixels to green in an image
    ... as I have an image with hundreds of separate little red ... parts throughout (some only a few pixels). ... I use Photoshop CS for most of my image manipulation, ... It also provides a range of transforms; various rotations, trim to proportion, ...
    (comp.graphics.apps.photoshop)