Function adshow

Synopse

Basic Display image in AdessoWiki.

  • adshow(f, title)
    • f: uint8 Image to be displayed.
    • title: string to be shown in the caption.

Description

adshow accepts binary (bool) or integer images with pixels between 0 and 255, gray scale or RGB 3 band color image.

If the values are outside the range 0 - 255, adshow sends an error message and stops.

adshow is a modified implementation from PIL to show images in Adessowiki. In the Adessowiki context, the image is saved to a file and the file URL is included in the output document (usually HTML).

Examples

Example 1: Display uint8 images

1. import numpy as np
2. import ia636 as ia
3. 
4. f = uint8(np.arange(256))
5. f = np.tile(f, (128,1))
6. print ia.iaimginfo(f)
7. adshow(f,'256 gray tones')
<type 'numpy.ndarray'> (128, 256) uint8 0.000000 255.000000

256 gray tones

Example 2: Display binary images

1. g = f > 128
2. print ia.iaimginfo(g)
3. adshow(g,'binary image')
4. gp = np.pad(g, ((1,1),(1,1)), 'constant', constant_values=((0,0),(0,0)))
5. print ia.iaimginfo(gp)
6. adshow(gp,'framed binary image')
<type 'numpy.ndarray'> (128, 256) bool 0.000000 1.000000
<type 'numpy.ndarray'> (130, 258) bool 0.000000 1.000000

binary image

framed binary image

See Also