From siqueiraaf at gmail.com Wed Nov 9 09:56:07 2016 From: siqueiraaf at gmail.com (Alexandre Fioravante de Siqueira) Date: Wed, 9 Nov 2016 15:56:07 +0100 Subject: [scikit-image] Fitting figures with missing parts Message-ID: Dear all, I have these contours from the same object. However, there was another object over it. Its contour was divided, and I don't have the "center" part. I'd like to use a tool and show that they're belong to the same part. I was trying to use an ellipse to do that, but the results are really bad. Could you help me with that? I appreciate any idea. Thank you very much! Kind regards, Alex -- ------------------------------------------------------------------------------ Dr. Alexandre 'Jaguar' Fioravante de Siqueira Office 306 - Institut f?r Geologie Fakult?t f?r Geowissenschaften, Geotechnik und Bergbau Technische Universit?t Bergakademie Freiberg Bernhard-von-Cotta-Stra?e, 2 Freiberg (09599), Mittelsachsen - Sachsen - Deutschland Lattes curriculum: http://lattes.cnpq.br/3936721630855880/ Personal site: http://www.programandociencia.com/about/ Github: http://www.github.com/alexandrejaguar/ Skype: alexandrejaguar Twitter: http://www.twitter.com/alexdesiqueira/ ------------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: missing_part_contour.png Type: image/png Size: 12592 bytes Desc: not available URL: From hellomurasaki at gmail.com Thu Nov 10 08:54:44 2016 From: hellomurasaki at gmail.com (Viji C) Date: Thu, 10 Nov 2016 19:24:44 +0530 Subject: [scikit-image] Fitting figures with missing parts In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: *Viji C* > Date: Thursday, November 10, 2016 Subject: [scikit-image] Fitting figures with missing parts To: Alexandre Fioravante de Siqueira > Hello Mr. Alex, Please try Fractal Analysis. I couldn't understand the morphology of the contours exactly from your mail. But if the contours are self similar, then Fractals can help you. FracLac is one of tool for Fractal Analysis. I'm newbie to Vision Research. Kindly get suggestions from experts before proceeding to implement Fractals. Regards, C.Viji On Wednesday, November 9, 2016, Alexandre Fioravante de Siqueira < siqueiraaf at gmail.com> wrote: > Dear all, > I have these contours from the same object. However, there was another > object over it. Its contour was divided, and I don't have the "center" part. > I'd like to use a tool and show that they're belong to the same part. I > was trying to use an ellipse to do that, but the results are really bad. > Could you help me with that? I appreciate any idea. > Thank you very much! > Kind regards, > > Alex > > -- > ------------------------------------------------------------ > ------------------ > Dr. Alexandre 'Jaguar' Fioravante de Siqueira > Office 306 - Institut f?r Geologie > Fakult?t f?r Geowissenschaften, Geotechnik und Bergbau > Technische Universit?t Bergakademie Freiberg > Bernhard-von-Cotta-Stra?e, 2 > Freiberg (09599), Mittelsachsen - Sachsen - Deutschland > Lattes curriculum: http://lattes.cnpq.br/3936721630855880/ > Personal site: http://www.programandociencia.com/about/ > Github: http://www.github.com/alexandrejaguar/ > Skype: alexandrejaguar > Twitter: http://www.twitter.com/alexdesiqueira/ > ------------------------------------------------------------ > ------------------ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kevin.keraudren at googlemail.com Thu Nov 10 09:51:23 2016 From: kevin.keraudren at googlemail.com (Kevin Keraudren) Date: Thu, 10 Nov 2016 14:51:23 +0000 Subject: [scikit-image] Fitting figures with missing parts In-Reply-To: References: Message-ID: Hi Alex, Why not use the Hough transform to detect lines as in http://scikit-image.org/docs/dev/auto_examples/plot_ line_hough_transform.html ? See adapted code and output attached. Kevin On Wed, Nov 9, 2016 at 2:56 PM, Alexandre Fioravante de Siqueira < siqueiraaf at gmail.com> wrote: > Dear all, > I have these contours from the same object. However, there was another > object over it. Its contour was divided, and I don't have the "center" part. > I'd like to use a tool and show that they're belong to the same part. I > was trying to use an ellipse to do that, but the results are really bad. > Could you help me with that? I appreciate any idea. > Thank you very much! > Kind regards, > > Alex > > -- > ------------------------------------------------------------ > ------------------ > Dr. Alexandre 'Jaguar' Fioravante de Siqueira > Office 306 - Institut f?r Geologie > Fakult?t f?r Geowissenschaften, Geotechnik und Bergbau > Technische Universit?t Bergakademie Freiberg > Bernhard-von-Cotta-Stra?e, 2 > Freiberg (09599), Mittelsachsen - Sachsen - Deutschland > Lattes curriculum: http://lattes.cnpq.br/3936721630855880/ > Personal site: http://www.programandociencia.com/about/ > Github: http://www.github.com/alexandrejaguar/ > Skype: alexandrejaguar > Twitter: http://www.twitter.com/alexdesiqueira/ > ------------------------------------------------------------ > ------------------ > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2016-11-10 at 14.37.51.png Type: image/png Size: 345257 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: broken.py Type: text/x-python-script Size: 1840 bytes Desc: not available URL: From jeanpatrick.pommier at gmail.com Thu Nov 10 11:47:40 2016 From: jeanpatrick.pommier at gmail.com (Jean-Patrick Pommier) Date: Thu, 10 Nov 2016 17:47:40 +0100 Subject: [scikit-image] Fitting figures with missing parts In-Reply-To: References: Message-ID: The attached notebook proposes a solution 2016-11-10 14:54 GMT+01:00 Viji C : > > > ---------- Forwarded message ---------- > From: *Viji C* > Date: Thursday, November 10, 2016 > Subject: [scikit-image] Fitting figures with missing parts > To: Alexandre Fioravante de Siqueira > > > Hello Mr. Alex, > > Please try Fractal Analysis. I couldn't understand the morphology of the > contours exactly from your mail. But if the contours are self similar, then > Fractals can help you. FracLac is one of tool for Fractal Analysis. > > I'm newbie to Vision Research. Kindly get suggestions from experts before > proceeding to implement Fractals. > > Regards, > C.Viji > > > > On Wednesday, November 9, 2016, Alexandre Fioravante de Siqueira < > siqueiraaf at gmail.com> wrote: > >> Dear all, >> I have these contours from the same object. However, there was another >> object over it. Its contour was divided, and I don't have the "center" part. >> I'd like to use a tool and show that they're belong to the same part. I >> was trying to use an ellipse to do that, but the results are really bad. >> Could you help me with that? I appreciate any idea. >> Thank you very much! >> Kind regards, >> >> Alex >> >> -- >> ------------------------------------------------------------ >> ------------------ >> Dr. Alexandre 'Jaguar' Fioravante de Siqueira >> Office 306 - Institut f?r Geologie >> Fakult?t f?r Geowissenschaften, Geotechnik und Bergbau >> Technische Universit?t Bergakademie Freiberg >> Bernhard-von-Cotta-Stra?e, 2 >> Freiberg (09599), Mittelsachsen - Sachsen - Deutschland >> Lattes curriculum: http://lattes.cnpq.br/3936721630855880/ >> Personal site: http://www.programandociencia.com/about/ >> Github: http://www.github.com/alexandrejaguar/ >> Skype: alexandrejaguar >> Twitter: http://www.twitter.com/alexdesiqueira/ >> ------------------------------------------------------------ >> ------------------ >> > > > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -- http://dip4fish.blogspot.fr/ Dedicated to Digital Image Processing for FISH, QFISH and other things about the telomeres. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Patch cut shape.ipynb Type: application/x-ipynb+json Size: 62286 bytes Desc: not available URL: From jeanpatrick.pommier at gmail.com Thu Nov 10 11:49:34 2016 From: jeanpatrick.pommier at gmail.com (Jean-Patrick Pommier) Date: Thu, 10 Nov 2016 17:49:34 +0100 Subject: [scikit-image] Fitting figures with missing parts In-Reply-To: References: Message-ID: ?the picture is in the previous notebook 2016-11-10 17:47 GMT+01:00 Jean-Patrick Pommier < jeanpatrick.pommier at gmail.com>: > The attached notebook proposes a solution > > 2016-11-10 14:54 GMT+01:00 Viji C : > >> >> >> ---------- Forwarded message ---------- >> From: *Viji C* >> Date: Thursday, November 10, 2016 >> Subject: [scikit-image] Fitting figures with missing parts >> To: Alexandre Fioravante de Siqueira >> >> >> Hello Mr. Alex, >> >> Please try Fractal Analysis. I couldn't understand the morphology of the >> contours exactly from your mail. But if the contours are self similar, then >> Fractals can help you. FracLac is one of tool for Fractal Analysis. >> >> I'm newbie to Vision Research. Kindly get suggestions from experts before >> proceeding to implement Fractals. >> >> Regards, >> C.Viji >> >> >> >> On Wednesday, November 9, 2016, Alexandre Fioravante de Siqueira < >> siqueiraaf at gmail.com> wrote: >> >>> Dear all, >>> I have these contours from the same object. However, there was another >>> object over it. Its contour was divided, and I don't have the "center" part. >>> I'd like to use a tool and show that they're belong to the same part. I >>> was trying to use an ellipse to do that, but the results are really bad. >>> Could you help me with that? I appreciate any idea. >>> Thank you very much! >>> Kind regards, >>> >>> Alex >>> >>> -- >>> ------------------------------------------------------------ >>> ------------------ >>> Dr. Alexandre 'Jaguar' Fioravante de Siqueira >>> Office 306 - Institut f?r Geologie >>> Fakult?t f?r Geowissenschaften, Geotechnik und Bergbau >>> Technische Universit?t Bergakademie Freiberg >>> Bernhard-von-Cotta-Stra?e, 2 >>> Freiberg (09599), Mittelsachsen - Sachsen - Deutschland >>> Lattes curriculum: http://lattes.cnpq.br/3936721630855880/ >>> Personal site: http://www.programandociencia.com/about/ >>> Github: http://www.github.com/alexandrejaguar/ >>> Skype: alexandrejaguar >>> Twitter: http://www.twitter.com/alexdesiqueira/ >>> ------------------------------------------------------------ >>> ------------------ >>> >> >> >> _______________________________________________ >> scikit-image mailing list >> scikit-image at python.org >> https://mail.python.org/mailman/listinfo/scikit-image >> >> > > > -- > http://dip4fish.blogspot.fr/ > Dedicated to Digital Image Processing for FISH, QFISH and other things > about the telomeres. > -- http://dip4fish.blogspot.fr/ Dedicated to Digital Image Processing for FISH, QFISH and other things about the telomeres. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: incomplete shape.png Type: image/png Size: 14293 bytes Desc: not available URL: From jiri.borovec at fel.cvut.cz Sun Nov 13 10:51:15 2016 From: jiri.borovec at fel.cvut.cz (=?UTF-8?B?SmnFmcOtIEJvcm92ZWM=?=) Date: Sun, 13 Nov 2016 16:51:15 +0100 Subject: [scikit-image] BPDL in skimage? In-Reply-To: <1476209251.998616.752709505.31E31A16@webmail.messagingengine.com> References: <1476209251.998616.752709505.31E31A16@webmail.messagingengine.com> Message-ID: Ok, it means wait until it will be generally proved that it is useful method, correct? -- Best regards, Jiri Borovec ------------------------------------------------------------------------ Ing. Jiri Borovec, MSc PhD student at CMP CTU, http://cmp.felk.cvut.cz/~borovji3 On 11 October 2016 at 20:07, Stefan van der Walt wrote: > Hi Jiri > > On Mon, Oct 10, 2016, at 04:42, Ji?? Borovec wrote: > > recently we made a new method Binary Pattern Dictionary learning for > estimation an atlas from set of binary images where we detect and decompose > frequent patterns in the image set, see paper in attachment. I was > wondering if you are interested to have this method as contribution to the > scikit-image library? > > > We typically wait a while for papers to gain popularity before we > implement them in scikit-image. > > That said, I think it's an excellent idea to make the code available with > proper licensing and documentation until such time that we can include it. > > Best regards > St?fan > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefanv at berkeley.edu Sun Nov 13 11:30:03 2016 From: stefanv at berkeley.edu (Stefan van der Walt) Date: Sun, 13 Nov 2016 08:30:03 -0800 Subject: [scikit-image] BPDL in skimage? In-Reply-To: References: <1476209251.998616.752709505.31E31A16@webmail.messagingengine.com> Message-ID: <1479054603.1661771.786254929.27BD7882@webmail.messagingengine.com> Hi Jiri On Sun, Nov 13, 2016, at 07:51, Ji?? Borovec wrote: > Ok, it means wait until it will be generally proved that it is useful > method, correct? Yes, that's our approach in general. But, as mentioned before, it's so easy to publish a package on pypi now that there's no reason to get the code out into the hands of others already. And you should feel free to post announcements related to the package on this list. Best regards St?fan -------------- next part -------------- An HTML attachment was scrubbed... URL: From luecks at gmail.com Mon Nov 14 04:20:47 2016 From: luecks at gmail.com (=?UTF-8?Q?Stefanie_L=C3=BCck?=) Date: Mon, 14 Nov 2016 10:20:47 +0100 Subject: [scikit-image] statistical region merging Message-ID: Hi! I am looking for a statistical region merging segmentation. Is there anything like this in skimage? Thanks in advance, Stefanie -------------- next part -------------- An HTML attachment was scrubbed... URL: From siqueiraaf at gmail.com Mon Nov 14 14:38:53 2016 From: siqueiraaf at gmail.com (Alexandre Fioravante de Siqueira) Date: Mon, 14 Nov 2016 20:38:53 +0100 Subject: [scikit-image] Fitting figures with missing parts In-Reply-To: References: Message-ID: Dear Jean, Viji and Kevin, thank you very much for your proposed solutions! Kevin's solution looks nice, although Jean's one is very good too. I'll try to apply them on my problem this week. After that I return to contact you with the results. Thanks again for your support, Alex 2016-11-10 17:49 GMT+01:00 Jean-Patrick Pommier < jeanpatrick.pommier at gmail.com>: > > ?the picture is in the previous notebook > > 2016-11-10 17:47 GMT+01:00 Jean-Patrick Pommier < > jeanpatrick.pommier at gmail.com>: > >> The attached notebook proposes a solution >> >> 2016-11-10 14:54 GMT+01:00 Viji C : >> >>> >>> >>> ---------- Forwarded message ---------- >>> From: *Viji C* >>> Date: Thursday, November 10, 2016 >>> Subject: [scikit-image] Fitting figures with missing parts >>> To: Alexandre Fioravante de Siqueira >>> >>> >>> Hello Mr. Alex, >>> >>> Please try Fractal Analysis. I couldn't understand the morphology of the >>> contours exactly from your mail. But if the contours are self similar, then >>> Fractals can help you. FracLac is one of tool for Fractal Analysis. >>> >>> I'm newbie to Vision Research. Kindly get suggestions from experts >>> before proceeding to implement Fractals. >>> >>> Regards, >>> C.Viji >>> >>> >>> >>> On Wednesday, November 9, 2016, Alexandre Fioravante de Siqueira < >>> siqueiraaf at gmail.com> wrote: >>> >>>> Dear all, >>>> I have these contours from the same object. However, there was another >>>> object over it. Its contour was divided, and I don't have the "center" part. >>>> I'd like to use a tool and show that they're belong to the same part. I >>>> was trying to use an ellipse to do that, but the results are really bad. >>>> Could you help me with that? I appreciate any idea. >>>> Thank you very much! >>>> Kind regards, >>>> >>>> Alex >>>> >>>> -- >>>> ------------------------------------------------------------ >>>> ------------------ >>>> Dr. Alexandre 'Jaguar' Fioravante de Siqueira >>>> Office 306 - Institut f?r Geologie >>>> Fakult?t f?r Geowissenschaften, Geotechnik und Bergbau >>>> Technische Universit?t Bergakademie Freiberg >>>> Bernhard-von-Cotta-Stra?e, 2 >>>> Freiberg (09599), Mittelsachsen - Sachsen - Deutschland >>>> Lattes curriculum: http://lattes.cnpq.br/3936721630855880/ >>>> Personal site: http://www.programandociencia.com/about/ >>>> Github: http://www.github.com/alexandrejaguar/ >>>> Skype: alexandrejaguar >>>> Twitter: http://www.twitter.com/alexdesiqueira/ >>>> ------------------------------------------------------------ >>>> ------------------ >>>> >>> >>> >>> _______________________________________________ >>> scikit-image mailing list >>> scikit-image at python.org >>> https://mail.python.org/mailman/listinfo/scikit-image >>> >>> >> >> >> -- >> http://dip4fish.blogspot.fr/ >> Dedicated to Digital Image Processing for FISH, QFISH and other things >> about the telomeres. >> > > > > -- > http://dip4fish.blogspot.fr/ > Dedicated to Digital Image Processing for FISH, QFISH and other things > about the telomeres. > -- ------------------------------------------------------------------------------ Dr. Alexandre 'Jaguar' Fioravante de Siqueira Office 306 - Institut f?r Geologie Fakult?t f?r Geowissenschaften, Geotechnik und Bergbau Technische Universit?t Bergakademie Freiberg Bernhard-von-Cotta-Stra?e, 2 Freiberg (09599), Mittelsachsen - Sachsen - Deutschland Lattes curriculum: http://lattes.cnpq.br/3936721630855880/ Personal site: http://www.programandociencia.com/about/ Github: http://www.github.com/alexandrejaguar/ Skype: alexandrejaguar Twitter: http://www.twitter.com/alexdesiqueira/ ------------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: incomplete shape.png Type: image/png Size: 14293 bytes Desc: not available URL: From jni.soma at gmail.com Mon Nov 14 19:51:01 2016 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Mon, 14 Nov 2016 19:51:01 -0500 Subject: [scikit-image] statistical region merging In-Reply-To: References: Message-ID: Hi Stefanie, Sorry, these responses should all be CCd to the list, so that others can benefit from the discussion ? my bad for dropping that thread. Could you please: - provide an example segmentation where skimage is doing worse than Fiji - provide the script and parameter settings for both Then we can help troubleshoot. I don?t know what you mean by the results ?were very strange?, for example, so it?s hard to diagnose the problem. =) Starting to merge directly from pixels, as the Fiji plugin does, is expensive and can be error prone. SLIC is a fast, initial pixel merging step, from which we can merge regions according to various criteria. With the right parameters, SLIC + RAG mean color agglomeration should give quite similar results to Fiji?s approach? Juan. On 15 November 2016 at 2:39:45 am, Stefanie L?ck (luecks at gmail.com) wrote: Hi Juan, thank you for your reply! I have seen and tested the RAG examples but I did not understand the SLIC step and the results were very strange... Is there any advantage? I am using SLIC anyway at the moment but the statistical region merging of ImageJ gives me better results. Thanks Stefanie 2016-11-14 13:44 GMT+01:00 Juan Nunez-Iglesias : > Hi Stefanie! > > Have a look at skimage.future.graph! There are some relevant examples in > the gallery, too: > > http://scikit-image.org/docs/dev/auto_examples/#segmentation-of-objects > > The future.graph API is still experimental (that?s why it?s in ?future?), > so we really appreciate any feedback you have about it! > > Juan. > > > > On 14 November 2016 at 8:21:12 pm, Stefanie L?ck (luecks at gmail.com) wrote: > > Hi! > > I am looking for a statistical region merging segmentation. Is there > anything like this in skimage? > > Thanks in advance, > Stefanie > _______________________________________________ > scikit-image mailing list > scikit-image at python.org > https://mail.python.org/mailman/listinfo/scikit-image > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luecks at gmail.com Tue Nov 15 03:11:12 2016 From: luecks at gmail.com (=?UTF-8?Q?Stefanie_L=C3=BCck?=) Date: Tue, 15 Nov 2016 09:11:12 +0100 Subject: [scikit-image] statistical region merging In-Reply-To: References: Message-ID: Dear all, sorry about the worse problem description! I tried this example with different parameters for SLIC and graph.cut_threshold but none of them gave me satisfying results. I attached the original image, the ImageJ SRM (Q=25) output and the RAG output (segmentation.slic(img, compactness=20; n_segments=400), graph.cut_threshold(labels1, g, 10)) The results are quite different, obviously I am doing something wrong. My aim is to segment each leaf separately. At the moment I am using felzenszwalb, which gives me quite reasonable results. However I would like to try everything possible and therefore I would appreciate some tips. Thank you for the explanation of the algorithm, that was helpful. Best regards, Stefanie 2016-11-15 1:51 GMT+01:00 Juan Nunez-Iglesias : > Hi Stefanie, > > Sorry, these responses should all be CCd to the list, so that others can > benefit from the discussion ? my bad for dropping that thread. Could you > please: > > - provide an example segmentation where skimage is doing worse than Fiji > - provide the script and parameter settings for both > > Then we can help troubleshoot. I don?t know what you mean by the results > ?were very strange?, for example, so it?s hard to diagnose the problem. =) > > Starting to merge directly from pixels, as the Fiji plugin does, is > expensive and can be error prone. SLIC is a fast, initial pixel merging > step, from which we can merge regions according to various criteria. With > the right parameters, SLIC + RAG mean color agglomeration should give quite > similar results to Fiji?s approach? > > Juan. > > On 15 November 2016 at 2:39:45 am, Stefanie L?ck (luecks at gmail.com) wrote: > > Hi Juan, > > thank you for your reply! I have seen and tested the RAG examples but I > did not understand the SLIC step and the results were very strange... Is > there any advantage? I am using SLIC anyway at the moment but > the statistical region merging of ImageJ gives me better results. > > Thanks > Stefanie > > > > 2016-11-14 13:44 GMT+01:00 Juan Nunez-Iglesias : > >> Hi Stefanie! >> >> Have a look at skimage.future.graph! There are some relevant examples in >> the gallery, too: >> >> http://scikit-image.org/docs/dev/auto_examples/#segmentation-of-objects >> >> The future.graph API is still experimental (that?s why it?s in ?future?), >> so we really appreciate any feedback you have about it! >> >> Juan. >> >> >> >> On 14 November 2016 at 8:21:12 pm, Stefanie L?ck (luecks at gmail.com) >> wrote: >> >> Hi! >> >> I am looking for a statistical region merging segmentation. Is there >> anything like this in skimage? >> >> Thanks in advance, >> Stefanie >> _______________________________________________ >> scikit-image mailing list >> scikit-image at python.org >> https://mail.python.org/mailman/listinfo/scikit-image >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: imagej.png Type: image/png Size: 3367 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: original.png Type: image/png Size: 141236 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RAG.png Type: image/png Size: 8466 bytes Desc: not available URL: From jni.soma at gmail.com Tue Nov 15 17:55:16 2016 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 15 Nov 2016 16:55:16 -0600 Subject: [scikit-image] statistical region merging In-Reply-To: References: Message-ID: Hi Stefanie, Wow, those results *do* look weird! =) Why are they not the same shape as the image? Could you send us the complete code you used? In the meantime, there's a few things to change. `cut_threshold` is probably the single most fragile algorithm you can use with a RAG. You want to be using merge_hierarchical. You can do this either on a "color graph", which merges regions according to color similarity (and is most similar to the statistical region merging of Fiji): http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_rag_merge.html#sphx-glr-auto-examples-segmentation-plot-rag-merge-py or on a *boundary graph*, which first detects "edges" in the image and then merges regions progressively according to the mean edge value: http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_rag_boundary.html#sphx-glr-auto-examples-segmentation-plot-rag-boundary-py http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_boundary_merge.html#sphx-glr-auto-examples-segmentation-plot-boundary-merge-py My intuition about this image is that your best choice is to use a sobel filter: http://scikit-image.org/docs/dev/auto_examples/edges/plot_edge_filter.html#sphx-glr-auto-examples-edges-plot-edge-filter-py followed by compact watershed: http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_compact_watershed.html#sphx-glr-auto-examples-segmentation-plot-compact-watershed-py then by region boundary merging: http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_boundary_merge.html#sphx-glr-auto-examples-segmentation-plot-boundary-merge-py The edges look pretty sharp, too. You might even get good results with Canny: http://scikit-image.org/docs/dev/auto_examples/edges/plot_canny.html#sphx-glr-auto-examples-edges-plot-canny-py I hope all this helps! Juan. On 15 November 2016 at 7:11:14 pm, Stefanie L?ck (luecks at gmail.com) wrote: Dear all, sorry about the worse problem description! I tried this example with different parameters for SLIC and graph.cut_threshold but none of them gave me satisfying results. I attached the original image, the ImageJ SRM (Q=25) output and the RAG output (segmentation.slic(img, compactness=20; n_segments=400), graph.cut_threshold(labels1, g, 10)) The results are quite different, obviously I am doing something wrong. My aim is to segment each leaf separately. At the moment I am using felzenszwalb, which gives me quite reasonable results. However I would like to try everything possible and therefore I would appreciate some tips. Thank you for the explanation of the algorithm, that was helpful. Best regards, Stefanie 2016-11-15 1:51 GMT+01:00 Juan Nunez-Iglesias : > Hi Stefanie, > > Sorry, these responses should all be CCd to the list, so that others can > benefit from the discussion ? my bad for dropping that thread. Could you > please: > > - provide an example segmentation where skimage is doing worse than Fiji > - provide the script and parameter settings for both > > Then we can help troubleshoot. I don?t know what you mean by the results > ?were very strange?, for example, so it?s hard to diagnose the problem. =) > > Starting to merge directly from pixels, as the Fiji plugin does, is > expensive and can be error prone. SLIC is a fast, initial pixel merging > step, from which we can merge regions according to various criteria. With > the right parameters, SLIC + RAG mean color agglomeration should give quite > similar results to Fiji?s approach? > > Juan. > > On 15 November 2016 at 2:39:45 am, Stefanie L?ck (luecks at gmail.com) wrote: > > Hi Juan, > > thank you for your reply! I have seen and tested the RAG examples but I > did not understand the SLIC step and the results were very strange... Is > there any advantage? I am using SLIC anyway at the moment but > the statistical region merging of ImageJ gives me better results. > > Thanks > Stefanie > > > > 2016-11-14 13:44 GMT+01:00 Juan Nunez-Iglesias : > >> Hi Stefanie! >> >> Have a look at skimage.future.graph! There are some relevant examples in >> the gallery, too: >> >> http://scikit-image.org/docs/dev/auto_examples/#segmentation-of-objects >> >> The future.graph API is still experimental (that?s why it?s in ?future?), >> so we really appreciate any feedback you have about it! >> >> Juan. >> >> >> >> On 14 November 2016 at 8:21:12 pm, Stefanie L?ck (luecks at gmail.com) >> wrote: >> >> Hi! >> >> I am looking for a statistical region merging segmentation. Is there >> anything like this in skimage? >> >> Thanks in advance, >> Stefanie >> _______________________________________________ >> scikit-image mailing list >> scikit-image at python.org >> https://mail.python.org/mailman/listinfo/scikit-image >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luecks at gmail.com Wed Nov 16 11:06:00 2016 From: luecks at gmail.com (=?UTF-8?Q?Stefanie_L=C3=BCck?=) Date: Wed, 16 Nov 2016 17:06:00 +0100 Subject: [scikit-image] statistical region merging In-Reply-To: References: Message-ID: Hi Juan, thank you very much for this detailed explanation and your suggestions. I just had a quick try with the merge_hierarchical example. If I use the code which I attached the results look more like expected. In addition, I will test your others suggestions also in terms of speed (I have to segment many images). Thanks again for your effort! Stefanie 2016-11-15 23:55 GMT+01:00 Juan Nunez-Iglesias : > Hi Stefanie, > > Wow, those results *do* look weird! =) Why are they not the same shape as > the image? Could you send us the complete code you used? > > In the meantime, there's a few things to change. `cut_threshold` is > probably the single most fragile algorithm you can use with a RAG. You want > to be using merge_hierarchical. You can do this either on a "color graph", > which merges regions according to color similarity (and is most similar to > the statistical region merging of Fiji): > http://scikit-image.org/docs/dev/auto_examples/ > segmentation/plot_rag_merge.html#sphx-glr-auto-examples- > segmentation-plot-rag-merge-py > > or on a *boundary graph*, which first detects "edges" in the image and > then merges regions progressively according to the mean edge value: > http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_rag_ > boundary.html#sphx-glr-auto-examples-segmentation-plot-rag-boundary-py > > http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_boundary_ > merge.html#sphx-glr-auto-examples-segmentation-plot-boundary-merge-py > > My intuition about this image is that your best choice is to use a sobel > filter: > http://scikit-image.org/docs/dev/auto_examples/edges/plot_ > edge_filter.html#sphx-glr-auto-examples-edges-plot-edge-filter-py > followed by compact watershed: > http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_compact_ > watershed.html#sphx-glr-auto-examples-segmentation-plot- > compact-watershed-py > then by region boundary merging: > http://scikit-image.org/docs/dev/auto_examples/segmentation/plot_boundary_ > merge.html#sphx-glr-auto-examples-segmentation-plot-boundary-merge-py > > The edges look pretty sharp, too. You might even get good results with > Canny: > http://scikit-image.org/docs/dev/auto_examples/edges/plot_ > canny.html#sphx-glr-auto-examples-edges-plot-canny-py > > I hope all this helps! > > Juan. > > On 15 November 2016 at 7:11:14 pm, Stefanie L?ck (luecks at gmail.com) wrote: > > Dear all, > > sorry about the worse problem description! I tried this example > with > different parameters for SLIC and graph.cut_threshold but none of them > gave me satisfying results. > > I attached the original image, the ImageJ SRM (Q=25) output and the RAG > output (segmentation.slic(img, compactness=20; n_segments=400), graph.cut_threshold(labels1, > g, 10)) > > The results are quite different, obviously I am doing something wrong. My > aim is to segment each leaf separately. At the moment I am > using felzenszwalb, which gives me quite reasonable results. However I > would like to try everything possible and therefore I would appreciate some > tips. > > Thank you for the explanation of the algorithm, that was helpful. > > Best regards, > Stefanie > > > > > > 2016-11-15 1:51 GMT+01:00 Juan Nunez-Iglesias : > >> Hi Stefanie, >> >> Sorry, these responses should all be CCd to the list, so that others can >> benefit from the discussion ? my bad for dropping that thread. Could you >> please: >> >> - provide an example segmentation where skimage is doing worse than Fiji >> - provide the script and parameter settings for both >> >> Then we can help troubleshoot. I don?t know what you mean by the results >> ?were very strange?, for example, so it?s hard to diagnose the problem. =) >> >> Starting to merge directly from pixels, as the Fiji plugin does, is >> expensive and can be error prone. SLIC is a fast, initial pixel merging >> step, from which we can merge regions according to various criteria. With >> the right parameters, SLIC + RAG mean color agglomeration should give quite >> similar results to Fiji?s approach? >> >> Juan. >> >> On 15 November 2016 at 2:39:45 am, Stefanie L?ck (luecks at gmail.com) >> wrote: >> >> Hi Juan, >> >> thank you for your reply! I have seen and tested the RAG examples but I >> did not understand the SLIC step and the results were very strange... Is >> there any advantage? I am using SLIC anyway at the moment but >> the statistical region merging of ImageJ gives me better results. >> >> Thanks >> Stefanie >> >> >> >> 2016-11-14 13:44 GMT+01:00 Juan Nunez-Iglesias : >> >>> Hi Stefanie! >>> >>> Have a look at skimage.future.graph! There are some relevant examples in >>> the gallery, too: >>> >>> http://scikit-image.org/docs/dev/auto_examples/#segmentation-of-objects >>> >>> The future.graph API is still experimental (that?s why it?s in >>> ?future?), so we really appreciate any feedback you have about it! >>> >>> Juan. >>> >>> >>> >>> On 14 November 2016 at 8:21:12 pm, Stefanie L?ck (luecks at gmail.com) >>> wrote: >>> >>> Hi! >>> >>> I am looking for a statistical region merging segmentation. Is there >>> anything like this in skimage? >>> >>> Thanks in advance, >>> Stefanie >>> _______________________________________________ >>> scikit-image mailing list >>> scikit-image at python.org >>> https://mail.python.org/mailman/listinfo/scikit-image >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- import numpy as np import matplotlib.pyplot as plt from skimage import data, util, filters, color from skimage.filters import roberts, sobel, scharr, prewitt from skimage import io from skimage.morphology import watershed from skimage import data, segmentation, filters, color from skimage.future import graph from skimage.filters import threshold_otsu def _weight_mean_color(graph, src, dst, n): """Callback to handle merging nodes by recomputing mean color. The method expects that the mean color of `dst` is already computed. Parameters ---------- graph : RAG The graph under consideration. src, dst : int The vertices in `graph` to be merged. n : int A neighbor of `src` or `dst` or both. Returns ------- data : dict A dictionary with the `"weight"` attribute set as the absolute difference of the mean color between node `dst` and `n`. """ diff = graph.node[dst]['mean color'] - graph.node[n]['mean color'] diff = np.linalg.norm(diff) return {'weight': diff} def merge_mean_color(graph, src, dst): """Callback called before merging two nodes of a mean color distance graph. This method computes the mean color of `dst`. Parameters ---------- graph : RAG The graph under consideration. src, dst : int The vertices in `graph` to be merged. """ graph.node[dst]['total color'] += graph.node[src]['total color'] graph.node[dst]['pixel count'] += graph.node[src]['pixel count'] graph.node[dst]['mean color'] = (graph.node[dst]['total color'] / graph.node[dst]['pixel count']) img = io.imread("test4.png", as_grey=True) edges = filters.sobel(color.rgb2gray(img)) labels = segmentation.slic(img, compactness=10, n_segments=10000) g = graph.rag_mean_color(img, labels) labels2 = graph.merge_hierarchical(labels, g, thresh=20, rag_copy=False, in_place_merge=True, merge_func=merge_mean_color, weight_func=_weight_mean_color) g2 = graph.rag_mean_color(img, labels2) out = color.label2rgb(labels2, img, kind='avg') #thresh = threshold_otsu(out) #binary = out > thresh #out = segmentation.mark_boundaries(out, labels2, (0, 0, 0)) io.imshow(out) io.show() # -------------- next part -------------- A non-text attachment was scrubbed... Name: test4.png Type: image/png Size: 456224 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: out.png Type: image/png Size: 26012 bytes Desc: not available URL: From ssouravsingh12 at gmail.com Wed Nov 16 13:57:29 2016 From: ssouravsingh12 at gmail.com (Sourav Singh) Date: Thu, 17 Nov 2016 00:27:29 +0530 Subject: [scikit-image] Contributing to scikit-image In-Reply-To: References: Message-ID: Hello, I am a student from India who is interested in scikit-image project. I would like to contribute to scikit-image by adding COSFIRE and merging CellProfiler code. If possible, I would also like to become a long-term maintainer of the project. Regards, Sourav -------------- next part -------------- An HTML attachment was scrubbed... URL: From winecoding at gmail.com Mon Nov 21 22:49:41 2016 From: winecoding at gmail.com (wine lover) Date: Mon, 21 Nov 2016 21:49:41 -0600 Subject: [scikit-image] filtering image entry values based on a threshold Message-ID: Dear All, In one code segment, I once saw an approach of filtering image values as follows using cv2. In Scikit image, if I want to realize the same functionality, how to do it? import cv2 img = cv2.threshold(img, 0.5, 1., cv2.THRESH_BINARY)[1].astype(np.uint8 Thanks, huaiyang -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefanv at berkeley.edu Tue Nov 22 20:25:48 2016 From: stefanv at berkeley.edu (Stefan van der Walt) Date: Tue, 22 Nov 2016 17:25:48 -0800 Subject: [scikit-image] Model PRs Message-ID: <1479864348.1798838.796498617.7D9771AA@webmail.messagingengine.com> Hi everyone I've started a new page on the wiki to track "Model PRs" (thanks, Juan, for the suggestion). These PRs are meant to illustrate how to perform certain common refactoring operations. I've added one example already, of how to deprecate modules that return XY formatted outputs to row-column format. If you have similar examples, please feel free to add them: https://github.com/scikit-image/scikit-image/wiki/Model-PRs Thanks St?fan From stefanv at berkeley.edu Tue Nov 22 20:30:02 2016 From: stefanv at berkeley.edu (Stefan van der Walt) Date: Tue, 22 Nov 2016 17:30:02 -0800 Subject: [scikit-image] filtering image entry values based on a threshold In-Reply-To: References: Message-ID: <1479864602.1799613.796499057.14C1D0D7@webmail.messagingengine.com> On Mon, Nov 21, 2016, at 19:49, wine lover wrote: > In one code segment, I once saw an approach of filtering image values > as follows using cv2. In Scikit image, if I want to realize the same > functionality, how to do it? > > import cv2 img = cv2.threshold(img, 0.5, 1., > cv2.THRESH_BINARY)[1].astype(np.uint8 How about: from skimage import img_as_float, img_as_ubyte img = img_as_float(img) img_thresholded = img_as_ubyte(img < 0.5) St?fan -------------- next part -------------- An HTML attachment was scrubbed... URL: