Hello everyone.
I am trying to load masks for a model such that I have my images in project/jpg/someimage_001.jpg and my masks in project/masks/someimage_001_mask.jpg. I looked at the API and found the importMasks function. I know that they can be loaded based on a naming convention but I can't quite get my head around it. Any help would be appreciated.
ImageDirectory = path + "/jpg/"
MasksDirectory = path + "/masks/"
images = []
for photo in os.listdir (ImageDirectory):
if ("jpg" in photo.lower()) or ("jpeg" in photo.lower()):
images.append(photo)
chunk.addPhotos(images)
for mask in os.listdir (MasksDirectory):
if ("jpg" in mask.lower()) or ("jpeg" in photo2.lower()):
chunk.importMasks(path=mask,source=PhotoScan.MaskSourceBackground,operation=PhotoScan.MaskOperationDifference,tolerance=10,cameras=chunk.cameras)
EDIT:
I found the API difference and edited my OP. How do you pass a file naming template in the path parameter? Also does the optional camera parameter work. The above code is what I presently have and it doesn't throw an error. Does the template act as a link between each image and corresponding mask or is it just to iterate through images.
Thanks,