Skip to content

Commit

Permalink
Improve doc, remove empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Jun 11, 2024
1 parent 91c8e0c commit e9e69f1
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/****************************************************************************
*
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2023 by Inria. All rights reserved.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -27,8 +26,7 @@
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*****************************************************************************/
*/

/*!
\example photometricMappingVisualServoing.cpp
Expand Down
10 changes: 4 additions & 6 deletions example/direct-visual-servoing/photometricVisualServoing.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/****************************************************************************
*
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2023 by Inria. All rights reserved.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -27,8 +26,7 @@
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*****************************************************************************/
*/

/*!
\example photometricVisualServoing.cpp
Expand Down Expand Up @@ -440,4 +438,4 @@ int main(int argc, const char **argv)
std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
return EXIT_SUCCESS;
#endif
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/****************************************************************************
*
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2023 by Inria. All rights reserved.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -27,8 +26,7 @@
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
*****************************************************************************/
*/

/*!
\example photometricVisualServoingWithoutVpServo.cpp
Expand Down Expand Up @@ -491,4 +489,4 @@ int main(int argc, const char **argv)
std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
return EXIT_SUCCESS;
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,14 @@ class VISP_EXPORT vpLuminanceMapping
*/
void setBorder(unsigned border) { m_border = border; }


static void imageAsVector(const vpImage<unsigned char> &I, vpColVector &Ivec, unsigned border);
static void imageAsMatrix(const vpImage<unsigned char> &I, vpMatrix &Imat, unsigned border);


protected:
unsigned m_mappingSize; //! Final vector size
unsigned m_border; //! Borders that were removed during raw photometric VS computation
};


/**
* \brief Implementation of \cite Marchand19a.
*
Expand All @@ -148,7 +145,6 @@ class VISP_EXPORT vpLuminanceMapping
class VISP_EXPORT vpLuminancePCA : public vpLuminanceMapping
{
public:

vpLuminancePCA() : vpLuminanceMapping(0), m_basis(nullptr), m_mean(nullptr), m_Ivec(0), m_Ih(0), m_Iw(0) { }

/**
Expand All @@ -165,7 +161,6 @@ class VISP_EXPORT vpLuminancePCA : public vpLuminanceMapping
*/
vpLuminancePCA(const vpLuminancePCA &other);


vpLuminancePCA &operator=(const vpLuminancePCA &other);

/**
Expand Down Expand Up @@ -224,6 +219,7 @@ class VISP_EXPORT vpLuminancePCA : public vpLuminanceMapping
* \throws if files cannot be read, or if basis and mean dimensions are incorrect.
*/
static vpLuminancePCA load(const std::string &basisFilename, const std::string &meanFileName, const std::string &explainedVarianceFile);

#ifdef VISP_HAVE_MODULE_IO
/**
* \brief Compute a new Principal Component Analysis on set of images, stored on disk.
Expand All @@ -238,6 +234,7 @@ class VISP_EXPORT vpLuminancePCA : public vpLuminanceMapping
*/
static vpLuminancePCA learn(const std::vector<std::string> &imageFiles, const unsigned int projectionSize, const unsigned int imageBorder = 0);
#endif

/**
* \brief Compute a new Principal Component Analysis on set of images.
*
Expand Down Expand Up @@ -279,7 +276,6 @@ class VISP_EXPORT vpLuminancePCA : public vpLuminanceMapping
class VISP_EXPORT vpLuminanceDCT : public vpLuminanceMapping
{
public:

/**
* \brief Helper class to iterate and get/set the values from a matrix, following a zigzag pattern.
*
Expand Down Expand Up @@ -321,7 +317,6 @@ class VISP_EXPORT vpLuminanceDCT : public vpLuminanceMapping
unsigned m_cols;
};


/**
* \brief Build a new DCT object
*
Expand All @@ -347,10 +342,8 @@ class VISP_EXPORT vpLuminanceDCT : public vpLuminanceMapping
*/
vpLuminanceDCT(const vpLuminanceDCT &other);


vpLuminanceDCT &operator=(const vpLuminanceDCT &other) = default;


void map(const vpImage<unsigned char> &I, vpColVector &s) vp_override;
void inverse(const vpColVector &s, vpImage<unsigned char> &I) vp_override;
void interaction(const vpImage<unsigned char> &I, const vpMatrix &LI, const vpColVector &s, vpMatrix &L) vp_override;
Expand All @@ -366,7 +359,6 @@ class VISP_EXPORT vpLuminanceDCT : public vpLuminanceMapping
vpMatrix m_Dcols, m_Drows; //! the computed DCT matrices. The separable property of DCt is used so that a 1D DCT is computed on rows and another on columns of the result of the first dct;
std::array<vpMatrix, 6> m_dIdrPlanes; //! Luminance interaction matrix, seen as six image planes
vpLuminanceDCT::vpMatrixZigZagIndex m_zigzag; //! zigzag indexing helper

};

/**
Expand All @@ -385,7 +377,6 @@ class VISP_EXPORT vpLuminanceDCT : public vpLuminanceMapping
class VISP_EXPORT vpFeatureLuminanceMapping : public vpBasicFeature
{
public:

vpFeatureLuminanceMapping(const vpCameraParameters &cam, unsigned int h, unsigned int w, double Z, const std::shared_ptr<vpLuminanceMapping> mapping);
vpFeatureLuminanceMapping(const vpFeatureLuminance &luminance, std::shared_ptr<vpLuminanceMapping> mapping);
void init() vp_override;
Expand All @@ -407,7 +398,6 @@ class VISP_EXPORT vpFeatureLuminanceMapping : public vpBasicFeature
unsigned int = 1) const vp_override
{ }


vpColVector error(const vpBasicFeature &s_star, unsigned int select = FEATURE_ALL) vp_override;
void error(const vpBasicFeature &s_star, vpColVector &e);

Expand All @@ -420,12 +410,10 @@ class VISP_EXPORT vpFeatureLuminanceMapping : public vpBasicFeature
std::shared_ptr<vpLuminanceMapping> &getMapping() { return m_mapping; }

private:

std::shared_ptr<vpLuminanceMapping> m_mapping;
vpFeatureLuminance m_featI;
vpMatrix m_LI; //! Photometric interaction matrix
vpImage<unsigned char> I;

};
END_VISP_NAMESPACE
#endif
Expand Down
18 changes: 5 additions & 13 deletions modules/visual_features/src/visual-feature/vpFeatureLuminance.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/****************************************************************************
*
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2023 by Inria. All rights reserved.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -30,8 +29,7 @@
*
* Description:
* Luminance feature.
*
*****************************************************************************/
*/

/*!
\file vpFeatureLuminance.cpp
Expand Down Expand Up @@ -112,7 +110,7 @@ vpFeatureLuminance::vpFeatureLuminance() : Z(1), nbr(0), nbc(0), bord(DEFAULT_BO
}

/*!
Copy constructor.
Copy constructor.
*/
vpFeatureLuminance::vpFeatureLuminance(const vpFeatureLuminance &f)
: vpBasicFeature(f), Z(1), nbr(0), nbc(0), bord(DEFAULT_BORDER), pixInfo(nullptr), firstTimeIn(0), cam()
Expand All @@ -121,7 +119,7 @@ vpFeatureLuminance::vpFeatureLuminance(const vpFeatureLuminance &f)
}

/*!
Copy operator.
Copy operator.
*/
vpFeatureLuminance &vpFeatureLuminance::operator=(const vpFeatureLuminance &f)
{
Expand Down Expand Up @@ -237,7 +235,6 @@ vpFeatureLuminance &vpFeatureLuminance::build(vpImage<unsigned char> &I)
}

