This is basically an implementation of the Paper "defect detection algorithm for corner cracks in steel billet using discrete wavelet transform", with some modifications that recognize 4 different types of cracks.
https://github.com/jrvstw/defect_detection