Skip to content

Commit

Permalink
dense: load mask with predefined '.mask.png' extension
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcseacave committed Dec 27, 2022
1 parent 516306a commit 305b768
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
uses: actions/checkout@v3

- name: Restore artifacts, or setup vcpkg for building artifacts
uses: lukka/run-vcpkg@v10.6
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: '4cb4a5c5ddcb9de0c83c85837ee6974c8333f032'
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ if(OpenMVS_USE_PYTHON)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
LIST(APPEND OpenMVS_EXTRA_INCLUDES ${PYTHON_INCLUDE_DIRS})
LIST(APPEND OpenMVS_EXTRA_LIBS ${PYTHON_LIBRARIES})
MESSAGE(STATUS "Python ${PYTHON_VERSION} found (include: ${PYTHON_INCLUDE_DIRS})")
else()
MESSAGE("-- Can't find Python. Continuing without it.")
endif()
Expand Down
2 changes: 1 addition & 1 deletion apps/DensifyPointCloud/DensifyPointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ bool Initialize(size_t argc, LPCTSTR* argv)
("sub-resolution-levels", boost::program_options::value(&nSubResolutionLevels)->default_value(2), "number of patch-match sub-resolution iterations (0 - disabled)")
("number-views", boost::program_options::value(&nNumViews)->default_value(nNumViewsDefault), "number of views used for depth-map estimation (0 - all neighbor views available)")
("number-views-fuse", boost::program_options::value(&nMinViewsFuse)->default_value(3), "minimum number of images that agrees with an estimate during fusion in order to consider it inlier (<2 - only merge depth-maps)")
("ignore-mask-label", boost::program_options::value(&nIgnoreMaskLabel)->default_value(-1), "integer value for the label to ignore in the segmentation mask (<0 - disabled)")
("ignore-mask-label", boost::program_options::value(&nIgnoreMaskLabel)->default_value(-1), "integer value for the label to ignore in the segmentation mask; the mask for each image is stored in the MVS scene or next to each image with '.mask.png' extension (<0 - disabled)")
("iters", boost::program_options::value(&nEstimationIters)->default_value(numIters), "number of patch-match iterations")
("geometric-iters", boost::program_options::value(&nEstimationGeometricIters)->default_value(2), "number of geometric consistent patch-match iterations (0 - disabled)")
("estimate-colors", boost::program_options::value(&nEstimateColors)->default_value(2), "estimate the colors for the dense point-cloud (0 - disabled, 1 - final, 2 - estimate)")
Expand Down
8 changes: 4 additions & 4 deletions libs/MVS/DepthMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ unsigned DepthData::DecRef()
// S T R U C T S ///////////////////////////////////////////////////

// try to load and apply mask to the depth map;
// the mask for each image is stored in the MVS scene or next to each image with '.mask.png' extension;
// the mask marks as false pixels that should be ignored
bool DepthEstimator::ImportIgnoreMask(const Image& image0, const Image8U::Size& size, BitMatrix& bmask, uint16_t nIgnoreMaskLabel)
{
ASSERT(image0.IsValid() && !image0.image.empty());
if (image0.maskName.empty())
return false;
const String maskFileName(image0.maskName.empty() ? Util::getFileFullName(image0.name)+".mask.png" : image0.maskName);
Image16U mask;
if (!mask.Load(image0.maskName)) {
DEBUG("warning: can not load the segmentation mask '%s'", image0.maskName.c_str());
if (!mask.Load(maskFileName)) {
DEBUG("warning: can not load the segmentation mask '%s'", maskFileName.c_str());
return false;
}
cv::resize(mask, mask, size, 0, 0, cv::INTER_NEAREST);
Expand Down

0 comments on commit 305b768

Please sign in to comment.