The Digital Image Dr. John Ryan. What would this look like in grayscale?

76
The Digital Image r. John Ryan

Transcript of The Digital Image Dr. John Ryan. What would this look like in grayscale?

The Digital ImageDr. John Ryan

What would this look like in grayscale?

grayscale

50 43 48

100124134

187234250

Is this the lowest level we can go?

00110010 00101011 00110000

011001000111101110000110

101110101110110111111001

Why process images?

Source: Hornegger & Paulus, Erlangen University

Line Defect Interpolation

Source: Hornegger & Paulus, Erlangen University

Contrast Enhancement

Source: Hornegger & Paulus, Erlangen University

Noise Reduction

Source: Hornegger & Paulus, Erlangen University

Edge Enhancement

Source: Hornegger & Paulus, Erlangen University

The filter works by identifying sharp edge boundaries in the image, such as the edge between a subject and a background of a contrasting color, and increasing the image contrast in the area immediately around the edge

The Difference?

Original Result

What is a Digital Image?The digital image is sampled and mapped as a grid of dots or picture elements (pixels). Each pixel is assigned a tonal value (black, white, shades of gray or color), which is represented in binary code (zeros and ones).

Digital radiography

• is a form of X-ray imaging, where digital X-ray sensors are used instead of traditional photographic film. Advantages include time efficiency through bypassing chemical processing and the ability to digitally transfer and enhance images. Also less radiation can be used to produce an image of similar contrast to conventional radiography

What is a Pixel?

• A pixel is the smallest element within an image that has a single intensity value

• The pixel value varies depending on intensity resolution (range, depth)

Pixels

What is a Voxel?

• A voxel is like the 3D version of a pixel• It is the smallest unit within a volume

A Fly on the Ceiling

Y

X

Image Coordinate System

• Top left corner is the origin.• Bottom right corner is the final

pixel or (width, height).• Although this is the most

common image coordinate system, it may vary.

• There are many definitions for “pixel”, but in the context of medical imaging, a pixel is the smallest intensity or colour component of an image.

Bits and Bytes

00110010 00101011 00110000

011001000111101110000110

101110101110110111111001

How Computers Store Images

• Uncompressed images are stored as a sequence of pixel values

• From left to right, then down to next row• For 8 bit, 1 byte per pixel• Deep down it’s stored as binary

information:

101001010100101001110101101001010010101001010100101010100101010001001010010010100101110100111010010110100111010010101010111010100110011101010101001101100100011010010100100101011001011010100101010011010101100101001010100110110101101010011101000011010100101

Bits and Bytes

A bit can have two values: 1 or 0, on or off

• 8 bits = 1 byte (Total is 256)• Computer data is stored in binary• Binary digits (bits)• Looks like 10010100101110101……

1 2 4 8 16 32 64 128

Getting a Value

1248163264128

Example 1:10000001 = 128 + 1 = 129

Example 2:00010010 = 16 + 2 = 18

Resolution

• Intensity resolution– The range from totally white to totally black.– Intensity – relating to brightness value

• Spatial resolution– The width and height of the image.

• Temporal resolution– The rate of frames per second of animation or

video.– Temporal – relating to time

contrast

• Contrast is a measure of the• magnitude of the measured signal

differences between physically different regions of the imaged object.

contrast

Two versions of a wrist MR image. Image a plainly has higher contrast than imageb – the bones are much brighter relative to the surrounding tissue background, even though inimage b the average brightness of the bones is greater than in image a. Measures of contrast arebased on the relative or absolute difference in average intensity of an object and its background

Artifacts

• Any intensity or color fluctuations that make it difficult to see what you want to see that occur due to specific properties of the imaging method

Intensity Resolution

• Bits per pixel• Or, number of gray levels• 8 bpp [256; (256 colours)], • 16 bpp [65536; (65,536 colours, known as

Highcolour)], • 24 bpp [16777216; (16,777,216 colours, known

as Truecolour)]. • 48 bpp [281474976710656;

(281,474,976,710,656 colors, used in many flatbed scanners and for professional work)

Intensity Resolution

8 bit, 256 gray levels 3 bit, 8 gray levels

Lets Build a Chest X-RayFrom scratch, 0 bits – 0 levels

1 bit, 2 levels

2 bits, 4 levels

3 bits, 8 levels

4 bits, 16 levels

5 bits, 32 levels

6 bits, 64 levels

7 bits, 128 levels

8 bits, 256 levels

Intensity Resolution

8 bit, 256 gray levels 3 bit, 8 gray levels

Quantization

• Quantization involves the downsizing of the number of gray levels

• This allows us to compress the image (less number of bits)

• However, there are pitfalls:– An effect called posterisation can

be produced– Vital information may be omitted

Original Grayscale ImageFull range of intensity values.

Quantized to 8 Intensities / Shades

Note the contours.

Intensity values limited to 8 shades.

Quantized to Black and WhiteIntensity values limited to just 2 shades: black and white

Posterisation

Affects areas of low spatial frequency the most

Spatial Resolution

• The number of pixels in an image

• Can be expressed by WIDTHxHEIGHT or actual value

• Eg. 256x256 pixels• Or, 65536 pixels

WIDTH

HE

IGH

T

Spatial Resolution

800x800 50x50, Scaled Up

Temporal Resolution

• Frames per second• For video or animation• Normally 25-30 fps

Temporal Aliasing

• Not enough frames per second• This causes flickering or strobing

of the video• Solution: sample at a higher rate

or apply some image pre-processing techniques

• An example of temporal aliasing would be the “wagon wheel” effect, where a wheel or helicopter rotor-blade appears to be slowing down or in reverse, due to a different sampling rate.

Histogram

• A Histogram is a distribution of intensity values.• Usually expressed as a graph.• X – axis: Pixel value• Y – axis: Number of pixels

No.ofpixels

Pixel Value

What does this image look like?

Mean: 206 Median: 207Standard Deviation: 23Pixels: 640000 Depth: 256 (8bits)

Example 1

How about this?

Mean: 39 Median: 35Standard Deviation: 33Pixels: 640000 Depth: 256 (8bits)

Example 2

And this?

Mean: 122 Median: 125Standard Deviation: 71Pixels: 640000 Depth: 256 (8bits)

Example 3

More Histograms

Shrubbery Sky and clouds

A Histogram is a distribution of intensity values.

Even More Histograms

Air BrainBone

Luminance-based segmentation

• By knowing about image statistics, we can do interesting things like segmentation of bone for 3D reconstruction.

3D Reconstruction of Child’s Skull

Brightness (Level)Original Level Adjusted

Brightness (Level)

• “Level” or “Brightness” is adjusted by adding or subtracting to the current pixel value.

• This is applied evenly throughout the image.

• If the limit of the intensity values are reached (i.e., totally black or totally white), the current pixel is assigned the same value as the limit.

ContrastOriginal Contrast Adjusted

Contrast

• AKA “Histogram stretching”

• “Contrast” involves the stretching of an original narrow range of values to a wider grayscale range or vice-versa

• i.e., Expanding from a “clumped” histogram to a more well spaced distribution.

References

• Previous image analysis lectures by Dr. Hamish Carr• Digital Image Processing by Gregory A Baxes.• http://www.wikipedia.org• Hornegger & Paulus, Erlangen University• http://mi.eng.cam.ac.uk/~gmt11/videos/video.html• http://biocomp.stanford.edu/3dreconstruction/movies/hav

eri/fr_orbitae.jpg• http://www.stanford.edu/class/ee368/Handouts/1-Introdu

ction.pdf• http://grail.cs.washington.edu/projects/dance-

symmetry/