from math import sqrt
from skimage import data
from skimage.feature import blob_dog, blob_log, blob_doh
from skimage.color import rgb2gray
from skimage import io

import matplotlib.pyplot as plt


image = io.imread("star.jpg")
image_gray = rgb2gray(image)

blobs_log = blob_log(image_gray, max_sigma=30, num_sigma=10, threshold=.1)

# Compute radii in the 3rd column.
blobs_log[:, 2] = blobs_log[:, 2] * sqrt(2)

blobs_dog = blob_dog(image_gray, max_sigma=30, threshold=.1)
blobs_dog[:, 2] = blobs_dog[:, 2] * sqrt(2)

blobs_doh = blob_doh(image_gray, max_sigma=30, threshold=.01)

blobs_list = [blobs_log, blobs_dog, blobs_doh]
colors = ['yellow', 'lime', 'red']
titles = ['Laplacian of Gaussian', 'Difference of Gaussian',
          'Determinant of Hessian']
sequence = zip(blobs_list, colors, titles)

fig, axes = plt.subplots(1, 3, figsize=(9, 3), sharex=True, sharey=True)
ax = axes.ravel()

for idx, (blobs, color, title) in enumerate(sequence):
    ax[idx].set_title(title)
    ax[idx].imshow(image)
    for blob in blobs:
        y, x, r = blob
        c = plt.Circle((x, y), r, color=color, linewidth=2, fill=False)
        ax[idx].add_patch(c)
    ax[idx].set_axis_off()

plt.tight_layout()
plt.show()
[((10, 8, 10, 29), 'skimage.io.imread', 'io.imread', ({(10, 18, 10, 28): '"""star.jpg"""'}, {}), "('star.jpg')", False, 'from skimage import io\n'), ((11, 13, 11, 28), 'skimage.color.rgb2gray', 'rgb2gray', ({(11, 22, 11, 27): 'image'}, {}), '(image)', False, 'from skimage.color import rgb2gray\n'), ((13, 12, 13, 74), 'skimage.feature.blob_log', 'blob_log', (), '', False, 'from skimage.feature import blob_dog, blob_log, blob_doh\n'), ((18, 12, 18, 60), 'skimage.feature.blob_dog', 'blob_dog', (), '', False, 'from skimage.feature import blob_dog, blob_log, blob_doh\n'), ((21, 12, 21, 61), 'skimage.feature.blob_doh', 'blob_doh', (), '', False, 'from skimage.feature import blob_dog, blob_log, blob_doh\n'), ((29, 12, 29, 72), 'matplotlib.pyplot.subplots', 'plt.subplots', (), '', True, 'import matplotlib.pyplot as plt\n'), ((41, 0, 41, 18), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((42, 0, 42, 10), 'matplotlib.pyplot.show', 'plt.show', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((16, 36, 16, 43), 'math.sqrt', 'sqrt', ({(16, 41, 16, 42): '(2)'}, {}), '(2)', False, 'from math import sqrt\n'), ((19, 36, 19, 43), 'math.sqrt', 'sqrt', ({(19, 41, 19, 42): '(2)'}, {}), '(2)', False, 'from math import sqrt\n'), ((37, 12, 37, 71), 'matplotlib.pyplot.Circle', 'plt.Circle', (), '', True, 'import matplotlib.pyplot as plt\n')]