On Mon, Mar 5, 2012 at 9:36 AM, Michael Aye <kmichael.aye@gmail.com> wrote:


On Monday, March 5, 2012 11:37:16 AM UTC+1, Nelle wrote:
Hi Michael,

The example imports the harris method and not the module. It is a bit confusing because the method and the module have both the same name (maybe we can modify that ?).

I've checked both on the documentation and on my machine, and the example works fine.
What error message do you get when trying to run the example ?


The documentation of the harris corner example on http://scikits-image.org/docs/dev/auto_examples/plot_harris.html
states for the import:

from skimage.feature import harris

So when I do that, I get a module, with the method inside:

In [149]: from skimage.feature import harris

In [150]: harris
Out[150]: <module 'skimage.feature.harris' from '/Users/maye/Library/Python/2.7/site-packages/skimage-0.4-py2.7-macosx-10.5-i386.egg/skimage/feature/harris.pyc'>

Hi Michael,

It appears that you're importing skimage 0.4 here. You may need to clean out this older version and try again.

-Tony
 

In [151]: type(harris)
Out[151]: module

In [152]: harris.
harris.harris   harris.ndimage  harris.peak     

And the error is accordingly, a TypeError for the module not being callable:

In [152]: harris(ctx.data)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Users/maye/Dropbox/src/pymars/<ipython-input-152-a1e24f9ed74a> in <module>()
----> 1 harris(ctx.data)

TypeError: 'module' object is not callable

 
Regards,
Michael


Cheers,
N



The example does an import of the harris module, not the class.
Therefore for me in the code I have to call it like harris.harris(img, min_distance=6)

Do I have a messed up system or is that an error? If yes, I can issue a PR.

Michael