Image Processing Reference
In-Depth Information
eye:=READBMP(eye_orig)
We can view (part) of the image as a matrix of pixels or we can view it as an image (viewed
using Mathcad's picture facility) as
01 2 345 678 9
0
1
2
3
4
5
6
7
8
9
10
11
12
115
117
130
155
155
146
146
135
115
132
135
130
139
155
141
146
146
115
115
135
139
146
146
152
152
155
117
117
117
139
139
144
146
155
155
146
115
114
117
139
139
146
146
152
150
136
117
115
135
139
146
146
146
155
149
130
115
137
135
145
eye =
147
146
142
150
136
115
132
146
146
146
146
141
155
152
130
115
139
139
146
146
136
145
160
141
115
129
139
147
146
141
117
146
155
130
115
115
137
149
141
139
132
152
150
130
115
115
142
149
141
118
137
149
136
130
130
114
135
139
141
139
137
145
130
117
115
115
117
117
132
132
(b)
(a)
This image is 64 pixels wide and 64 pixels in height. Let's check: cols(eye)=64
rows(eye)=64
This gives us 4096 pixels. Each pixel is an 8- bit byte (n.b. it's stored in .BMP format)
so this gives us 256 possible intensity levels , starting at zero and ending at 255. It's more
common to use larger (say 256 × 256) images, but you won't be tempted to use much larger
ones in Mathcad. It's very common to use 8 bits for pixels, as this is well suited to digitised
video information.
We describe the occupation of intensity levels by a histogram . This is a count of all
pixels with a specified brightness level, plotted against brightness level. As a function, we
can calculate it by:
for bright 0..255
8 bits give 256 levels, 0..255
histogram(pic):=
pixels_at_level bright
Initialise histogram
0
for x 0..cols(pic)-1
Cover whole picture
for y 0..rows(pic)-1
level
Find level
pic y,x
Increment points at
pixels_at_level level
specified levels
pixels_at_level level +1
pixels_at_level
Return histogram
Search WWH ::




Custom Search