Function iaisolines

namespace:ia636
page:iaisolines

Synopse

Isolines of a grayscale image.

  • g = iaisolines(f, nc=10, np=1)
    • g: Image.
    • f: Image. Input image.
    • nc: Double. Number of colors.
    • n : Double. Number of pixels by isoline.
01. import numpy as np
02. import ia636 as ia
03. 
04. def iaisolines(f, nc=10, n=1):
05.     maxi = np.ceil(f.max())
06.     mini = np.floor(f.min())
07.     d = int(np.ceil(1.*(maxi-mini)/nc))
08.     m = np.zeros((d,1))
09.     m[0:n,:] = 1
10.     m = np.resize(m, (maxi-mini, 1))
11.     m = np.concatenate((np.zeros((mini,1)), m))
12.     m = np.concatenate((m, np.zeros((256-maxi,1))))
13.     m = np.concatenate((m,m,m), 1)
14.     ct = m*ia.iacolormap('hsv') + (1-m)*ia.iacolormap('gray')
15.     g = ia.iaapplylut(f, ct)
16.     return g

Description

Shows lines where the pixels have same intensity with a unique color.

Examples

Example 1

1. from ia636 import iaisolines, iabwlp, ianormalize
2. 
3. f = uint8(ianormalize(iabwlp([150,150], 4, 1), [0,255]))
4. adshow(f, title='f')
5. g = iaisolines(f, 10, 3)
6. adshow(g, title='g')

f

g

See Also: