a method of correcting dirt or other defects in video or other images in which a region is provisionally corrected , an accumulated gradient measure formed along the periphery of the region with and without correction and the region corrected or not depending on a comparison of the gradient measures .