Example #1
0
 def test_02_00_mct_zeros(self):
     result = T.get_maximum_correlation_threshold(np.zeros(0))
     r = np.random.RandomState()
     r.seed(11)
     result = T.get_maximum_correlation_threshold(r.uniform(size=(10, 10)), mask=np.zeros((10, 10), bool))
     result = T.get_maximum_correlation_threshold(np.ones((10, 10)) * 0.5)
     self.assertEqual(result, 0.5)
Example #2
0
 def test_02_00_mct_zeros(self):
     result = T.get_maximum_correlation_threshold(np.zeros(0))
     r = np.random.RandomState()
     r.seed(11)
     result = T.get_maximum_correlation_threshold(r.uniform(size=(10,10)),
                                                  mask=np.zeros((10,10), bool))
     result = T.get_maximum_correlation_threshold(np.ones((10,10)) * .5)
     self.assertEqual(result, .5)
Example #3
0
 def test_02_01_mct_matches_reference_implementation(self):
     image = np.array([
         0, 255, 231, 161, 58, 218, 95, 17, 136, 56, 179, 196, 1, 70, 173,
         113, 192, 101, 223, 65, 127, 27, 234, 224, 205, 61, 74, 168, 63,
         209, 120, 41, 218, 22, 66, 135, 244, 178, 193, 238, 140, 215, 96,
         194, 158, 20, 169, 61, 55, 1, 130, 17, 240, 237, 15, 228, 136, 207,
         65, 90, 191, 253, 63, 101, 206, 91, 154, 76, 43, 89, 213, 26, 17,
         107, 251, 164, 206, 191, 73, 32, 51, 191, 80, 48, 61, 57, 4, 152,
         74, 174, 103, 91, 106, 217, 194, 161, 248, 59, 198, 24, 22, 36
     ], float)
     self.assertEqual(127, T.get_maximum_correlation_threshold(image))
Example #4
0
 def test_02_01_mct_matches_reference_implementation(self):
     image = np.array([0,255,231,161,58,218,95,17,136,56,179,196,1,70,173,113,192,101,223,65,127,27,234,224,205,61,74,168,63,209,120,41,218,22,66,135,244,178,193,238,140,215,96,194,158,20,169,61,55,1,130,17,240,237,15,228,136,207,65,90,191,253,63,101,206,91,154,76,43,89,213,26,17,107,251,164,206,191,73,32,51,191,80,48,61,57,4,152,74,174,103,91,106,217,194,161,248,59,198,24,22,36], float)
     self.assertEqual(127, T.get_maximum_correlation_threshold(image))