• 沒有找到結果。

Image Visualization

N/A
N/A
Protected

Academic year: 2022

Share "Image Visualization"

Copied!
62
0
0

加載中.... (立即查看全文)

全文

(1)

Image Visualization

(2)

Image Visualization

(3)

outline

• Image Representation & Visualization

• Basic Imaging Algorithms

• Shape Representation and Analysis

(4)

outline

• Image Representation & Visualization

• Basic Imaging Algorithms

• Shape Representation and Analysis

(5)

Image Data Representation

}) ({ p

i

}, {C

i

}, {f

i

},{Φ

i

s

D

• What is an image?

• An image is a well-behaved uniform dataset.

• An image is a two-dimensional array, or matrix of pixels, e.g., bitmaps, pixmaps, RGB images

• A pixel is square-shaped

• A pixel has a constant value over the entire pixel surface

• The value is typically encoded in 8 bits integer

(6)

Image Data Representation

• Pixel values typically represent gray levels, colours, heights, opacities etc

• Remember digitization implies that a digital image is an approximation of a real scene

(7)

Image Processing and Visualization

• Image processing follows the visualization pipeline, e.g., image contrast enhancement following the

rendering operation

• Image processing may also follow every step of the visualization pipeline

(8)

outline

• Image Representation & Visualization

• Basic Imaging Algorithms

• Shape Representation and Analysis

(9)

Basic Image Processing

• Image enhancement operation is to apply a

transfer function on the pixel luminance values

• Transfer function is usually based on image histogram analysis

• High-slope function enhance image contrast

• Low-slope function attenuate the contrast.

(10)

Basic Image Processing

• The basic image processing is the contrast enhancement through applying a transfer function

• Transfer function

– The original image:

f(x) = x

– Linear normalization

f(x) = (x – lmin ) / ( lmax – lmin ) – Nonlinear transfer

(11)

Image Enhancement

Linear Transfer Non-linear Transfer

(12)

Image Histograms

• The histogram of an image shows us the distribution of grey levels in the image

• Massively useful in image processing, especially in segmentation

Grey Levels

Frequencies

(13)

Histogram Equalization

• All luminance values covers the same number of pixels

• Histogram equalization method is to compute a transfer function such as the resulted image has a near-constant histogram

x

i

h[i]

) (size- f(x)

0

1

(14)

Histogram Equalization

Original Image After equalization

(15)

Noise and Images

• Noise can be described as rapid variation of high amplitude

• Or regions where high-order derivatives of f have large values

• Noise is usually the high frequency components in the Fourier series expansion of the input signal

(16)

Noise Model

• We can consider a noisy image to be modeled as follows:

• where f(x, y) is the original image pixel, η(x, y) is the noise term and g(x, y) is the resulting noisy

pixel

• If we can estimate the model the noise in an image is based on this will help us to figure out how to

restore the image

) ,

( )

, ( )

,

( x y f x y x y

g

(17)

Noise Model

There are many different models for the image

noise term η(x, y):

– Gaussian

• Most common model

– Rayleigh – Erlang

– Exponential – Uniform

– Impulse

• Salt and pepper noise

Gaussian Rayleigh

Erlang Exponential

Uniform

Impulse

(18)

Filtering to Remove Noise

We can use spatial filters of different kinds to remove different kinds of noise

The arithmetic mean filter is a very simple one and is calculated as follows:

This is implemented as the simple smoothing filter

Blurs the image to remove noise

Sxy

t s

t s mn g

y x f

) , (

) , 1 (

) , ˆ (

1/9 1/9 1/9

1/9 1/9 1/9

1/9 1/9 1/9

(19)

Smoothing

Noise image After filtering

(20)

Fourier Series

• For any continuous function f(x) with period T (or x=[0,T]), the Fourier series expansion are:

T

n n

T

n n

n

n

n n

n

n n

dt t w t

T f b

dt t w t

T f a

n T w

x w b

x w a

a f(x)

0 0

1 1

0

) cos (

) 2 (

) s i n(

) 2 (

2

) cos (

) s i n(

The higher the order n or the frequency, the smaller the amplitudes an and bn

(21)

Fourier Series

(22)

Fourier Transform

)) (

), (

( )

(

cos )

(

s i n

0 0

w B w

A w

F

B (wt)dt f(t)

w B

(wt)dt f(t)

A(w)

. continuous are also

amplitudes

, continuous , w is

When T

(23)

Fourier Transform

(24)

Discrete Fourier Transform (DFT)

The Discrete Fourier Transform of f(x, y), for x

= 0, 1, 2…M-1 and y = 0,1,2…N-1, denoted by F(u, v), is given by the equation:

for u = 0, 1, 2…M-1 and v = 0, 1, 2…N-1.



1 0

1

0

) / /

(

)

2

, ( )

, (

M

x

N

y

N vy M ux

e

j

y x f v

u

F

(25)

Discrete Fourier Transform (DFT)

The DFT of a two dimensional image can be visualized by showing the spectrum of the images component frequencies

DFT

Scanning electron microscope image of an integrated circuit

magnified ~2500 times

Fourier spectrum of the image

(26)

Convolution Theorem

Frequency filtering is equivalent to the convolution with a filter function g(x)

N

k

k i N k

i

f g

g f

G F

x g x

f

dt t

x g t f x

g x

f

0

) (

)) ( )

