59
Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Embed Size (px)

Citation preview

Page 1: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Page 2: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Page 3: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Page 4: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Pixel Saturation:Pixel Saturation:

SaturationSaturation can be described by the fact that no pixel can be darker than pure black (i.e. value = 0) nor brighter than absolute white (i.e. greater than 255 or 4095 or 65,535)

Page 5: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Pixel Saturation:Pixel Saturation:

Once a pixel’s value is saturated it can no longer provide useful information

Page 6: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

HistogramsHistograms The data contained in a digital image can be displayed as a histogram which is a plot of the pixel values ranging from black to white versus the number of pixels that have that particular value.

Page 7: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Low Contrast image (pixels concentrated in a narrow, central values)

High Contrast image (many pixels clustered at the extremes of the value range)

Page 8: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Good contrast(even distribution)

Page 9: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

One can take an image with a narrow contrast range and expand it to cover the entire range of black to white in a process known as contrast stretching.

Page 10: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

HistogramsHistogramsThe display values of those pixels (i.e. how they will appear on the viewing screen) is determined by the display curve. In the histogram to the left a pixel value of 68 would have a display value of 68. The display curve is straight with a slope of 1.00

Page 11: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

The slope of the display curve relative to the pixel values can be varied in any number of ways. This is known as a “gamma” correction and can be used to

expand the display of either the dark ( < 1) or bright ( >1) portion of the image.

Page 12: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Slope = 1.0 0.5 2.0

Gamma correction can be easily adjusted in many image processing programs by choosing the midpoint of display on the histogram of pixel values and thus changing the slope of the display curve.

Page 13: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

micro.magnet.fsu.edu/primer/digitalimaging/index.html

Page 14: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

micro.magnet.fsu.edu/primer/digitalimaging/index.html

Page 15: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Another way of altering the way an image is displayed involves the use of a Look-Up Table or “LUT” in which the value of the input pixel is changed to a new value in the output. Thus a new image matrix is created with new values for each pixel.

Page 16: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

This affords much greater control over the This affords much greater control over the displayed image.displayed image.

A)Inverted image B) All pixels below 100 are blackC) All pixels between 64 and 120 are black

Page 17: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

In applying a color LUT to this image pixels of specific values are displayed as red.

Page 18: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Color LUTs or “CLUT” can be complex and apparently random but if later passed through an inverse CLUT the original image can be restored

Page 19: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Why would having additional bit-depth be important when the human eye can only detect about 100 shades of grey anyhow?

X-ray of Breast Contrast Enhanced

Subtle differences in grey levels contain information

Page 20: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

The fact that digital images are data matrices means that functions can be applied to them. A new data matrix based on the intensity of the pixels in the background can be subtracted from the original matrix and the resultant matrix is then contrast stretched to produce an image in which the distracting background has been substracted.

Page 21: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Dodging and Burning:

Selectively increase or decreasing the brightness of a subset of pixels.

Page 22: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Clone Stamp:Clone Stamp:

Selectively copy a portion of the matrix onto another portion of the image.

Page 23: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Clone Stamp:Clone Stamp:

Selectively copy a portion of the matrix onto another portion of the image.

Page 24: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Having increased bit-depth also allows one to take advantage of sophisticated image processing.

Page 25: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Image Processing:

Page 26: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Image Processing:Spatial Convolution (image processing)An image processing operation that is used to spatially filter an image. A convolution is defined by a kernel that is a small matrix of fixed numbers. The size of the kernel (3x3, 5x5, 7x7, 9x9) the numbers within it, and a single normalizer value define the operation that is applied to the image. The kernel is applied to the image by placing the kernel over the image to be convolved and sliding it around to center it over every pixel in the original image. At each placement the numbers (pixel values) from the original image are multiplied by the kernel number that is currently aligned above it.

Page 27: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Image Processing:The operation, as defined by the kernel, is applied to all pixels in the original data matrix with the exception of those pixels that form the edge of the matrix. A new output matrix of the same size, but with different pixel values results.

Page 28: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Image Processing:

The sum of all these products is tabulated and divided by the kernel's normalizer. This result is placed into the new image at the position of the kernel's center. The kernel is translated to the next pixel position and the process repeats until all image pixels have been processed.

As an example, a 3x3 kernel holding all 1's with a normalizer of 9 performs a neighborhood averaging operation. Each pixel in the new image is the average of its 9 neighbors from the original.

Page 29: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

529 9 = 59

Page 30: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)
Page 31: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Sharpening Sharpening

