ct336/ct404 graphics & image processingsredfern/ct404/08.pdf · • e.g. lens imperfections,...

12
CT336/CT404 Graphics & Image Processing Section 8 Geometric Manipulation

Upload: others

Post on 02-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

CT336/CT404Graphics & Image Processing

Section 8

Geometric Manipulation

Page 2: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Geometric Manipulation

• Image geometry appears in the form of spatial relationships

between the pixels or groups of pixels.

• Geometric operations change these relationships by moving

pixels to new locations while preserving to some extent

pixel neighbourhoods

• These are useful when the captured image contains

geometric distortions, e.g. images of the earth’s surface

• measurements taken from distorted image cannot be

assumed accurate

• Geometric correction removes distortions so that the

resulting image has the geometric properties of a map

Page 3: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Example

e.g. airborne line

scanner may give

extreme distortions

due to changes in

height, velocity, and

rotation of aircraft

Page 4: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Geometric Correction: the General Process

• the output level of a pixel depends on the input level at some other pixel, or

in the neighbourhood of that pixel.

• this other pixel is defined by a geometrical transformation (e.g. translation,

rotation, scale change, etc.)

• often defined as a function which describes the “motion” of a pixel as it is

mapped from its initial to its final position.

• this function may mathematically describe the nature and magnitude of the

sources of systematic error (e.g. perspective distortion in photographs)

• if the sources and types of distortion are not well understood (‘random

error’), the geometric correction task establishes the relationships between

selected pixels in the input image and their corresponding co-ordinates in the

output image

• e.g. with aerial photography, the chosen 'control points' will be chosen as

pixels that are clearly visible in both the image and on a map

Page 5: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Pixel Filling, and Interpolation

• A geometrically transformed input pixel will rarely coincide

exactly with a pixel in the output image.

• It is usually necessary to estimate the value of each output

pixel through interpolation.

• Pixel filling is simpler than pixel carryover (since the

latter produces an output image with holes in) and is

therefore more often used

• the transformation function is applied in reverse =>

output pixels are mapped onto where they came from

in the input image

• this rarely coincides with an exact pixel

• interpolation therefore defines the pixel's value as

some combination of nearby pixels in the input image

Page 6: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Bilinear Interpolation

• Using a rotation operation as an

example, we can see how bilinear

interpolation is superior to nearest

neighbour interpolation

• Bilinear interpolation calculates a

distance-weighted average of the 4 pixels

closest to the target (sub-pixel) position

(v,w)

Page 7: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Bilinear Interpolation

In this geometric visualisation,

the value at the black spot is the

sum of the value at each

coloured spot multiplied by the

area of the rectangle of the same

colour, divided by the total area

of all four rectangles.

Page 8: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Camera Decalibration / removal of random+systematic errors

• Decalibration is a standard approach to

geometric correction when not all sources of

error can be systematically/mathematically

defined

• E.g. lens imperfections, wide-angle lens etc.

• A camera decalibration transformation is a

series of displacement values for specified

control points in the image.

• Displacements of non-control points are

determined through interpolation.

• e.g. photograph a rectangular grid and then

determine the mapping required to move output

control points back to known undistorted

positions

Page 9: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Image Registration

• The process of transforming different

sets of data into one coordinate system

• Geometric operations applied to

images for purposes of comparison or

measurement

• Suggested algorithm:1. Manually identify start (left) of each chromosome

2. Threshold image

3. Moving right, identify each black ‘blob’ in turn

(=wherever white changes to black as we move pixel by

pixel, then black to white determines end of ‘blob’) and

determine its max/min y extent in order to calculate its

centre in vertical direction

4. Output image from each ‘blob’ rectifies vertical positions

and uses rotations based on angle of movement

Page 10: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Map Projection

• Map projection: aerial or spaceborne images of the

surface of a planet may be rectified into

photomaps

• Not only oblique photos but also orthogonal

photos require correction, due to shape of surface

being imaged

Maybe domain

knowledge/

assumptions are useful

here also? (circular

craters)

Page 11: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Map Projection continued..

• Severe distortion

may be a side-effect

of other decisions in

the image capture

process

• E.g. low-level

oblique photos

taken by aerial

archaeologists

Page 12: CT336/CT404 Graphics & Image Processingsredfern/ct404/08.pdf · • E.g. lens imperfections, wide-angle lens etc. • A camera decalibration transformation is a series of displacement

Morphing

• Gradually transforms one image into

another over a number of animation

frames.

• Involves a dissolve from one image to

the other (i.e. gradual change of pixel

values), as well as an incremental

geometric operation using control

points (e.g. nostrils, eyes, chin etc.)

• See:

http://blog.polysfactory.com/2012/01/

image-morphing.html