def test_extracredit_contrastclipping(self): supersharp = a1.contrast(self.im, 10) self.assertEqual(supersharp[41,50,int(3*random.random())],1.0) self.assertEqual(supersharp[42,50,int(3*random.random())],0.0)
def test_2_contrast(self): contrasted = a1.contrast(self.im, 0.5, 0.6) comparison = numpy.array([ 0.30146616, 0.30387551, 0.39698608, 0.63652454, 0.36951123]) self.assertTrue((numpy.abs((contrasted[45,30:35,1]/comparison)-1) < .0001).all())