Sonar image denoising using adaptive processing of local patches