Skip to content

Instantly share code, notes, and snippets.

@vighneshbirodkar
Created May 2, 2016 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vighneshbirodkar/c16515126e648cf92f08d3319d3a023e to your computer and use it in GitHub Desktop.
Save vighneshbirodkar/c16515126e648cf92f08d3319d3a023e to your computer and use it in GitHub Desktop.
from skimage import io, color
from skimage.filters.rank import median
from skimage.feature import blob_dog, blob_log, blob_doh
from skimage.morphology import disk
from matplotlib import pyplot as plt
img = io.imread('RawImage.tif')
img_gray = color.rgb2gray(img)
img_filtered = median(img_gray, disk(10))
plt.figure()
plt.imshow(img_filtered, cmap='gray')
plt.title('Filtered Image')
blobs = blob_doh(img_filtered)
for blob in blobs:
y, x, r = blob
c = plt.Circle((x, y), r, color='red', linewidth=2, fill=False)
plt.gca().add_patch(c)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment