Home > Enterprise >  Mark selected pixels in an image with circle
Mark selected pixels in an image with circle

Time:09-14

I have an image, and I have to mark pixels whose intensity value is less than threshold value with a circle. How do you do this, Scatter plot wont work as we need two input. Help in this regard is appreciated.

matrix = np.matrix([row1,row2,row3,row4,row5,row6,row7,row8,row9,row10,row11,row12])
matrix_s = matrix<=1 # array containing pixels with value less than threshold
#plotting
plt.imshow(matrix)
plt.colorbar()
plt.plot(matrix_s, marker='o') # this won't work as it will join points with line and is not properly scaled with image 
plt.show()

CodePudding user response:

You can use the Circle patch function from matplotlib (see doc enter image description here

  • Related