Image edge detection

180 views
Skip to first unread message

Dipankar Ganguly

unread,
Aug 8, 2016, 8:09:54 PM8/8/16
to scikit-image
I am trying to do an image edge detection project using Python 3.5 under Jupyter on Anaconda's Navigator on my Mac running OS 10.11.6. I have verified that  the Envirnoment does have scikit-image installed   I have run into this at the very outset.

_________________
 File "<ipython-input-8-59ade0051fc5>", line 1
    import scikit-image as image
                 ^
SyntaxError: invalid syntax
__________________

How do I solve this? Is there a more recent package I should be using?

Thanks.

Dipu


Stéfan van der Walt

unread,
Aug 8, 2016, 8:24:50 PM8/8/16
to scikit-image
Hi Dipu

Please try one of the examples from the gallery:

http://scikit-image.org/docs/dev/auto_examples/

Stéfan

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to scikit...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/scikit-image/476b29f9-0e89-495d-aaee-88a9dbc69460%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dipankar “Dipu” Ganguly

unread,
Aug 9, 2016, 11:35:42 AM8/9/16
to scikit...@googlegroups.com
Thank you Stefan. That was very helpful. 

I now need to convert “.jpg" and DICOM images into arrays that I can operate on using numpy and other Scikit-image algorithms/tools. What tools/packages could I use for the conversions (Images —> numpy arrays)?

Best.

Dipu

Dipankar Ganguly
Consultant: Strategy/Technology/Commercialization
Bothell, WA
Cell: 408-203-8814
email: dip...@gmail.com
http://www.linkedin.com/in/dipugee 









You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/7IskXgM-99E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.

To post to this group, send email to scikit...@googlegroups.com.

Stéfan van der Walt

unread,
Aug 9, 2016, 2:40:37 PM8/9/16
to scikit-image
Hi Dipu

On 9 August 2016 at 08:35, Dipankar “Dipu” Ganguly <dip...@gmail.com> wrote:
I now need to convert “.jpg" and DICOM images into arrays that I can operate on using numpy and other Scikit-image algorithms/tools. What tools/packages could I use for the conversions (Images —> numpy arrays)?

You can use pydicom to load the DICOM images to numpy arrays:

http://pydicom.readthedocs.io/en/stable/working_with_pixel_data.html

If you have more advanced DICOM needs, such as working with multiple slices, or reading meta-data, you may want to look at dcmstack and nibabel as well.

Best regards
Stéfan

Dipankar “Dipu” Ganguly

unread,
Aug 9, 2016, 5:30:12 PM8/9/16
to scikit...@googlegroups.com
Thanks again Stefa. Very helpful. I will try using these. I am assuming, I will also find tools to read .jpg images as numpy arrays, my immediate need.

Dipu


Dipankar “Dipu” Ganguly







--
You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/7IskXgM-99E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.
To post to this group, send email to scikit...@googlegroups.com.

Stéfan van der Walt

unread,
Aug 9, 2016, 5:34:50 PM8/9/16
to scikit-image
Hi Dipu

On 9 August 2016 at 14:30, Dipankar “Dipu” Ganguly <dip...@gmail.com> wrote:
Thanks again Stefa. Very helpful. I will try using these. I am assuming, I will also find tools to read .jpg images as numpy arrays, my immediate need.

You assume correctly :)  If you take a look at the user guide I mentioned earlier, you will find examples of how to do that.

from skimage import io
image = io.imread('my_image.jpg')

Best regards
Stéfan

Dipankar “Dipu” Ganguly

unread,
Aug 9, 2016, 5:40:55 PM8/9/16
to scikit...@googlegroups.com
Hi Stefan:

Sorry to bother you again. I am having trouble with "from skimage import xyz” commands. I am using Python 3.5 with Jupyter from Navigator. I am wondering if I am running into version mismatches.

Thanks.

Dipu


Dipankar “Dipu” Ganguly







--
You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/7IskXgM-99E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.
To post to this group, send email to scikit...@googlegroups.com.

Stéfan van der Walt

unread,
Aug 9, 2016, 5:43:17 PM8/9/16
to scikit-image
Hi Dipu

On 9 August 2016 at 14:40, Dipankar “Dipu” Ganguly <dip...@gmail.com> wrote:
Sorry to bother you again. I am having trouble with "from skimage import xyz” commands. I am using Python 3.5 with Jupyter from Navigator. I am wondering if I am running into version mismatches.

Yes, I am afraid we don't have an xyz submodule.

Perhaps you can share some code with us, along with the error messages you are seeing?

Stéfan

Dipankar “Dipu” Ganguly

unread,
Aug 11, 2016, 12:04:27 AM8/11/16
to scikit...@googlegroups.com
Your suggestions have been very helpful and allowed me to make good progress.

Do you know where I can find the Python source code for the edge filters in MatPlotlib?

Thanks.

Dipu


Dipankar Ganguly
Consultant: Strategy/Technology/Commercialization
Bothell, WA
Cell: 408-203-8814
email: dip...@gmail.com
http://www.linkedin.com/in/dipugee 









--
You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/7IskXgM-99E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.
To post to this group, send email to scikit...@googlegroups.com.

Dipankar “Dipu” Ganguly

unread,
Aug 29, 2016, 8:53:48 PM8/29/16
to scikit...@googlegroups.com
Hi:

I have ImageJ installed on the same Mac that I am using to develop IPython Image Processing algorithms under Anaconda Navigator’s Jupyter. Can I load ImageJ as a package in my Image Processing environment and call its functions as I do with Scikit-image?

Thanks

Dipu

Dipankar “Dipu” Ganguly

You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/7IskXgM-99E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.
To post to this group, send email to scikit...@googlegroups.com.

Dipankar “Dipu” Ganguly

unread,
Sep 22, 2016, 12:34:12 AM9/22/16
to scikit...@googlegroups.com
Hi Stefan:

I need to bug you again. I have a couple of new questions…

1 My Python 3.5 code now includes Sci-Image, numpy and matplotlib functions as well some openCV calls. I need too convert this using JPython. How easily will  these SciPy and openCV functions convert?

2. How close are SciImage and openCV in function content? Is there a document where I can find openCV equivalents to Sciimage functions and vice versa?

Thanks.

Dipu


Dipankar Ganguly
Consultant: Strategy/Technology/Commercialization
Bothell, WA
Cell: 408-203-8814
email: dip...@gmail.com
http://www.linkedin.com/in/dipugee 









--
You received this message because you are subscribed to a topic in the Google Groups "scikit-image" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scikit-image/7IskXgM-99E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scikit-image...@googlegroups.com.
To post to this group, send email to scikit...@googlegroups.com.

Juan Nunez-Iglesias

unread,
Sep 22, 2016, 1:49:06 AM9/22/16
to scikit...@googlegroups.com
Hi Dipu,

1. I assume you mean Jython. Most of the SciPy stack is not available for Jython, unless things have changed dramatically since I last looked at it…

2. I am not aware of a document translating between scikit-image and openCV. I suspect there is substantial non-overlap. Python bindings for both should operate on numpy arrays, so I think you should use both, wherever it makes sense? Though, as mentioned above, you will have more trouble with this using Jython…

Juan.
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...@googlegroups.com.

To post to this group, send email to scikit...@googlegroups.com.

Dipankar “Dipu” Ganguly

unread,
Sep 22, 2016, 11:58:51 AM9/22/16
to scikit...@googlegroups.com
Thanks for the quick response Juan.

Sorry. I DID mean Jython. The real issue is porting this hybrid Scikit-image/openCV/Python 3.5 code on to an Android tablet as an app. I am not an expert on that Android environment but thought Java was the common development platform. If there are other ways to accomplish that, I am all ears!

Thanks.

Dipu

 
Dipankar “Dipu” Ganguly







Reply all
Reply to author
Forward
0 new messages