The sharpness of a digital image refers to the degree of clarity in both coarse and fine specimen detail.

Page 32: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

micro.magnet.fsu.edu/primer/digitalimaging/index.html

Page 33: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

micro.magnet.fsu.edu/primer/digitalimaging/index.html

Page 34: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

micro.magnet.fsu.edu/primer/digitalimaging/index.html

Page 35: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

micro.magnet.fsu.edu/primer/digitalimaging/index.html

Page 36: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

micro.magnet.fsu.edu/primer/digitalimaging/index.html

Page 37: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

micro.magnet.fsu.edu/primer/digitalimaging/index.html

Page 38: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

First apply apply a color LUT to a greyscale image.

Image processing can be Image processing can be a complex combination a complex combination of processesof processes

Page 39: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

The lowpass averaging filter can be selected from 3x3 up to 255x255 neighborhoods. All pixels included in the filters size are added up, the result is divided by the number of pixels.

Page 40: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

The Gauss filter can be selected from 3x3 up to 7x7 kernel size. It performs a weighted sum (center pixel = highest weight). The result is normalized by total kernel weight.

Page 41: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Process / Filters / MedianWith a kernel size of 3x3 the resulting value is the median (number 5 out of the sorted list of 9). In contrast to lowpass filters, the median keeps edges and removes single pixel errors (like hot pixels) completely.

Page 42: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Laplace (8 connected)The Laplace Filter weights the difference between the center pixel and its neighbors.

-1 -1 -1-1 8 -1-1 -1 -1

Page 43: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Sharpen (8 connected)Based on the Laplace Filter, the Sharpen Filter includes/adds the original image (center pixels weight one above Laplace)

-1 -1 -1-1 9 -1-1 -1 -1

Page 44: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

SobelThe Sobel filter enhances edges in all directions. It is implemented through two independent convolutions with the left kernel (once rotated by about 90°). The results of each kernel are combined to form the final result. 1 2 1

0 0 0-1 -2 -1

Page 45: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

PrewittThe Prewitt filter performs a similar operation as the Sobel Filter (90° kernel rotate).

1 1 1 0 0 0-1 -1 -1

Page 46: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

The exact sequence of processing steps can bring about a profound change, and improvement, in the image.

Page 47: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

The spatial domain is represented by the conventional image. The processes of adjusting contrast, sharpening, background removal, etc. are all forms of spatial convolution.

We can also process the data in the image matrix in its frequency domain using algorithms developed by Joseph Fourier

Joseph FourierJoseph Fourier (1768-1830)(1768-1830)

Page 48: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

A Fourier Fast Transform (FFT) converts an image into a display of frequencies displayed as an energy spectrum. This can be done optically an an electron diffraction pattern is an example of this, the spacing of dots indicating their frequency and the brightness of the dots indicating the intensity.

Page 49: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

A FFT can be created of the spatial domain and if there is a frequency it will show up as dots.

Page 50: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

A FFT can be created of the spatial domain and if there is a frequency it will show up as dots.

If the size and brightness of the spots is increased the frequency will be enhanced but not changed.

Page 51: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

If the processed FFT is once again put through a Fourier transform (inverse FFT) an altered image of the original spatial domain is recreated.

Page 52: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Inverse FFT OriginalInverse FFT Original

Page 53: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Likewise the intensity of the spots can be reduced and an inverse FFT will result in the reduction of the apparent frequencies such as chatter in a TEM section.

Page 54: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Ethics of Digital Image Processing:Ethics of Digital Image Processing:

Although most of what can now be accomplished in the way of image manipulation was possible by way of clever darkroom technique it is now much easier to falsify a digital image.

Page 55: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Rules of Image Processing:Rules of Image Processing:

1. Save the original unaltered image. For your own sanity you should only process duplicates of the original and the original image should be made available for others to examine.2. Process only as needed. The removal of artifacts is acceptable if it does NOTNOT alter the data contained in the image. Processing for emphasis (i.e. colorization) is generally acceptable.3. Document EACHEACH step. Your materials and methods should specify precisely which steps were taken in processing the image.

Page 56: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Use of Color in Electron Micrographs:Use of Color in Electron Micrographs:

Microheater Blood Clot

HIV buddingfrom cell

Page 57: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)

Use of Color in Electron Micrographs:Use of Color in Electron Micrographs:

Drosophila melanogaster

By David Scharf

Page 58: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)
Page 59: Creation of a digital image from an analog signal. Analog-Digital Converter (ADC)