# Module: data¶

Standard test images.

For more images, see

 Color image of the astronaut Eileen Collins. skimage.data.binary_blobs([length, …]) Generate synthetic binary image with several rounded blob-like objects. Brick wall. Gray-level “camera” image. Cell floating in saline. Checkerboard image. Chelsea the cat. Motion blurred clock. Coffee cup. Greek coins from Pompeii. Color Wheel. Grass. Gravel Black and white silhouette of a horse. Hubble eXtreme Deep Field. Immunohistochemical (IHC) staining with hematoxylin counterstaining. Returns the path to the XML file containing information about the weak classifiers of a cascade classifier trained using LBP features. Subset of data from the LFW dataset. skimage.data.load(f[, as_gray]) Load an image file located in the data directory. Scikit-image logo, a RGBA image. Gray-level “microaneurysms” image. Surface of the moon. Scanned page. Human retina. Launch photo of DSCOVR on Falcon 9 by SpaceX. Rough wall. Shepp Logan Phantom. Rectified stereo image pair with ground-truth disparities. Gray-level “text” image used for corner detection.

## astronaut¶

skimage.data.astronaut()[source]

Color image of the astronaut Eileen Collins.

Photograph of Eileen Collins, an American astronaut. She was selected as an astronaut in 1992 and first piloted the space shuttle STS-63 in 1995. She retired in 2006 after spending a total of 38 days, 8 hours and 10 minutes in outer space.

This image was downloaded from the NASA Great Images database <https://flic.kr/p/r9qvLn>__.

No known copyright restrictions, released into the public domain.

Returns
astronaut(512, 512, 3) uint8 ndarray

Astronaut image.

## binary_blobs¶

skimage.data.binary_blobs(length=512, blob_size_fraction=0.1, n_dim=2, volume_fraction=0.5, seed=None)[source]

Generate synthetic binary image with several rounded blob-like objects.

Parameters
lengthint, optional

Linear size of output image.

blob_size_fractionfloat, optional

Typical linear size of blob, as a fraction of length, should be smaller than 1.

n_dimint, optional

Number of dimensions of output image.

volume_fractionfloat, default 0.5

Fraction of image pixels covered by the blobs (where the output is 1). Should be in [0, 1].

seedint, optional

Seed to initialize the random number generator. If None, a random seed from the operating system is used.

Returns
blobsndarray of bools

Output binary image

Examples

>>> from skimage import data
>>> data.binary_blobs(length=5, blob_size_fraction=0.2, seed=1)
array([[ True, False,  True,  True,  True],
[ True,  True,  True, False,  True],
[False,  True, False,  True,  True],
[ True, False, False,  True,  True],
[ True, False, False, False,  True]])
>>> blobs = data.binary_blobs(length=256, blob_size_fraction=0.1)
>>> # Finer structures
>>> blobs = data.binary_blobs(length=256, blob_size_fraction=0.05)
>>> # Blobs cover a smaller volume fraction of the image
>>> blobs = data.binary_blobs(length=256, volume_fraction=0.3)


## brick¶

skimage.data.brick()[source]

Brick wall.

Returns
brick(512, 512) uint8 image

A small section of a brick wall.

Notes

A perspective transform was then applied to the image, prior to rotating it by 90 degrees, cropping and scaling it to obtain the final image.

## camera¶

skimage.data.camera()[source]

Gray-level “camera” image.

Often used for segmentation and denoising examples.

Returns
camera(512, 512) uint8 ndarray

Camera image.

## cell¶

skimage.data.cell()[source]

Cell floating in saline.

This is a quantitative phase image retrieved from a digital hologram using the Python library qpformat. The image shows a cell with high phase value, above the background phase.

Because of a banding pattern artifact in the background, this image is a good test of thresholding algorithms. The pixel spacing is 0.107 µm.

These data were part of a comparison between several refractive index retrieval techniques for spherical objects as part of [1].

This image is CC0, dedicated to the public domain. You may copy, modify, or distribute it without asking permission.

Returns
cell(660, 550) uint8 array

Image of a cell.

References

1

Paul Müller, Mirjam Schürmann, Salvatore Girardo, Gheorghe Cojoc, and Jochen Guck. “Accurate evaluation of size and refractive index for spherical objects in quantitative phase imaging.” Optics Express 26(8): 10729-10743 (2018). DOI:10.1364/OE.26.010729

## checkerboard¶

skimage.data.checkerboard()[source]

Checkerboard image.

Checkerboards are often used in image calibration, since the corner-points are easy to locate. Because of the many parallel edges, they also visualise distortions particularly well.

Returns
checkerboard(200, 200) uint8 ndarray

Checkerboard image.

## chelsea¶

skimage.data.chelsea()[source]

Chelsea the cat.