( (

) (

) ( ))

( )

(

(

(27)

Frequency Filtering

1. Compute the Fourier transform F(wx,wy) of f(x,y)

2. Multiply F by the transfer function Φ to obtain a new function G, e.g., high frequency components are

removed or attenuated.

3. Compute the inverse Fourier transform G-1 to get the filtered version of f

1

G

-

f

Φ F

G

F f

(28)

Frequency Filtering

Frequency filter function Φ can be classified into three different types:

1. Low-pass filter: increasingly damp frequencies above some maximum wmax

2. High-pass filter: increasingly damp frequencies below some minimal wmin

3. Band-pass filter: damp frequencies with some band [wmin,wmax]

To remove noise, low-pass filter is used

(29)

Smoothing Frequency Domain Filters

• Smoothing is achieved in the frequency domain by dropping out the high frequency components

• The basic model for filtering is:

G(u,v) = H(u,v)F(u,v)

• where F(u,v) is the Fourier transform of the image being filtered and H(u,v) is the filter

transform function

• Low pass filters – only pass the low

frequencies, drop the high ones

(30)

Gaussian smoothing

The most-used low-pass filter is the Gaussian function

/a ω

π

-ax e

a ) π

F(e

2

2 2

(31)

Gaussian Lowpass Filters

The transfer function of a Gaussian lowpass filter is defined as

02 2( , )/2

) ,

( u v e

D u v D

H

(32)

Edge Detection

Original Image Edge Detection

(33)

Edge Detection

• Edges are curves that separate image regions of different luminance

• Edges are locations that have high gradient

j i j

i

j i j

i

I I

j y i

I

I I

j x i

I

y I x

I(x,y) I

, 1

,

, ,

1

2 2

) , (

) , (

) (

) (

 

 

 

 

(34)

Edge Detection

Edges detection using derivatives

(35)

Edge Detection Operators

1 , 1 1

, 1

, 1 1

, 1 1

, 1

, 1

1 , 1 ,

1 1

, 1 1

, 1 ,

1 1

, 1

2 1 , ,

1 2

, 1

, 1

2 2

) , (

2 2

) , (

) (

) (

) , (

j i j

i j

i j

i j

i j

i

j i j i j

i j

i j

i j

i

j i j i j

i j

i

I I

I I

I I

j y i

I

I I

I I

I I

j x i

I

I I

I I

j i

R Roberts

Operator

Sobel Operator:

good on noise These are the first-order derivative. Finding edge is to find the high value through thresholding segmentation

(36)

Edge Detection Operators

1 , 1

, ,

1 ,

1 ,

2 2 2

2

4 )

, (

) , (

  

 

 

j i j

i j

i j

i j

i I I I I

I j

i I

y I x

y I x I

Laplacian-based operator:

good on producing thin edge

Second-order derivative. Finding edge is to find the zero- crossing or minimum.

(37)

Derivative based edge detectors are extremely sensitive to noise

Edge Detection

(38)

The Laplacian of Gaussian filter uses the Gaussian for noise removal and the Laplacian for edge detection

Laplacian Of Gaussian

(39)

outline

• Image Representation & Visualization

• Basic Imaging Algorithms

• Shape Representation and Analysis

(40)

Shape Representation and Analysis

Shape Analysis Pipeline

(41)

• Filtering high-volume, low level datasets into low volume dataset containing high amounts of information

• Shape is defined as a compact subset of a given image

• Shape is characterized by a boundary and an interior

• Shape properties include

• geometry (form, aspect ratio, roundness, or squareness)

• Topology (genus, number)

• Texture (luminance, shading)

Shape Representation and Analysis

(42)

• Segment or classify the image pixels into those

belonging to the shape of interest, called foreground pixels, and the remainder, also called background

pixels.

• Segmentation results in a binary image

• Segmentation is related to the operation of selection, i.e., thresholding

Segmentation

(43)

Segmentation

Find soft tissue Find hard tissue

(44)

Connected Components

Find non-local properties

Algorithm: start from a given

foreground pixels, find all

foreground pixels that are directly or indirectly

neighbored

(45)

• Morphological image processing (or morphology) describes a range of image processing techniques

that deal with the shape (or morphology) of features in an image

• Morphological operations are typically applied to remove imperfections introduced during

segmentation, and so typically operate on bi-level images

Morphological Operations

(46)

To close holes and remove islands in segmented images

a: original image b: segmentation c: close holes d: remove island

Morphological Operations

(47)

• Dilation: translate a structuring element (e.g., disc, square) over each foreground pixel of the segmented image

• Dilation thickens thin foreground regions, and fill holes and close background gaps that have a size smaller than the structuring element R

• Erosion: the opposite operation of dilation.

• Erosion is to thin the foreground components,

remove island smaller than the structuring element R

Morphological Operations

(48)

Morphological Operations

Original image Dilation by 3*3 square structuring

element

Dilation by 5*5 square structuring element

Original image Erosion by 3*3 square structuring

element

Erosion by 5*5 square structuring element

(49)

• Compound Operations

• More interesting morphological operations can be performed by performing combinations of erosions and dilations

• Morphological closing

• dilation followed by an erosion

• Morphological opening

• erosion followed by a dilation operation

Morphological Operations

(50)

Examples

Original Image

Image After Opening

Image After Closing

(51)

Distance Transform

(52)

• The distance transform DT of a binary image I is a scalar field that contains, at every pixel of I, the minimal distance to the boundary ∂ Ω of the foreground of I

q p

DT(p)

Ω

q

 min

Distance Transform

(53)

• Distance transform can be used for morphological operation

• Consider a contour line C(δ) of DT

} )

