I created a rectangle roi in the image but I need to do polygon
instead.
Below the code of how I did the rectangle roi
##Define the axis
lower=150
upper=200
left= 180
right=400
how to manipulate these to make a polygon
##Set constraints
if lower >= upper:
raise ValueError("ROI lower bound must be smaller than upper bound")
if left >= right:
raise ValueError("ROI left bound must be smaller than right bound")
##Create an image:
image = np.zeros (cleaned.shape, dtype=cleaned.type)
##Mask out outside the axis:
mask [lower:upper, left:right]= 1