test_illumination_statistics.py 文件源码

python
阅读 43 收藏 0 点赞 0 评论 0

项目:DeepProfiler 作者: jccaicedo 项目源码 文件源码
def test_process_image(illumination_stats):
    numpy.random.seed(8)
    image = numpy.random.randint(256, size=(16, 16, 3), dtype=numpy.uint16)

    illumination_stats.processImage(0, image, None)

    histogram1 = numpy.histogram(image[:, :, 0], bins=2 ** 16, range=(0, 2 ** 16))[0]
    histogram2 = numpy.histogram(image[:, :, 1], bins=2 ** 16, range=(0, 2 ** 16))[0]
    histogram3 = numpy.histogram(image[:, :, 2], bins=2 ** 16, range=(0, 2 ** 16))[0]

    assert illumination_stats.count == 1
    numpy.testing.assert_array_equal(illumination_stats.hist[0], histogram1)
    numpy.testing.assert_array_equal(illumination_stats.hist[1], histogram2)
    numpy.testing.assert_array_equal(illumination_stats.hist[2], histogram3)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号