Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dense: check and resize the existed dmap file to image #1024

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions libs/MVS/SceneDensify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,14 @@ void Scene::DenseReconstructionEstimate(void* pData)
}
// try to load already compute depth-map for this image
if (depthmapComputed && data.nFusionMode >= 0) {
if (depthData.Load(ComposeDepthFilePath(depthData.GetView().GetID(), "dmap"))) {
thomas-19 marked this conversation as resolved.
Show resolved Hide resolved
DepthMap& depthMap = depthData.depthMap;
Image& image = images[idx];
if(image.width != static_cast<uint32_t>(depthMap.width()) || image.height != static_cast<uint32_t>(depthMap.height())){
thomas-19 marked this conversation as resolved.
Show resolved Hide resolved
cv::resize(depthMap, depthMap, cv::Size(image.width, image.height), 0, 0, cv::INTER_CUBIC);
thomas-19 marked this conversation as resolved.
Show resolved Hide resolved
depthData.Save(ComposeDepthFilePath(depthData.GetView().GetID(), "dmap"));
thomas-19 marked this conversation as resolved.
Show resolved Hide resolved
}
}
if (OPTDENSE::nOptimize & OPTDENSE::OPTIMIZE) {
if (!depthData.Load(ComposeDepthFilePath(depthData.GetView().GetID(), "dmap"))) {
VERBOSE("error: invalid depth-map '%s'", ComposeDepthFilePath(depthData.GetView().GetID(), "dmap").c_str());
Expand Down