mineral_test.py 文件源码

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

项目:pycoal 作者: capstone-coal 项目源码 文件源码
def test_classify_image_in_memory():

    # create mineral classifier instance with image loading enabled
    mc = mineral.MineralClassification(libraryFilenames[0], in_memory=True)

    # for each of the test images
    for image_file_name in test_classifyImage_testFilenames:

        # classify the test image
        classified_file_name = image_file_name[:-4] + "_class_test.hdr"
        mc.classify_image(image_file_name, classified_file_name)
        actual = spectral.open_image(classified_file_name)

        # classified image for comparison
        expected = spectral.open_image(image_file_name[:-4] + "_class.hdr")

        # verify that every pixel has the same classification
        assert numpy.array_equal(expected.asarray(), actual.asarray())

# test files for classify image threshold and subset tests
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号