def test_add_to_mean_no_scaling(illumination_stats):
numpy.random.seed(8)
image = numpy.random.randint(256, size=(16, 16, 3), dtype=numpy.uint16)
illumination_stats.down_scale_factor = 1
illumination_stats.addToMean(image)
assert illumination_stats.mean_image.shape == (16, 16, 3)
# This method rescales the input image and normalizes pixels according to
# the data type. We restore the values in this test to match the input for comparison.
result_mean = illumination_stats.mean_image #* (2 ** 16)
numpy.testing.assert_array_equal(numpy.round(result_mean).astype(numpy.uint16), image)
test_illumination_statistics.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录