I want to use ImageMagick to separate cracks in a specimen, because it's fast, lightweight and easy to use.
I googled a lot yesterday but couldn't figure out existing posts regarding this topic.
That's my starting picture I got from a scanner:
Since I found no post on exactly crack detection, I tried to use methods that (I thought) would be useful, including:
- edge / cann-edge-detector
- sobel / gaussian
- improving contrast by sigmoidal function
and maybe some more I forgot about at the moment.
Combining some of these methods, I got the best result with:
Code: Select all
convert test.png -colorspace gray -auto-level test1.png convert test1.png -sigmoidal-contrast 30,55% test2.png convert test2.png -edge 1 -negate test3.png
One can see the crack but there is a lot of noise around (could be some dirt on the surface).
As a starting point for my analysis I only want to see the outline of the specimen and the crack in black with as few noise as possible.
Do you have any ideas, how I can improve my result?
Thanks in advance!
I'm running Kubuntu 16.04 LTS with the following version of ImageMagick:
Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-09-28 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP