MCPcopy Create free account
hub / github.com/alicevision/AliceVision / exportVolumeInformation

Method exportVolumeInformation

src/aliceVision/depthMap/Sgm.cpp:327–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327void Sgm::exportVolumeInformation(const Tile& tile,
328 const SgmDepthList& tileDepthList,
329 const CudaDeviceMemoryPitched<TSim, 3>& in_volume_dmp,
330 const std::string& name) const
331{
332 if (!_sgmParams.exportIntermediateVolumes && !_sgmParams.exportIntermediateCrossVolumes && !_sgmParams.exportIntermediateVolume9pCsv)
333 {
334 // nothing to do
335 return;
336 }
337
338 // get file tile begin indexes (default is single tile)
339 int tileBeginX = -1;
340 int tileBeginY = -1;
341
342 if (tile.nbTiles > 1)
343 {
344 tileBeginX = tile.roi.x.begin;
345 tileBeginY = tile.roi.y.begin;
346 }
347
348 // copy device similarity volume to host memory
349 CudaHostMemoryHeap<TSim, 3> volumeSim_hmh(in_volume_dmp.getSize());
350 volumeSim_hmh.copyFrom(in_volume_dmp);
351
352 if (_sgmParams.exportIntermediateVolumes)
353 {
354 ALICEVISION_LOG_INFO(tile << "Export similarity volume (" << name << ").");
355
356 const std::string volumePath = getFileNameFromIndex(_mp, tile.rc, mvsUtils::EFileType::volume, "_" + name, tileBeginX, tileBeginY);
357
358 exportSimilarityVolume(volumeSim_hmh, tileDepthList.getDepths(), _mp, tile.rc, _sgmParams, volumePath, tile.roi);
359
360 ALICEVISION_LOG_INFO(tile << "Export similarity volume (" << name << ") done.");
361 }
362
363 if (_sgmParams.exportIntermediateCrossVolumes)
364 {
365 ALICEVISION_LOG_INFO(tile << "Export similarity volume cross (" << name << ").");
366
367 const std::string volumeCrossPath = getFileNameFromIndex(_mp, tile.rc, mvsUtils::EFileType::volumeCross, "_" + name, tileBeginX, tileBeginY);
368
369 exportSimilarityVolumeCross(volumeSim_hmh, tileDepthList.getDepths(), _mp, tile.rc, _sgmParams, volumeCrossPath, tile.roi);
370
371 ALICEVISION_LOG_INFO(tile << "Export similarity volume cross (" << name << ") done.");
372 }
373
374 if (_sgmParams.exportIntermediateTopographicCutVolumes)
375 {
376 ALICEVISION_LOG_INFO(tile << "Export similarity volume topographic cut (" << name << ").");
377
378 const std::string volumeCutPath =
379 getFileNameFromIndex(_mp, tile.rc, mvsUtils::EFileType::volumeTopographicCut, "_" + name, tileBeginX, tileBeginY);
380
381 exportSimilarityVolumeTopographicCut(volumeSim_hmh, tileDepthList.getDepths(), _mp, tile.rc, _sgmParams, volumeCutPath, tile.roi);
382
383 ALICEVISION_LOG_INFO(tile << "Export similarity volume topographic cut (" << name << ") done.");
384 }

Callers

nothing calls this directly

Calls 7

getFileNameFromIndexFunction · 0.85
exportSimilarityVolumeFunction · 0.70
getSizeMethod · 0.45
copyFromMethod · 0.45

Tested by

no test coverage detected