Solving white space + improving code +PEP8

Solving white space + Correcting code

Solving white spaces

Solving white spaces

Solving white spaces

Answering comments

Correcting silly mistakes

Solving white spaces

Trying again... now with Travis enabled
This commit is contained in:
Alexandre Fioravante de Siqueira
2015-12-23 18:20:57 -02:00
parent fb9fdec7db
commit af95784ac9
4 changed files with 76 additions and 72 deletions
+7 -3
View File
@@ -34,19 +34,20 @@ independent of the size of blobs as internally the implementation uses
box filters instead of convolutions. Bright on dark as well as dark on
bright blobs are detected. The downside is that small blobs (<3px) are not
detected accurately. See :py:meth:`skimage.feature.blob_doh` for usage.
"""
from matplotlib import pyplot as plt
from skimage import data
from skimage.feature import blob_dog, blob_log, blob_doh
from math import sqrt
from skimage.color import rgb2gray
import matplotlib.pyplot as plt
image = data.hubble_deep_field()[0:500, 0:500]
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)
@@ -61,14 +62,17 @@ titles = ['Laplacian of Gaussian', 'Difference of Gaussian',
'Determinant of Hessian']
sequence = zip(blobs_list, colors, titles)
fig, axes = plt.subplots(1, 3, figsize=(14, 4), sharex=True, sharey=True,
subplot_kw={'adjustable': 'box-forced'})
plt.tight_layout()
fig,axes = plt.subplots(1, 3, sharex=True, sharey=True, subplot_kw={'adjustable':'box-forced'})
axes = axes.ravel()
for blobs, color, title in sequence:
ax = axes[0]
axes = axes[1:]
ax.set_title(title)
ax.imshow(image, interpolation='nearest')
ax.set_axis_off()
for blob in blobs:
y, x, r = blob
c = plt.Circle((x, y), r, color=color, linewidth=2, fill=False)