Function iaisequal

namespace:morph
page:iaisequal

Synopse

Verify if two images are equal

  • boo = iaisequal(f1, f2, MSG=NULL)
    • boo: Boolean
    • f1: Image
    • f2: Image
    • MSG: String
1. import numpy
2. 
3. def iaisequal(f1, f2, MSG=None):
4. 
5.     if f1.shape != f2.shape:
6.       return False
7.     return numpy.all(f1 == f2)

Description

iaisequal compares the images f1 and f2 and returns true (1), if f1(x)=f2(x) , for all pixel x, and false (0), otherwise.

Examples

Example 1

01. from ia870 import iaisequal
02. 
03. 
04. f1 = uint8(arange(4))
05. print f1
06. f2 = uint8([9, 5, 3, 3])
07. print f2
08. f3 = f1
09. iaisequal(f1,f2)
10. iaisequal(f1,f3)
[0 1 2 3]
[9 5 3 3]

Equation