Skip to content

Commit 00adc51

Browse files
Merge pull request #2002 from alicevision/dev/maskProcessing
Update mask processing for single mask broadcasting
2 parents 5264cff + b1861b4 commit 00adc51

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

meshroom/aliceVision/MaskProcessing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class MaskProcessing(desc.AVCommandLineNode):
4343
),
4444
name="inputs",
4545
label="Input Directories",
46-
description="A set of directories containing masks with the same names.",
46+
description="A set of directories containing masks with the same names.\n"
47+
"Any entry (except the first one) may be an image path. In this case, this mask will be used as an operand for each entry of the first directory.",
4748
exposed=True,
4849
),
4950
desc.ChoiceParam(

src/software/utils/main_maskProcessing.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,19 @@ int aliceVision_main(int argc, char** argv)
157157
{
158158
std::filesystem::path otherPath(directoryNames[otherDirIndex]);
159159

160-
std::filesystem::path otherMaskPath = otherPath / refpath.filename();
161-
if (!std::filesystem::exists(otherMaskPath))
160+
std::filesystem::path otherMaskPath;
161+
if (std::filesystem::is_directory(otherPath))
162162
{
163-
continue;
163+
otherMaskPath = otherPath / refpath.filename();
164+
if (!std::filesystem::exists(otherMaskPath))
165+
{
166+
continue;
167+
}
168+
}
169+
else
170+
{
171+
//Use the specified file directly
172+
otherMaskPath = otherPath;
164173
}
165174

166175
image::Image<unsigned char> otherImg;

0 commit comments

Comments
 (0)