Beispiel #1
0
 def test_peak_near_center_large_width(self):
     img = np.zeros((100, 200))
     # Peak centered around 50, 100
     img[49:52, 99:102] = 2
     img[50:51, 100:101] = 3
     expected = peak_local_max(img)[0]
     width = 300
     result = peak_near_center(img, width)
     assert_equal(result, expected)
Beispiel #2
0
 def test_peak_near_center_with_secondary_peak(self):
     img = np.zeros((100, 200))
     # Peak centered around 50, 100
     img[50:51, 100:101] = 3
     img[79:82, 39:42] = 20
     expected = peak_local_max(img)[0]
     width = 30
     result = peak_near_center(img, width)
     assert_equal(result, expected)
Beispiel #3
0
 def test_peak_prominent(self):
     img = np.zeros((100, 200))
     # Main peak centered around 50, 100
     img[50:51, 100:101] = 3
     img[20:21, 140:141] = 1
     img[80:81, 180:181] = 1
     expected = (50, 100)
     width = 10
     result = peak_near_center(img, width)
     assert_equal(result, expected)