Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Images as high dimensional data

English · فارسی

Images as high dimensional data

Computer Science Dept, Ferdowsi University of Mashhad

array([[3, 0, 5, 6, 3, 3], [4, 8, 6, 5, 4, 7], [6, 6, 1, 7, 8, 1], [9, 1, 0, 6, 7, 8], [4, 5, 1, 4, 0, 5]])
<Figure size 300x400 with 1 Axes>

Image segmentation by thresholding

(numpy.ndarray, array([[False, False, False, True, False, False], [False, True, True, False, False, True], [ True, True, False, True, True, False], [ True, False, False, True, True, True], [False, False, False, False, False, False]]))
<Figure size 600x400 with 2 Axes>

RGB2Gray

((400, 600, 3), numpy.uint8)
<Figure size 1000x500 with 2 Axes>
<Figure size 800x1200 with 10 Axes>

Exercises

  1. Load the image used on this page, print its shape, dtype and nbytes, and compute the mean image over the colour axis. Explain each number in terms of rows, columns and channels.

  2. Segment the image by thresholding on grey level: choose the threshold with Otsu’s method, then compare with three fixed thresholds. Which object does the automatic threshold recover?

  3. Flatten ten 32×3232\times32 images into vectors and compute the pairwise Euclidean distance matrix. Identify the two most similar images and check by eye whether the metric agrees.