Skip to content

Commit

Permalink
[build] sanitize
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Sep 14, 2016
1 parent 114888f commit 2274bd1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/nonFree/sift/vl/sift.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ Gaussian window size is set to have standard deviation
**/

VL_INLINE double
fast_expn (VlSiftFilt * filter, double x)
fast_expn (VlSiftFilt const * filter, double x)
{
double a,b,r ;
int i ;
Expand Down
12 changes: 10 additions & 2 deletions src/openMVG/multiview/solver_homography_kernel_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ TEST(HomographyKernelTest, Fitting_Unnormalized) {

size_t samples_[5]={0,1,2,3,4};
vector<size_t> samples(samples_,samples_+5);
for (Mat::Index j = 4; samples.size() < x.cols(); samples.push_back(j++)) {
for (
Mat::Index j = 4;
static_cast<Mat::Index>(samples.size()) < x.cols();
samples.push_back(j++))
{
vector<Mat3> Hs;
kernel.Fit(samples, &Hs);
CHECK_EQUAL(1, Hs.size());
Expand Down Expand Up @@ -97,7 +101,11 @@ TEST(HomographyKernelTest, Fitting_Normalized) {

size_t samples_[5]={0,1,2,3,4};
vector<size_t> samples(samples_,samples_+5);
for (Mat::Index j = 4; samples.size() < x.cols(); samples.push_back(j++)) {
for (
Mat::Index j = 4;
static_cast<Mat::Index>(samples.size()) < x.cols();
samples.push_back(j++))
{
vector<Mat3> Hs;
kernel.Fit(samples, &Hs);
CHECK_EQUAL(1, Hs.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ class TranslationTripletKernel_ACRansac
typedef SolverArg Solver;
typedef ModelArg Model;

TranslationTripletKernel_ACRansac
TranslationTripletKernel_ACRansac
(
const Mat & x1,
const Mat & x2,
const Mat & x1,
const Mat & x2,
const Mat & x3,
const std::vector<Mat3> & vec_KRi,
const std::vector<Mat3> & vec_KRi,
const Mat3 & K,
const double ThresholdUpperBound
const double ThresholdUpperBound
)
: x1_(x1), x2_(x2), x3_(x3),
vec_KR_(vec_KRi),
Kinv_(K.inverse()),
K_(K),
logalpha0_(log10(M_PI)),
ThresholdUpperBound_(ThresholdUpperBound)
: x1_(x1), x2_(x2), x3_(x3),
Kinv_(K.inverse()),
K_(K),
logalpha0_(log10(M_PI)),
ThresholdUpperBound_(ThresholdUpperBound),
vec_KR_(vec_KRi)
{
// Normalize points by inverse(K)
ApplyTransformationToPoints(x1_, Kinv_, &x1n_);
ApplyTransformationToPoints(x2_, Kinv_, &x2n_);
ApplyTransformationToPoints(x3_, Kinv_, &x3n_);

vec_KR_[0] = Kinv_ * vec_KR_[0];
vec_KR_[1] = Kinv_ * vec_KR_[1];
vec_KR_[2] = Kinv_ * vec_KR_[2];
vec_KR_[0] *= Kinv_;
vec_KR_[1] *= Kinv_;
vec_KR_[2] *= Kinv_;
}

enum { MINIMUM_SAMPLES = Solver::MINIMUM_SAMPLES };
Expand Down
12 changes: 6 additions & 6 deletions src/software/SfMViewer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void key(GLFWwindow* window, int k, int scancode, int action, int mod)
break;
case GLFW_KEY_RIGHT:
++current_cam;
if (current_cam >= vec_cameras.size()) {
if (current_cam >= static_cast<int>(vec_cameras.size())) {
current_cam = 0;
}
break;
Expand Down Expand Up @@ -238,7 +238,7 @@ static void draw(void)

glDisable(GL_CULL_FACE);

for (size_t i_cam=0; i_cam < vec_cameras.size(); ++i_cam)
for (int i_cam=0; i_cam < static_cast<int>(vec_cameras.size()); ++i_cam)
{
const View * view = sfm_data.GetViews().at(vec_cameras[i_cam]).get();
const Pose3 pose = sfm_data.GetPoseOrDie(view);
Expand Down Expand Up @@ -279,10 +279,10 @@ static void draw(void)
// use principal point to adjust image center
const Vec2 pp = camPinhole->principal_point();

Vec3 c1( -pp[0]/focal * normalized_focal, (-pp[1]+h)/focal * normalized_focal, normalized_focal);
Vec3 c2((-pp[0]+w)/focal * normalized_focal, (-pp[1]+h)/focal * normalized_focal, normalized_focal);
Vec3 c3((-pp[0]+w)/focal * normalized_focal, -pp[1]/focal * normalized_focal, normalized_focal);
Vec3 c4( -pp[0]/focal * normalized_focal, -pp[1]/focal * normalized_focal, normalized_focal);
const Vec3 c1( -pp[0]/focal * normalized_focal, (-pp[1]+h)/focal * normalized_focal, normalized_focal);
const Vec3 c2((-pp[0]+w)/focal * normalized_focal, (-pp[1]+h)/focal * normalized_focal, normalized_focal);
const Vec3 c3((-pp[0]+w)/focal * normalized_focal, -pp[1]/focal * normalized_focal, normalized_focal);
const Vec3 c4( -pp[0]/focal * normalized_focal, -pp[1]/focal * normalized_focal, normalized_focal);

// 2. Draw thumbnail
if (i_cam == current_cam)
Expand Down
14 changes: 9 additions & 5 deletions src/software/colorHarmonize/colorHarmonizeEngineGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ ColorHarmonizationEngineGlobal::ColorHarmonizationEngineGlobal(
const string & sOutDirectory,
const int selectionMethod,
const int imgRef):
_sSfM_Data_Path(sSfM_Data_Filename),
_sMatchesPath(sMatchesPath),
_sOutDirectory(sOutDirectory),
_selectionMethod( selectionMethod ),
_imgRef( imgRef ),
_sMatchesFile(sMatchesFile)
_sMatchesFile(sMatchesFile),
_sSfM_Data_Path(sSfM_Data_Filename),
_sMatchesPath(sMatchesPath),
_sOutDirectory(sOutDirectory)
{
if( !stlplus::folder_exists( sOutDirectory ) )
{
Expand Down Expand Up @@ -146,7 +146,11 @@ bool ColorHarmonizationEngineGlobal::Process()
{
cout << "id: " << i << "\t" << _vec_fileNames[ i ] << endl;
}
}while( !( cin >> _imgRef ) || _imgRef < 0 || _imgRef >= _vec_fileNames.size() );
}
while (
!( cin >> _imgRef )
|| _imgRef < 0
|| _imgRef >= static_cast<int>(_vec_fileNames.size()) );
}

//Choose selection method
Expand Down

0 comments on commit 2274bd1

Please sign in to comment.