Created
December 20, 2019 15:39
-
-
Save ritvikmath/734c103b216f9b8b0caa5c38095cbf8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #operate on a copy of the image | |
| copyImg = img.copy() | |
| #get the x and y center points of our image | |
| center_x = n/2 | |
| center_y = m/2 | |
| #create a circle mask which is centered in the middle of the image, and with radius 100 | |
| circle_mask = (x-center_x)**2 + (y-center_y)**2 <= 100**2 | |
| #black out anywhere within the circle mask | |
| copyImg[circle_mask] = [0,0,0] | |
| #show the image | |
| plt.imshow(copyImg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment