Understanding the inner workings of the radon function (from skimage)
Kaloyan Marinov
kaloyan.at.uw at gmail.com
Fri Apr 11 07:10:37 EDT 2014
Dear Juan,
Thank you for the reference.
I am afraid I have not had exposure to Cython, so I was wondering if I may
ask the following basic questions:
- the comments below the definition of a_matrix_transform seem to
suggest that H is supposed to be a 2D array of shape (3,3); however, the
code for a_matrix_transform seems to refer to H as a 1D array of length 9.
Does that mean the comment is inaccurate?
- the third input in the call of a_matrix_transform (within the nested
for loops) is &M[0,0], which is neither a 2D array of shape (3,3), nor a 1D
array of length 9; this seems to a bit contradictory to me. Do you happen
to know how the third input in the call of a_matrix_transform is to be
interpreted?
- I am interested in the case when order = 1 so, for me, interp_func =
bilinear_interpolation; where could I find the sourcecode (or clear
description) for bilinear_interpolation?
- last but not least, the type of img is defined to cnp.ndarray, and
then one converts it to a contiguous array; what is the purpose/advantage
of doing this conversion?
- I do have a _warps_cy.so on my harddrive, but I don't know what
application it can be opened it; could you let me know about that?
I would be very thankful for any feedback you may offer.
Best,
Kaloyan
On Friday, April 11, 2014 3:11:46 AM UTC+3, Juan Nunez-Iglesias wrote:
>
> Hi Kaloyan,
>
> I'm not familiar with the radon transform but the _warps_cy source file is
> a Cython file (.pyx extension), _warps_cy.pyx here:
>
> https://github.com/scikit-image/scikit-image/tree/master/skimage/transform
>
> Others might weigh in on the actual maths of the discrete radon transform.
> =)
>
> Juan.
>
>
> On Thu, Apr 10, 2014 at 9:25 PM, Kaloyan Marinov <kaloya... at gmail.com<javascript:>
> > wrote:
>
>> I am familiar with the mathematical theory of the continuous Radon
>> transform, but am having trouble understanding its discrete implementation
>> from skimage. Below I list my two questions on the topic.
>>
>> *Question 1*
>>
>> Let us define a matrix A as follows:
>>
>> A = np.zeros( (4,4) )
>> A[1:3,1:3] = 1
>>
>> Compute its Radon transform as follows:
>>
>> radTranfOfA = skimage.transform.radon(A,[45])
>>
>> This computed radTranfOfA to be the following array of shape (6,1):
>>
>> array([[ 0. ],
>> [ 0. ],
>> [ 0.87867966],
>> [ 2.42893219],
>> [ 0.87867966],
>> [ 0. ]])
>>
>> Could someone explain to me (preferably in a mathematically precise way)
>> exactly how Python computed this?
>>
>> *Question 2*
>>
>> I have attempted to study the radon_transform.py source-code file from
>> the skimage package, but the definition of the radon function there depends
>> on a function called _warp_fast which is imported from _warps_cy. However,
>> I cannot see the sourcecode for _warps_cy; could anyone suggest a way
>> around this (or a precise mathematical explanation of what _warps_cy does
>> and how its output is stored)?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "scikit-image" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to scikit-image... at googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20140411/6ce2369a/attachment.html>
More information about the scikit-image
mailing list