Skip to main content

Image Enhancement in the Spatial Domain

  • Chapter
  • First Online:
Digital Image Processing

Abstract

Although the transform domain processing is essential, as the images naturally occur in the spatial domain, image enhancement in the spatial domain is presented first. Point operations, histogram processing, and neighborhood operations are presented. The convolution operation, along with the Fourier analysis, is essential for any form of signal processing. Therefore, the 1-D and 2-D convolution operations are introduced. Linear and nonlinear filtering of images is described next.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 99.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to D. Sundararajan .

Exercises

Exercises

2.1

Find the complement of the \(4\times 4\) 8-bit gray level image and verify that the image can be restored by complementing the complemented image.

  1. (i)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 112&{}148&{} 72&{}153\\ 120&{}125&{} 30&{} 99\\ 95&{}120&{} 89&{} 33\\ 170&{} 99&{}109&{} 40 \end{array}\right] $$
  2. (ii)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 164&{}127&{}117&{} 59\\ 154&{}122&{}104&{} 83\\ 129&{}136&{}100&{} 60\\ 117&{}128&{} 80&{} 48 \end{array}\right] $$
  3. (iii)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 46&{}48&{}46&{}45\\ 42&{}49&{}46&{}45\\ 64&{}73&{}60&{}43\\ 94&{}69&{}63&{}37 \end{array}\right] $$

2.2

Find the complement of the \(4\times 4\) binary image and verify that the image can be restored by complementing the complemented image.

  1. (i)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 1&{}0&{}0&{}0\\ 1&{}0&{}0&{}0\\ 1&{}1&{}0&{}0\\ 0&{}1&{}0&{}0 \end{array}\right] $$
  2. (ii)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 0&{}1&{}0&{}1\\ 0&{}0&{}0&{}1\\ 0&{}0&{}0&{}1\\ 0&{}0&{}0&{}1 \end{array}\right] $$
  3. (iii)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 1&{}1&{}0&{}0\\ 1&{}0&{}0&{}0\\ 1&{}1&{}1&{}1\\ 1&{}1&{}0&{}0 \end{array}\right] $$

2.3

For the list of gray levels, apply gamma correction and find the corresponding new gray levels. Apply the inverse transformation to the new gray levels and verify that the given gray levels are obtained.

$$\begin{aligned} \{0, 25, 50, 100, 150, 200, 250, 255 \} \end{aligned}$$
  1. (i)

    \(\gamma =0.8\).

  2. (ii)

    \(\gamma =1.1\).

  3. (iii)

    \(\gamma =1.8\).

2.4

Given a \(4\times 4\) 4-bit image, find the histogram equalized version of it.

  1. *(i)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 4&{} 4&{} 3&{} 3\\ 4&{} 4&{} 4&{} 3\\ 5 &{}4&{} 4&{} 4\\ 4&{} 4&{} 4&{} 4 \end{array}\right] $$
  2. (ii)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 1&{}1&{}0&{}1\\ 1&{}1&{}0&{}3\\ 1&{}0&{}0&{}2\\ 1&{}0&{}0&{}2 \end{array}\right] $$
  3. (iii)
    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 3&{}5&{}5&{}3\\ 4&{}4&{}4&{}3\\ 4&{}2&{}3&{}4\\ 4&{}2&{}2&{}3\end{array}\right] $$

2.5

