Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 2 additions & 3 deletions src/aliceVision/hdr/LaguerreBACalibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <ceres/ceres.h>

#include <utility>
#include <iostream>
#include <cassert>
#include <numeric>

Expand Down Expand Up @@ -242,14 +241,14 @@ void LaguerreBACalibration::process(const std::vector<std::vector<ImageSample>>&
ceres::Solver::Summary summary;
ceres::Solve(solverOptions, &problem, &summary);

std::cout << summary.FullReport() << std::endl;
ALICEVISION_LOG_DEBUG(summary.FullReport());

for (unsigned int channel = 0; channel < 3; ++channel)
{
std::vector<float>& curve = response.getCurve(channel);
const double step = 1.0 / double(curve.size());

std::cout << laguerreParam[channel] << std::endl;
ALICEVISION_LOG_DEBUG("Laguerre parameter[" << channel << "]: " << laguerreParam[channel]);
for (unsigned int i = 0; i < curve.size(); ++i)
{
curve[i] = laguerreFunctionInv(laguerreParam[channel], i * step);
Expand Down
3 changes: 2 additions & 1 deletion src/aliceVision/lightingEstimation/lightingCalibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <aliceVision/photometricStereo/photometricDataIO.hpp>

#include <aliceVision/sfmDataIO/sfmDataIO.hpp>
#include <aliceVision/system/Logger.hpp>

#include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp>
Expand Down Expand Up @@ -53,7 +54,7 @@ void lightCalibration(const sfmData::SfMData& sfmData,

if (currentMetadata.find("Exif:DateTimeDigitized") == currentMetadata.end())
{
std::cout << "No metadata case" << std::endl;
ALICEVISION_LOG_DEBUG("No metadata case: Exif:DateTimeDigitized is missing.");
viewMap[sfmData.getView(viewIt.first).getImage().getImagePath()] = sfmData.getView(viewIt.first);
}
else
Expand Down
5 changes: 3 additions & 2 deletions src/aliceVision/matching/kvld/kvld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <numeric>
#include <aliceVision/image/Image.hpp>
#include <aliceVision/config.hpp>
#include <aliceVision/system/Logger.hpp>

using namespace aliceVision;
using namespace aliceVision::image;
Expand Down Expand Up @@ -218,15 +219,15 @@ float KVLD(const Image<float>& I1,
ImageScale Chaine1(I1);
ImageScale Chaine2(I2);

std::cout << "Image scale-space complete..." << std::endl;
ALICEVISION_LOG_INFO("Image scale-space complete...");

const float range1 = getRange(I1, std::min(F1.size(), matches.size()), kvldParameters.inlierRate);
const float range2 = getRange(I2, std::min(F2.size(), matches.size()), kvldParameters.inlierRate);

const size_t size = matches.size();

//================distance map construction, foruse of selecting neighbors===============//
std::cout << "computing distance maps" << std::endl;
ALICEVISION_LOG_INFO("Computing distance maps...");

bool bPrecomputedDist = false;

Expand Down
4 changes: 2 additions & 2 deletions src/aliceVision/matchingImageCollection/GeometricFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void robustModelEstimation(PairwiseMatches& out_geometricMatches,
{
out_geometricMatches.clear();

auto progressDisplay = system::createConsoleProgressDisplay(putativeMatches.size(), std::cout, "Robust Model Estimation\n");
auto progressDisplay = system::createConsoleProgressDisplay(putativeMatches.size(), "Robust Model Estimation\n");

#pragma omp parallel for schedule(dynamic)
for (int i = 0; i < (int)putativeMatches.size(); ++i)
Expand Down Expand Up @@ -109,7 +109,7 @@ void robustModelEstimation(PairwiseGeometricInfo& out_geometricInfos,
{
out_geometricInfos.clear();

auto progressDisplay = system::createConsoleProgressDisplay(putativeMatches.size(), std::cout, "Robust Model Estimation\n");
auto progressDisplay = system::createConsoleProgressDisplay(putativeMatches.size(), "Robust Model Estimation\n");

#pragma omp parallel for schedule(dynamic)
for (int i = 0; i < (int)putativeMatches.size(); ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void Match(std::mt19937& gen,
PairwiseMatches& map_PutativesMatches // the pairwise photometric corresponding points
)
{
auto progressDisplay = system::createConsoleProgressDisplay(pairs.size(), std::cout);
auto progressDisplay = system::createConsoleProgressDisplay(pairs.size());

// Collect used view indexes
std::set<IndexT> used_index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void ImageCollectionMatcher_generic::Match(std::mt19937& randomNumberGenerator,
const bool b_multithreaded_pair_search = (_matcherType == CASCADE_HASHING_L2);
// -> set to true for CASCADE_HASHING_L2, since OpenMP instructions are not used in this matcher

auto progressDisplay = system::createConsoleProgressDisplay(pairs.size(), std::cout);
auto progressDisplay = system::createConsoleProgressDisplay(pairs.size());

// Sort pairs according the first index to minimize the MatcherT build operations
typedef std::map<size_t, std::vector<size_t>> Map_vectorT;
Expand Down
7 changes: 4 additions & 3 deletions src/aliceVision/mvsData/Matrix3x4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <aliceVision/mvsData/Matrix3x3.hpp>
#include <aliceVision/mvsData/Point3d.hpp>
#include <aliceVision/mvsData/StaticVector.hpp>
#include <aliceVision/system/Logger.hpp>

namespace aliceVision {

Expand Down Expand Up @@ -90,9 +91,9 @@ class Matrix3x4
}
else
{
std::cout << m11 << m12 << m13 << m14 << std::endl;
std::cout << m21 << m22 << m23 << m24 << std::endl;
std::cout << m31 << m32 << m33 << m34 << std::endl;
ALICEVISION_LOG_ERROR(m11 << " " << m12 << " " << m13 << " " << m14);
ALICEVISION_LOG_ERROR(m21 << " " << m22 << " " << m23 << " " << m24);
ALICEVISION_LOG_ERROR(m31 << " " << m32 << " " << m33 << " " << m34);
throw std::runtime_error("Matrix3x4::decomposeProjectionMatrix: affine camera.");
}

Expand Down
4 changes: 2 additions & 2 deletions src/aliceVision/photometricStereo/normalIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <aliceVision/camera/Pinhole.hpp>
#include <aliceVision/numeric/projection.hpp>
#include <aliceVision/numeric/numeric.hpp>
#include <aliceVision/system/Logger.hpp>

#include <iostream>
#include <sstream>
#include <fstream>
#include <algorithm>
Expand Down Expand Up @@ -597,7 +597,7 @@ void smoothIntegration(const image::Image<image::RGBfColor>& normals,
const image::Image<float>& z0,
const image::Image<float>& maskZ0)
{
std::cout << "WIP" << std::endl;
ALICEVISION_LOG_INFO("WIP: frankot_chellappa with calibration not yet implemented.");
}

void convertZtoDistance(const aliceVision::image::Image<float>& zMap, aliceVision::image::Image<float>& distanceMap, const Eigen::Matrix3f& K)
Expand Down
2 changes: 1 addition & 1 deletion src/aliceVision/sfm/FrustumFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ PairSet FrustumFilter::getFrustumIntersectionPairs() const
std::transform(z_near_z_far_perView.begin(), z_near_z_far_perView.end(), std::back_inserter(viewIds), stl::RetrieveKey());

auto progressDisplay =
system::createConsoleProgressDisplay(viewIds.size() * (viewIds.size() - 1) / 2, std::cout, "\nCompute frustum intersection\n");
system::createConsoleProgressDisplay(viewIds.size() * (viewIds.size() - 1) / 2, "\nCompute frustum intersection\n");

// Exhaustive comparison (use the fact that the intersect function is symmetric)
#pragma omp parallel for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void GlobalSfMTranslationAveragingSolver::computePutativeTranslationEdgesCoverag
aliceVision::sfm::MutexSet<myEdge> mMutexSet;

auto progressDisplay =
system::createConsoleProgressDisplay(vecEdges.size(), std::cout, "\nRelative translations computation (edge coverage algorithm)\n");
system::createConsoleProgressDisplay(vecEdges.size(), "\nRelative translations computation (edge coverage algorithm)\n");

// set number of threads, 1 if openMP is not enabled
std::vector<translationAveraging::RelativeInfoVec> initialEstimates(omp_get_max_threads());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ void ReconstructionEngine_globalSfM::computeRelativeRotations(rotationAveraging:
poseWiseMatches[Pair(v1->getPoseId(), v2->getPoseId())].insert(pair);
}

auto progressDisplay = system::createConsoleProgressDisplay(poseWiseMatches.size(), std::cout, "\n- Relative pose computation -\n");
auto progressDisplay = system::createConsoleProgressDisplay(poseWiseMatches.size(), "\n- Relative pose computation -\n");
#pragma omp parallel for schedule(dynamic)
// Compute the relative pose from pairwise point matches:
for (int i = 0; i < poseWiseMatches.size(); ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bool GlobalPositioning::process(sfmData::SfMData & sfmData, std::mt19937 & gener
ceres::Solver::Summary summary;
ceres::Solve(options, &problem, &summary);

std::cout << summary.FullReport() << std::endl;
ALICEVISION_LOG_DEBUG(summary.FullReport());

if (!summary.IsSolutionUsable())
{
Expand Down
4 changes: 2 additions & 2 deletions src/aliceVision/sfm/pipeline/regionsIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ bool loadRegionsPerView(feature::RegionsPerView& regionsPerView,
featuresFolders.erase(last, featuresFolders.end());

auto progressDisplay =
system::createConsoleProgressDisplay(sfmData.getViews().size() * imageDescriberTypes.size(), std::cout, "Loading regions\n");
system::createConsoleProgressDisplay(sfmData.getViews().size() * imageDescriberTypes.size(), "Loading regions\n");

std::atomic_bool invalid(false);

Expand Down Expand Up @@ -268,7 +268,7 @@ bool loadFeaturesPerView(feature::FeaturesPerView& featuresPerView,
for (auto it = featuresFolders.begin(); it != featuresFolders.end(); ++it)
ALICEVISION_LOG_DEBUG("\t - " << *it);

auto progressDisplay = system::createConsoleProgressDisplay(sfmData.getViews().size(), std::cout, "Loading features\n");
auto progressDisplay = system::createConsoleProgressDisplay(sfmData.getViews().size(), "Loading features\n");

// read for each view the corresponding features and store them as PointFeatures
std::atomic_bool invalid(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ bool ReconstructionEngine_sequentialSfM::getBestInitialImagePairs(std::vector<Pa
bestImagePairs.reserve(_pairwiseMatches->size());

// Compute the relative pose & the 'baseline score'
auto progressDisplay = system::createConsoleProgressDisplay(_pairwiseMatches->size(), std::cout, "Automatic selection of an initial pair:\n");
auto progressDisplay = system::createConsoleProgressDisplay(_pairwiseMatches->size(), "Automatic selection of an initial pair:\n");

#pragma omp parallel for schedule(dynamic)
for (int i = 0; i < _pairwiseMatches->size(); ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void StructureEstimationFromKnownPoses::match(const SfMData& sfmData,
const feature::RegionsPerView& regionsPerView,
double geometricErrorMax)
{
auto progressDisplay = system::createConsoleProgressDisplay(pairs.size(), std::cout, "Compute pairwise fundamental guided matching:\n");
auto progressDisplay = system::createConsoleProgressDisplay(pairs.size(), "Compute pairwise fundamental guided matching:\n");

#pragma omp parallel
for (PairSet::const_iterator it = pairs.begin(); it != pairs.end(); ++it)
Expand Down Expand Up @@ -174,7 +174,7 @@ void StructureEstimationFromKnownPoses::filter(const SfMData& sfmData, const Pai
const Triplets triplets = graph::tripletListing(pairs);

auto progressDisplay =
system::createConsoleProgressDisplay(triplets.size(), std::cout, "Per triplet tracks validation (discard spurious correspondences):\n");
system::createConsoleProgressDisplay(triplets.size(), "Per triplet tracks validation (discard spurious correspondences):\n");
#pragma omp parallel
for (Triplets::const_iterator it = triplets.begin(); it != triplets.end(); ++it)
{
Expand Down
4 changes: 2 additions & 2 deletions src/aliceVision/sfm/sfmTriangulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void StructureComputationBlind::triangulate(sfmData::SfMData& sfmData, std::mt19
std::deque<IndexT> rejectedId;
system::ProgressDisplay progressDisplay;
if (_bConsoleVerbose)
progressDisplay = system::createConsoleProgressDisplay(sfmData.getLandmarks().size(), std::cout, "Blind triangulation progress:\n");
progressDisplay = system::createConsoleProgressDisplay(sfmData.getLandmarks().size(), "Blind triangulation progress:\n");

#pragma omp parallel
for (sfmData::Landmarks::iterator iterTracks = sfmData.getLandmarks().begin(); iterTracks != sfmData.getLandmarks().end(); ++iterTracks)
Expand Down Expand Up @@ -118,7 +118,7 @@ void StructureComputationRobust::robustTriangulation(sfmData::SfMData& sfmData,

system::ProgressDisplay progressDisplay;
if (_bConsoleVerbose)
progressDisplay = system::createConsoleProgressDisplay(sfmData.getLandmarks().size(), std::cout, "Robust triangulation progress:\n");
progressDisplay = system::createConsoleProgressDisplay(sfmData.getLandmarks().size(), "Robust triangulation progress:\n");

#pragma omp parallel
for (sfmData::Landmarks::iterator iterTracks = sfmData.getLandmarks().begin(); iterTracks != sfmData.getLandmarks().end(); ++iterTracks)
Expand Down
4 changes: 2 additions & 2 deletions src/aliceVision/sfm/utils/alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ bool computeSimilarityFromCommonLandmarks(const sfmData::SfMData& sfmDataA,

if (!aliceVision::geometry::ACRansac_FindRTS(xA, xB, randomNumberGenerator, S, t, R, inliers, true))
{
std::cout << "merde" << std::endl;
ALICEVISION_LOG_DEBUG("Failed to compute similarity transform from markers.");
return false;
}

Expand Down Expand Up @@ -644,7 +644,7 @@ bool computeSimilarityFromPairs(const std::vector<Vec3> & ptsA,

if (!aliceVision::geometry::ACRansac_FindRTS(xA, xB, randomNumberGenerator, S, t, R, inliers, true))
{
std::cout << "merde" << std::endl;
ALICEVISION_LOG_DEBUG("Failed to compute similarity transform from point pairs.");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/aliceVision/sfmData/colorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace sfmData {

void colorizeTracks(SfMData& sfmData)
{
auto progressDisplay = system::createConsoleProgressDisplay(sfmData.getLandmarks().size(), std::cout, "\nCompute scene structure color\n");
auto progressDisplay = system::createConsoleProgressDisplay(sfmData.getLandmarks().size(), "\nCompute scene structure color\n");

std::vector<std::reference_wrapper<Landmark>> remainingLandmarksToColor;
remainingLandmarksToColor.reserve(sfmData.getLandmarks().size());
Expand Down
9 changes: 9 additions & 0 deletions src/aliceVision/system/ProgressDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "ProgressDisplay.hpp"
#include <boost/timer/progress_display.hpp>
#include <iostream>
#include <mutex>

namespace aliceVision {
Expand Down Expand Up @@ -70,5 +71,13 @@ ProgressDisplay createConsoleProgressDisplay(unsigned long expectedCount,
return ProgressDisplay(impl);
}

ProgressDisplay createConsoleProgressDisplay(unsigned long expectedCount,
const std::string& s1,
const std::string& s2,
const std::string& s3)
{
return createConsoleProgressDisplay(expectedCount, std::cout, s1, s2, s3);
}

} // namespace system
} // namespace aliceVision
8 changes: 7 additions & 1 deletion src/aliceVision/system/ProgressDisplay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,18 @@ class ProgressDisplay
std::shared_ptr<ProgressDisplayImpl> _impl;
};

/// Creates console-based progress bar
/// Creates console-based progress bar (output to the given stream)
ProgressDisplay createConsoleProgressDisplay(unsigned long expectedCount,
std::ostream& os,
const std::string& s1 = "\n", // leading strings
const std::string& s2 = "",
const std::string& s3 = "");

/// Creates console-based progress bar (output to stdout)
ProgressDisplay createConsoleProgressDisplay(unsigned long expectedCount,
const std::string& s1 = "\n", // leading strings
const std::string& s2 = "",
const std::string& s3 = "");

} // namespace system
} // namespace aliceVision
2 changes: 1 addition & 1 deletion src/aliceVision/voctree/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void Database::sanityCheck(std::size_t N, std::map<std::size_t, DocMatches>& mat
matches.clear();
// since we already know the size of the vectors, in order to parallelize the
// query allocate the whole memory
auto display = system::createConsoleProgressDisplay(database_.size(), std::cout);
auto display = system::createConsoleProgressDisplay(database_.size());

// #pragma omp parallel for default(none) shared(database_)
for (const auto& doc : database_)
Expand Down
13 changes: 6 additions & 7 deletions src/software/utils/precisionEvaluationToGt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <aliceVision/numeric/BoxStats.hpp>

#include <aliceVision/utils/Histogram.hpp>
#include <aliceVision/system/Logger.hpp>
#include <dependencies/htmlDoc/htmlDoc.hpp>
#include <dependencies/vectorGraphics/svgDrawer.hpp>

Expand Down Expand Up @@ -129,10 +130,8 @@ inline void EvaluteToGT(const std::vector<Vec3>& vec_camCenterGT,

computeSimilarity(vec_camCenterGT, vec_camCenterComputed, randomNumberGenerator, vec_camPosComputed_T, &scale, &R, &t);

std::cout << "\nEstimated similarity transformation between the sequences\n";
std::cout << "R\n" << R << std::endl;
std::cout << "t\n" << t << std::endl;
std::cout << "scale\n" << scale << std::endl;
ALICEVISION_LOG_INFO("Estimated similarity transformation between the sequences\n"
<< "R\n" << R << "\nt\n" << t << "\nscale\n" << scale);

// Compute statistics and export them
// -a. distance between camera center
Expand All @@ -149,7 +148,7 @@ inline void EvaluteToGT(const std::vector<Vec3>& vec_camCenterGT,
trajectoryLength += (vec_camCenterGT[i] - vec_camCenterGT[i + 1]).norm();
}

std::cout << std::endl << "\nTrajectory length: " << trajectoryLength;
ALICEVISION_LOG_INFO("Trajectory length: " << trajectoryLength);

// -b. angle between rotation matrix
std::vector<double> vec_angularErrors;
Expand All @@ -172,10 +171,10 @@ inline void EvaluteToGT(const std::vector<Vec3>& vec_camCenterGT,
// copy(vec_angularErrors.begin(), vec_angularErrors.end(), std::ostream_iterator<double>(std::cout, " , "));

BoxStats<double> statsBaseline(vec_baselineErrors.begin(), vec_baselineErrors.end());
std::cout << std::endl << "\nBaseline error statistics:\n" << statsBaseline;
ALICEVISION_LOG_INFO("Baseline error statistics:\n" << statsBaseline);

BoxStats<double> statsAngular(vec_angularErrors.begin(), vec_angularErrors.end());
std::cout << std::endl << "\nAngular error statistics:\n" << statsAngular;
ALICEVISION_LOG_INFO("Angular error statistics:\n" << statsAngular);

// Export camera position (viewable)
exportToPly(vec_camCenterGT, vec_camPosComputed_T, (fs::path(sOutPath) / "camera_Registered.ply").string());
Expand Down
Loading
Loading