Thread Subject:
help me resolve a question.Thanks a lot!

Subject: help me resolve a question.Thanks a lot!

From: yuhuijun

Date: 17 May, 2006 23:02:44

Message: 1 of 5

I have a difficult question.
Please help me.Thank you!
I am trying to do a programme of 3D CED,I consult Rein van den
Boomgaard's Algorithms for Non-Linear Diffusion.
The question is only gaussian derivatives.The original programme is
    function g = gD( f, scale, ox, oy )
    % Gaussian (Derivative) Convolution
        K = ceil( 3 * scale );
        x = -K:K;
        Gs = exp( - x.^2 / (2*scale^2) );
        Gs = Gs / sum(Gs);
        Gsx = gDerivative( ox, x, Gs, scale );
        Gsy = gDerivative( oy, x, Gs, scale );
        g = convSepBrd( f, Gsx, Gsy );

    function r = gDerivative( order, x, Gs, scale )
    switch order
    case 0
        r = Gs;
    case 1
        r = -x/(scale^2) .* Gs;
    case 2
        r = (x.^2-scale^2)/(scale^4) .* Gs;
    otherwise
        error('only derivatives up to second order are supported');
    end
The subfunction is
    function g = convSepBrd( f, w1, w2 )
    % convolve along colums + along rows with repetition of the
border
    N = size(f,1);
    M = size(f,2);
    K = (size(w1(:),1)-1)/2;
    L = (size(w2(:),1)-1)/2;
    iind = min(max((1:(N+2*K))-K,1),N);
    jind = min(max((1:(M+2*L))-L,1),M);
    fwb = f(iind,jind);
    g=conv2(w1,w2,fwb,'valid');
I don't konw whether I consult above or not.
The above is 2D gaussian derivatives,and I want to do the 3D gaussian
derivatives.Please do me a favor!!!
Thank you for your attention.
I hope to hear from you.

Subject: help me resolve a question.Thanks a lot!

From: Sajid Khan

Date: 7 May, 2012 16:21:06

Message: 2 of 5

can you please email me the file named gDerivative.m whose function you have mentioned in you query.
my email address is sajidkhan7301@gmail.com


yuhuijun <yuhuijun5212003@yahoo.com.cn> wrote in message <ef35827.-1@webx.raydaftYaTP>...
> I have a difficult question.
> Please help me.Thank you!
> I am trying to do a programme of 3D CED,I consult Rein van den
> Boomgaard's Algorithms for Non-Linear Diffusion.
> The question is only gaussian derivatives.The original programme is
> function g = gD( f, scale, ox, oy )
> % Gaussian (Derivative) Convolution
> K = ceil( 3 * scale );
> x = -K:K;
> Gs = exp( - x.^2 / (2*scale^2) );
> Gs = Gs / sum(Gs);
> Gsx = gDerivative( ox, x, Gs, scale );
> Gsy = gDerivative( oy, x, Gs, scale );
> g = convSepBrd( f, Gsx, Gsy );
>
> function r = gDerivative( order, x, Gs, scale )
> switch order
> case 0
> r = Gs;
> case 1
> r = -x/(scale^2) .* Gs;
> case 2
> r = (x.^2-scale^2)/(scale^4) .* Gs;
> otherwise
> error('only derivatives up to second order are supported');
> end
> The subfunction is
> function g = convSepBrd( f, w1, w2 )
> % convolve along colums + along rows with repetition of the
> border
> N = size(f,1);
> M = size(f,2);
> K = (size(w1(:),1)-1)/2;
> L = (size(w2(:),1)-1)/2;
> iind = min(max((1:(N+2*K))-K,1),N);
> jind = min(max((1:(M+2*L))-L,1),M);
> fwb = f(iind,jind);
> g=conv2(w1,w2,fwb,'valid');
> I don't konw whether I consult above or not.
> The above is 2D gaussian derivatives,and I want to do the 3D gaussian
> derivatives.Please do me a favor!!!
> Thank you for your attention.
> I hope to hear from you.

Subject: help me resolve a question.Thanks a lot!

From: dpb

Date: 7 May, 2012 16:34:29

Message: 3 of 5

On 5/7/2012 11:21 AM, Sajid Khan wrote:
> can you please email me the file named gDerivative.m ...
...
>> function r = gDerivative( order, x, Gs, scale )
>> switch order
>> case 0
>> r = Gs;
>> case 1
>> r = -x/(scale^2) .* Gs;
>> case 2
>> r = (x.^2-scale^2)/(scale^4) .* Gs;
>> otherwise
>> error('only derivatives up to second order are supported');
>> end
...

???

--

Subject: help me resolve a question.Thanks a lot!

From: Sajid Khan

Date: 9 May, 2012 13:09:07

Message: 4 of 5

Anyone please send me gDerivative.m as soon as possible, if anyone have it.
my email address is sajidkhan7301@gmail.com

Subject: help me resolve a question.Thanks a lot!

From: Steven_Lord

Date: 9 May, 2012 13:29:59

Message: 5 of 5



"Sajid Khan" <p070094@nu.edu.pk> wrote in message
news:jodq9j$hin$1@newscl01ah.mathworks.com...
> Anyone please send me gDerivative.m as soon as possible, if anyone have
> it.
> my email address is sajidkhan7301@gmail.com

Read the post to which you replied. It includes gDerivative.m inside it.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us