Skip to content

Commit

Permalink
Merge pull request #1719 from alicevision/fix/minorChecks
Browse files Browse the repository at this point in the history
Minor checks and log
  • Loading branch information
cbentejac authored Jul 11, 2024
2 parents 8b49e84 + d185b85 commit 2958893
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/aliceVision/system/hardwareContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ namespace aliceVision {

void HardwareContext::displayHardware()
{
std::cout << "Hardware : " << std::endl;
ALICEVISION_LOG_INFO("Hardware:");

std::cout << "\tDetected core count : " << system::get_total_cpus() << std::endl;
ALICEVISION_LOG_INFO("\tDetected core count: " << system::get_total_cpus());

if (_maxUserCoresAvailable < std::numeric_limits<unsigned int>::max())
{
std::cout << "\tUser upper limit on core count : " << _maxUserCoresAvailable << std::endl;
ALICEVISION_LOG_INFO("\tUser upper limit on core count: " << _maxUserCoresAvailable);
}

std::cout << "\tOpenMP will use " << omp_get_max_threads() << " cores" << std::endl;
ALICEVISION_LOG_INFO("\tOpenMP will use " << omp_get_max_threads() << " cores");

auto meminfo = system::getMemoryInfo();

std::cout << "\tDetected available memory : " << meminfo.availableRam / (1024 * 1024) << " Mo" << std::endl;
ALICEVISION_LOG_INFO("\tDetected available memory: " << meminfo.availableRam / (1024 * 1024) << " Mo");

if (_maxUserMemoryAvailable < std::numeric_limits<size_t>::max())
{
std::cout << "\tUser upper limit on memory available : " << _maxUserMemoryAvailable / (1024 * 1024) << " Mo" << std::endl;
ALICEVISION_LOG_INFO("\tUser upper limit on memory available: " << _maxUserMemoryAvailable / (1024 * 1024) << " Mo");
}

std::cout << std::endl;
ALICEVISION_LOG_INFO("");
}

unsigned int HardwareContext::getMaxThreads() const
Expand Down Expand Up @@ -61,4 +61,4 @@ size_t HardwareContext::getMaxMemory() const
return ret;
}

} // namespace aliceVision
} // namespace aliceVision
10 changes: 9 additions & 1 deletion src/software/export/main_exportAnimatedCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ int aliceVision_main(int argc, char** argv)
image::readImage(view.getImage().getImagePath(), image, image::EImageColorSpace::LINEAR);
oiio::ParamValueList metadata = image::readImageMetadata(view.getImage().getImagePath());

if (cam->isValid() && cam->hasDistortion())
if (cam != nullptr && cam->isValid() && cam->hasDistortion())
{
// Undistort the image and save it
if (exportFullROD)
Expand Down Expand Up @@ -348,6 +348,14 @@ int aliceVision_main(int argc, char** argv)
}
else // No distortion
{
if(cam == nullptr)
{
ALICEVISION_LOG_ERROR("One camera intrinsic is undefined (intrinsic Id: " << view.getIntrinsicId() << ", view Id: " << view.getViewId() << ")");
}
else if(!cam->isValid())
{
ALICEVISION_LOG_ERROR("One camera intrinsic is not valid (intrinsic Id: " << view.getIntrinsicId() << ", view Id: " << view.getViewId() << ")");
}
// Copy the image since there is no distortion
image::writeImage(dstImage, image, image::ImageWriteOptions(), metadata);
}
Expand Down
5 changes: 5 additions & 0 deletions src/software/pipeline/main_incrementalSfM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ int aliceVision_main(int argc, char** argv)
sfmEngine.setMatches(&pairwiseMatches);

if (!sfmEngine.process())
{
ALICEVISION_LOG_ERROR("Failed to reconstruct.");
return EXIT_FAILURE;
}

// Mimic sfmTransform "EAlignmentMethod::AUTO"
if (useAutoTransform)
Expand All @@ -336,7 +339,9 @@ int aliceVision_main(int argc, char** argv)

// get the color for the 3D points
if (computeStructureColor)
{
sfmEngine.colorize();
}

sfmEngine.retrieveMarkersId();

Expand Down

0 comments on commit 2958893

Please sign in to comment.