154
Imagine Camp: Image Processing Camp followed by 2 weeks Hackathon Conducted by: Rahat Yasir Anindo

Imagine camp, Developing Image Processing app for windows phone platform

Embed Size (px)

Citation preview

Page 1: Imagine camp, Developing Image Processing app for windows phone platform

Imagine Camp:Image Processing Camp

followed by 2 weeks HackathonConducted by: Rahat Yasir Anindo

Page 2: Imagine camp, Developing Image Processing app for windows phone platform

Imagine Camp Overview

• Image• Image Processing• Applications of image processing• Image processing algorithms (10-12)• Matlab live demo• Image manipulation in Matlab• Windows Phone Demo• Brain storming for Hackathon• Idea selection (one out of three)• Live presentation on selected idea• Suggestion for converting your idea into an app

Time Schedule:10:30-1:00 & 2:00-3:00 = Image processing

discussion & demo3:00-3:30 = Brain storming for Hackathon idea3:30-4:00 = Idea selection4:00-5:00 = presentation on idea & suggestion for

development.

Page 3: Imagine camp, Developing Image Processing app for windows phone platform

A Picture is Worth 100 Words

Page 4: Imagine camp, Developing Image Processing app for windows phone platform

A Picture is Worth 10,000 Words

Page 5: Imagine camp, Developing Image Processing app for windows phone platform

A Picture is Worth a Million Words

Page 6: Imagine camp, Developing Image Processing app for windows phone platform

Lighting

Scene

Camera

Computer

Scene Interpretation

Components of a Computer Vision System

Page 7: Imagine camp, Developing Image Processing app for windows phone platform

The goal of computer vision• To extract “meaning” from pixels

What we see What a computer sees

Page 8: Imagine camp, Developing Image Processing app for windows phone platform

The goal of computer vision• To extract “meaning” from pixels

Source: “80 million tiny images” by Torralba et al.

Humans are remarkably good at this…

Page 9: Imagine camp, Developing Image Processing app for windows phone platform

What kind of information can be extracted from an image?

• Metric 3D information• Semantic information

Page 10: Imagine camp, Developing Image Processing app for windows phone platform

10

What is a digital image?

Page 11: Imagine camp, Developing Image Processing app for windows phone platform

11

Processing of images which are Digital in nature by a Digital computer

Common image formats include:– 1 sample per point (B&W or Gray scale)– 3 samples per point (Red, Green, and Blue)– 4 samples per point (Red, Green, Blue, and “Alpha”,

Opacity)

Page 12: Imagine camp, Developing Image Processing app for windows phone platform

12

Why we need image processing?It is motivated by three major application

Improvement of pictorial information for human perception

Image processing for autonomous machine application

Efficient storage and transmission

Page 13: Imagine camp, Developing Image Processing app for windows phone platform

Matrix Representation of an Image

13

1,11,10,1

1,10,10,1

1,01,00,0

)1,1()1,1()0,1(

)1,1()1,1()0,1(

)1,0()1,0()0,0(

),(

:image NAn

NMMM

N

N

aaa

aaa

aaa

A

NMFMfMf

Nfff

Nfff

yxf

M

Page 14: Imagine camp, Developing Image Processing app for windows phone platform

Visual image formation-Digital Version

14

3D object

Digital Camera

Digitizer 2D Digital ImageCCD / CMOS

sensor

Lens

Page 15: Imagine camp, Developing Image Processing app for windows phone platform

Sampling and Quantization, 2D Case

15

Continuous Sampled

f(0,0) f(0,1)

f(N-1,M-1)

Page 16: Imagine camp, Developing Image Processing app for windows phone platform

16

DIGITAL IMAGES: Digital images are 2D arrays (matrices) of numbers:

Page 17: Imagine camp, Developing Image Processing app for windows phone platform

Hybrid Images

• A. Oliva, A. Torralba, P.G. Schyns, “Hybrid Images,” SIGGRAPH 2006

Page 18: Imagine camp, Developing Image Processing app for windows phone platform

Why do we get different, distance-dependent interpretations of hybrid images?

?

Slide: Hoiem

Page 19: Imagine camp, Developing Image Processing app for windows phone platform

Why study computer vision?• Vision is useful• Vision is interesting• Vision is difficult

• Half of primate cerebral cortex is devoted to visual processing• Achieving human-level visual perception is probably “AI-complete”

Page 20: Imagine camp, Developing Image Processing app for windows phone platform

Why is computer vision difficult?

Page 21: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: viewpoint variation

Michelangelo 1475-1564

Page 22: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: illumination

image credit: J. Koenderink

Page 23: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: scale

Page 24: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: deformation

Xu, Beihong 1943

Page 25: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: occlusion

Magritte, 1957

Page 26: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: background clutter

Page 27: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: Motion

Page 28: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: object intra-class variation

Page 29: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: local ambiguity

Page 30: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: local ambiguity

Page 31: Imagine camp, Developing Image Processing app for windows phone platform

Challenges: local ambiguity

Page 32: Imagine camp, Developing Image Processing app for windows phone platform

Challenges or opportunities?• Images are confusing, but they also reveal the structure of

the world through numerous cues• Our job is to interpret the cues!

Image source: J. Koenderink

Page 33: Imagine camp, Developing Image Processing app for windows phone platform

Biometrics

Fingerprint scanners on many new laptops, other devices

Face recognition systems now beginning to appear more widelyhttp://www.sensiblevision.com/

Source: S. Seitz

Page 34: Imagine camp, Developing Image Processing app for windows phone platform

Biometrics

How the Afghan Girl was Identified by Her Iris Patterns

Source: S. Seitz

Page 35: Imagine camp, Developing Image Processing app for windows phone platform

Vision-based interaction: Xbox Kinect

Page 36: Imagine camp, Developing Image Processing app for windows phone platform

. Digitizing an image ( convert an continuous image to a digital one)

. Enhancing an image ( Let an image better suit for a specific application)

. Restoring an image ( Recover a damaged image)

. Compressing an image ( Store it with less bytes )

. Segmenting an image ( Partition objects in an image from background )

. Recognizing an image ( Tell what the objects are in an image )

36

What can digital image processing do?

Page 37: Imagine camp, Developing Image Processing app for windows phone platform

When an image damaged, we can recover it

37

Cracked parts

torn

Restoring an image

Page 38: Imagine camp, Developing Image Processing app for windows phone platform

04/18/2023 38

Original image 257kb Compressed image 147kb

Redundant Info.

Compressing an image

Page 39: Imagine camp, Developing Image Processing app for windows phone platform

Take car license plate recognition as an example.

04/18/2023 39

Recognizing an image

Page 40: Imagine camp, Developing Image Processing app for windows phone platform

EXAMPLE OF DIP•One of the most common uses of DIP techniques: improve quality, remove noise etc

Page 41: Imagine camp, Developing Image Processing app for windows phone platform

EXAMPLES:

(e) Poorly exposed x-ray image

(f) The result from contrast and edge enhancement

(g) Image blurred by motion

(h) The result of de-blurring

Page 42: Imagine camp, Developing Image Processing app for windows phone platform

Object Recognition (CVPR 2006)

Page 43: Imagine camp, Developing Image Processing app for windows phone platform

Examples: The Hubble Telescope•Launched in 1990 the Hubble telescope can take images of very distant objects•However, an incorrect mirror made many of Hubble’s images useless•Image processing techniques were used to fix this....

Page 44: Imagine camp, Developing Image Processing app for windows phone platform

Finding the outline and shape of image objects, e.g. character recognition.

Page 45: Imagine camp, Developing Image Processing app for windows phone platform

FACE DETECTION:

Face detection

Page 46: Imagine camp, Developing Image Processing app for windows phone platform

FACE TRACKING

Page 47: Imagine camp, Developing Image Processing app for windows phone platform

1)Biological Research: e.g. DNA typing and matching; automatic counting and classification of cell structures in bone and tissue.

2) Defence and Intelligence: e.g. Reconnaissance photo-interpretation of objects in satellite images; target acquisition and missile guidance.

3) Document Processing: e.g. Scanning, archiving and transmission (fax); automatic detection and recognition of printed text (postal sorting office, tax return processing, banking cheques).

4) Law Enforcement Forensics: e.g. Photo-ID kits, criminal photo-search, automatic fingerprint matching, DNA matching and fibre analysis

.

APPLICATIONS OF (DIP):

Page 48: Imagine camp, Developing Image Processing app for windows phone platform

5) Photography: e.g. altering colours, zooming; adding and subtracting objects to a scene;

6) Remote Sensing: e.g.

Land cover analysis (water, roads, cities and cultivation),

vegetation features (water content and temperature) and crop yield analysis;

3-D terrain rendering from satellite or aircraft data (road and dam planning); fire and smoke detection.

7) Space exploration and Astronomy: satellite navigation and altitude control using star positions.

8) Video and Film Special Effects: Animation,and special effects (Star Wars).

APPLICATIONS OF (DIP):

Page 49: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image Processing:

Page 50: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image Processing:Image Aquisition

Page 51: Imagine camp, Developing Image Processing app for windows phone platform

IMAGE ACQUISITION:

Page 52: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image Processing:

Image Enhancement

Page 53: Imagine camp, Developing Image Processing app for windows phone platform

Image Enhancement:

Page 54: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image restoration:

Page 55: Imagine camp, Developing Image Processing app for windows phone platform

Digital Image restoration:

Page 56: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image processing, morphological processing:

Page 57: Imagine camp, Developing Image Processing app for windows phone platform

Digital Image Morphological Processing:

Page 58: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital ImageProcessing,segmentation:

Page 59: Imagine camp, Developing Image Processing app for windows phone platform

Digital Image Processing: Segmentation:

Page 60: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image Processing object recognition:

Page 61: Imagine camp, Developing Image Processing app for windows phone platform

Digital Image ProcessingObject Recognition:

Page 62: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image Processing:Representation & Description:

Page 63: Imagine camp, Developing Image Processing app for windows phone platform

Key Stages in Digital Image Processing: Representation & Description:

Page 64: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image Processing,Image Compression:

Page 65: Imagine camp, Developing Image Processing app for windows phone platform

IMAGE COMPRESSION:

Page 66: Imagine camp, Developing Image Processing app for windows phone platform

Image Restoration

Morphological Processing

Segmentation

Object Recognition

Representation & Description

Image Compression

Colour Image Processing

Problem Domain

Image Acquisition

Image Enhancement

Key Stages in Digital Image Processing,Colour Image Processing:

Page 67: Imagine camp, Developing Image Processing app for windows phone platform

Colour Image Processing:

Page 68: Imagine camp, Developing Image Processing app for windows phone platform

Image Sub-sampling-Gray

68

Page 69: Imagine camp, Developing Image Processing app for windows phone platform

Image Re-sampling

69

Page 70: Imagine camp, Developing Image Processing app for windows phone platform

70

Effect of Sampling and Quantization

250 x 210 samples 256 gray levels

125 x 105 samples

50 x 42 samples

25 x 21 samples

8 gray levels

4 gray levels

Binary image

16 gray levels

Page 71: Imagine camp, Developing Image Processing app for windows phone platform

Windows Phone Camera Basics• We can build a camera application that can capture still photos.

• We can query device camera capabilities (where there are multiple cameras on the device (front and/or rear), where it has flash, etc.).

• We can get raw camera frames and process them ourselves (encode/decode).

• We can programmatically set flash and focus when taking a photo.

• We can change the resolution of the photo.

• We can continue using the hardware button for the camera shutter to capture a photo and for auto-focus when taking shots outside our application.

• A camera need not be present (for example, front facing camera was not a part of the original devices). Your application would need to handle that condition gracefully.

• To allow our application to have access to the camera capability, you need to specify ID_CAP_ISV_CAMERA in our application manifest file.

• To allow our application to have access to a front facing camera (if one exists), we need to specify ID_HW_FRONTCAMERA in our application manifest file.

Page 72: Imagine camp, Developing Image Processing app for windows phone platform

Code to Capture images on Windows Phone

using Microsoft.Phone.Tasks;using Microsoft.Phone;private CameraCaptureTask ccTask;public MainPage() { InitializeComponent(); ccTask = new CameraCaptureTask();}private void btnCamera_Click(object sender, RoutedEventArgs e) { ccTask.Show(); }

Page 73: Imagine camp, Developing Image Processing app for windows phone platform

Code to Capture images on Windows Phone

using Microsoft.Devices;using Microsoft.Xna.Framework.Media;PhotoCamera myCamera;MediaLibrary mediaLibrary;public MainPage() { InitializeComponent(); mediaLibrary = new MediaLibrary();

}private void buttonStartCamera_Click(object sender, RoutedEventArgs e) { myCamera = new Microsoft.Devices.PhotoCamera(CameraType.Primary); myCamera.CaptureCompleted += new EventHandler<CameraOperationCompletedEventArgs>(camera_CaptureCompleted); myCamera.CaptureImageAvailable += new EventHandler<Microsoft.Devices.ContentReadyEventArgs>(camera_CaptureImageAvailable); viewfinderBrush.SetSource(myCamera); }

Page 74: Imagine camp, Developing Image Processing app for windows phone platform

Code to Preview images on Windows Phone

private void ccTaskCompleted(object sender, PhotoResult pr) { byte[] imgLocal; if (pr.ChosenPhoto != null) { imgLocal = new byte[(int)pr.ChosenPhoto.Length]; pr.ChosenPhoto.Read(imgLocal, 0, imgLocal.Length); pr.ChosenPhoto.Seek(0, System.IO.SeekOrigin.Begin); var bitmapImage = PictureDecoder.DecodeJpeg(pr.ChosenPhoto); this.imgCaptured.Source = bitmapImage; } }

Page 75: Imagine camp, Developing Image Processing app for windows phone platform

Windows phone camera API’s

Page 76: Imagine camp, Developing Image Processing app for windows phone platform

Windows phone camera API’s

Page 77: Imagine camp, Developing Image Processing app for windows phone platform

77

Image manipulation Demo on Matlab (Matrix representation )

Page 78: Imagine camp, Developing Image Processing app for windows phone platform

RGB to GREY Scale Conversion

Page 79: Imagine camp, Developing Image Processing app for windows phone platform

RGB to GREY Scale Conversion

Page 80: Imagine camp, Developing Image Processing app for windows phone platform

80

RGB 2 Grey Matlab & Windows Phone Demo

Page 81: Imagine camp, Developing Image Processing app for windows phone platform

81

Effect of averaging:

(1) Signal power unchanged

(2) Noise power reduced by 1/M

Conditions:

(1) Signal and noise uncorrelated

(2) Observations are independent

(3) Noise in different observations has the same distribution (iid noise model, independent identically distributed random variables)

Effect of Image Averaging

www.cvcrbd.org

Page 82: Imagine camp, Developing Image Processing app for windows phone platform

82

Moving Window Transform: Example

originaloriginal 3x3 average3x3 average

Another example Another example

www.cvcrbd.org

Page 83: Imagine camp, Developing Image Processing app for windows phone platform

83

Moving Window Transform: Example

originaloriginal 3x3 average3x3 average

www.cvcrbd.org

Page 84: Imagine camp, Developing Image Processing app for windows phone platform

84

Moving Window Transform: Example

originaloriginal 3x3 average3x3 average

www.cvcrbd.org

Page 85: Imagine camp, Developing Image Processing app for windows phone platform

85

Image Averaging, Example

Averaging 2 images Original image

Averaging 8 images Averaging 16 images

Averaging 32 images Averaging 128 images

www.cvcrbd.org

Page 86: Imagine camp, Developing Image Processing app for windows phone platform

86

Convolution Examples: Original Images

www.cvcrbd.org

Page 87: Imagine camp, Developing Image Processing app for windows phone platform

87

Convolution Examples: 33 Blur

111111111

9

1

www.cvcrbd.org

Page 88: Imagine camp, Developing Image Processing app for windows phone platform

88

Convolution Examples: 55 Blur

1111111111111111111111111

25

1

www.cvcrbd.org

Page 89: Imagine camp, Developing Image Processing app for windows phone platform

89

Convolution Examples: 99 Blur

111111111111111111111111111111111111111111111111111111111111111111111111111111111

811

www.cvcrbd.org

Page 90: Imagine camp, Developing Image Processing app for windows phone platform

90

Convolution Examples: 1717 Blur

1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

289

1

www.cvcrbd.org

Page 91: Imagine camp, Developing Image Processing app for windows phone platform

91

Convolution Examples: 99 Blur using Gaussian mask

0.01124 0.01164 0.01193 0.01211 0.01217 0.01211 0.01193 0.01164 0.011240.01164 0.01205 0.01236 0.01254 0.01261 0.01254 0.01236 0.01205 0.011640.01193 0.01236 0.01267 0.01286 0.01292 0.01286 0.01267 0.01236 0.011930.01211 0.01254 0.01286 0.01305 0.01312 0.01305 0.01286 0.01254 0.012110.01217 0.01261 0.01292 0.01312 0.01319 0.01312 0.01292 0.01261 0.012170.01211 0.01254 0.01286 0.01305 0.01312 0.01305 0.01286 0.01254 0.012110.01193 0.01236 0.01267 0.01286 0.01292 0.01286 0.01267 0.01236 0.011930.01164 0.01205 0.01236 0.01254 0.01261 0.01254 0.01236 0.01205 0.011640.01124 0.01164 0.01193 0.01211 0.01217 0.01211 0.01193 0.01164 0.011242

22

222

1),(

yx

eyxh

www.cvcrbd.org

Page 92: Imagine camp, Developing Image Processing app for windows phone platform

92

Average filter, Example 1

Page 93: Imagine camp, Developing Image Processing app for windows phone platform

93

Average filter, Example 2

Beauty Mirror App of IOS

Page 94: Imagine camp, Developing Image Processing app for windows phone platform

94

Average Filtering Demo (Matlab & Windows Phone)

Page 95: Imagine camp, Developing Image Processing app for windows phone platform

95

MEDIAN FILTER

Page 96: Imagine camp, Developing Image Processing app for windows phone platform

96

Effective for salt and pepper noise

- remove noise spikes

987654321

10025,20,20,20,20,20,15,10

100,25,20,20,15,20,20,20,10

Median = 20

ranking

Median Filtering-more later

www.cvcrbd.org

Page 97: Imagine camp, Developing Image Processing app for windows phone platform

97

Impulse Noise Removal, Example 1

Original image Corrupted image

5 X 5 averaging 5 X 5 medianfiltering

www.cvcrbd.org

Page 98: Imagine camp, Developing Image Processing app for windows phone platform

98

Impulse Noise Removal, Example 2

Original image 3 X 3 averaging 3 X 3 medianfiltering

www.cvcrbd.org

Page 99: Imagine camp, Developing Image Processing app for windows phone platform

99

NOICE REDUCTION DEMO (Matlab + Windows Phone)

Page 100: Imagine camp, Developing Image Processing app for windows phone platform

Effect of Reducing Gray Levels

100

256 128

64 32

16 8

4 2

Page 101: Imagine camp, Developing Image Processing app for windows phone platform

101

Set OperationsTwo Sets Union Intersection

Complement Difference

Page 102: Imagine camp, Developing Image Processing app for windows phone platform

102

Set Operations, Example

Complement(Negative)

Union of Constant Imageand Complement Image

The Original Image

Page 103: Imagine camp, Developing Image Processing app for windows phone platform

103

Logic Operations on Binary Images

BA (A) AND (B)

AND

A B (A) OR (B)

OR

A B (A) XOR (B)

XOR

A B [NOT (A)] AND (B)

NOT-AND

A NOT (A)

NOT

Page 104: Imagine camp, Developing Image Processing app for windows phone platform

104

Windows phone demo of set operation

Page 105: Imagine camp, Developing Image Processing app for windows phone platform

105

rk

rk

Histogram

n

nrp kk MNnn

kk 10 Lk

Image Pixel Intensity Histogram

1 1 3 3 7

1 1 3 3 5

1 0 3 3 2

0 0 2 2 2

0 0 2 2 2

0 4321 5 76r

nk

0

2

4

6

r 0 1 2 3 4 5 6 7

nk 5 5 7 6 0 1 0 1

Page 106: Imagine camp, Developing Image Processing app for windows phone platform

106

Image Histograms, Examples

Page 107: Imagine camp, Developing Image Processing app for windows phone platform

107

Uneven Pixel Intensity DistributionsThe Histogram of a Grayscale Image

Let I be a 1-band (grayscale) image.

I(r,c) is an 8-bit integer between 0 and 255.

Histogram, hI, of I: – a 256-element array, hI – hI (g), for g = 1, 2, 3, …,

256, is an integer – hI (g) = number of pixels in

I that have value g-1.

Page 108: Imagine camp, Developing Image Processing app for windows phone platform

Image Histogram

108

The Histogram of a Grayscale

Image

16-level (4-bit) image

black marks pixels w

ith intensity g

low

er R

HC

: nu

mbe

r of

pixe

ls w

ith

inte

nsit

y g

Page 109: Imagine camp, Developing Image Processing app for windows phone platform

109

The Histogram of a Grayscale Image

Plot of histogram: number of pixels with intensity g

Black marks pixels with intensity g

Page 110: Imagine camp, Developing Image Processing app for windows phone platform

110

The Histogram of a Grayscale Image

Plot of histogram: number of pixels with intensity g

Black marks pixels with intensity g

Page 111: Imagine camp, Developing Image Processing app for windows phone platform

111

Image Histogram (Matlab & Windows Phone Demo)

Page 112: Imagine camp, Developing Image Processing app for windows phone platform

112

. graylevel with

in pixels of

number the

g

I

ghI 1

Luminosity

The Histogram of a Grayscale Image

Page 113: Imagine camp, Developing Image Processing app for windows phone platform

113

If I is a 3-band image (truecolor, 24-bit) then I(r,c,b) is an integer between 0 and 255. Either I has 3 histograms:

– hR(g+1) = # of pixels in I(:,:,1) with intensity value g– hG(g+1) = # of pixels in I(:,:,2) with intensity value g– hB(g+1) = # of pixels in I(:,:,3) with intensity value g

or 1 vector-valued histogram, h(g,1,b) where– h(g+1,1,1) = # of pixels in I with red intensity value

g– h(g+1,1,2) = # of pixels in I with green intensity

value g– h(g+1,1,3) = # of pixels in I with blue intensity value

g

The Histogram of a Color Image

Page 114: Imagine camp, Developing Image Processing app for windows phone platform

114

There is one histo-gram per color bandR, G, & B. Luminosity histogram is from 1 band = (R+G+B)/3

There is one histo-gram per color bandR, G, & B. Luminosity histogram is from 1 band = (R+G+B)/3

RIhGIh

BIh

LIh

Luminosity

The Histogram of a Color Image

Page 115: Imagine camp, Developing Image Processing app for windows phone platform

115

The Histogram of a Color Image

Page 116: Imagine camp, Developing Image Processing app for windows phone platform

Histogram Processing• Histogram processing re-scales an image intensities so

that the enhanced image histogram follows some desired form.

• The modification can take on many forms:• histogram equalization or• histogram shaping

• e.g. exponential or hyperbolic histogram

116

Page 117: Imagine camp, Developing Image Processing app for windows phone platform

117

Point Processes: Histogram Equalization

after

1255, gPcrJ I

before

Luminosity

Page 118: Imagine camp, Developing Image Processing app for windows phone platform

118

Histogram EQ- LUT

The CDF (cummulative distribution) is the LUT for remapping.

The CDF (cummulative distribution) is the LUT for remapping.CDF

LUT

HEQ

Page 119: Imagine camp, Developing Image Processing app for windows phone platform

119

Histogram EQ

HEQ HEQ

Page 120: Imagine camp, Developing Image Processing app for windows phone platform

120

10

Image CDFImage CDF Target CDFTarget CDF

LUTLUT

Look Up Table for Histogram Matching

Page 121: Imagine camp, Developing Image Processing app for windows phone platform

121

Remap an Image:

To Have Two of its Color pdfs Match the Third

original G & B R B & R G R & G B

Page 122: Imagine camp, Developing Image Processing app for windows phone platform

122

Example: Histogram Matching

original target remapped

Page 123: Imagine camp, Developing Image Processing app for windows phone platform

123

255,

256,

255

,,,

gcrI

gcrIgcrIcrJ

k

kkk if

if

,

Point Processes: Increase Brightness

0 127 255

0

127

255

g

transform mapping index. band the is and 3210 ,,kg

Page 124: Imagine camp, Developing Image Processing app for windows phone platform

124

Point Processes: Decrease Brightness

0 127 255

0

127

255

transform mapping

255-g

index. band the is and 3210 ,,kg

crI

gcrI

gcrIcrJ

k

k

kk ,

0,

,,

0,

if

if

,

Page 125: Imagine camp, Developing Image Processing app for windows phone platform

125

Image Brightness Matlab Demo

Page 126: Imagine camp, Developing Image Processing app for windows phone platform

126

Image Sharpening Matlab Demo

Page 127: Imagine camp, Developing Image Processing app for windows phone platform

127

Point Processes: Increase Contrast

.255,

,255,0

,0,

,255

,,

,0

,

crT

crT

crT

crTcrJ

k

k

k

kk

if

if

if

0.1127127,),( acrIacrT kk where, Let

0 127 255

0

127

255

transform mapping 321 ,,k

Page 128: Imagine camp, Developing Image Processing app for windows phone platform

128

Point Processes: Decrease Contrast

.3,2,10.10

127127,),(

ka

crIacrT kk

and where

,

0 127 255

0

127

255

transform mapping

Page 129: Imagine camp, Developing Image Processing app for windows phone platform

129

Point Processes: Contrast Stretch

.

,,

Then,

.,max , ,min

,,max , ,min Let

JII

IJJ

JJ

II

mmM

mcrImMcrJ

crJMcrJm

crIMcrIm

0 127 255

0

127

255

transform mappingmI MI

mJ

MJ

Page 130: Imagine camp, Developing Image Processing app for windows phone platform

130

Information Loss from Contrast Adjustment

origorig

a = 0.5

a = 2.0

lo-clo-c

lo-cRestored

lo-cRestored

hi-chi-c

hi-cRestored

hi-cRestored

Page 131: Imagine camp, Developing Image Processing app for windows phone platform

131

Information Loss from Contrast Adjustment

origorig

origorig

origorig

lo-clo-c hi-chi-c

lo-clo-c

hi-chi-c

restrest

restrest

lo-clo-c

hi-chi-c

diff diff

diffdiff

abbreviations: original low-contrast high-contrast restored difference

abbreviations: original low-contrast high-contrast restored difference

difference between original and restored low-contrast

difference between original and restored low-contrast

difference between original and restored high-contrast

difference between original and restored high-contrast

Page 132: Imagine camp, Developing Image Processing app for windows phone platform

132

0 127 255

0

127

255

transform mapping

0.1

255,

255,/1

for

crIcrJ

Point Processes: Increased Gamma

Page 133: Imagine camp, Developing Image Processing app for windows phone platform

133

Point Processes: Decreased Gamma

0 127 255

0

127

255

transform mappingm M

0.1

255,

255,/1

for

crIcrJ

Page 134: Imagine camp, Developing Image Processing app for windows phone platform

134

Image Subtraction for Background Removal

g(x,y) = f(x,y) – h(x,y)

www.cvcrbd.org

Page 135: Imagine camp, Developing Image Processing app for windows phone platform

135

Edge Detection Operator

Page 136: Imagine camp, Developing Image Processing app for windows phone platform

136

Discrete Laplacian

www.cvcrbd.org

Page 137: Imagine camp, Developing Image Processing app for windows phone platform

137

Highboost Filtering, Example 3

(a) Image of whole body bone scene

(b) Laplacian of (a)

+

(d) Sobel gredient of (a)

=(c) = (a)+(b)

Sharpened image

(g) = (a)+(f) Sharpened

image

(h) power-law transform of

(g)

www.cvcrbd.org

Page 138: Imagine camp, Developing Image Processing app for windows phone platform

138

Commonly Used Derivative Masks

www.cvcrbd.org

Page 139: Imagine camp, Developing Image Processing app for windows phone platform

139

Convolution Examples: Original Images

www.cvcrbd.org

Page 140: Imagine camp, Developing Image Processing app for windows phone platform

140

Convolution Examples: Vertical Difference

010

020

010

www.cvcrbd.org

Page 141: Imagine camp, Developing Image Processing app for windows phone platform

141

Convolution Examples: Horizontal Difference

000

121

000

www.cvcrbd.org

Page 142: Imagine camp, Developing Image Processing app for windows phone platform

142

010141010

Convolution Examples: H + V Diff.

www.cvcrbd.org

Page 143: Imagine camp, Developing Image Processing app for windows phone platform

143

Edge Detection (Sobel Operator) Matlab Demo

Page 144: Imagine camp, Developing Image Processing app for windows phone platform

144

Edge Enhancement, Example 1

Original image MagnitudeGradientPrewitt Mask

Original image +Edges with

magnitude > 25

Edges magnitude > 25

www.cvcrbd.org

Page 145: Imagine camp, Developing Image Processing app for windows phone platform

145

Hybrid Contrast Enhancement Method, Example

Original Image

Histogram Equalization

Highboot Filtering

HighbootFiltering

+Histogram

Equalization

www.cvcrbd.org

Page 146: Imagine camp, Developing Image Processing app for windows phone platform
Page 147: Imagine camp, Developing Image Processing app for windows phone platform
Page 148: Imagine camp, Developing Image Processing app for windows phone platform

148

Medical Image Analysis Demo

Page 149: Imagine camp, Developing Image Processing app for windows phone platform

149

Brain Storming for Hackathon

Page 150: Imagine camp, Developing Image Processing app for windows phone platform

150

Idea Selection (One Idea our of Three)

Page 151: Imagine camp, Developing Image Processing app for windows phone platform

151

Presentation on Hackathon App Ideas

Page 152: Imagine camp, Developing Image Processing app for windows phone platform

152

Suggestion for converting the idea into an image processing app

Page 153: Imagine camp, Developing Image Processing app for windows phone platform

Q / A ?

Page 154: Imagine camp, Developing Image Processing app for windows phone platform

thank you