Sub topics - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Sub topics

Description:

The pixel shape in computer images is normally square or rectangular but, in ... B&W Bitmap is monochrome and the colour table contains two entries. ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 36
Provided by: ericfl
Category:
Tags: monochrome | sub | topics

less

Transcript and Presenter's Notes

Title: Sub topics


1
Sub topics
  • Grey scale images
  • Colour images (RGB, HSV, indexed)
  • Introduction to image storage formats
  • Image representation in MatLab
  • Image sources
  • CCD cameras

2
The basic unit of a digital image is the the
pixel.
The pixel shape in computer images is normally
square or rectangular but, in principle, any
cross section or size is possible. For example
newspaper images are base on a variable sized
pixel.
The variable size is to compensate for having
only two colours !
3
The standard grey scale image uses 256 shades of
grey from 0 (black) to 255 (white).
4
  • With colour images the situation is more complex.
    For a given number of pixels considerably more
    data is required to represent the image and more
    than one colour model is used. We will consider
    only three of the more common colour models
  • RGB
  • HSV
  • Indexed

5
This can be thought of as a simple extension of
the grey scale model where each pixel is composed
of three primary colours, red, green and blue
each represented by a digital range of 0 to 255
leading to 16,777,216 (16 million) colours. All
available colours can be represented on the
colour cube
Instead of a single array of numbers we can now
think of three array planes or for an m x n image
an m x n x 3 array
Please check out the meaning of primary colour
6
Whilst the RGB model is very simple it does not
correspond very well with our intuitive
understanding of colour. It is more natural to
think in terms of Hue The colour starting
with Red (0 degrees)
Saturation The purity of the colour. A
saturation of 1 is the pure colour and 0 is
white. Value Is a measure of intensity with 0
as black and 1 as white. The combination of
saturation value are often referred to as the
tint of the colour.
Hue
A simple transform will convert colour spec from
RGB to HSV and vice versa
7
Both RGB and HSV colour specifications are very
memory intensive. For example a 768 x 1024 RGB
image requires 2.36 Mbytes. Often double
precision numbers are used in place of single
byte values in which case the above image
requires 9.44 Mbytes.
An alternative is to use a small fixed range of
colours (e.g. 256) and make the entries in the
image array simply single byte pointers to the
colour table.
128 24 150 200
123 123 50 80
55 198 26 88
Col. Num. R G B
23 10 200 180
24 255 10 100
25 45 88 220
26 255 255 255
Abstract from the image array
Abstract from the colour table
8
  • Storing large quantities of images can consume a
    considerable quantity of memory. This fact
    together with the requirement to use the same
    image in a wide variety of applications has the
    led to the emergence of image storage standards.
  • Regrettably a very large number of such standards
    exist of which about 30 are in common use.
  • Image compression is a large a fascinating topic
    which we do not have time to explore in this
    course. A little non mathematical information can
    be found in Topic 13 of the undergraduate course
    notes.

9
  • Image compression can be loss less in which
    redundant data is recorded and then removed on
    storage. When the image is restored all the data
    is recovered. Compression ratios are typically
    51.
  • Loss less compression algorithms include Run
    Length Encoding (RLE), Huffman encoding and
    Lempel Ziv Welch (LZW) encoding.
  • Topic 13 includes some details and there is a
    good description in reference text 2 chapter 8

10
Lossy image compression techniques rely on the
fact that the human visual system is insensitive
to the loss of certain types of information. In
particular it is insensitive to very small
intensity changes and high frequency
components. Two of the most common lossy
compression techniques are JPEG and fractal
compression. The following diagram illustrates
the sequence of operations for JPEG compression
11
  • The following formats are supported
  • BW Bitmap is monochrome and the colour table
    contains two entries. Each bit in the bitmap
    array represents a pixel. If the bit is clear,
    the pixel is displayed with the colour of the
    first entry in the colour table. If the bit is
    set, the pixel has the colour of the second entry
    in the table.
  • 4bit Bitmap has a maximum of 16 colours. Each
    pixel in the bitmap is represented by a 4-bit
    index into the colour table array. The first
    pixel contains the colour in the second table
    entry, and the second pixel contains the colour
    in the sixteenth table entry.
  • 8bit Bitmap has a maximum of 256 colours. Each
    pixel in the bitmap is represented by a 1-byte
    index into the colour table.
  • 24bit Bitmap has a maximum of 224 colours. Each
    pixel is a 3-byte sequence in the bitmap array
    represents the relative intensities of red,
    green, and blue.
  • Windows supports RLE encoding to compress bit
    maps.