Given \(4\times 4\) 4-bit reference and input images, use histogram matching to restore the input image.

  1. *(i)

    The reference and input images, respectively, are

    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 4&{} 4&{} 3&{} 3\\ 4&{} 4&{} 4&{} 3\\ 5 &{}4&{} 4&{} 4\\ 4&{} 4&{} 4&{} 4 \end{array}\right] \quad \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 15&{}15&{} 0&{} 0\\ 15&{}15&{}15&{} 0\\ 15&{}15&{}15&{}15\\ 15&{}15&{}15&{}15 \end{array}\right] $$
  2. (ii)

    The reference and input images, respectively, are

    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 3&{} 3&{} 3&{} 3\\ 3&{} 3&{} 3&{} 3\\ 3&{} 2&{} 2&{} 3\\ 2&{} 2&{} 2&{} 2 \end{array}\right] \quad \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 15&{}15&{}15&{}15\\ 15&{}15&{}15&{}15\\ 15&{} 0&{} 0&{}15\\ 0&{} 0&{} 0&{} 0 \end{array}\right] $$
  3. (iii)

    The reference and input images, respectively, are

    $$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 3&{} 5&{} 5&{} 3\\ 4&{} 4&{} 4&{} 3\\ 4&{} 2&{} 3&{} 4\\ 4&{} 2&{} 2&{} 3 \end{array}\right] \quad \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 0&{}15&{}15&{} 0\\ 15&{}15&{}15&{} 0\\ 15&{} 0&{} 0&{}15\\ 15&{} 0&{} 0&{} 0 \end{array}\right] $$

2.6

Given a \(8\times 8\) 8-bit image, find the binary, hard and soft thresholded versions with the threshold \(T=160\).

$$ \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 255&{}255&{}255&{}117&{} 50&{} 39&{} 50&{} 56\\ 255&{}255&{}255&{}194&{} 45&{} 26&{} 48&{} 54\\ 255&{}255&{}255&{}241&{} 61&{} 25&{} 53&{} 57\\ 255&{}255&{}255&{}255&{}104&{} 32&{} 64&{} 64\\ 255&{}255&{}255&{}255&{}154&{} 37&{} 59&{} 61\\ 255&{}255&{}255&{}255&{}199&{} 54&{} 55&{} 61\\ 255&{}255&{}255&{}255&{}230&{} 71&{} 59&{} 64\\ 255&{}255&{}255&{}255&{}250&{} 95&{} 60&{} 68 \end{array}\right] $$

2.7

Given a \(4\times 4\) image, find the \(4\times 4\) lowpass filtered output using the \(3\times 3\) averaging filter with the borders zero-padded.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 70&{}62&{}51&{}45\\ 71&{}62&{}57&{}55\\ 73&{}65&{}56&{}60\\ 68&{}69&{}63&{}66 \end{array}\right] $$

2.8

Given a \(4\times 4\) image, find the \(4\times 4\) lowpass filtered output using the \(3\times 3\) averaging filter with the borders replicated.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 41&{}43&{}45&{}43\\ 40&{}41&{}42&{}41\\ 42&{}38&{}39&{}42\\ 39&{}33&{}37&{}36 \end{array}\right] $$

2.9

Given a \(4\times 4\) image, find the \(4\times 4\) lowpass filtered output using the \(3\times 3\) averaging filter with the borders periodically extended.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 45&{}78&{}87&{}51\\ 59&{}56&{}62&{}49\\ 59&{}39&{}44&{}57\\ 56&{}36&{}35&{}51 \end{array}\right] $$

2.10

Given a \(4\times 4\) image, find the \(4\times 4\) lowpass filtered output using the \(3\times 3\) Gaussian filter \((\sigma =0.5)\) with the borders symmetrically extended.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 202&{}195&{}192&{}191\\ 216&{}211&{}200&{}209\\ 224&{}212&{}215&{}227\\ 224&{}205&{}227&{}230 \end{array}\right] $$

2.11

Given a \(4\times 4\) image, find the \(4\times 4\) lowpass filtered output using the \(3\times 3\) Gaussian filter \((\sigma =0.5)\) with the borders periodically extended.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 202&{}195&{}192&{}191\\ 216&{}211&{}200&{}209\\ 224&{}212&{}215&{}227\\ 224&{}205&{}227&{}230 \end{array}\right] $$

2.12

Given a \(4\times 4\) image, find the \(4\times 4\) lowpass filtered output using the \(3\times 3\) Gaussian filter \((\sigma =0.5)\) with the borders zero-padded.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 95&{}82&{}54&{}33\\ 84&{}78&{}56&{}64\\ 73&{}71&{}53&{}60\\ 73&{}73&{}54&{}36 \end{array}\right] $$

