<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6944.0">
<TITLE>RE: [Insight-users] itkGaussianDerivativeImageFunction, are you correct?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Thanks for your prompt answer,<BR>
<BR>
I see your point when I am performing conv in _more than ONE pixel_. The conv on a column can be reused for neighbours. Okay in a whole image computing we should get a hit in performance. However I am performing here an image Function, i.e. I compute on *isolated* pixel. That would mean that separable convolution is equivalent to standard 2D conv. when computing in one pixel?<BR>
<BR>
Moreover itk implementation continues to be to me the implementation that is forgetting to compute enough values, a simple example on paper seems to reveal it...Maybe I cannot understand how the itk implementation is working?<BR>
<BR>
<BR>
Best Regards,<BR>
<BR>
Jerome Schmid<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Richard Beare [<A HREF="mailto:richard.beare@gmail.com">mailto:richard.beare@gmail.com</A>]<BR>
Sent: Mon 3/20/2006 12:17 PM<BR>
To: SCHMID, Jerome<BR>
Subject: Re: [Insight-users] itkGaussianDerivativeImageFunction, are you correct?<BR>
<BR>
Hi,<BR>
<BR>
I haven't gone through your maths thoroughly, but perhaps you are<BR>
forgetting to compute enough values. In your example you compute the<BR>
value at the center of a 3x3 array of pixels. However the column<BR>
convolutions you carry out can be used to compute the values at<BR>
locations next to the centre pixel as well. The cost becomes<BR>
proportional to kernel size + kernel size when extending the approach<BR>
to an infinite array.<BR>
<BR>
I hope this is the answer.<BR>
<BR>
<BR>
<BR>
On 3/20/06, SCHMID, Jerome <jeromeschmid@surgery.cuhk.edu.hk> wrote:<BR>
><BR>
><BR>
> Hi,<BR>
><BR>
> After having read the itkGaussianDerivativeImageFunction,<BR>
> I am<BR>
> facing some interrogations on basic image processing of convolution stuff,<BR>
> I am starting to wonder whether or<BR>
> not my knowledge on the topic is a little "rusty".<BR>
><BR>
> Reading the itkGaussianDerivativeImageFunction I couldn't<BR>
> agree with its implementation.<BR>
> Okay it seems that it is for 2D images and hat some redundant stuff is<BR>
> present. This has been emphasized in<BR>
> an insight journal review:<BR>
><BR>
> <A HREF="http://www.insight-journal.org/view_reviews.php?back=publications.php%3Fjournalid%3D4%26order%3Dreviews%26revision_display%3D&pubid=78">http://www.insight-journal.org/view_reviews.php?back=publications.php%3Fjournalid%3D4%26order%3Dreviews%26revision_display%3D&pubid=78</A><BR>
><BR>
> I am not commenting these things, but rather the core itself, i.e. how to<BR>
> perform the derivation with<BR>
> gaussian. Please find below three links for 3 pics, they are not<BR>
> masterpieces but they help to follow me ( if you read<BR>
> this you are doing it :) )<BR>
><BR>
> def.jpg: <A HREF="http://moscao.free.fr/PrivateDownloads/def.jpg">http://moscao.free.fr/PrivateDownloads/def.jpg</A><BR>
><BR>
> we perform derivation along x on a 2D image. I want to have the value for<BR>
> the green pixel. The def of the derivation<BR>
> and the convolution, gives two 1-D convolution kernels, g1(x) and g0(y).<BR>
> The size of<BR>
> the 2D kernel is fixed as a 3x3 area in red, so the 2 filters have size of<BR>
> 3 ( we do not discuss here the correctness of<BR>
> extents, etc. )<BR>
><BR>
> We will so perform a separable convolution with these 2 kernels.<BR>
><BR>
> my.jpg: <A HREF="http://moscao.free.fr/PrivateDownloads/my.jpg">http://moscao.free.fr/PrivateDownloads/my.jpg</A><BR>
><BR>
> What I am excpecting for conv. I convolve each column in the red area with<BR>
> the g0(y) kernel. This give me a row of three elements. Then I convolve<BR>
> this row with g1(x ).<BR>
><BR>
> itk.jpg: <A HREF="http://moscao.free.fr/PrivateDownloads/itk.jpg">http://moscao.free.fr/PrivateDownloads/itk.jpg</A><BR>
><BR>
> What itk does. It performs a conv with the pixel columm (central col in the<BR>
> red area) that gives a new value.<BR>
> Then a three elements row is build with in its center the previous computed<BR>
> value, and with a and b. a and b are the neighb of green pixel in image.<BR>
> This row is then convolved with g1(x).<BR>
><BR>
> I cannot figure out how this may produce the same result....!<BR>
><BR>
> I will sound as an idiot, but if my implementation is the correct one, and<BR>
> not the itk one,<BR>
> I cannot figure out why the separable convolution is faster than the usual<BR>
> one !!!???<BR>
><BR>
> It is said everywhere and I have been taught this, that the cost per pixel<BR>
> in normal conv is kernelSize*KernelSize mult. ops instead of KernelSize +<BR>
> KernelSize for separable conv. By taking a simple image and counting the ops<BR>
> in both cases I cannot find this result....<BR>
><BR>
> Can somebody enlight me? this is turning me mad for such a classic image<BR>
> processing stuff....<BR>
><BR>
> Last pt, but nor relevant here:<BR>
><BR>
> In itk code, Truncated kernel of the derivative is not normalized as<BR>
> usual, i.e. divide each coeff by sum(k=-1,..,k=1)( k * g1(k) ).<BR>
><BR>
><BR>
> Thanks for reading this looooong email and be nice if the answer is so<BR>
> simple.<BR>
><BR>
> regards,<BR>
><BR>
> Jerome Schmid<BR>
><BR>
><BR>
><BR>
><BR>
><BR>
> _______________________________________________<BR>
> Insight-users mailing list<BR>
> Insight-users@itk.org<BR>
> <A HREF="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR>
><BR>
><BR>
><BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>