12
Graphic interchange file format
(.GIF) CompuServ graphics format that uses LWZ
compression and support from BW (1bit) to 8bit
colour and grey scale images. One of the formats
that World Wide Web (WWW) documents use for
in-line graphics files. Tagged image file format
(.TIF) TIFF files have many formats Black and
white, grey scale, 4 and 8 bit colour, full
colour (24-bit) images. TIFF files support the
uses of data compression using LZW and other
compression standards. Not all software that
supports basic TIFF will support all the variants
of TIFF Joint photographic expert group format
(.JPG) Provides very good compression, but does
not uncompress exactly as it was. Information is
lost that your eyes can not see, as a result it
is good for storing image that will not be
re-edited. TIFF is a better format for storing
image that are to be edited or changed at a later
date. Compressions up to 501 are easily
obtainable.
13
  • MatLab uses three data representations for its
    image classes
  • UINT8 Unsigned 8 bit integers in the range 0 to
    255.
  • UINT16 Unsigned 16 bit integers in the range 0
    to 65,535
  • Double Double precision numbers in the range 0 to
    1. 4 bytes are required per pixel.

Only a very limited amount of data processing can
be done with the UINT image classes. In fact with
UINT16 you are virtually limited to displaying
the image. Their function is to store images more
efficiently on disc files. Almost all your work
will be done with double precision images.
14
Working with images almost always requires using
double precision arithmetic. The MatLab function
double converts data to double precision. The
functions uint8 and uint16 do the inverse
conversions for an indexed image. The majority
of indexed colour map standards use 0 to point
to the first entry in the colour table, 1 to
point to the next etc. Thus it is necessary to
add 1 when converting a UINT image to a double
precision array and subtract 1 for the inverse
conversion.
To convert the UINT8 image X8 to the double image
J use
J double(X8) 1
To convert the indexed double image J into a
UINT16 image use
X16 uint16(J - 1)
15
  • The image processing toolbox supports four basic
    image types
  • Indexed images
  • Intensity images (MatLabs name for grey scale
    images)
  • Binary images
  • RGB full colour images

A binary image has only two pixel values 0
or off and 1 or on
16
We can load an image with the imread function
and display an image with the imshow
function. imread A imread(filename,fmt) X,map
imread(filename,fmt) In the first form the
image is read into the array A and the format of
the image fmt is optional. In the second form
the image is read into the array X and the
associated indexed map into map scaled 0 to 1
as double. imshow imshow(A) imshow(X,map) imshow
has many other formats
17
function colourdisplay To demonstrate the
splitting of an image into its primary colours A
imread('monar.jpg') subplot(2,2,1)
imshow(A) title('RGB image') Redimage
A(,,1) subplot(2,2,2) imshow(Redimage) title(
'Red image') Greenimage A(,,2) subplot(2,2,3
) imshow(Greenimage) title('Green
image') Blueimage A(,,3) subplot(2,2,4)
imshow(Blueimage) title('Blue image')
18
(No Transcript)
19
MatLab allows easy conversion between image types
using rgb2hsv to convert to a HSV
image rgb2gray to convert to a grey scale image
(note American spelling). rgb2ind to convert to
an indexed image You should check the details in
the MatLab help files. With the addition of the
following line (and a variable name change) the
previous example can be used to display the HSV
components. B rgb2hsv(A)
20
(No Transcript)
21
improfile which will reveal the colour
intensity profile along a line defined on the
image. Simply placing improfile on a line will
allow you to interactively explore the colour
profile alternatively using c
improfile(I,xi,yi,n) will record in the array
c the RGB values from image I with line segment
end points defined by xi yi using n equally
spaced points   pixval which will interactively
record the location and colour components of each
pixel as you move a cursor across the
image.   impixel returns the RGB values for a
specified pixel.
22
(No Transcript)
23
(No Transcript)
24
Provided the data from any sensor can be
digitised the data can be imaged. If the sensor
is cheap and can be implemented as a sensor array
(e.g. CCD camera) the image source can be
projected directly onto the sensors. For more
expensive or bulky sensors some form of scanning
arrangement needs to be implemented as in this
general scheme.
25
This is an example of an imaging source
(scattered electron beam) where the image is
generated by the scanning process.
26
Laser morphometric analysis of shoulder joint
Source COMIR research group Leeds University
27
Magnetic resonance imaging of water flow in the
brain.
Source COMIR research group Leeds University
28
X-ray image of Auroral display
Source University of Stockholm
29
Radio image of CO gas in galaxy M82
Source NASA
30
Near infra red spectroscopic imaging.
31
Almost all the work we will do in this course is
centred on visible light imaging using either a
still or video CCD camera. The basic operation of
a Charge Coupled Device (CCD) is summarised in
the following diagrams
photon
-
e
e-
Q

Topic 10 has more information on charge readout
32
  • A dark current exists even in the absence of a
    light source. astronomical cameras are cooled to
    minimise this effect.
  • The accumulation of charge is subject to noise
    which limits the intensity resolution.
  • There is also readout noise due to the ADC
    process.
  • For accurate work the intensity response will
    need to be calibrated. For very accurate work
    each pixel may need individual calibration !.
  • For most of what we do we can regard the camera
    as a simple pinhole camera.
  • For our work the camera optics will need
    calibration (see topic XX).

33
(No Transcript)
34
(No Transcript)
35
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com