(

| {

)

(   p  

2

DT p  

C

• δ = 0 …

• δ > 0 …

• δ < 0 …

Distance Transform

(54)

• The contour lines of DT are also called level sets

Shape Level Sets Elevation plot

Distance Transform

(55)

• Find the closest boundary points, so called feature points

Feature Transform

Given a:

Feature point is b

Given p:

Feature points are q1 and q2

(56)

Skeletonization

(57)

Skeletonization: the Goals

• Geometric analysis: aspect ratio, eccentricity, curvature and elongation

• Topological analysis: genus

• Retrieval: find the shape matching a source shape

• Classification: partition the shape into classes

• Matching: find the similarity between two shapes

(58)

• Skeletons are the medial axes

• Or skeleton S( Ω) was the set of points that are centers of maximally inscribed disks in Ω

• Or skeletons are the set of points situated at equal distance from at least two boundary feature

points of the given shape

r p

q p

r q p

S (  )  {   |  ,    ,   

Skeletonization

(59)

Skeletonization

(60)

Feature Transform Method:

Select those points whose feature transform contains more than two boundary points.

Skeleton Computation

Works well on

continuous data

Fails on discreate data

(61)

Using distance field singularities:

Skeleton points are local maxima of distance transform

Skeleton Computation

(62)

• Basic Imaging Algorithms

– Image Enhancement – Histogram Equalization – Noise and Images

– Spatial Filtering – Fourier Transform – Frequency Filtering – Edge Detection

• Shape Representation and Analysis

– Segmentation

– Connected Components – Morphological Operations – Distance Transform

– Feature Transform – Skeletonization

Summary

參考文獻

相關文件

• The scene with depth variations and the camera has movement... Planar scene (or a

• Richard Szeliski, Image Alignment and Stitching: A Tutorial, Foundations and Trends in Computer Graphics and Computer Vision, 2(1):1-104, December 2006. Szeliski

• The scene with depth variations and the camera has movement... Planar scene (or a

 image processing, visualization and interaction modules can be combined to complex image processing networks using a graphical

The prototype consists of four major modules, including the module for image processing, the module for license plate region identification, the module for character extraction,

Efficient Image - - Based Methods Based Methods for Rendering Soft Shadows.. for Rendering

Partial Volume Segmentation with Voxel Histograms; Higher Order Statistics for Tissue Segmentation; III Quantification; Two-dimensional Shape and Texture

Salmon, Automatic Creation of Object Hierarchies for Ray Tracing IEEE CG&amp;A 1987 Object Hierarchies for Ray Tracing, IEEE CG&amp;A, 1987. • Brian Smits, Efficiency Issues