An efficient procedure for removing salt and pepper noise in images