An example with texture, prominent edges in horizontal and diagonal directions, as well as features of differing scales.

Returns
chelsea(300, 451, 3) uint8 ndarray

Chelsea image.

Notes

No copyright restrictions. CC0 by the photographer (Stefan van der Walt).

## clock¶

skimage.data.clock()[source]

Motion blurred clock.

This photograph of a wall clock was taken while moving the camera in an aproximately horizontal direction. It may be used to illustrate inverse filters and deconvolution.

Released into the public domain by the photographer (Stefan van der Walt).

Returns
clock(300, 400) uint8 ndarray

Clock image.

## coffee¶

skimage.data.coffee()[source]

Coffee cup.

This photograph is courtesy of Pikolo Espresso Bar. It contains several elliptical shapes as well as varying texture (smooth porcelain to course wood grain).

Returns
coffee(400, 600, 3) uint8 ndarray

Coffee image.

Notes

No copyright restrictions. CC0 by the photographer (Rachel Michetti).

## coins¶

skimage.data.coins()[source]

Greek coins from Pompeii.

This image shows several coins outlined against a gray background. It is especially useful in, e.g. segmentation tests, where individual objects need to be identified against a background. The background shares enough grey levels with the coins that a simple segmentation is not sufficient.

Returns
coins(303, 384) uint8 ndarray

Coins image.

Notes

## colorwheel¶

skimage.data.colorwheel()[source]

Color Wheel.

Returns
colorwheel(370, 371, 3) uint8 image

A colorwheel.

## grass¶

skimage.data.grass()[source]

Grass.

Returns
grass(512, 512) uint8 image

Some grass.

Notes

The downloaded image was cropped to include a region of (512, 512) pixels around the top left corner, converted to grayscale, then to uint8 prior to saving the result in PNG format.

## gravel¶

skimage.data.gravel()[source]

Gravel

Returns
gravel(512, 512) uint8 image

Grayscale gravel sample.

Notes

The downloaded image was then rescaled to (1024, 1024), then the top left (512, 512) pixel region was cropped prior to converting the image to grayscale and uint8 data type. The result was saved using the PNG format.

## horse¶

skimage.data.horse()[source]

Black and white silhouette of a horse.

No copyright restrictions. CC0 given by owner (Andreas Preuss (marauder)).

Returns
horse(328, 400) bool ndarray

Horse image.

## hubble_deep_field¶

skimage.data.hubble_deep_field()[source]

Hubble eXtreme Deep Field.

This photograph contains the Hubble Telescope’s farthest ever view of the universe. It can be useful as an example for multi-scale detection.

Returns
hubble_deep_field(872, 1000, 3) uint8 ndarray

Hubble deep field image.

Notes

The image was captured by NASA and may be freely used in the public domain.

## immunohistochemistry¶

skimage.data.immunohistochemistry()[source]

Immunohistochemical (IHC) staining with hematoxylin counterstaining.

This picture shows colonic glands where the IHC expression of FHL2 protein is revealed with DAB. Hematoxylin counterstaining is applied to enhance the negative parts of the tissue.

This image was acquired at the Center for Microscopy And Molecular Imaging (CMMI).

Returns
immunohistochemistry(512, 512, 3) uint8 ndarray

Immunohistochemistry image.

### Examples using skimage.data.immunohistochemistry¶

skimage.data.lbp_frontal_face_cascade_filename()[source]

Returns the path to the XML file containing information about the weak classifiers of a cascade classifier trained using LBP features. It is part of the OpenCV repository [1].

References

1

## lfw_subset¶

skimage.data.lfw_subset()[source]

Subset of data from the LFW dataset.

This database is a subset of the LFW database containing:

• 100 faces

• 100 non-faces

The full dataset is available at [2].

Returns
images(200, 25, 25) uint8 ndarray

100 first images are faces and subsequent 100 are non-faces.

Notes

The faces were randomly selected from the LFW dataset and the non-faces were extracted from the background of the same dataset. The cropped ROIs have been resized to a 25 x 25 pixels.

References

1

Huang, G., Mattar, M., Lee, H., & Learned-Miller, E. G. (2012). Learning to align from scratch. In Advances in Neural Information Processing Systems (pp. 764-772).

2

http://vis-www.cs.umass.edu/lfw/

### Examples using skimage.data.lfw_subset¶

skimage.data.load(f, as_gray=False)[source]

Load an image file located in the data directory.

Parameters
fstring

File name.

as_graybool, optional

Whether to convert the image to grayscale.

Returns
imgndarray

Image loaded from skimage.data_dir.

Notes

This functions is deprecated and will be removed in 0.18.

## microaneurysms¶

skimage.data.microaneurysms()[source]

Gray-level “microaneurysms” image.

Detail from an image of the retina (green channel). The image is a crop of image 07_dr.JPG from the High-Resolution Fundus (HRF) Image Database: https://www5.cs.fau.de/research/data/fundus-images/

Returns
microaneurysms(102, 102) uint8 ndarray

Retina image with lesions.

Notes

No copyright restrictions. CC0 given by owner (Andreas Maier).

References

1

Budai, A., Bock, R, Maier, A., Hornegger, J., Michelson, G. (2013). Robust Vessel Segmentation in Fundus Images. International Journal of Biomedical Imaging, vol. 2013, 2013. DOI:10.1155/2013/154860

## moon¶

skimage.data.moon()[source]

Surface of the moon.

This low-contrast image of the surface of the moon is useful for illustrating histogram equalization and contrast stretching.

Returns
moon(512, 512) uint8 ndarray

Moon image.

## page¶

skimage.data.page()[source]

Scanned page.

This image of printed text is useful for demonstrations requiring uneven background illumination.

Returns
page(191, 384) uint8 ndarray

Page image.

## retina¶

skimage.data.retina()[source]

Human retina.

This image of a retina is useful for demonstrations requiring circular images.

Returns
retina(1411, 1411, 3) uint8 ndarray

Retina image in RGB.

Notes

This image was downloaded from wikimedia. This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.

References

1

Häggström, Mikael (2014). “Medical gallery of Mikael Häggström 2014”. WikiJournal of Medicine 1 (2). DOI:10.15347/wjm/2014.008. ISSN 2002-4436. Public Domain

## rocket¶

skimage.data.rocket()[source]

Launch photo of DSCOVR on Falcon 9 by SpaceX.

This is the launch photo of Falcon 9 carrying DSCOVR lifted off from SpaceX’s Launch Complex 40 at Cape Canaveral Air Force Station, FL.

Returns
rocket(427, 640, 3) uint8 ndarray

Rocket image.

Notes

The image was captured by SpaceX and released in the public domain.

## rough_wall¶

skimage.data.rough_wall()[source]

Rough wall.

Returns
rough_wall(512, 512) uint8 image

Some rough wall.

## shepp_logan_phantom¶

skimage.data.shepp_logan_phantom()[source]

Shepp Logan Phantom.

Returns
phantom(400, 400) float64 image

Image of the Shepp-Logan phantom in grayscale.

References

1

L. A. Shepp and B. F. Logan, “The Fourier reconstruction of a head section,” in IEEE Transactions on Nuclear Science, vol. 21, no. 3, pp. 21-43, June 1974. DOI:10.1109/TNS.1974.6499235

## stereo_motorcycle¶

skimage.data.stereo_motorcycle()[source]

Rectified stereo image pair with ground-truth disparities.

The two images are rectified such that every pixel in the left image has its corresponding pixel on the same scanline in the right image. That means that both images are warped such that they have the same orientation but a horizontal spatial offset (baseline). The ground-truth pixel offset in column direction is specified by the included disparity map.

The two images are part of the Middlebury 2014 stereo benchmark. The dataset was created by Nera Nesic, Porter Westling, Xi Wang, York Kitajima, Greg Krathwohl, and Daniel Scharstein at Middlebury College. A detailed description of the acquisition process can be found in [1].

The images included here are down-sampled versions of the default exposure images in the benchmark. The images are down-sampled by a factor of 4 using the function skimage.transform.downscale_local_mean. The calibration data in the following and the included ground-truth disparity map are valid for the down-sampled images:

Focal length:           994.978px
Principal point x:      311.193px
Principal point y:      254.877px
Principal point dx:      31.086px
Baseline:               193.001mm

Returns
img_left(500, 741, 3) uint8 ndarray

Left stereo image.

img_right(500, 741, 3) uint8 ndarray

Right stereo image.

disp(500, 741, 3) float ndarray

Ground-truth disparity map, where each value describes the offset in column direction between corresponding pixels in the left and the right stereo images. E.g. the corresponding pixel of img_left[10, 10 + disp[10, 10]] is img_right[10, 10]. NaNs denote pixels in the left image that do not have ground-truth.

Notes

The original resolution images, images with different exposure and lighting, and ground-truth depth maps can be found at the Middlebury website [2].

References

1

D. Scharstein, H. Hirschmueller, Y. Kitajima, G. Krathwohl, N. Nesic, X. Wang, and P. Westling. High-resolution stereo datasets with subpixel-accurate ground truth. In German Conference on Pattern Recognition (GCPR 2014), Muenster, Germany, September 2014.

2

http://vision.middlebury.edu/stereo/data/scenes2014/

## text¶

skimage.data.text()[source]

Gray-level “text” image used for corner detection.

Returns
text(172, 448) uint8 ndarray

Text image.

Notes