blob detection and dust removal

Raphael Okoye raphael at aims.ac.za
Tue May 17 02:19:58 EDT 2016


No worries...thanks for your input man..I appreciate

On 13 May 2016 at 16:43, Vighnesh Birodkar <vighneshbirodkar at gmail.com>
wrote:

> Hello
>
> Sorry for not getting back sooner. As mentioned in the scipy-lectures
> website you can use measure.label and set the dust particle pixels to 0 and
> they will be ignored as the background
>
> On Tuesday, May 3, 2016 at 12:48:05 AM UTC-4, Raphael wrote:
>>
>> hi Vighnesh,
>>
>>
>> Thats an interesting question..never really given it a thought. I think
>> this http://scikit-image.org/docs/dev/auto_examples/plot_label.html or
>> the help in section  3.3.4.1.2 given here
>> http://www.scipy-lectures.org/packages/scikit-image/ might work. As how
>> to create the mask image to mask dust particles, I'm currently not sure how
>> to implement that in scikit image.
>>
>> Thanks a lot.
>> 3.3.4.1.2
>>
>> On 2 May 2016 at 13:54, Vighnesh Birodkar <vighnesh... at gmail.com> wrote:
>>
>>> regionprops takes a labelled image as input. The question still remains,
>>> how will you generate the image in which the interested regions are
>>> labelled accordingly. You need to make that part of your algorithm exclude
>>> the dust particles.
>>>
>>> On Mon, May 2, 2016 at 3:34 PM, Raphael Okoye <rap... at aims.ac.za> wrote:
>>>
>>>> hi Vighnesh
>>>>
>>>> I plan to use this guy
>>>> http://scikit-image.org/docs/dev/auto_examples/plot_regionprops.html.
>>>> The documentation  on regionprops (
>>>> http://scikit-image.org/docs/dev/api/skimage.measure.html#regionprops)
>>>> says I can get parameters such as co-ordinate positions, equivalent
>>>> diameter etc
>>>>
>>>>  But first I need to think of a way to exclude the dust particles, that
>>>> is the main challenge.
>>>>
>>>> Thanks
>>>> Raphael
>>>>
>>>> On 2 May 2016 at 02:30, Vighnesh Birodkar <vighnesh... at gmail.com>
>>>> wrote:
>>>>
>>>>> How do you plan to find the position of the real crystals ? Maybe the
>>>>> function you will use to find the original crystals will take a mask
>>>>> argument ?
>>>>>
>>>>> On Mon, May 2, 2016 at 1:07 AM, Raphael Okoye <rap... at aims.ac.za>
>>>>> wrote:
>>>>>
>>>>>> hi Vighnesh,
>>>>>>
>>>>>>  Further processing involves getting the size and positions of real
>>>>>> crystals (I want to use the positions to estimate the pair correlation
>>>>>> function and then using the pair correlation function to estimate the
>>>>>> structure factor) The image comes from a sequence of time lapse images.
>>>>>> There are dust particles of various sizes in the images so if they are not
>>>>>> eliminated, a false structure factor will be determined.  The median filter
>>>>>> took care of the very little ones but didn’t work for the bigger ones.
>>>>>>
>>>>>> Thanks a lot.
>>>>>>
>>>>>> Raphael
>>>>>>
>>>>>> On 1 May 2016 at 21:27, Vighnesh Birodkar <vighnesh... at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> That really depends on your application. What's your motivation for
>>>>>>> removing these dust particles ? How are these images going to be processed
>>>>>>> further ?
>>>>>>>
>>>>>>> Thanks
>>>>>>> Vighnesh
>>>>>>>
>>>>>>> On Monday, May 2, 2016 at 12:13:27 AM UTC-4, Raphael wrote:
>>>>>>>>
>>>>>>>> hi Vighnesh,
>>>>>>>>
>>>>>>>>  Thanks a bunch!! I see my error now.
>>>>>>>>
>>>>>>>> Actually that blob you detected a dust particle. Which  operation
>>>>>>>> would you suggest to erase it? I tried morphological erosion but it doesn't
>>>>>>>> take it away.
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Raphael
>>>>>>>>
>>>>>>>> On 1 May 2016 at 18:27, Vighnesh Birodkar <vighnesh... at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hello Raphael
>>>>>>>>>
>>>>>>>>> The error here is because the output of blob_doh in a numpy array
>>>>>>>>> of blobs, it is not an image meant for display. If you notice the example
>>>>>>>>> the blobs are being drawn separately inside the for loop. If no blobs are
>>>>>>>>> being detected, you can adjust the threshold. Lowering the threshold will
>>>>>>>>> make the function detect more blobs. It is clarified futher in the
>>>>>>>>> documentation
>>>>>>>>>
>>>>>>>>> http://scikit-image.org/docs/dev/api/skimage.feature.html#skimage.feature.blob_doh
>>>>>>>>>
>>>>>>>>> I was able to detect one blob in your image with the default
>>>>>>>>> threshold value. See:
>>>>>>>>>
>>>>>>>>> https://gist.github.com/vighneshbirodkar/c16515126e648cf92f08d3319d3a023e
>>>>>>>>>
>>>>>>>>> Find the result attached.
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Vighnesh
>>>>>>>>>
>>>>>>>>> On Saturday, April 30, 2016 at 2:02:51 AM UTC-4, Raphael wrote:
>>>>>>>>>
>>>>>>>>>> hi folks,
>>>>>>>>>>
>>>>>>>>>>   Got a problem removing dust and identifying blobs/crytals.
>>>>>>>>>> Kindly see my code below
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> from __future__ import division, print_function
>>>>>>>>>> import matplotlib.pyplot as plt
>>>>>>>>>> import numpy as np
>>>>>>>>>> from skimage import io, feature, color, measure, draw,
>>>>>>>>>> img_as_float, exposure
>>>>>>>>>> from skimage.filters.rank import median
>>>>>>>>>> from skimage.feature import blob_dog, blob_log, blob_doh
>>>>>>>>>> from skimage.morphology import disk
>>>>>>>>>>
>>>>>>>>>> #raw image
>>>>>>>>>> image_raw =
>>>>>>>>>> img_as_float((io.imread('/home/raphael/Documents/ScikitImage/Run
>>>>>>>>>> 4-2_00061cropped.tif'))) (RawImage.tif attached)
>>>>>>>>>> plt.imshow(image_raw)
>>>>>>>>>>
>>>>>>>>>> #converted to grayscale
>>>>>>>>>>
>>>>>>>>>> img_gray =
>>>>>>>>>> color.rgb2gray(io.imread('/home/raphael/Documents/ScikitImage/Run
>>>>>>>>>> 4-2_00061cropped.tif'))
>>>>>>>>>> plt.imshow(image_gray)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> #applied median filter to take out small dust particles. But the
>>>>>>>>>> big dust particle on the top right corner still persists (see median1.png
>>>>>>>>>> attached)
>>>>>>>>>> img_filtered=median(img_gray,disk(10))
>>>>>>>>>> plt.imshow(img_filtered)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> #applied  adapthist to make image more clearer (see adaptive.png)
>>>>>>>>>>
>>>>>>>>>> img_equalized=exposure.equalize_adapthist(img_filtered)
>>>>>>>>>> plt.imshow(img_equalized)
>>>>>>>>>>
>>>>>>>>>> #trying to detect the crystals/blobs. I followed the example here
>>>>>>>>>> http://scikit-image.org/docs/dev/auto_examples/features_detection/plot_blob.html
>>>>>>>>>> But this gave an error. matplotlib was not happy with the data type
>>>>>>>>>> blobs_doh = blob_doh(img_equalized,  max_sigma=30, threshold=.1)
>>>>>>>>>> plt.imshow(blobs_doh)
>>>>>>>>>>
>>>>>>>>>> My problems are:
>>>>>>>>>>
>>>>>>>>>> 1. I could not get the dust particle out especially the really
>>>>>>>>>> big one on the top right. How can I get it out?
>>>>>>>>>>
>>>>>>>>>> 2. I could not detect the crystals/blobs in the image using
>>>>>>>>>> blob_doh
>>>>>>>>>>
>>>>>>>>>> Any ideas/suggestions is highly appreciated.  Thank you!
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> 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/VtkzL9ZCY6Q/unsubscribe
>>>>>>>>> .
>>>>>>>>> To unsubscribe from this group and all its topics, send an email
>>>>>>>>> to scikit-image... at googlegroups.com.
>>>>>>>>> To post to this group, send email to scikit... at googlegroups.com.
>>>>>>>>> To view this discussion on the web, visit
>>>>>>>>> https://groups.google.com/d/msgid/scikit-image/0fd22d80-4549-470f-b61b-f48d9a8d66f5%40googlegroups.com
>>>>>>>>> <https://groups.google.com/d/msgid/scikit-image/0fd22d80-4549-470f-b61b-f48d9a8d66f5%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>> 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/VtkzL9ZCY6Q/unsubscribe
>>>>>>> .
>>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>>> scikit-image... at googlegroups.com.
>>>>>>> To post to this group, send email to scikit... at googlegroups.com.
>>>>>>> To view this discussion on the web, visit
>>>>>>> https://groups.google.com/d/msgid/scikit-image/b9ede614-1c9d-4a22-a681-fab417250aba%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/scikit-image/b9ede614-1c9d-4a22-a681-fab417250aba%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> 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/VtkzL9ZCY6Q/unsubscribe
>>>>>> .
>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>> scikit-image... at googlegroups.com.
>>>>>> To post to this group, send email to scikit... at googlegroups.com.
>>>>>> To view this discussion on the web, visit
>>>>>> https://groups.google.com/d/msgid/scikit-image/CAFCvXeMTH9ke7Cv%3DucywhtaWPVftbfqQwVUw0O340J4y%2B6bafA%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/scikit-image/CAFCvXeMTH9ke7Cv%3DucywhtaWPVftbfqQwVUw0O340J4y%2B6bafA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> --
>>>>> 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/VtkzL9ZCY6Q/unsubscribe
>>>>> .
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> scikit-image... at googlegroups.com.
>>>>> To post to this group, send email to scikit... at googlegroups.com.
>>>>> To view this discussion on the web, visit
>>>>> https://groups.google.com/d/msgid/scikit-image/CAD82iYrA%2BgP0K2zopnj8Cp_Jg7QOVVNCt9tJmsy8rSz6dAfLBg%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/scikit-image/CAD82iYrA%2BgP0K2zopnj8Cp_Jg7QOVVNCt9tJmsy8rSz6dAfLBg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>>>> 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/VtkzL9ZCY6Q/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> scikit-image... at googlegroups.com.
>>>> To post to this group, send email to scikit... at googlegroups.com.
>>>> To view this discussion on the web, visit
>>>> https://groups.google.com/d/msgid/scikit-image/CAFCvXePXM93QLh9PFO%2B9GZxTHP%3D62B8Fk%3DddFect%2BrAkfBzyag%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/scikit-image/CAFCvXePXM93QLh9PFO%2B9GZxTHP%3D62B8Fk%3DddFect%2BrAkfBzyag%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> 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/VtkzL9ZCY6Q/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> scikit-image... at googlegroups.com.
>>> To post to this group, send email to scikit... at googlegroups.com.
>>> To view this discussion on the web, visit
>>> https://groups.google.com/d/msgid/scikit-image/CAD82iYo%2BxaeFKMf6vzKe5xgn8v6Jfb46j3vzqYjxGMGcqAxLFg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/scikit-image/CAD82iYo%2BxaeFKMf6vzKe5xgn8v6Jfb46j3vzqYjxGMGcqAxLFg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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/VtkzL9ZCY6Q/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> scikit-image+unsubscribe at googlegroups.com.
> To post to this group, send email to scikit-image at googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/scikit-image/e483515c-2f96-41e3-a22a-90e0de0e1700%40googlegroups.com
> <https://groups.google.com/d/msgid/scikit-image/e483515c-2f96-41e3-a22a-90e0de0e1700%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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/20160516/2a907bd1/attachment.html>


More information about the scikit-image mailing list