38
1 Image Filtering and Image Arithmetic

1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

Embed Size (px)

Citation preview

Page 1: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

1

Image Filtering and Image Arithmetic

Page 2: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

2

a. Image Filtering

• filters emphasise or de-emphasise image data of various Spatial frequencies

• spatial frequency refers to roughness of tonal variations in image

• areas of high spatial frequency are tonally rough - grey levels change abruptly over small distances eg. across roads, field borders

• smooth areas have low spatial frequency eg. large fields or water bodies

Page 3: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

3

Image filtering• low pass filters emphasise low frequency changes in

brightness and de-emphasise local detail eg. smoothing filter (mean, median or mode); noise removal filter

• high pass filters emphasise high frequency components of image and de-emphasise more general, low frequency detail eg. edge enhancement filter; directional first differencing filter

• pixels modified on basis of grey level of neighbouring pixels in 3 stages:-– input image– moving window (kernel)– output image

Page 4: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

4

Kernel• the kernel is a square matrix (window) which is moved

pixel-by-pixel over the image• has an odd numbered array of elements (3x3, 5x5 etc.)

whose elements represent a weight to be applied to each corresponding digital number of the input image: result is summarised for central pixel eg. mean

Page 5: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

5

Low pass 3*3 Mean filter

other frequencies may be smoothed by altering size of kernel or weighting factors

Page 6: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

6

Traverse of pixel values across raw image and after

mean filter

Page 7: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

7

Output image for mean filter

• The output value for the central image pixel covered by the kernel(k) is the value of the products of each of the surrounding input pixel values and their corresponding kernel weights (W):

O(x,y) = SUMk(x,y/W) /nk

Where O = output value for central pixel

Page 8: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

8

Ikonos Pan image of Shau Kei Wan, with raw image, 3*3, 5*5 and 7*7 kernel

smoothing filter

Page 9: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

9

Ikonos Pan. image of Mt. Butler/Mt. ParkerBefore and after 5 * 5 low pass (smoothing) filter

Page 10: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

10

Median smoothing filters• superior to mean filter, as median is an actual

number in the dataset (kernel)

• less sensitive to error or extreme values– eg. 3,1,2,8,5,3,9,4,27 median=5, mean=6.89 rounded to 7

– 7 not present in original dataset

– mean larger than 6 of the 9 observed values because influenced by extreme value 27 (3 times higher than next highest value in dataset)

– therefore isolated pixels, which may represent noise removed by median

• preserves edges better than mean, which blurs edges (fig.7.2)

Page 11: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

11

Comparison of median and mean filters

Page 12: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

12

Image filtering in ErMapper

Page 13: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

13

Figure1. SPOT Image before removal of the pushbroom scanner noise. The darker and lighter areas represent differing levels of suspended sediment east of Lamma Island

Figure 2. Image after removal of scan (system) noise using a 11*11 median filter. Edges of sediment plumes also preserved

Effect of median filtering in noise removal

Page 14: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

14

Modal smoothing filter• often referred to as a ‘majority’ filter

• used for classified data, as mean and median are irrelevant for class data

• removes misclassified ‘salt and pepper’ pixels

Modalfilter

Polyvec

Page 15: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

15

High pass (sharpening) filters

• emphasise high frequency component by exaggerating local contrast

eg. mean of surrounding pixels = 30, central pixel = 30, filtered (180/6) = 30mean of surrounding pixels = 30, central pixel = 35, filtered (250/6) = 42

Page 16: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

16

High-pass sharpening filter accentuates noise

Page 17: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

17

Before and after 3 * 3 high pass (sharpening) filter

Ikonos Panchromatic, Mt. Butler

Page 18: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

18

Edge Enhancement and Sharpening filters• edges: ‘areas where slope of grey

level values change markedly’• to detect edges, need both high and

low frequency information• high pass sharpening filters enhance

local contrast but do not preserve low frequency brightness information

• edge filters attempt to preserve both• done by first isolating the low

frequency component by low pass filtering, then subtract this from original image leaving the high frequency component

• add this back to original, doubling the high frequency part

after edge filter

Page 19: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

19

Directional First Differencing• part of edge enhancement used for emphasising lineaments in

one of four directions

• determines the derivative of grey levels with respect to a given direction

• compares each pixel to one of its neighbours

• result can be positive or negative outside the byte range, so rescaled by adding 127

• first differences often give very small

values so contrast stretch is also done

Page 20: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

20

LANDSAT band 2 (green): west of Guangzhou, with Y-directional filter emphasising E-W

trends

Page 21: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

21

Noise removal• noise - ‘the unwanted disturbance in an image that is

due to limitations in the sensing, digitisation or data recording process’

• may either be systematic (banding of multispectral images) or random eg. dropped lines- these may degrade, or totally mask the true radiometric information content of the digital image

• removal is done to produce an image that is as close to the original radiometry of the scene as possible

• removal is critical to the subsequent processing and classification of an image

Page 22: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

22

Stripe noise

Sixteenth line banding noise in LANDSAT Band 2 (green) of 3.3.96: Deep Bay, Hong Kong

Page 23: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

23

Landsat band 2: Deep Bay after 7*7 median filter

Page 24: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

24

Line drop

• Dropped line removed by averaging pixels each side of the line using a 1-dimensional 3*1 vertical filter with threshold of 0

Page 25: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

25

b. Image Arithmetic: band ratioing• enhance image by dividing one band with another

• independent of variations in scene illumination

• may highlight subtle spectral differences because portray variations in slopes of the spectral curves between two bands, which are different for different materials

eg. vegetation is darker in the visible, but brighter in the NIR than soil, thus the ratio difference is greater than either band individually

Page 26: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

26

Ratio images

• ratios commonly used as vegetation indices aimed at identifying greenness and biomass

• a ratio of NIR/Red is most common

• the number of ratios possible from n bands

= n(n-1), thus for SPOT = 6, LANDSAT TM =30

• can be used to generate false colour composites by combining 3 monochromatic ratios

Page 27: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

27

Use of ratio to reduce topographic effects

NB. The objective is to map 2 classes –coniferous and deciduous forest

Page 28: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

28

Effects of NIR/RED ratio on topograpic shading

SPOT Band 3 (NIR) SPOT Bands 3/ 2 (NIR/Red)

Q. Why do we want to reduce topographic shading?

Page 29: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

29

LANDSAT FCC of semi-arid zone, northern Nigeria in dry season, showing effects of displaying Vegetation Index

(NDVI) on red

NB. in dry season the only green vegetated areas, for growing of crops and cattle grazing are along river valleys and on irrigation schemes

Page 30: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

30

Factors to consider in band ratios• choice of bands important - some bands highly

correlated should not be ratioed

• only cancels those factors that are operative equally in both bands eg. topographic effects BUT others such as atmospheric factors may be additive

• ratioing may enhance noise patterns that are uncorrelated in individual bands

• ratio between raw DNs may be different from between radiance values, as offsets different

• generally require re-scaling to byte scale

Page 31: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

31

c. Change detection• involves use of multitemporal images to

discriminate land cover change between dates

• can be short term change eg. flooding or vegetation ripening, or long term eg.urban growth or desertification or sea level change

• imagery should be comparable eg. same sensor, bands, spatial resolution, time of day

• anniversary dates minimise seasonal and sun angle differences

• accurate spatial registration of images important eg. 1/4 to 1/2 pixel

Page 32: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

32

Change detection process

• two approaches - – postclassification

comparison– temporal image

differencing

Lillesand and Keifer Plate 9. LANDSAT MSS, Las Vegas

1972

1986

1992

Page 33: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

33

Post-classification comparison•co-register 2 dates of images and independently classify them

•devise algorithm to determine change

–eg. IF i1 = i2 THEN null ELSE C

OR

IF i1=1 AND i2=2 THEN C1.2

IF i1=1 AND i2=3 THEN C1.3

•devise contingency

table

 

  URBAN WATER SOIL GRASS FOREST TOTAL %Change

URBAN 82 6 7 2 3 100  

WATER 2 30 0 0 0 32  

SOIL 4 4 20 1 0 29  

GRASS 4 0 3 18 8 33  

FOREST 8 2 3 3 26 42  

TOTAL 102 42 33 24 37 236  

 

Page 34: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

34

Temporal image differencing (single band)

• co-register images of different dates

• do atmospheric correction

• convert to radiance

• subtract image pixel values change image

• no change - change image values near zero

• areas of change give larger negative or positive values

• possible values -255 to +255: rescale by +-, /2, +127

• determine threshold for change

• change will be within tails of histogram distribution

Page 35: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

35

SPOT FCC image of Tai Mo Shan,

Dec, 1991 showing burn

SPOT NIR band

cloud

Page 36: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

36

SPOT February 1995

NIR band

Page 37: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

37

Increase in NIR reflectance over burned area from Dec 1991 to Feb.1995

Page 38: 1 Image Filtering and Image Arithmetic. 2 a. Image Filtering filters emphasise or de-emphasise image data of various Spatial frequencies spatial frequency

38

T1=20, T2=90T1-T2=-70(-70/2)+127=92

Change HistogramNo difference =127Thresholds for change = <100 and >150

Graph of lookup table for mapping change values (0-100, and 150-255) to white Areas of less or no change (101-149) set to black

Vegetation change detection based on NIR radiance