Function iaunpad

Synopse

Reduces the size of the image removing a frame around it. Undo the iapad function.

  • g = iaunpad(f, B=iasecross())
    • g: Image
    • f: Image input image.
    • B: Structuring Element The offsets of the bounding box of the structuring element is used to specify the thickness of the frame.

Description

iaunpad reduces the image by removing a frame from it. The frame thickness is controlled by the bounding rectangle defined by a structuring element. Normaly iaunpad undo what iapad does.

Examples

Example 1

01. from ia870 import iapad, iaunpad
02. from ia870 import iaseline
03. 
04. 
05. f = uint8([
06.    [0,1,2],
07.    [3,4,5]])
08. g1 = iapad(f)
09. print 'g1=\n', g1
10. ug1 = iaunpad(g1)
11. print 'ug1=\n', ug1
g1=
[[0 0 0 0 0]
 [0 0 1 2 0]
 [0 3 4 5 0]
 [0 0 0 0 0]]
ug1=
[[0 1 2]
 [3 4 5]]

Example 2

01. B = array([[0, 0, 0, 0, 0, 0, 0, 0, 0],
02.            [0, 0, 0, 0, 0, 0, 0, 0, 0],
03.            [0, 0, 1, 1, 1, 1, 1, 1, 1],
04.            [0, 0, 0, 0, 0, 0, 0, 0, 1],
05.            [0, 0, 0, 0, 0, 0, 0, 0, 1],
06.            [0, 0, 0, 0, 0, 0, 0, 0, 1],
07.            [0, 0, 1, 0, 0, 0, 0, 0, 1]],bool)
08. g3 = iapad(f, B, 5)
09. print 'g3=\n', g3
10. ug3 = iaunpad(g3,B)
11. 
12. print 'ug3=\n',ug3
g3=
[[5 5 5 5 5 5 5 5 5]
 [5 5 0 1 2 5 5 5 5]
 [5 5 3 4 5 5 5 5 5]
 [5 5 5 5 5 5 5 5 5]
 [5 5 5 5 5 5 5 5 5]
 [5 5 5 5 5 5 5 5 5]]
ug3=
[[0 1 2]
 [3 4 5]]

Example 3

1. 
Empty code fragment
1. B=array([1,1,1,1,1],bool)
2. A=array([1,1,1],bool)
3. C=iapad(B,A,4)
4. D=iaunpad(C,A)
5. print B * 1
6. print A * 1
7. print C
8. print D
[1 1 1 1 1]
[1 1 1]
[[ True  True  True  True  True  True  True]]
[[ True  True  True  True  True]]

See Also