Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions plantcv/plantcv/output_mask_ori_img.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ def output_mask(img, mask, filename, outdir=None, mask_only=False):
mask_only = bool for printing only mask

Returns:
imgpath = path to image
maskpath path to mask
results = list of output paths, [imgpath, maskpath, analysis_images]

:param img: numpy.ndarray
:param mask: numpy.ndarray
:param filename: str
:param outdir: str
:param mask_only: bool
:return imgpath: str
:return maskpath: str
:return results: list
"""
analysis_images = []

Expand Down
4 changes: 3 additions & 1 deletion tests/plantcv/test_output_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ def test_output_mask(test_data, tmpdir):
# Read in test data
img = cv2.imread(test_data.small_gray_img, -1)
mask = cv2.imread(test_data.small_bin_img, -1)
imgpath, maskpath, _ = output_mask(img=img, mask=mask, filename='test.png', outdir=cache_dir, mask_only=False)
results = output_mask(img=img, mask=mask, filename='test.png', outdir=cache_dir, mask_only=False)
imgpath = results[0]
maskpath = results[1]
assert all([os.path.exists(imgpath) is True, os.path.exists(maskpath) is True])