51f598aaedc73ef180913c670d2c20a8032aaf1e,doc/examples/edges/plot_random_shapes.py,,,#,15

Before Change


image, _ = random_shapes(
    (128, 128), min_shapes=5, max_shapes=10, min_size=20, allow_overlap=True
)
fig, axis = plt.subplots()
axis.imshow(image)
axis.set_axis_off()

plt.show()

After Change



// We can visualize the images.
fig, axes = plt.subplots(nrows=2, ncols=3)
ax = axes.ravel()
ax[0].imshow(image, cmap="gray")
ax[0].set_title("Grayscale shape")

// The generated images can be much more complex. For example, let"s try many
// shapes of any color. If we want the colors to be particularly light, we can
// set the `intensity_range` to an upper subrange of (0,255).
image1, _ = random_shapes((128, 128), max_shapes=10,
                          intensity_range=((100, 255),))

// Moar :)
image2, _ = random_shapes((128, 128), max_shapes=10,
                          intensity_range=((200, 255),))
image3, _ = random_shapes((128, 128), max_shapes=10,
                          intensity_range=((50, 255),))
image4, _ = random_shapes((128, 128), max_shapes=10,
                          intensity_range=((0, 255),))

for i, image in enumerate([image1, image2, image3, image4], 1):
    ax[i].imshow(image)
    ax[i].set_title("Colored shapes, //{}".format(i-1))

// These shapes are well suited to test segmentation algorithms. Often, we
// want shapes to overlap to test the algorithm. This is also possible:
image, _ = random_shapes((128, 128), min_shapes=5, max_shapes=10,
                         min_size=20, allow_overlap=True)
ax[5].imshow(image)
ax[5].set_title("Overlapping shapes")

for a in ax:
    a.set_xticklabels([])
    a.set_yticklabels([])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: scikit-image/scikit-image
Commit Name: 51f598aaedc73ef180913c670d2c20a8032aaf1e
Time: 2018-05-16
Author: egor.v.panfilov@gmail.com
File Name: doc/examples/edges/plot_random_shapes.py
Class Name:
Method Name:


Project Name: nilmtk/nilmtk
Commit Name: 6621f0b9511e252a10c190f773c5686535d998de
Time: 2014-01-14
Author: nipunreddevil@gmail.com
File Name: scripts/plots_for_e_energy_2014/wm_comparison_table.py
Class Name:
Method Name:


Project Name: matplotlib/matplotlib
Commit Name: a1b680bc1ed4f0305298e56ae915d74d08514a66
Time: 2016-11-11
Author: tcaswell@gmail.com
File Name: examples/api/date_index_formatter.py
Class Name:
Method Name: