Download - Lecture 3 - Stenography
![Page 1: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/1.jpg)
Steganography & Pixel neighbors
Dr Khurram Khurshid
Digital Image Processing
![Page 2: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/2.jpg)
2
Steganography
The science of writing hidden messages in such a way that no one, apart from the
sender and intended recipient, suspects the existence of the message
![Page 3: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/3.jpg)
3
Steganography
Before Moving On …. Recall – Logical Shift Operators
Logical left shift one bit Logical right shift one bit
![Page 4: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/4.jpg)
SteganographySteganography
8-bit Image 6-bit Image
Two
lea
st s
igni
fica
nt b
its a
re 0
If an image is quantized, say from 8 bits to 6 bits and redisplayed it can be all but impossible to tell the difference between the two.
![Page 5: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/5.jpg)
5
Steganography
That other information could be a message, perhaps encrypted, or even another image.
If the 6-bit version is displayed as an 8-bit image then the 8-bit pixels all have zeros in the lower 2 bits:
00bb bb b b
b = 0 or 1 always 0
This introduces the possibility of encoding other information in the low-order bits.
Image 2
R-Shift 6
Image Out
Image 1
R-Shift 2
L-Shift 2
X-Shift n = logical left or right shift by n bits.
logical OR
![Page 6: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/6.jpg)
0 0 1 0 1 1 0 1
1 0 1 1 0 1 0 0
180
1 1 0 1 1 1 0 0
220
0 0 0 0 0 0 1 103
1 0 1 1 0 1 1 1
183
1 0 1 1 0 1 1 0
182
R-Shift 2
L-Shift 2
SteganographySteganography
R-Shift 6
![Page 7: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/7.jpg)
1 0 1 1 0 1 1 1
183
SteganographySteganography
L-Shift 6
1 1 0 0 0 0 0 0
192
Extracted Second Image
How
to
get
the
seco
nd im
age
How
to
get
the
seco
nd im
age
![Page 8: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/8.jpg)
0 0 1 0 1 1 0 1
1 0 1 1 0 1 0 0
180
0 0 0 0 0 0 1 1
03
0 0 0 0 0 0 1 103
1 0 1 1 0 1 1 1
183
1 0 1 1 0 1 1 0
182
R-Shift 2
L-Shift 2
SteganographySteganography
R-Shift 6
If we have only 4 colors (2-bits) and we put them in the lower order bits
If we have only 4 colors (2-bits) and we put them in the lower order bits
No need to shift rightNo need to shift right
What would you do to get back original data?
What would you do to get back original data?
![Page 9: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/9.jpg)
9
Steganography
8-bit-per-band, 3-band, “original” image
8-bit-per-band, 3-band, “original” image
![Page 10: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/10.jpg)
10
Steganography
6-bit-per-band, 3-band, quantized image
6-bit-per-band, 3-band, quantized image
![Page 11: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/11.jpg)
11
Steganography
The histograms of the two versions indicate which is which. If the 6-bit version is displayed as an 8-bit image it has only pixels with values 0, 4, 8, … , 252.
green-band histogram of 8-bit image green-band histogram of 6-bit image
![Page 12: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/12.jpg)
12
Steganography
The second image is invisible because the value of each pixel is between 0 and 3. For any given pixel, its value is added to the to the collocated pixel in the first image that has a value from the set {0, 4, 8, … , 252}. The 2nd image is noise on the 1st.
![Page 13: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/13.jpg)
13
Steganography
To recover the second image (which is 2 bits per pixel per band) simply left shift the combined image by 6 bits.
L-S
hift
6
?
![Page 14: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/14.jpg)
14
Steganography
To recover the second image (which is 2 bits per pixel per band) simply left shift the combined image by 6 bits.
L-S
hift
6
image
![Page 15: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/15.jpg)
15
Steganography
Images 1 and 2 each have 4-bits per pixel when combined.
Images 1 and 2 each have 4-bits per pixel when combined.
This is so effective that two 4-bit-per-pixel images can be superimposed with only the image in the high-order bits visible. Both images contain the same amount of information but the image in the low-order bits is effectively invisible
Image 2
R-Shift 4
Image Out
Image 1
R-Shift 4
L-Shift 4
![Page 16: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/16.jpg)
16
Steganography
Original ImageOriginal Image
![Page 17: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/17.jpg)
17
Steganography
Image quantized to 4-bits per pixel.
Image quantized to 4-bits per pixel.
![Page 18: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/18.jpg)
18
Steganography
Image 1 in upper 4-bits. Image 2 in lower 4-bits.
Image 1 in upper 4-bits. Image 2 in lower 4-bits.
![Page 19: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/19.jpg)
19
Steganography
Extracted Image
![Page 20: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/20.jpg)
20
Steganography
http://mozaiq.org/encrypt/
![Page 21: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/21.jpg)
21
Relationships between pixels
Neighbors of pixel are the pixels that are adjacent pixels of an identified pixel
x-1 x+1x
y-1
y+1
y
![Page 22: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/22.jpg)
22
4- Neighbors of a Pixel –N4(p)
x-1 x+1x
y-1
y-1
y
(x-1,y), (x+1,y), (x, y-1), (x, y+1)
Wh
at a
re th
e
coo
rdin
ate
s of
ea
ch o
f th
e b
lue
pix
els
Wh
at a
re th
e
coo
rdin
ate
s of
ea
ch o
f th
e b
lue
pix
els
![Page 23: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/23.jpg)
23
Diagonal Neighbors of a Pixel –ND(p)
x-1 x+1x
y-1
y-1
y
(x-1,y-1), (x+1,y-1), (x-1, y+1), (x+1, y+1)
![Page 24: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/24.jpg)
24
8- Neighbors of a Pixel –N8(p)
x-1 x+1x
y-1
y-1
y
(x-1,y), (x+1,y), (x, y-1), (x, y+1)
(x-1,y-1), (x+1,y-1), (x-1, y+1), (x+1, y+1)
8 4( ) ( ) ( )DN p N p N p
![Page 25: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/25.jpg)
25
Determine different regions in the image
![Page 26: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/26.jpg)
26
Connectivity
Establishing boundaries of objects and components in an image
Group the same region by assumption that the pixels being the same color or
equal intensity
Two pixels p & q are connected if
They are adjacent in some sense If their gray levels satisfy a specified criterion of
similarity
![Page 27: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/27.jpg)
27
Connectivity
V: Set of gray levels used to define the criterion of similarity
4-connectivity4-connectivity
If gray level4( , ) , ( )p q V and q N p
Set of gray levels V = {1}Set of gray levels V = {1}
![Page 28: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/28.jpg)
28
Connectivity
V: Set of gray levels used to define the criterion of similarity
8-connectivity8-connectivity
If gray level8( , ) , ( )p q V and q N p
Set of gray levels V = {1}Set of gray levels V = {1}
![Page 29: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/29.jpg)
29
Connectivity
V: Set of gray levels used to define the criterion of similarity
m-connectivity (Mixed Connectivity)m-connectivity (Mixed Connectivity)
If gray level
( , ) , satisfies one of the following:p q V and q4 ( )q N p or
4 4( ) ( ) ( ) has no pixels
whose values are from VDq N p And N p N q
a.
b.
![Page 30: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/30.jpg)
30
Example: m – Connectivity
Set of gray levels V = {1}
Note: Mixed connectivity can eliminate the multiple path connections that often occurs in 8-connectivity
![Page 31: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/31.jpg)
31
Paths
Path: Let coordinates of pixel p: (x, y), and of pixel q: (s, t)
A path from p to q is a sequence of distinct pixels with
coordinates: (x0, y0), (x1, y1), ......, (xn,yn)
where (x0, y0) = (x, y) & (xn,yn) = (s, t), and (xi,yi) is adjacent
to (xi-1,yi-1) 1≤i ≤n
![Page 32: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/32.jpg)
32
CC labeling – 4 Connectivity
Process the image from left toright, top to bottom:
1.) If the next pixel to process is 1 i.) If only one of its neighbors
(top or left) is 1, copy its label.
ii.) If both are 1 and have the same label, copy it.
iii.) If they have different labels Copy the label from the left. Update the equivalence table.
iv.) Otherwise, assign a new label.
Re-label with the smallest of equivalentlabels
Pass 1
Pass 2
![Page 33: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/33.jpg)
33
CC labeling – 4 Connectivity
![Page 34: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/34.jpg)
34
CC labeling – 4 Connectivity
![Page 35: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/35.jpg)
35
CC labeling – 8 Connectivity
Same algorithm but examine also the upper diagonal neighbors of pSame algorithm but examine also the upper diagonal neighbors of p
![Page 36: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/36.jpg)
36
CC labeling – 8 Connectivity
Background pixel
Unlabeled Pixel
Background pixel
Unlabeled Pixel
Label 1
![Page 37: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/37.jpg)
37
CC labeling – 8 Connectivity
Background pixel
Unlabeled Pixel
Label 1
Label 2
Background pixel
Unlabeled Pixel
Label 1
Label 2
Label 3
![Page 38: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/38.jpg)
38
CC labeling – 8 Connectivity
Background pixel
Unlabeled Pixel
Label 1
Label 2
Label 3
Background pixel
Unlabeled Pixel
Label 1
Label 2
Label 3
![Page 39: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/39.jpg)
39
CC labeling – 8 Connectivity
Background pixel
Label 1
Label 2
Label 3
Unlabeled pixel
Background pixel
Label 1
Label 2
Label 3
Unlabeled pixel
![Page 40: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/40.jpg)
40
CC labeling – 8 Connectivity
Background pixel
Label 1
Label 2
Label 3
Unlabeled pixel
Label 4
Background pixel
Label 1
Label 2
Label 3
Unlabeled pixel
Label 4
![Page 41: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/41.jpg)
41
Distance Metrics
Let pixels p, q and z have coordinates (x,y), (s,t) and (u,v) respectively.
D is a distance function or metric if D(p,q) ≥ 0 and D(p,q) = 0 iff p = q and D(p,q) = D(q,p) and D(p,z) ≤ D(p,q) + D(q,z)
![Page 42: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/42.jpg)
42
City block distance (D4 distance)
4 ( , )D p q x s y t
Diamond with center at (x,y)
D4 = 1 are the 4 neighbors of pixel p(x,y)
![Page 43: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/43.jpg)
43
Chessboard distance (D8 distance)
8 ( , ) max( , )D p q x s y t
Square centered at p(x,y) D8 = 1 are the 8 neighbors
of pixel p(x,y)
![Page 44: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/44.jpg)
44
Euclidean Distance
2 2( , ) ( ) ( )eD p q x s y t
A circle with radius r centered at (x,y)
p(x,y)
q(s,t)
r
![Page 45: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/45.jpg)
45
Arithmetic Operations
Carried out between corresponding pixel pairs ( , ) ( , ) ( , )s x y f x y g x y
( , ) ( , ) ( , )d x y f x y g x y ( , ) ( , ) ( , )p x y f x y g x y
( , ) ( , ) ( , )d x y f x y g x y
![Page 46: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/46.jpg)
46
Arithmetic Operations
Conversion to range 0 – 255 Difference of two 8-bit images: -255 to 255 Sum of two 8-bit images: 0 to 510 Solution?
Set all values < 0 to 0
Set all values > 255 to 255
Full range of arithmetic operation not captured
![Page 47: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/47.jpg)
47
Arithmetic Operations
First perform the operation
Then perform
min( )mf f f
Creates an image whose minimum value
is 0
max( )s m mf K f f
Creates a scaled image fs with values in
the range [0 K]
![Page 48: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/48.jpg)
48
Logical Operations (Binary Images)
![Page 49: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/49.jpg)
49
Acknowledgements
Digital Image Processing”, Rafael C. Gonzalez & Richard E. Woods, Addison-Wesley, 2002
Peters, Richard Alan, II, Lectures on Image Processing, Vanderbilt University, Nashville, TN, April 2008
Brian Mac Namee, Digitial Image Processing, School of Computing, Dublin Institute of Technology
Computer Vision for Computer Graphics, Mark Borg
Ma
teria
l in
th
ese
slid
es
ha
s b
ee
n t
ake
n f
rom
th
e f
ollo
win
g r
eso
urc
es
![Page 50: Lecture 3 - Stenography](https://reader037.vdocument.in/reader037/viewer/2022102804/5477e407b4af9fa2108b4a57/html5/thumbnails/50.jpg)
50
Acknowledgements
Statistical Pattern Recognition: A Review – A.K Jain et al., PAMI (22) 2000 Pattern Recognition and Analysis Course – A.K. Jain, MSU Pattern Classification” by Duda et al., John Wiley & Sons. Digital Image Processing”, Rafael C. Gonzalez & Richard E. Woods, Addison-Wesley,
2002 Machine Vision: Automated Visual Inspection and Robot Vision”, David Vernon, Prentice
Hall, 1991 www.eu.aibo.com/ Advances in Human Computer Interaction, Shane Pinder, InTech, Austria, October 2008
Ma
teria
l in
th
ese
slid
es
ha
s b
ee
n t
ake
n f
rom
, th
e f
ollo
win
g r
eso
urc
es