Skip to content

Commit

Permalink
[misc.] Fix "< " t "<"; " >" to ">"; "< <" to "<<"; "> >" to ">>"
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Oct 26, 2017
1 parent aa04012 commit e5e15b3
Show file tree
Hide file tree
Showing 106 changed files with 353 additions and 340 deletions.
2 changes: 1 addition & 1 deletion src/openMVG/cameras/Camera_Intrinsics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace cameras
/**
* @brief Struct used to force "clonability"
*/
template< typename T>
template<typename T>
struct Clonable
{
virtual T * clone() const = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static void Encode_histo_relation(
sRMat & A, Vec & C,
std::vector<linearProgramming::LP_Constraints::eLP_SIGN> & vec_sign,
std::vector<double> & vec_costs,
std::vector< std::pair<double,double> > & vec_bounds)
std::vector<std::pair<double,double>> & vec_bounds)
{
const size_t Nima = (size_t) nImage;
const size_t Nrelative = vec_relativeHistograms.size();
Expand Down Expand Up @@ -136,8 +136,8 @@ static void Encode_histo_relation(

//-- compute the two cumulated and normalized histogram

const std::vector< size_t > & vec_histoI = edge.histoI;
const std::vector< size_t > & vec_histoJ = edge.histoJ;
const std::vector<size_t> & vec_histoI = edge.histoI;
const std::vector<size_t> & vec_histoJ = edge.histoJ;

const size_t nBuckets = vec_histoI.size();

Expand Down Expand Up @@ -253,7 +253,7 @@ struct ConstraintBuilder_GainOffset
}
// Internal data
size_t _Nima;
const std::vector< relativeColorHistogramEdge > & _vec_relative;
const std::vector<relativeColorHistogramEdge> & _vec_relative;
const std::vector<size_t> & _vec_indexToFix;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class normal_distribution

TEST(ColorHarmonisation, Simple_offset) {

Histogram< double > histo( 0, 256, 255);
Histogram<double> histo( 0, 256, 255);
for (size_t i=0; i < 6000; i++)
{
histo.Add(normal_distribution(127, 10)());
Expand Down Expand Up @@ -100,8 +100,8 @@ TEST(ColorHarmonisation, Simple_offset) {

TEST(ColorHarmonisation, Offset_gain) {

Histogram< double > histo_ref( 0, 256, 255);
Histogram< double > histo_offset_gain( 0, 256, 255);
Histogram<double> histo_ref( 0, 256, 255);
Histogram<double> histo_offset_gain( 0, 256, 255);
const double GAIN = 3.0;
const double OFFSET = 160;
//const double GAIN = 2.0;
Expand Down Expand Up @@ -173,7 +173,7 @@ TEST(ColorHarmonisation, Offset_gain) {
jsxGraph.addYChart(histo_ref.GetHist(), "point");
jsxGraph.UnsuspendUpdate();
std::vector<double> xBin = histo_ref.GetXbinsValue();
std::pair< std::pair<double,double>, std::pair<double,double> > range = autoJSXGraphViewport<double>(xBin, histo_ref.GetHist());
const auto range = autoJSXGraphViewport<double>(xBin, histo_ref.GetHist());
jsxGraph.setViewport(range);
jsxGraph.close();
_htmlDocStream.pushInfo(jsxGraph.toStr());
Expand All @@ -185,7 +185,7 @@ TEST(ColorHarmonisation, Offset_gain) {
jsxGraph.addYChart(histo_offset_gain.GetHist(), "point");
jsxGraph.UnsuspendUpdate();
std::vector<double> xBin = histo_offset_gain.GetXbinsValue();
std::pair< std::pair<double,double>, std::pair<double,double> > range = autoJSXGraphViewport<double>(xBin, histo_offset_gain.GetHist());
const auto range = autoJSXGraphViewport<double>(xBin, histo_offset_gain.GetHist());
jsxGraph.setViewport(range);
jsxGraph.close();
_htmlDocStream.pushInfo(jsxGraph.toStr());
Expand Down
28 changes: 14 additions & 14 deletions src/openMVG/color_harmonization/selection_VLDSegment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class commonDataByPair_VLDSegment : public commonDataByPair
public:
commonDataByPair_VLDSegment( const std::string & sLeftImage,
const std::string & sRightImage,
const std::vector< matching::IndMatch >& vec_PutativeMatches,
const std::vector< features::SIOPointFeature >& vec_featsL,
const std::vector< features::SIOPointFeature >& vec_featsR):
const std::vector<matching::IndMatch>& vec_PutativeMatches,
const std::vector<features::SIOPointFeature >& vec_featsL,
const std::vector<features::SIOPointFeature >& vec_featsR):
commonDataByPair( sLeftImage, sRightImage ),
_vec_featsL( vec_featsL ), _vec_featsR( vec_featsR ),
_vec_PutativeMatches( vec_PutativeMatches )
Expand All @@ -43,31 +43,31 @@ class commonDataByPair_VLDSegment : public commonDataByPair
* \return True.
*/
bool computeMask(
image::Image< unsigned char > & maskLeft,
image::Image< unsigned char > & maskRight ) override
image::Image<unsigned char> & maskLeft,
image::Image<unsigned char> & maskRight ) override
{
std::vector< matching::IndMatch > vec_KVLDMatches;
std::vector<matching::IndMatch> vec_KVLDMatches;

image::Image< unsigned char > imageL, imageR;
image::Image<unsigned char> imageL, imageR;
image::ReadImage( _sLeftImage.c_str(), &imageL );
image::ReadImage( _sRightImage.c_str(), &imageR );

image::Image< float > imgA ( imageL.GetMat().cast< float >() );
image::Image< float > imgB(imageR.GetMat().cast< float >());
image::Image<float> imgA ( imageL.GetMat().cast<float>() );
image::Image<float> imgB(imageR.GetMat().cast<float>());

std::vector< Pair > matchesFiltered, matchesPair;
std::vector<Pair> matchesFiltered, matchesPair;

for (const auto & iter_match : _vec_PutativeMatches)
{
matchesPair.push_back( {iter_match.i_, iter_match.j_} );
}

std::vector< double > vec_score;
std::vector<double> vec_score;

//In order to illustrate the gvld(or vld)-consistant neighbors, the following two parameters has been externalized as inputs of the function KVLD.
openMVG::Mat E = openMVG::Mat::Ones( _vec_PutativeMatches.size(), _vec_PutativeMatches.size() ) * ( -1 );
// gvld-consistancy matrix, intitialized to -1, >0 consistancy value, -1=unknow, -2=false
std::vector< bool > valide( _vec_PutativeMatches.size(), true );// indices of match in the initial matches, if true at the end of KVLD, a match is kept.
std::vector<bool> valide( _vec_PutativeMatches.size(), true );// indices of match in the initial matches, if true at the end of KVLD, a match is kept.

size_t it_num = 0;
KvldParameters kvldparameters;//initial parameters of KVLD
Expand Down Expand Up @@ -110,9 +110,9 @@ class commonDataByPair_VLDSegment : public commonDataByPair

private:
// Left and Right features
std::vector< features::SIOPointFeature > _vec_featsL, _vec_featsR;
std::vector<features::SIOPointFeature > _vec_featsL, _vec_featsR;
// Left and Right corresponding index (putatives matches)
std::vector< matching::IndMatch > _vec_PutativeMatches;
std::vector<matching::IndMatch> _vec_PutativeMatches;
};

} // namespace color_harmonization
Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/color_harmonization/selection_fullFrame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class commonDataByPair_FullFrame : public commonDataByPair
*
* \return True.
*/
bool computeMask( image::Image< unsigned char > & maskLeft, image::Image< unsigned char > & maskRight ) override
bool computeMask( image::Image<unsigned char> & maskLeft, image::Image<unsigned char> & maskRight ) override
{
maskLeft.fill( image::WHITE );
maskRight.fill( image::WHITE );
Expand Down
8 changes: 4 additions & 4 deletions src/openMVG/color_harmonization/selection_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class commonDataByPair
*
* \return True if (mask not empty).
*/
virtual bool computeMask( image::Image< unsigned char > & maskLeft, image::Image< unsigned char > & maskRight ) = 0;
virtual bool computeMask( image::Image<unsigned char> & maskLeft, image::Image<unsigned char> & maskRight ) = 0;

/**
* Compute Histogram for the color's masked data
Expand All @@ -46,10 +46,10 @@ class commonDataByPair
* \param[out] histo Histogram of the left image.
*
*/
template< typename ImageType >
template<typename ImageType>
static void computeHisto(
Histogram< double > & histo,
const image::Image< unsigned char >& mask,
Histogram<double> & histo,
const image::Image<unsigned char>& mask,
size_t channelIndex,
const image::Image< ImageType >& image )
{
Expand Down
23 changes: 10 additions & 13 deletions src/openMVG/color_harmonization/selection_matchedPoints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class commonDataByPair_MatchedPoints : public commonDataByPair
public:
commonDataByPair_MatchedPoints(const std::string & sLeftImage,
const std::string & sRightImage,
const std::vector< matching::IndMatch >& vec_PutativeMatches,
const std::vector< features::SIOPointFeature >& vec_featsL,
const std::vector< features::SIOPointFeature >& vec_featsR,
const std::vector<matching::IndMatch>& vec_PutativeMatches,
const std::vector<features::SIOPointFeature>& vec_featsL,
const std::vector<features::SIOPointFeature>& vec_featsR,
const size_t radius = 1 ):
commonDataByPair( sLeftImage, sRightImage ),
_radius( radius ),
Expand All @@ -45,17 +45,14 @@ class commonDataByPair_MatchedPoints : public commonDataByPair
*
* \return True if some pixel have been set to true.
*/
bool computeMask( image::Image< unsigned char > & maskLeft, image::Image< unsigned char > & maskRight ) override
bool computeMask( image::Image<unsigned char> & maskLeft, image::Image<unsigned char> & maskRight ) override
{
maskLeft.fill(0);
maskRight.fill(0);
for (std::vector< matching::IndMatch >::const_iterator
iter_putativeMatches = _vec_PutativeMatches.begin();
iter_putativeMatches != _vec_PutativeMatches.end();
++iter_putativeMatches )
for (const auto & iter_matches : _vec_PutativeMatches)
{
const features::SIOPointFeature & L = _vec_featsL[ iter_putativeMatches->i_ ];
const features::SIOPointFeature & R = _vec_featsR[ iter_putativeMatches->j_ ];
const features::SIOPointFeature & L = _vec_featsL[ iter_matches.i_ ];
const features::SIOPointFeature & R = _vec_featsR[ iter_matches.j_ ];

image::FilledCircle( L.x(), L.y(), ( int )_radius, ( unsigned char ) 255, &maskLeft );
image::FilledCircle( R.x(), R.y(), ( int )_radius, ( unsigned char ) 255, &maskRight );
Expand All @@ -65,9 +62,9 @@ class commonDataByPair_MatchedPoints : public commonDataByPair

private:
size_t _radius;
std::vector< matching::IndMatch > _vec_PutativeMatches;
std::vector< features::SIOPointFeature > _vec_featsL;
std::vector< features::SIOPointFeature > _vec_featsR;
std::vector<matching::IndMatch> _vec_PutativeMatches;
std::vector<features::SIOPointFeature> _vec_featsL;
std::vector<features::SIOPointFeature> _vec_featsR;
};

} // namespace color_harmonization
Expand Down
14 changes: 7 additions & 7 deletions src/openMVG/features/akaze/AKAZE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ float AKAZE::ComputeAutomaticContrastFactor( const Image<float> & src , const fl
const float grad_max = grad.maxCoeff();

// Compute histogram
std::vector< size_t > histo( nb_bin, 0 );
std::vector<size_t> histo( nb_bin, 0 );

int nb_value = 0;

Expand Down Expand Up @@ -155,7 +155,7 @@ void AKAZE::ComputeAKAZESlice( const Image<float> & src , const int p , const in
ImagePeronaMalikG2DiffusionCoef( Lx , Ly , contrast_factor , diff );

// Compute FED cycles
std::vector< float > tau;
std::vector<float> tau;
FEDCycleTimings( total_cycle_time , 0.25f , tau );
ImageFEDCycle( in , diff , tau );
Li = in; // evolution image
Expand Down Expand Up @@ -249,16 +249,16 @@ void AKAZE::Compute_AKAZEScaleSpace()
str << "./" << "_oct_" << p << "_" << q << ".png";
Image<float> tmp = evo.cur;
convert_scale(tmp);
Image< unsigned char > tmp2 ((tmp*255).cast<unsigned char>());
Image<unsigned char> tmp2 ((tmp*255).cast<unsigned char>());
WriteImage( str.str().c_str() , tmp2 );
#endif // DEBUG_OCTAVE
}
}
}

void detectDuplicates(
std::vector<std::pair<AKAZEKeypoint, bool> > & previous,
std::vector<std::pair<AKAZEKeypoint, bool> > & current)
std::vector<std::pair<AKAZEKeypoint, bool>> & previous,
std::vector<std::pair<AKAZEKeypoint, bool>> & current)
{
// mark duplicates - using a full search algorithm
for (std::pair<AKAZEKeypoint, bool> & p1 : previous)
Expand All @@ -283,7 +283,7 @@ void detectDuplicates(

void AKAZE::Feature_Detection(std::vector<AKAZEKeypoint>& kpts) const
{
std::vector< std::vector< std::pair<AKAZEKeypoint, bool> > > vec_kpts_perSlice(options_.iNbOctave*options_.iNbSlicePerOctave);
std::vector<std::vector<std::pair<AKAZEKeypoint, bool>>> vec_kpts_perSlice(options_.iNbOctave*options_.iNbSlicePerOctave);

#ifdef OPENMVG_USE_OPENMP
#pragma omp parallel for schedule(dynamic)
Expand Down Expand Up @@ -346,7 +346,7 @@ void AKAZE::Feature_Detection(std::vector<AKAZEKeypoint>& kpts) const
// Keep only the one marked as not duplicated
for (size_t k = 0; k < vec_kpts_perSlice.size(); ++k)
{
const std::vector< std::pair<AKAZEKeypoint, bool> > & vec_kp = vec_kpts_perSlice[k];
const std::vector<std::pair<AKAZEKeypoint, bool>> & vec_kp = vec_kpts_perSlice[k];
for (size_t i = 0; i < vec_kp.size(); ++i)
if (!vec_kp[i].second)
kpts.emplace_back(vec_kp[i].first);
Expand Down
6 changes: 3 additions & 3 deletions src/openMVG/features/akaze/mldb_descriptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace features {
** @param mean_Lx mean of Lx in each subdivision
** @param mean_Ly mean of Ly in each subdivision
**/
template< typename Real>
template<typename Real>
static inline void ComputeMeanValuesInSubdivisions(
const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> & samples_Li ,
const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> & samples_Lx ,
Expand Down Expand Up @@ -106,7 +106,7 @@ namespace features {
** @param outIndex input/ouput index to store description
** @param desc ouput vector (idealy a std::bitset) containing binary description of theses regions
**/
template< typename DescriptorType , typename Real>
template<typename DescriptorType, typename Real>
static inline void ComputeBinaryValues(
const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> & mean_Li ,
const Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> & mean_Lx ,
Expand Down Expand Up @@ -143,7 +143,7 @@ namespace features {
** @param ipt Input interest point
** @param desc output descriptor (binary descriptor)
**/
template< typename Real>
template<typename Real>
void ComputeMLDBDescriptor(
const image::Image<Real> & Li,
const image::Image<Real> &Lx,
Expand Down
6 changes: 3 additions & 3 deletions src/openMVG/features/dipole/dipole_descriptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace features
dipoleF2(i) = sampler(image, yi, xi) - sampler(image, yii, xii);
}
// Normalize to be affine luminance invariant (a*I(x,y)+b).
Map< Vecf > dataMap( data, 20);
Map<Vecf> dataMap( data, 20);
dataMap.block<8,1>(0,0) = (A * dipoleF1).normalized();
dataMap.block<12,1>(8,0) = dipoleF2.normalized();
}
Expand Down Expand Up @@ -193,7 +193,7 @@ namespace features
sampler(image, yii3, xii3)) /3.0f;
}
// Normalize to be affine luminance invariant (a*I(x,y)+b).
Map< Vecf > dataMap( data, 20);
Map<Vecf> dataMap( data, 20);
dataMap.block<8,1>(0,0) = (A * dipoleF1).normalized();
dataMap.block<12,1>(8,0) = dipoleF2.normalized();
}
Expand All @@ -207,7 +207,7 @@ namespace features
** angular smoothed dipole
** @param magnif_factor Scaling factor used to rescale the dipole sampling
**/
template< typename Real>
template<typename Real>
void ComputeDipoleDescriptor
(
const image::Image<Real> & Li,
Expand Down
2 changes: 1 addition & 1 deletion src/openMVG/features/feature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static bool saveFeatsToFile(
}

/// Export point feature based vector to a matrix [(x,y)'T, (x,y)'T]
template< typename FeaturesT>
template<typename FeaturesT>
void PointsToMat(
const FeaturesT & vec_feats,
Mat& m)
Expand Down
10 changes: 5 additions & 5 deletions src/openMVG/features/mser/mser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ namespace openMVG
* @param img Input image
* @param[out] regions Output regions
*/
void MSERExtractor::Extract( const image::Image<unsigned char> & img , std::vector< MSERRegion > & regions ) const
void MSERExtractor::Extract( const image::Image<unsigned char> & img , std::vector<MSERRegion> & regions ) const
{
// Compute minimum and maximum region area relative to this image
const int minRegArea = img.Width() * img.Height() * m_minimum_area;
const int maxRegArea = img.Width() * img.Height() * m_maximum_area;

// List of processed pixels (maybe we can use a more efficient structure)
std::vector< std::vector< bool > > processed;
std::vector<std::vector<bool >> processed;
processed.resize( img.Width() );
for (int i = 0; i < img.Width(); ++i )
{
Expand All @@ -216,10 +216,10 @@ namespace openMVG
}

// Holds the boundary of given grayscale value (boundary[0] -> pixels in the boundary with 0 grayscale value)
std::vector< PixelStackElt > boundary[ 256 ];
std::vector<PixelStackElt> boundary[ 256 ];

// List of regions computed so far (not only valid MSER regions)
std::vector< MSERRegion * > regionStack;
std::vector<MSERRegion *> regionStack;

// Push en empty region
regionStack.push_back( new MSERRegion );
Expand Down Expand Up @@ -343,7 +343,7 @@ namespace openMVG
* @param pixel_x X-coord of the base of the merged region
* @param pixel_y Y-coord of the base of the merged region
*/
void MSERExtractor::ProcessStack( const int nextLevel , const int pixel_x , const int pixel_y , std::vector< MSERRegion * > & regionStack ) const
void MSERExtractor::ProcessStack( const int nextLevel , const int pixel_x , const int pixel_y , std::vector<MSERRegion * > & regionStack ) const
{
do
{
Expand Down
Loading

0 comments on commit e5e15b3

Please sign in to comment.