My curvature plugin at http://www.optinav.info/Curvature.htm has been updated to restore a small amount of smoothing and ignore non-area objects such as lines. Now Version 8. Again, I hope it is finished.
-- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Herbie
Greetings to all,
who are interested in this thread and topic that is now more than a month old. Not satisfied with the results of very many experiments with various approaches, I finally decided to code a ImageJ-plugin myself that can now be accessed with its ReadMe-doc from: <https://www.gluender.de/Miscellanea/MiscTexts/UtilitiesText.html#Gl-2020-3> Attached please find the parameter dialog of my plugin "Contour_Curvature.class" that may give you a first impression. Please let me briefly sketch some design criteria and give some background regarding the approach and code: 1. It may sound trivial but a good pattern (object) for testing approaches to local contour curvatures of binary-valued images is a circular disc object (see attached image "0000.png"). -- This kind of image should result in curvatures with a period of four. -- The attached plot shows the result obtained with my plugin using 20 coefficient-pairs (see 4.). 2. As mentioned mentioned earlier in this thread (see the below message) the initial extraction of an object's boundary points is crucial. -- Computing them by "Process > Binary > Outline" is insufficient and skeletonizing the result doesn't really improve the result. -- I've not been able to generate a polyline of the boundary points by standard ImageJ means that, after smoothing, led to the expected curvatures of the test image. 3. I finally applied the approach of Chang et al. (2004) <https://www.sciencedirect.com/science/article/abs/pii/S1077314203001401> that, as far as I understand, does essentially what Gabriel Landini's plugin "Particles8" does. -- My code is derived (and simplified) from the corresponding code example provided by Burger & Burge (2016): <https://www.springer.com/us/book/9781447166832> -- The result is the correct polyline or polygon selection of an object's boundary points. -- It would be nice if we could have this functionality in ImageJ. 4. While there is no doubt about what the correct boundary points of an object are, the question of how to smooth the associated polygon can't be answered uniquely. It must be answered heuristically. A possible approach uses Fourier shape descriptors that I decided to apply because it is mathematically well-defined and rather easy to understand. -- My code is again derived (and simplified) from the corresponding code example provided by Burger & Burge (2016) <see above>. -- The degree of smoothing is defined by the number of Fourier coefficient-pairs that are considered for the DFT-retransformation: The more pairs, the less smoothing. -- Furthermore, this approach allows one to define the number of points that define the resulting smooth object contour. Consequently, no post hoc interpolation is necessary. 5. Finally, local curvatures must be computed from the smooth contour. -- As mentioned earlier in this thread (see the below message), this operation is mathematically well-defined: <https://en.wikipedia.org/wiki/Curvature#In_terms_of_a_general_parametrization> -- Please note that the curvature of an ideal circle of radius r is 1/r. The test image has a diameter of 225 pixels and the mean curvature, as determined by my plugin, is 0.0089. I hope I could provide some insights and thanks for reading Herbie :::::::::::::::::::::::::::::::::::: Am 11.07.20 um 14:09 schrieb Herbie: > Bonjour Fabrice, > > as stated earlier already, the main problem, given a binary-valued > object, is to obtain a suitable description of the object contour. This > description requires interpolation and perhaps smoothing of the sampled > object's border points. > I'm not aware of a unique mathematically exact approach for this task. > Consequently, this first step or pre-processing is based on heuristics. > > To obtain local curvatures from a contour description, exact numeric > methods can be applied. Numeric, not analytic, because differentials are > approximated by quotients of differences. However, I would not denote > the approximation effects as noise. > > With ImageJ it is possible to obtain selections or RoIs, i.e. contour > descriptions, that show near to evenly spaced sample points having, of > course, real-valued coordinates. From contour descriptions showing such > parametrized coordinates, local curvatures can be obtained according to > <https://en.wikipedia.org/wiki/Curvature#In_terms_of_a_general_parametrization> > > > The many investigations of mine since the beginning of this thread show > that the main problem really is in the pre-processing stage: > Curvatures strongly depend on how the contour description is computed. > Even minor parameter changes in the pre-processing can have dramatic > effects on the local curvatures. > > That said, I've not yet decided about an adequate ImageJ-based heuristic > for the pre-processing. > > Thanks for your interest > > Herbie > > ::::::::::::::::::::::::::::::::::::::::::: > Am 11.07.20 um 13:26 schrieb Fabrice Senger: >> Dear all, >> I really enjoyed this thread. I'm right in the assumption that in the end >> to get the curvature you're sampling the contour with a number of points >> and use 3 consecutive points to retrieve the radius of curvature? If, so, >> how do you set the distance between those points, as for small values you >> will run into noise... >> >> Le sam. 11 juil. 2020 à 08:02, Robert Dougherty <[hidden email]> a >> écrit : >> >>> Thomas, >>> I have updated the plugin at http://www.optinav.info/Curvature.htm. >>> Version 5 shows tabular output and is probably more accurate than my >>> earlier version. >>> >>> Bob >>> >>> >>> >>> >>> On Sunday, July 5, 2020, 10:14:07 AM PDT, Thomas Fischer < >>> [hidden email]> wrote: >>> >>> Dear Bob, >>> >>> My reply is late because I had computer problems. The result of the >>> plugin >>> looks nice. In order to use it I would need two features >>> 1) A parameter to tune the sensitivity. Right now it is not sensitive >>> enough for my purpose. I am aware that an increase in sensitivity would >>> make the result more noisy. But as with the plugin of Thomas I would >>> do the >>> smoothing afterwards. >>> 2) A list of the curvature values along the circumference. Just >>> looking at >>> the nice result is not enough in my case. I have to extract numbers from >>> this list. >>> >>> I am content with the plugin of Thomas. But as we say in German: the >>> better >>> is the enemy of the good. >>> >>> Best regards, Thomas >>> >>> >>> >>> >>> >>> Am So., 5. Juli 2020 um 07:33 Uhr schrieb Robert Dougherty < >>> [hidden email] >>>> : >>> >>>> Gabriel, >>>> Thanks. In case it matters, there is a new version with smoother >>>> calculation and a black background. >>>> Bob >>>> >>>> On Saturday, July 4, 2020, 11:33:56 AM PDT, Gabriel Landini < >>>> [hidden email]> wrote: >>>> >>>> Thanks Bob, I can confirm that it works fine. >>>> I think colourblind observers (red-green type) would see the green as >>> some >>>> shades of yellow and blue as blue. At lease that is what the Dichromacy >>>> plugin >>>> shows. >>>> Regards >>>> >>>> Gabriel >>>> >>>> >>>> On Saturday, 4 July 2020 18:05:09 BST you wrote: >>>>> Gabriel, >>>>> In the meantime, I tried and failed to track down how ImageJ is >>> supposed >>>> to >>>>> load the Phase LUT. Giving up, I changed the code to use another >>>>> sign-friendly LUT that I coded explicitly. Now Curvature displays the >>>>> results in green-blue. Going forward, it may be a question of which >>> color >>>>> scheme is better. One could experiment by running the new version of >>>>> Curvature and then manually changing the LUT to Phase to simulate the >>> old >>>>> version. Perhaps green-blue is better for colorblindness than the >>>> red-blue >>>>> scheme of Phase? >>>>> >>>>> Bob >>>> >>>> -- >>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >>>> >>>> >>>> -- >>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >>>> >>> >>> -- >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >>> >>> >>> -- >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >>> >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html ParameterDialog.png (36K) Download Attachment 0000.png (1K) Download Attachment Local Curvatures of 0000.png (24K) Download Attachment |
Dear all,
I have updated my curvature code at http://www.optinav.info/Curvature.htm. It does more things now, including analysis of centerlines of objects. It is also faster on large objects. Bob -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Bob,
looks good. Thanks for sharing! Best Herbie :::::::::::::::::::::::::::::::::::::::::::::: Am 06.08.20 um 01:42 schrieb Robert Dougherty: > Dear all, > I have updated my curvature code at http://www.optinav.info/Curvature.htm. It does more things now, including analysis of centerlines of objects. It is also faster on large objects. > > Bob > > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |