def find_valid_pixels(mDataTrain): # find valid pixels mThresh = 0.75 mm = mDataTrain > mThresh strel = selem.disk(5) mm = binary.binary_dilation(mm, strel) mm = morphology.remove_small_objects(mm, 1000, 4) pixValid = mm[mm > 0] return pixValid
def test_binary_dilation(): strel = selem.square(3) binary_res = binary.binary_dilation(bw_img, strel) grey_res = img_as_bool(grey.dilation(bw_img, strel)) testing.assert_array_equal(binary_res, grey_res)
def test_binary_dilation(): strel = selem.square(3) binary_res = binary.binary_dilation(bw_img, strel) gray_res = img_as_bool(gray.dilation(bw_img, strel)) testing.assert_array_equal(binary_res, gray_res)
def test_binary_dilation(): footprint = morphology.square(3) binary_res = binary.binary_dilation(bw_img, footprint) gray_res = img_as_bool(gray.dilation(bw_img, footprint)) assert_array_equal(binary_res, gray_res)
def test_binary_dilation(): strel = selem.square(3) binary_res = binary.binary_dilation(bw_img, strel) with expected_warnings(['precision loss']): grey_res = img_as_bool(grey.dilation(bw_img, strel)) testing.assert_array_equal(binary_res, grey_res)
def test_binary_dilation(): strel = selem.square(3) binary_res = binary.binary_dilation(bw_lena, strel) grey_res = grey.dilation(bw_lena, strel) testing.assert_array_equal(binary_res, grey_res)