help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: Re: Smoothing Functions without distorting matrices' edges]


From: Søren Hauberg
Subject: [Fwd: Re: Smoothing Functions without distorting matrices' edges]
Date: Sun, 24 Sep 2006 20:22:50 +0200

Answer from Robert:

Soren,

Thank you for the URL and the fix.  

Sadly, anisodiff.m won't run as is. Gives me an error about
toascii, or such, when it tries to 
>> im=double(im);

I must have an old form of double.m

I'm running 
octave-2.1.50a-inst.exe on Win98
so will look through the code to see what I can change.

Two things catch my eye, one 'stability' ?!!! and the
other,
'iterations'  I'm trying to vectorize this smoothing to
make it snappy.  Right now I already have a program that
expands the matrix, iterates smoothing for the slope, then
smooths using conv2, then shaves it back to original size
and it only takes 0.6 seconds on 1200,120  

For what it's worth, the rms error, or "rattiness" at the
edges increases slightly using the 25 additional rows and
inserting mirror values into them.  Examining, the noise
increases by around sqrt(2), which seems right since at the
exact edge I have half the number of samples.  Sqrt(2) was
empirically demonstrated.  

I will use your excellent suggestions & URLs to see what
generic form I can come up with for my needs.  At least I
know the magnitudes of the matrix's derivatives approach
zero 

dx/dt > d2x/dt > d3x/dt etc

and probably drop VERY quickly for each derivative.  

    - Robert -

On Sun, 24 Sep 2006 19:06:08 +0200
 Søren Hauberg <address@hidden> wrote:
> Robert,
>   There was a bug in the program I sent you (I just
> programmed in from
> the top of my head). You need to change 
>     out = (Ipad./C);
> to
>     out = (Ipad./C)(w(1)+1:end-w(1), w(2)+1:end-w(2));
> 
> But, looking at your example, the mentioned program
> doesn't solve your
> problem. However, the Perona-Malik seems to solve your
> problem. Just
> download
>
http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/Spatial/anisodiff.m
> (it's from the link I sent you earlier), and type the
> following:
> 
> x=randn(300,101)+ones(300,1)*(-50:1:50)/12;
> y=anisodiff(x, 100, 50, 0.2, 1);
> 
> There are problems along the border of the image (matrix,
> if you like),
> but the edges looks fairly good to me.
> 
> Søren
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]