image and related concepts - dhirubhai ambani institute of...

80
Image and related concepts Aditya Tatu

Upload: hoangdieu

Post on 28-Mar-2018

214 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Image and related concepts

Aditya Tatu

Page 2: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What is an Image

Image is a representation of some property of a physical entity.

The property can be represented as a function f (x , y , z) of 3variables.

A 2D image is obtained by:

perspective projection through a pin-hole camera Assuming that the objects are very far away from the imaging

system (for eg: z →∞), thereby giving f ′(x , y) = f (x , y , z).

When the independent variables x , y and the function value fare discretized, we get a Digital Image.

IT523 - DIP: Lecture 2 2/25

Page 3: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What is an Image

Image is a representation of some property of a physical entity.

The property can be represented as a function f (x , y , z) of 3variables.

A 2D image is obtained by:

perspective projection through a pin-hole camera Assuming that the objects are very far away from the imaging

system (for eg: z →∞), thereby giving f ′(x , y) = f (x , y , z).

When the independent variables x , y and the function value fare discretized, we get a Digital Image.

IT523 - DIP: Lecture 2 2/25

Page 4: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What is an Image

Image is a representation of some property of a physical entity.

The property can be represented as a function f (x , y , z) of 3variables.

A 2D image is obtained by:

perspective projection through a pin-hole camera Assuming that the objects are very far away from the imaging

system (for eg: z →∞), thereby giving f ′(x , y) = f (x , y , z).

When the independent variables x , y and the function value fare discretized, we get a Digital Image.

IT523 - DIP: Lecture 2 2/25

Page 5: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What is an Image

Image is a representation of some property of a physical entity.

The property can be represented as a function f (x , y , z) of 3variables.

A 2D image is obtained by:

perspective projection through a pin-hole camera Assuming that the objects are very far away from the imaging

system (for eg: z →∞), thereby giving f ′(x , y) = f (x , y , z).

When the independent variables x , y and the function value fare discretized, we get a Digital Image.

IT523 - DIP: Lecture 2 2/25

Page 6: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What is an Image

Image is a representation of some property of a physical entity.

The property can be represented as a function f (x , y , z) of 3variables.

A 2D image is obtained by:

perspective projection through a pin-hole camera Assuming that the objects are very far away from the imaging

system (for eg: z →∞), thereby giving f ′(x , y) = f (x , y , z).

When the independent variables x , y and the function value fare discretized, we get a Digital Image.

IT523 - DIP: Lecture 2 2/25

Page 7: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What is an Image

Image is a representation of some property of a physical entity.

The property can be represented as a function f (x , y , z) of 3variables.

A 2D image is obtained by:

perspective projection through a pin-hole camera Assuming that the objects are very far away from the imaging

system (for eg: z →∞), thereby giving f ′(x , y) = f (x , y , z).

When the independent variables x , y and the function value fare discretized, we get a Digital Image.

IT523 - DIP: Lecture 2 2/25

Page 8: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What is an Image

Image is a representation of some property of a physical entity.

The property can be represented as a function f (x , y , z) of 3variables.

A 2D image is obtained by:

perspective projection through a pin-hole camera Assuming that the objects are very far away from the imaging

system (for eg: z →∞), thereby giving f ′(x , y) = f (x , y , z).

When the independent variables x , y and the function value fare discretized, we get a Digital Image.

IT523 - DIP: Lecture 2 2/25

Page 9: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Image formation model

IT523 - DIP: Lecture 2 3/25

Page 10: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Let i(x , y) be the illumination at a point (x , y) and r(x , y) bethe reflectance at the same point, then the image f (x , y) atthe point is given by f (x , y) = i(x , y) r(x , y).

From Physics, we get 0 < f (x , y), i(x , y) <∞ and0 < r(x , y) < 1.

The image capturing device is directly related to theillumination source used, for eg: Infrared source - Infrareddetector, X-ray source - X-ray film, Visible light - CCD arraydetectors.

Summary

At the end, we get a mathematical object f (x , y) to work with,that represents an aspect of the real object that we are interestedin.

IT523 - DIP: Lecture 2 4/25

Page 11: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Let i(x , y) be the illumination at a point (x , y) and r(x , y) bethe reflectance at the same point, then the image f (x , y) atthe point is given by f (x , y) = i(x , y) r(x , y).

From Physics, we get 0 < f (x , y), i(x , y) <∞ and0 < r(x , y) < 1.

The image capturing device is directly related to theillumination source used, for eg: Infrared source - Infrareddetector, X-ray source - X-ray film, Visible light - CCD arraydetectors.

Summary

At the end, we get a mathematical object f (x , y) to work with,that represents an aspect of the real object that we are interestedin.

IT523 - DIP: Lecture 2 4/25

Page 12: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Let i(x , y) be the illumination at a point (x , y) and r(x , y) bethe reflectance at the same point, then the image f (x , y) atthe point is given by f (x , y) = i(x , y) r(x , y).

From Physics, we get 0 < f (x , y), i(x , y) <∞ and0 < r(x , y) < 1.

The image capturing device is directly related to theillumination source used, for eg: Infrared source - Infrareddetector, X-ray source - X-ray film, Visible light - CCD arraydetectors.

Summary

At the end, we get a mathematical object f (x , y) to work with,that represents an aspect of the real object that we are interestedin.

IT523 - DIP: Lecture 2 4/25

Page 13: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Let i(x , y) be the illumination at a point (x , y) and r(x , y) bethe reflectance at the same point, then the image f (x , y) atthe point is given by f (x , y) = i(x , y) r(x , y).

From Physics, we get 0 < f (x , y), i(x , y) <∞ and0 < r(x , y) < 1.

The image capturing device is directly related to theillumination source used, for eg: Infrared source - Infrareddetector, X-ray source - X-ray film, Visible light - CCD arraydetectors.

Summary

At the end, we get a mathematical object f (x , y) to work with,that represents an aspect of the real object that we are interestedin.

IT523 - DIP: Lecture 2 4/25

Page 14: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What sort of objects are images?

Since we want to process, operate on and play with images,we should first characterize what sort of objects images areand what should be possible to do with images?

Should it be possible to apply filters on images (say, usingconvolution)?

If yes, then what operations should be allowed on images?

Addition and Scalar multiplication → Vector Spaces!

What sort of vector space? - Differentiable functions?Continuous functions? Finite bandwidth?

IT523 - DIP: Lecture 2 5/25

Page 15: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What sort of objects are images?

Since we want to process, operate on and play with images,we should first characterize what sort of objects images areand what should be possible to do with images?

Should it be possible to apply filters on images (say, usingconvolution)?

If yes, then what operations should be allowed on images?

Addition and Scalar multiplication → Vector Spaces!

What sort of vector space? - Differentiable functions?Continuous functions? Finite bandwidth?

IT523 - DIP: Lecture 2 5/25

Page 16: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What sort of objects are images?

Since we want to process, operate on and play with images,we should first characterize what sort of objects images areand what should be possible to do with images?

Should it be possible to apply filters on images (say, usingconvolution)?

If yes, then what operations should be allowed on images?

Addition and Scalar multiplication → Vector Spaces!

What sort of vector space? - Differentiable functions?Continuous functions? Finite bandwidth?

IT523 - DIP: Lecture 2 5/25

Page 17: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What sort of objects are images?

Since we want to process, operate on and play with images,we should first characterize what sort of objects images areand what should be possible to do with images?

Should it be possible to apply filters on images (say, usingconvolution)?

If yes, then what operations should be allowed on images?

Addition and Scalar multiplication → Vector Spaces!

What sort of vector space? - Differentiable functions?Continuous functions? Finite bandwidth?

IT523 - DIP: Lecture 2 5/25

Page 18: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

What sort of objects are images?

Since we want to process, operate on and play with images,we should first characterize what sort of objects images areand what should be possible to do with images?

Should it be possible to apply filters on images (say, usingconvolution)?

If yes, then what operations should be allowed on images?

Addition and Scalar multiplication → Vector Spaces!

What sort of vector space? - Differentiable functions?Continuous functions? Finite bandwidth?

IT523 - DIP: Lecture 2 5/25

Page 19: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Vector space of images

Images are defined on a set Ω ⊂ R2 with finite area.

From Physics, we see that the image values must be finite atall points,

→ the energy: ||f || =∫

Ω f 2(x , y) dx dy has to be finite.

Vector space of images

Set of images is modeled as a subset of vector space of 2-dfunctions on Ω which are square integrable. This vector space isdenoted as L2(Ω).

IT523 - DIP: Lecture 2 6/25

Page 20: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Vector space of images

Images are defined on a set Ω ⊂ R2 with finite area.

From Physics, we see that the image values must be finite atall points,

→ the energy: ||f || =∫

Ω f 2(x , y) dx dy has to be finite.

Vector space of images

Set of images is modeled as a subset of vector space of 2-dfunctions on Ω which are square integrable. This vector space isdenoted as L2(Ω).

IT523 - DIP: Lecture 2 6/25

Page 21: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Vector space of images

Images are defined on a set Ω ⊂ R2 with finite area.

From Physics, we see that the image values must be finite atall points,

→ the energy: ||f || =∫

Ω f 2(x , y) dx dy has to be finite.

Vector space of images

Set of images is modeled as a subset of vector space of 2-dfunctions on Ω which are square integrable. This vector space isdenoted as L2(Ω).

IT523 - DIP: Lecture 2 6/25

Page 22: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Vector space of images

Images are defined on a set Ω ⊂ R2 with finite area.

From Physics, we see that the image values must be finite atall points,

→ the energy: ||f || =∫

Ω f 2(x , y) dx dy has to be finite.

Vector space of images

Set of images is modeled as a subset of vector space of 2-dfunctions on Ω which are square integrable. This vector space isdenoted as L2(Ω).

IT523 - DIP: Lecture 2 6/25

Page 23: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Image sensors

Figure: Single Sensor

Figure: Array of sensors

Figure: Line of sensors

Figure: Circular Sensor

IT523 - DIP: Lecture 2 7/25

Page 24: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Sampling & Quantization

Although theoretically 0 < f (x , y) <∞, in practiceLmin ≤ f (x , y) ≤ Lmax , where Lmin > 0 and Lmax <∞ depend onsensor ratings.

For gray scale digital images, typically we use Lmin = 0 representingblack and Lmax = L− 1 representing white.

Sampled and quantized image gives a digital image which can berepresented as a m × n matrix, say A, of which each element iscalled a pixel (or picture element).

IT523 - DIP: Lecture 2 8/25

Page 25: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Sampling & Quantization

Although theoretically 0 < f (x , y) <∞, in practiceLmin ≤ f (x , y) ≤ Lmax , where Lmin > 0 and Lmax <∞ depend onsensor ratings.

For gray scale digital images, typically we use Lmin = 0 representingblack and Lmax = L− 1 representing white.

Sampled and quantized image gives a digital image which can berepresented as a m × n matrix, say A, of which each element iscalled a pixel (or picture element).

IT523 - DIP: Lecture 2 8/25

Page 26: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Sampling & Quantization

Although theoretically 0 < f (x , y) <∞, in practiceLmin ≤ f (x , y) ≤ Lmax , where Lmin > 0 and Lmax <∞ depend onsensor ratings.

For gray scale digital images, typically we use Lmin = 0 representingblack and Lmax = L− 1 representing white.

Sampled and quantized image gives a digital image which can berepresented as a m × n matrix, say A, of which each element iscalled a pixel (or picture element).

IT523 - DIP: Lecture 2 8/25

Page 27: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Sampling & Quantization

Although theoretically 0 < f (x , y) <∞, in practiceLmin ≤ f (x , y) ≤ Lmax , where Lmin > 0 and Lmax <∞ depend onsensor ratings.

For gray scale digital images, typically we use Lmin = 0 representingblack and Lmax = L− 1 representing white.

Sampled and quantized image gives a digital image which can berepresented as a m × n matrix, say A, of which each element iscalled a pixel (or picture element).

IT523 - DIP: Lecture 2 8/25

Page 28: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

L is typically a power of 2, L = 2k . L levels require k bits ofmemory.

For a general image of size 1024× 1024 pixels with L = 256,we will need 1MB memory.

Compare this with the file size of one image in your computer.

IT523 - DIP: Lecture 2 9/25

Page 29: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

L is typically a power of 2, L = 2k . L levels require k bits ofmemory.

For a general image of size 1024× 1024 pixels with L = 256,we will need 1MB memory.

Compare this with the file size of one image in your computer.

IT523 - DIP: Lecture 2 9/25

Page 30: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

L is typically a power of 2, L = 2k . L levels require k bits ofmemory.

For a general image of size 1024× 1024 pixels with L = 256,we will need 1MB memory.

Compare this with the file size of one image in your computer.

IT523 - DIP: Lecture 2 9/25

Page 31: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Spatial Resolution

Resolution of an imaging system determines the smallestdiscernible detail possible and technically is defined as thelargest number of discernible lines per unit distance.

(1) Is number of pixels enough to define resolution?

Not Always!- Also depends on (2) pixel size. Commonly foundsensors have individual pixel length/width ' 2− 8 microns.

Are smaller sensors always better?

NO! - Since an image is produced based on number ofphotons (a discrete random variable - Poisson pdf) incidenton each sensor, bigger sensors are found to be more reliable orhave higher SNR ratio compared to smaller sensors.

IT523 - DIP: Lecture 2 10/25

Page 32: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Spatial Resolution

Resolution of an imaging system determines the smallestdiscernible detail possible and technically is defined as thelargest number of discernible lines per unit distance.

(1) Is number of pixels enough to define resolution?

Not Always!- Also depends on (2) pixel size. Commonly foundsensors have individual pixel length/width ' 2− 8 microns.

Are smaller sensors always better?

NO! - Since an image is produced based on number ofphotons (a discrete random variable - Poisson pdf) incidenton each sensor, bigger sensors are found to be more reliable orhave higher SNR ratio compared to smaller sensors.

IT523 - DIP: Lecture 2 10/25

Page 33: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Spatial Resolution

Resolution of an imaging system determines the smallestdiscernible detail possible and technically is defined as thelargest number of discernible lines per unit distance.

(1) Is number of pixels enough to define resolution?

Not Always!- Also depends on (2) pixel size. Commonly foundsensors have individual pixel length/width ' 2− 8 microns.

Are smaller sensors always better?

NO! - Since an image is produced based on number ofphotons (a discrete random variable - Poisson pdf) incidenton each sensor, bigger sensors are found to be more reliable orhave higher SNR ratio compared to smaller sensors.

IT523 - DIP: Lecture 2 10/25

Page 34: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Spatial Resolution

Resolution of an imaging system determines the smallestdiscernible detail possible and technically is defined as thelargest number of discernible lines per unit distance.

(1) Is number of pixels enough to define resolution?

Not Always!- Also depends on (2) pixel size. Commonly foundsensors have individual pixel length/width ' 2− 8 microns.

Are smaller sensors always better?

NO! - Since an image is produced based on number ofphotons (a discrete random variable - Poisson pdf) incidenton each sensor, bigger sensors are found to be more reliable orhave higher SNR ratio compared to smaller sensors.

IT523 - DIP: Lecture 2 10/25

Page 35: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Spatial Resolution

Resolution of an imaging system determines the smallestdiscernible detail possible and technically is defined as thelargest number of discernible lines per unit distance.

(1) Is number of pixels enough to define resolution?

Not Always!- Also depends on (2) pixel size. Commonly foundsensors have individual pixel length/width ' 2− 8 microns.

Are smaller sensors always better?

NO! - Since an image is produced based on number ofphotons (a discrete random variable - Poisson pdf) incidenton each sensor, bigger sensors are found to be more reliable orhave higher SNR ratio compared to smaller sensors.

IT523 - DIP: Lecture 2 10/25

Page 36: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

For color images, sensors are arranged in a (3) mosaic pattern

It also depends on the (4) spatial resolution of the lens.

To summarize, a camera with 10 megapixels may not alwayshave a better resolution then a 3 megapixel camera.

IT523 - DIP: Lecture 2 11/25

Page 37: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

For color images, sensors are arranged in a (3) mosaic pattern

It also depends on the (4) spatial resolution of the lens.

To summarize, a camera with 10 megapixels may not alwayshave a better resolution then a 3 megapixel camera.

IT523 - DIP: Lecture 2 11/25

Page 38: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

For color images, sensors are arranged in a (3) mosaic pattern

It also depends on the (4) spatial resolution of the lens.

To summarize, a camera with 10 megapixels may not alwayshave a better resolution then a 3 megapixel camera.

IT523 - DIP: Lecture 2 11/25

Page 39: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

One pixel camera

Figure: University of Rice, taken from http://dsp.rice.edu/cscamera

Take some random projections of the scene.

Using norm-minimization algorithms, reconstruct the image.

Assumption: The image should be sparse in some basis.

IT523 - DIP: Lecture 2 12/25

Page 40: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

One pixel camera

Figure: University of Rice, taken from http://dsp.rice.edu/cscamera

Take some random projections of the scene.

Using norm-minimization algorithms, reconstruct the image.

Assumption: The image should be sparse in some basis.

IT523 - DIP: Lecture 2 12/25

Page 41: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

One pixel camera

Figure: University of Rice, taken from http://dsp.rice.edu/cscamera

Take some random projections of the scene.

Using norm-minimization algorithms, reconstruct the image.

Assumption: The image should be sparse in some basis.

IT523 - DIP: Lecture 2 12/25

Page 42: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

One pixel Camera

Figure: (left) Original Image (center) 20% measurements (right) 40%measurements

IT523 - DIP: Lecture 2 13/25

Page 43: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Imaging system

We can assume that the imaging system is linear and positioninvariant/shift invariant.

A meaningful conclusion about the spatial resolution can beobtained by looking at the impulse response of the imagingsystem.

What is an impulse/impulse response for a camera?

IT523 - DIP: Lecture 2 14/25

Page 44: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Imaging system

We can assume that the imaging system is linear and positioninvariant/shift invariant.

A meaningful conclusion about the spatial resolution can beobtained by looking at the impulse response of the imagingsystem.

What is an impulse/impulse response for a camera?

IT523 - DIP: Lecture 2 14/25

Page 45: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Imaging system

We can assume that the imaging system is linear and positioninvariant/shift invariant.

A meaningful conclusion about the spatial resolution can beobtained by looking at the impulse response of the imagingsystem.

What is an impulse/impulse response for a camera?

IT523 - DIP: Lecture 2 14/25

Page 46: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Imaging system

We can assume that the imaging system is linear and positioninvariant/shift invariant.

A meaningful conclusion about the spatial resolution can beobtained by looking at the impulse response of the imagingsystem.

What is an impulse/impulse response for a camera?

IT523 - DIP: Lecture 2 14/25

Page 47: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Spatial resolution

Print technology: dots per inch (dpi), Computer screens:pixels per inch (ppi)

Difference: Collection of dots forms one pixel.

IT523 - DIP: Lecture 2 15/25

Page 48: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Spatial resolution

Print technology: dots per inch (dpi), Computer screens:pixels per inch (ppi)

Difference: Collection of dots forms one pixel.

IT523 - DIP: Lecture 2 15/25

Page 49: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Spatial resolution

Print technology: dots per inch (dpi), Computer screens:pixels per inch (ppi)

Difference: Collection of dots forms one pixel.

IT523 - DIP: Lecture 2 15/25

Page 50: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Intensity resolution

Smallest discernible change in the intensity level.

IT523 - DIP: Lecture 2 16/25

Page 51: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Intensity resolution

Smallest discernible change in the intensity level.

IT523 - DIP: Lecture 2 16/25

Page 52: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Intensity resolution

IT523 - DIP: Lecture 2 17/25

Page 53: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Neighbors of a pixel p = (x , y)

4-NeighborhoodN4(p) = (x + 1, y), (x − 1, y), (x , y + 1), (x , y − 1).

Diagonal NeighborhoodND(p) = (x+1, y+1), (x−1, y+1), (x+1, y−1), (x−1, y−1).

8-Neighborhood N8(p) = N4(p) ∪ ND(p).

IT523 - DIP: Lecture 2 18/25

Page 54: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Neighbors of a pixel p = (x , y)

4-NeighborhoodN4(p) = (x + 1, y), (x − 1, y), (x , y + 1), (x , y − 1).

Diagonal NeighborhoodND(p) = (x+1, y+1), (x−1, y+1), (x+1, y−1), (x−1, y−1).

8-Neighborhood N8(p) = N4(p) ∪ ND(p).

IT523 - DIP: Lecture 2 18/25

Page 55: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Neighbors of a pixel p = (x , y)

4-NeighborhoodN4(p) = (x + 1, y), (x − 1, y), (x , y + 1), (x , y − 1).

Diagonal NeighborhoodND(p) = (x+1, y+1), (x−1, y+1), (x+1, y−1), (x−1, y−1).

8-Neighborhood N8(p) = N4(p) ∪ ND(p).

IT523 - DIP: Lecture 2 18/25

Page 56: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Neighbors of a pixel p = (x , y)

4-NeighborhoodN4(p) = (x + 1, y), (x − 1, y), (x , y + 1), (x , y − 1).

Diagonal NeighborhoodND(p) = (x+1, y+1), (x−1, y+1), (x+1, y−1), (x−1, y−1).

8-Neighborhood N8(p) = N4(p) ∪ ND(p).

IT523 - DIP: Lecture 2 18/25

Page 57: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Adjacency: Used to define relation between pixels of animage.

Let V be the set of gray levels used to define the relation.Example: V = 0, . . . , 10,V = 0.

4-adjacency: Two pixels p and q with values in V are4-adjacent if q ∈ N4(p).

8-adjacency: Two pixels p and q with values in V are8-adjacent if q ∈ N8(p).

m-adjacency: Two pixels p and q with values in V arem-adjacent if:

q ∈ N4(p), orq ∈ ND(p) and the set N4(p) ∪ N4(q) has no pixels whosevalues are in V .

IT523 - DIP: Lecture 2 19/25

Page 58: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Adjacency: Used to define relation between pixels of animage.

Let V be the set of gray levels used to define the relation.Example: V = 0, . . . , 10,V = 0.

4-adjacency: Two pixels p and q with values in V are4-adjacent if q ∈ N4(p).

8-adjacency: Two pixels p and q with values in V are8-adjacent if q ∈ N8(p).

m-adjacency: Two pixels p and q with values in V arem-adjacent if:

q ∈ N4(p), orq ∈ ND(p) and the set N4(p) ∪ N4(q) has no pixels whosevalues are in V .

IT523 - DIP: Lecture 2 19/25

Page 59: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Adjacency: Used to define relation between pixels of animage.

Let V be the set of gray levels used to define the relation.Example: V = 0, . . . , 10,V = 0.

4-adjacency: Two pixels p and q with values in V are4-adjacent if q ∈ N4(p).

8-adjacency: Two pixels p and q with values in V are8-adjacent if q ∈ N8(p).

m-adjacency: Two pixels p and q with values in V arem-adjacent if:

q ∈ N4(p), orq ∈ ND(p) and the set N4(p) ∪ N4(q) has no pixels whosevalues are in V .

IT523 - DIP: Lecture 2 19/25

Page 60: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Adjacency: Used to define relation between pixels of animage.

Let V be the set of gray levels used to define the relation.Example: V = 0, . . . , 10,V = 0.

4-adjacency: Two pixels p and q with values in V are4-adjacent if q ∈ N4(p).

8-adjacency: Two pixels p and q with values in V are8-adjacent if q ∈ N8(p).

m-adjacency: Two pixels p and q with values in V arem-adjacent if:

q ∈ N4(p), orq ∈ ND(p) and the set N4(p) ∪ N4(q) has no pixels whosevalues are in V .

IT523 - DIP: Lecture 2 19/25

Page 61: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Adjacency: Used to define relation between pixels of animage.

Let V be the set of gray levels used to define the relation.Example: V = 0, . . . , 10,V = 0.

4-adjacency: Two pixels p and q with values in V are4-adjacent if q ∈ N4(p).

8-adjacency: Two pixels p and q with values in V are8-adjacent if q ∈ N8(p).

m-adjacency: Two pixels p and q with values in V arem-adjacent if:

q ∈ N4(p), orq ∈ ND(p) and the set N4(p) ∪ N4(q) has no pixels whosevalues are in V .

IT523 - DIP: Lecture 2 19/25

Page 62: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Adjacency: Used to define relation between pixels of animage.

Let V be the set of gray levels used to define the relation.Example: V = 0, . . . , 10,V = 0.

4-adjacency: Two pixels p and q with values in V are4-adjacent if q ∈ N4(p).

8-adjacency: Two pixels p and q with values in V are8-adjacent if q ∈ N8(p).

m-adjacency: Two pixels p and q with values in V arem-adjacent if:

q ∈ N4(p), orq ∈ ND(p) and the set N4(p) ∪ N4(q) has no pixels whosevalues are in V .

IT523 - DIP: Lecture 2 19/25

Page 63: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Adjacency: Used to define relation between pixels of animage.

Let V be the set of gray levels used to define the relation.Example: V = 0, . . . , 10,V = 0.

4-adjacency: Two pixels p and q with values in V are4-adjacent if q ∈ N4(p).

8-adjacency: Two pixels p and q with values in V are8-adjacent if q ∈ N8(p).

m-adjacency: Two pixels p and q with values in V arem-adjacent if:

q ∈ N4(p), orq ∈ ND(p) and the set N4(p) ∪ N4(q) has no pixels whosevalues are in V .

IT523 - DIP: Lecture 2 19/25

Page 64: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Path: Path from pixel p = (x , y) to pixel q = (s, t) is asequence of distinct pixels with coordinates(x0 = x , y0 = y), (x1, y1), . . . , (xn = s, yn = t) such that pixels(xi−1, yi−1) and (xi , yi ),∀1 ≤ i ≤ n are adjacent. If the firstand last pixels are same then we have a closed path. Lengthof the path is said to be n.

Connectedness: For a given subset S of pixels in an image,p, q ∈ S are said to be connected in S if there exists a pathconnecting the two, consisting of pixels only from S .

Connected component: For p ∈ S , the set of all pixelsconnected to p is a connected component in S .

Connected Set: If S has only one connected component, it iscalled a connected set. A connected set in an image is oftencalled a region.

IT523 - DIP: Lecture 2 20/25

Page 65: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Path: Path from pixel p = (x , y) to pixel q = (s, t) is asequence of distinct pixels with coordinates(x0 = x , y0 = y), (x1, y1), . . . , (xn = s, yn = t) such that pixels(xi−1, yi−1) and (xi , yi ),∀1 ≤ i ≤ n are adjacent. If the firstand last pixels are same then we have a closed path. Lengthof the path is said to be n.

Connectedness: For a given subset S of pixels in an image,p, q ∈ S are said to be connected in S if there exists a pathconnecting the two, consisting of pixels only from S .

Connected component: For p ∈ S , the set of all pixelsconnected to p is a connected component in S .

Connected Set: If S has only one connected component, it iscalled a connected set. A connected set in an image is oftencalled a region.

IT523 - DIP: Lecture 2 20/25

Page 66: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Path: Path from pixel p = (x , y) to pixel q = (s, t) is asequence of distinct pixels with coordinates(x0 = x , y0 = y), (x1, y1), . . . , (xn = s, yn = t) such that pixels(xi−1, yi−1) and (xi , yi ),∀1 ≤ i ≤ n are adjacent. If the firstand last pixels are same then we have a closed path. Lengthof the path is said to be n.

Connectedness: For a given subset S of pixels in an image,p, q ∈ S are said to be connected in S if there exists a pathconnecting the two, consisting of pixels only from S .

Connected component: For p ∈ S , the set of all pixelsconnected to p is a connected component in S .

Connected Set: If S has only one connected component, it iscalled a connected set. A connected set in an image is oftencalled a region.

IT523 - DIP: Lecture 2 20/25

Page 67: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Topological concepts

Path: Path from pixel p = (x , y) to pixel q = (s, t) is asequence of distinct pixels with coordinates(x0 = x , y0 = y), (x1, y1), . . . , (xn = s, yn = t) such that pixels(xi−1, yi−1) and (xi , yi ),∀1 ≤ i ≤ n are adjacent. If the firstand last pixels are same then we have a closed path. Lengthof the path is said to be n.

Connectedness: For a given subset S of pixels in an image,p, q ∈ S are said to be connected in S if there exists a pathconnecting the two, consisting of pixels only from S .

Connected component: For p ∈ S , the set of all pixelsconnected to p is a connected component in S .

Connected Set: If S has only one connected component, it iscalled a connected set. A connected set in an image is oftencalled a region.

IT523 - DIP: Lecture 2 20/25

Page 68: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Application

Figure: Count the number of components in the image

IT523 - DIP: Lecture 2 21/25

Page 69: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Application

Figure: Convert it into a binary image

IT523 - DIP: Lecture 2 22/25

Page 70: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Application

Figure: Do some morphological processing on the image. Let V = 1.Find the connected sets in the image

IT523 - DIP: Lecture 2 23/25

Page 71: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Application

Figure: 11 components!

IT523 - DIP: Lecture 2 24/25

Page 72: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25

Page 73: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25

Page 74: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25

Page 75: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25

Page 76: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25

Page 77: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25

Page 78: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25

Page 79: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25

Page 80: Image and related concepts - Dhirubhai Ambani Institute of ...courses.daiict.ac.in/pluginfile.php/19571/mod_resource/content/1/... · IT523 - DIP: Lecture 2 5/25. What sort of objects

Neighborhood using distances

We may define neighborhood of a pixel using distances:N(p) = p1 = (x1, y1) |d(p, p1) ≤ a.

Euclidean distance: d(p, p1) =√

(x − x1)2 + (y − y1)2.

In general, a distance function (metric) should satisfy:

Positive Definiteness: d(p, p1) ≥ 0,= 0 iff p = p1. Symmetry: d(p, p1) = d(p1, p). Triangular inequality: d(p, p1) ≤ d(p, q) + d(q, p1).

Examples:

City block distance - d4(p, p1) = |x − x1|+ |y − y1| Chessboard distance - d8(p, p1) = max|x − x1|, |y − y1|

IT523 - DIP: Lecture 2 25/25