Optimal binarization of images by neural networks for morphological analysis of ductile cast iron