( self )
| 41 | class ImageThinnerTest( unittest.TestCase ) : |
| 42 | |
| 43 | def test( self ) : |
| 44 | |
| 45 | i = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "tiff", "toTrace.tif" ) ).read() |
| 46 | |
| 47 | IECoreImage.ImageThinner()( input=i, copyInput=False ) |
| 48 | |
| 49 | ii = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "tiff", "toTraceThinned.tif" ) ).read() |
| 50 | |
| 51 | i.blindData().clear() |
| 52 | ii.blindData().clear() |
| 53 | |
| 54 | self.assertEqual( i.channelNames(), ii.channelNames() ) |
| 55 | self.assertEqual( i.channelSize(), ii.channelSize() ) |
| 56 | for c in i.channelNames() : |
| 57 | ic = i[c] |
| 58 | iic = ii[c] |
| 59 | for j in range( 0, i.channelSize() ) : |
| 60 | # the values may not match exactly due to color space conversions reading the tif on disk |
| 61 | self.assertAlmostEqual( ic[j], iic[j], delta = 0.0001 ) |
| 62 | |
| 63 | if __name__ == "__main__": |
| 64 | unittest.main() |
nothing calls this directly
no test coverage detected