/*!
Compute and return the interaction matrix \f$ L_I \f$. The computation is
made thanks to the values of the luminance features \f$ I \f$
*/
Expand Down Expand Up @@ -379,8 +376,3 @@ vpFeatureLuminance *vpFeatureLuminance::duplicate() const
}

END_VISP_NAMESPACE
/*
* Local variables:
* c-basic-offset: 2
* End:
*/
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ void vpLuminancePCA::init(const std::shared_ptr<vpMatrix> &basis, const std::sha
m_border = vpFeatureLuminance::DEFAULT_BORDER;
}


vpLuminancePCA::vpLuminancePCA(const vpLuminancePCA &other) : vpLuminanceMapping(other.m_mappingSize)
{
*this = other;
Expand Down Expand Up @@ -496,7 +495,6 @@ void vpLuminanceDCT::interaction(const vpImage<unsigned char> &, const vpMatrix
}
}


// Feature luminance mapping

vpFeatureLuminanceMapping::vpFeatureLuminanceMapping(const vpCameraParameters &cam,
Expand Down Expand Up @@ -541,7 +539,6 @@ void vpFeatureLuminanceMapping::init(const vpFeatureLuminance &luminance, std::s
s.resize(dim_s, true);
}


vpFeatureLuminanceMapping &vpFeatureLuminanceMapping::operator=(const vpFeatureLuminanceMapping &f)
{
dim_s = f.dim_s;
Expand All @@ -555,16 +552,13 @@ vpFeatureLuminanceMapping *vpFeatureLuminanceMapping::duplicate() const
return new vpFeatureLuminanceMapping(*this);
}


void vpFeatureLuminanceMapping::build(vpImage<unsigned char> &I)
{
m_featI.build(I);
m_featI.interaction(m_LI);
m_mapping->map(I, s);
}



vpColVector vpFeatureLuminanceMapping::error(const vpBasicFeature &s_star, unsigned int select)
{
if (select != FEATURE_ALL) {
Expand Down Expand Up @@ -599,7 +593,6 @@ void vpFeatureLuminanceMapping::interaction(vpMatrix &L)
m_mapping->interaction(I, m_LI, s, L);
}


void vpFeatureLuminanceMapping::print(unsigned int /*select*/) const
{
std::cout << s << std::endl;
Expand Down
39 changes: 38 additions & 1 deletion modules/visual_features/test/feature/testLuminanceMapping.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@

/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* See the file LICENSE.txt at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using ViSP with software that can not be combined with the GNU
* GPL, please contact Inria about acquiring a ViSP Professional
* Edition License.
*
* See https://visp.inria.fr for more information.
*
* This software was developed at:
* Inria Rennes - Bretagne Atlantique
* Campus Universitaire de Beaulieu
* 35042 Rennes Cedex
* France
*
* If you have questions regarding the use of this file, please contact
* Inria at [email protected]
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Description:
* Performs various tests on the point class.
*/

/*!
* \file testLuminanceMapping.cpp
* \example testLuminanceMapping.cpp
*/

#include <visp3/visual_features/vpFeatureLuminanceMapping.h>

#include <visp3/core/vpSubMatrix.h>
Expand All @@ -14,7 +52,6 @@
using namespace VISP_NAMESPACE_NAME;
#endif


vpMatrix orthogonalBasis(unsigned n, unsigned seed)
{
vpUniRand rand(seed);
Expand Down
15 changes: 7 additions & 8 deletions modules/visual_features/test/feature/testPoint.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/****************************************************************************
*
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2023 by Inria. All rights reserved.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -30,13 +29,13 @@
*
* Description:
* Performs various tests on the point class.
*
*****************************************************************************/
*/

/*!
\file testPoint.cpp
\brief Performs various tests on the the point class.
*/
* \file testPoint.cpp
* \example testPoint.cpp
* \brief Performs various tests on the the point class.
*/

#include <visp3/core/vpDebug.h>
#include <visp3/core/vpHomogeneousMatrix.h>
Expand Down

0 comments on commit e9e69f1

Please sign in to comment.