A patch-based approach for removing impulse or mixed Gaussian-impulse noise