Image Processing Reference
In-Depth Information
(a) French canvas (deail)
(b) French canvas
(c) Beach sand
Figure 8.4
Co-occurrence matrices of the three Brodatz textures
used to generate the results in Figure 8.4 ), then the co-occurrence will be evaluated from
a point and its four nearest neighbours. First, the co-occurrence matrix is cleared. Then, for
each point in the image and for each value of distance and relative inclination (and so long
as the two points are within the image), then the element of the co-occurrence matrix
indexed by the brightnesses of the two points is incremented. Finally, the completed co-
occurrence matrix is returned. Note that even though the co-occurrence matrix is symmetric,
this factor cannot be used to speed its production.
tex_cc(im,dist,dirs):=
for x 0..maxbri
for y 0..maxbri
cocc y,x 0
for x 0..cols(im)-1
for y 0..rows(im)-1
for r 1..dist
for 0, 2
dirs ..2.
xc floor(x+r·cos( θ ))
yc floor(y+r·sin( θ ))
if (0 yc)·(yc<rows(im))·(0 xc)·(xc<cols(im))
cocc
cocc
+1
im y,x ,i m yc,xc
im y,x ,i m yc,xc
cocc
Code 8.2
Co-occurrence matrix generation
Again, we need measurements that describe these matrices. We shall use the measures
of entropy, inertia and energy defined earlier. The results are shown in Code 8.3 . Unlike
visual analysis of the co-occurrence matrices, the difference between the measures of the
three textures is less clear: classification from them will be discussed later. Clearly, the co-
Search WWH ::




Custom Search