https://technicalsource9.medium.com/how-to-perform-a-thresholding-operation-on-the-gradient-magnitude-252b1f20bb91