Using masks to apply different thresholds to different parts of an image
问题 I have an image, in which I want to threshold part of the image within a circular region, and then the remainder of the image outside of this region. Unfortunately my attempts seem to be thresholding the image as a whole, ignoring the masks. How can this be properly achieved? See code attempt below. def circular_mask(h, w, centre=None, radius=None): if centre is None: # use the middle of the image centre = [int(w / 2), int(h / 2)] if radius is None: # use the smallest distance between the