Presentation is loading. Please wait.

Presentation is loading. Please wait.

Image Processing F34IMP lecture 1

Similar presentations


Presentation on theme: "Image Processing F34IMP lecture 1"— Presentation transcript:

1 Image Processing F34IMP lecture 1
Alfonso Aragón-Salamanca CAPT B106

2 Lecture 1 Aim: to introduce image processing:
what can it be used for? how do computers store images?

3 1. Introduction What is image processing? Why is it in a Physics degree course?

4 What is a digital image? An image is a two-dimensional function f(x,y), where x and y are spatial co-ordinates and the amplitude of f is the intensity of the image. If f, x and y are finite, discrete quantities then the image is a digital image. The elements of a digital image are usually referred to as pixels.

5 What is digital image processing?
What is a digital image? An image is a two-dimensional function f(x,y), where x and y are spatial co-ordinates and the amplitude of f is the intensity of the image. If f, x and y are finite, discrete quantities then the image is a digital image. The elements of a digital image are usually referred to as pixels. What is digital image processing? Processing digital images using a computer. For instance: restoration (e.g. removing motion blur) enhancement (e.g. enhancing contrast) registration (matching size & orientation of multiple images) transformation (changing properties) segmentation (divide into regions) recognition (recognise objects)

6 Many different sources of images
e.g. medical X-rays (detect with solid state device or crystal scintillator or convert to visible photons) e.g. photo taken with digital camera e.g. heat camera (using Charge Coupled Devices) e.g. radio telescope Also non-electromagnetic images e.g.: Ultrasound (reflection of phonons by body) Magnetic Resonance Imaging (imaging interior of object using magnetic field and pulses of radio waves) Positron Emission Tomography (3-d image from gamma-rays produced by positron emitting isotope)

7 Restoration Before (blurred) After (deblurred) Deconvolution

8 Grey level enhancement
Before After Grey level enhancement

9 Registration MRI brain images:
Registration: precisely matching size and orientation of two or more images. Find matching points, and hence geometric transformation.

10 Transformation(geometric and colour)

11 Transformation (geometric and colour)
Morphing

12 Segmentation detect sign pixels

13 Object recognition Character recognition (postcodes, cheques, car registration numbers) Face recognition Recognising people and their movements

14 (mini)-Summary Image processing:
◆ Restoration ◆ Enhancement ◆ Registration ◆ Transforming ◆ Segmentation ◆ Recognition Essential in astronomy and medical physics (and all sorts of ‘real world’ applications).

15 2. Computer handling of images
a) pixels pixel 337 pixels 206 pixels

16 Each pixel = “average” of
b) Resolution Each pixel = “average” of original image 337 pixels 5 pixels 206 pixels 3 pixels

17 Important to have sufficiently high spatial resolution.
Original ÷2 ÷4 ÷6 ÷8 ÷10 ÷12 sketch aliasing on whiteboard Aliasing artefacts hopeless Important to have sufficiently high spatial resolution.

18 Nyquist criterion Resolution required depends on how rapidly Img(x,y) changes across the image. This is measured by the spatial frequency: gradual changes ≡ low spatial frequency rapid changes ≡ high spatial frequency

19 Nyquist criterion Resolution required depends on how rapidly Img(x,y) changes across the image. This is measured by the spatial frequency: gradual changes ≡ low spatial frequency rapid changes ≡ high spatial frequency can be adequately represented in coarse grained image can only be adequately represented in densely sampled image

20 Nyquist criterion Resolution required depends on how rapidly Img(x,y) changes across the image. This is measured by the spatial frequency: gradual changes ≡ low spatial frequency rapid changes ≡ high spatial frequency can be adequately represented in coarse grained image can only be adequately represented in densely sampled image Nyquist criterion: need pixel size less than 1/2 wavelength of highest spatial frequency in image. equivalently: sampling frequency must be greater than double the highest spatial frequency.

21 c) How matlab stores images
Represents them as a 2-d array: Img(1,2) Img(1,1) Img(j,k) value of element in j-th row and k-th column Img(2,1) Elements are pixels. Number of elements in each direction is called the spatial resolution.

22 i) Greyscale images Each pixel assigned value from:
British english: grey, American english: gray Each pixel assigned value from: 0=black to 255=white. 256 greylevels (quantisation levels) 255

23 False contouring 256 greylevels 8 greylevels

24 Two caveats Some image processing software packages represent greylevels differently, e.g., 1 → 256 [g = g’-1] 0.0 → 1.0 [g = round(g’*255)] g’=0 → g=0 g’= → g=0 Matlab does not actually support greylevels directly [see task1].

25 ii) Colour images British english: colour, American english: color
3 numbers needed e.g., RGB [amount of red, green, blue primaries]. Each from 0→255. yellow (255,255,0) red (255,0,0) grey (X,X,X)

26 Truecolour Each of the three levels can take a value from 0 to 255.
Therefore ≈ 16 million different possible colours, hence “true”. Stored in matlab as a 3D array: y x R G B first problem in task 1

27 Indexed colour Most images actually only contain 10s or 100s of colours (<< 16 million). Can make the image data file a lot smaller by using a colour table. “image array” “colour table” R G B img(1,1)=c f (1,1) (1,2) (1,3) (2,1) (2,2) (2,3) (c,1) (c,2) (c,3) (f,1) (f,2) (f,3) Each element of image array contains an integer. Used to “look up” colour from colour table. Size of colour table determined by number of unique colours in image. second problem in task 1

28 File formats PNG JPEG GIF Truecolour 1MB Indexed colour 396KB
Portable Network Graphics Truecolour 1MB Indexed colour 396KB Greyscale 376KB lossless compression JPEG Joint Photographic Experts Group Truecolour 122KB Greyscale substantial, but lossy, compression GIF Graphic Interchange Format Indexed colour 367KB lossless compression

29 Summary Greyscale Image Pixels Truecolour Colour Indexed colour

30 Task 1: useful sources of Matlab help: Matlab help function
Matlab introductory notes (available from Moodle)


Download ppt "Image Processing F34IMP lecture 1"

Similar presentations


Ads by Google