2.13

Given a \(4\times 4\) image, find the \(4\times 4\) highpass filtered output using the \(3\times 3\) Laplacian filter

$$h(m, n)= \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }} 0&{} 1&{} 0 \\ 1 &{} -4 &{} 1\\ 0&{} 1&{} 0 \end{array} \right] $$

with the borders zero-padded.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 45&{}52&{}56&{}52\\ 49&{}60&{}55&{}55\\ 47&{}55&{}53&{}46\\ 45&{}48&{}51&{}40 \end{array}\right] $$

2.14

Given a \(4\times 4\) image, find the \(4\times 4\) highpass filtered output using the \(3\times 3\) Laplacian filter with the borders symmetrically extended.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 64&{}62&{}62&{}68\\ 68&{}66&{}58&{}64\\ 75&{}70&{}60&{}58\\ 72&{}69&{}59&{}60 \end{array}\right] $$

2.15

Given a \(4\times 4\) image, find the \(4\times 4\) highpass filtered output using the \(3\times 3\) Laplacian filter with the borders replicated.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 39&{}40&{}35&{}33\\ 31&{}40&{}39&{}37\\ 34&{}38&{}41&{}43\\ 37&{}39&{}42&{}43 \end{array}\right] $$

*2.16

Given a \(4\times 4\) image, find the \(4\times 4\) enhanced output using the \(3\times 3\) Laplacian sharpening filter

$$h(m, n)= \left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }} 0&{} -1&{} 0 \\ -1 &{} 5 &{} -1\\ 0&{} -1&{} 0 \end{array} \right] $$

with the borders replicated.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 190&{}206&{}228&{}238\\ 180&{}205&{}227&{}219\\ 182&{}203&{}211&{}159\\ 184&{}212&{}206&{}177 \end{array}\right] $$

2.17

Given a \(4\times 4\) image, find the \(4\times 4\) enhanced output using the \(3\times 3\) Laplacian sharpening filter with the borders periodically extended.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 138&{}163&{}162&{}177\\ 148&{}157&{}167&{}175\\ 153&{}165&{}160&{}178\\ 157&{}162&{}164&{}188 \end{array}\right] $$

2.18

Given a \(4\times 4\) image, find the \(4\times 4\) enhanced output using the \(3\times 3\) Laplacian sharpening filter with the borders zero-padded.

$$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 201&{}195&{}191&{}169\\ 210&{}201&{}181&{}157\\ 213&{}207&{}190&{}166\\ 204&{}204&{}197&{}159 \end{array}\right] $$

2.19

Given a \(4\times 4\) image, find the \(4\times 4\) median filtered output using the \(3\times 3\) window with the borders zero-padded.

  1. (i)
    $$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 201&{}195&{}191&{}169\\ 210&{}201&{}181&{}157\\ 213&{}207&{}190&{}166\\ 204&{}204&{}197&{}159 \end{array}\right] $$
  2. (ii)
    $$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 138&{}163&{}162&{}177\\ 148&{}157&{}167&{}175\\ 153&{}165&{}160&{}178\\ 157&{}162&{}164&{}188 \end{array}\right] $$
  3. (iii)
    $$x(m, n)=\left[ \begin{array}{r@{\quad }r@{\quad }r@{\quad }r@{\quad }} 190&{}206&{}228&{}238\\ 180&{}205&{}227&{}219\\ 182&{}203&{}211&{}159\\ 184&{}212&{}206&{}177 \end{array}\right] $$

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer Nature Singapore Pte Ltd.

About this chapter

Cite this chapter

Sundararajan, D. (2017). Image Enhancement in the Spatial Domain. In: Digital Image Processing. Springer, Singapore. https://doi.org/10.1007/978-981-10-6113-4_2

Download citation

  • DOI: https://doi.org/10.1007/978-981-10-6113-4_2

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-10-6112-7

  • Online ISBN: 978-981-10-6113-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics