Beispiel #1
0
def test_erode_dilate_wrong_parameters_2():

    image = numpy.zeros((25, 25, 3), dtype=numpy.uint8)
    try:
        phm_img.erode_dilate(image)
    except Exception, e:
        assert type(e) == ValueError
Beispiel #2
0
def test_erode_dilate_wrong_parameters_1():
    try:
        phm_img.erode_dilate(None)
    except Exception as e:
        assert type(e) == TypeError
    else:
        assert False
Beispiel #3
0
def test_erode_dilate_wrong_parameters_3():

    image = numpy.zeros((25, 25), dtype=numpy.uint8)
    mask = 42
    try:
        phm_img.erode_dilate(image, mask=mask)
    except Exception, e:
        assert type(e) == TypeError
Beispiel #4
0
def test_erode_dilate_wrong_parameters_4():

    image = numpy.zeros((25, 25), dtype=numpy.uint8)
    mask = numpy.zeros((25, 25, 3), dtype=numpy.uint8)
    try:
        phm_img.erode_dilate(image, mask=mask)
    except Exception as e:
        assert type(e) == ValueError
    else:
        assert False
Beispiel #5
0
def test_erode_dilate_2():
    image = numpy.zeros((25, 25), dtype=numpy.uint8)

    image_cleaning = phm_img.erode_dilate(image)

    assert isinstance(image_cleaning, numpy.ndarray)
    assert image_cleaning.ndim == 2