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
评论列表
文章目录