NanoComp / imageruler

measure minimum solid/void lengthscales in binary image
https://nanocomp.github.io/imageruler/
MIT License
13 stars 6 forks source link

Warning of sharp corners or cusps #16

Closed mawc2019 closed 1 year ago

mawc2019 commented 1 year ago

In this PR, the Harris corner detector from OpenCV is used for detecting sharp corners or cusps in binary images. If a sharp corner or cusp is detected, a warning message will be printed out. The detection is not successful in every cases. A feature may be mistakenly classified as a sharp corner or cusp if the resolution is too low. On the other hand, a sharp corner or cusp may not be recognized if the angle is smaller than ~30° or larger than ~120°. Changing some parameters can easily increase the true positive rate, but also increase the false positive rate. This issue was partially investigated here.

stevengj commented 1 year ago

There should definitely be a way to turn this off.

mawc2019 commented 1 year ago

A boolean argument warn_cusp is added. If True, warning will be given when the input 2d image is likely to contain sharp corners or cusps; if False, warning will not be given. The default option is False.