From e9e69f18a807634c2422242be55e25692aa50166 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 11 Jun 2024 16:54:38 +0200 Subject: [PATCH] Improve doc, remove empty lines --- .../photometricMappingVisualServoing.cpp | 8 ++-- .../photometricVisualServoing.cpp | 10 ++--- ...hotometricVisualServoingWithoutVpServo.cpp | 10 ++--- .../vpFeatureLuminanceMapping.h | 16 +------- .../src/visual-feature/vpFeatureLuminance.cpp | 18 +++------ .../vpFeatureLuminanceMapping.cpp | 7 ---- .../test/feature/testLuminanceMapping.cpp | 39 ++++++++++++++++++- .../test/feature/testPoint.cpp | 15 ++++--- 8 files changed, 63 insertions(+), 60 deletions(-) diff --git a/example/direct-visual-servoing/photometricMappingVisualServoing.cpp b/example/direct-visual-servoing/photometricMappingVisualServoing.cpp index f116f24975..7e50556f0c 100644 --- a/example/direct-visual-servoing/photometricMappingVisualServoing.cpp +++ b/example/direct-visual-servoing/photometricMappingVisualServoing.cpp @@ -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 @@ -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 diff --git a/example/direct-visual-servoing/photometricVisualServoing.cpp b/example/direct-visual-servoing/photometricVisualServoing.cpp index ff189bed98..728aec0a2f 100644 --- a/example/direct-visual-servoing/photometricVisualServoing.cpp +++ b/example/direct-visual-servoing/photometricVisualServoing.cpp @@ -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 @@ -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 @@ -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 - } +} diff --git a/example/direct-visual-servoing/photometricVisualServoingWithoutVpServo.cpp b/example/direct-visual-servoing/photometricVisualServoingWithoutVpServo.cpp index 023bf73a84..c0be3a104b 100644 --- a/example/direct-visual-servoing/photometricVisualServoingWithoutVpServo.cpp +++ b/example/direct-visual-servoing/photometricVisualServoingWithoutVpServo.cpp @@ -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 @@ -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 @@ -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 - } +} diff --git a/modules/visual_features/include/visp3/visual_features/vpFeatureLuminanceMapping.h b/modules/visual_features/include/visp3/visual_features/vpFeatureLuminanceMapping.h index e9cb48505e..ae7573bcc5 100644 --- a/modules/visual_features/include/visp3/visual_features/vpFeatureLuminanceMapping.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureLuminanceMapping.h @@ -116,17 +116,14 @@ class VISP_EXPORT vpLuminanceMapping */ void setBorder(unsigned border) { m_border = border; } - static void imageAsVector(const vpImage &I, vpColVector &Ivec, unsigned border); static void imageAsMatrix(const vpImage &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. * @@ -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) { } /** @@ -165,7 +161,6 @@ class VISP_EXPORT vpLuminancePCA : public vpLuminanceMapping */ vpLuminancePCA(const vpLuminancePCA &other); - vpLuminancePCA &operator=(const vpLuminancePCA &other); /** @@ -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. @@ -238,6 +234,7 @@ class VISP_EXPORT vpLuminancePCA : public vpLuminanceMapping */ static vpLuminancePCA learn(const std::vector &imageFiles, const unsigned int projectionSize, const unsigned int imageBorder = 0); #endif + /** * \brief Compute a new Principal Component Analysis on set of images. * @@ -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. * @@ -321,7 +317,6 @@ class VISP_EXPORT vpLuminanceDCT : public vpLuminanceMapping unsigned m_cols; }; - /** * \brief Build a new DCT object * @@ -347,10 +342,8 @@ class VISP_EXPORT vpLuminanceDCT : public vpLuminanceMapping */ vpLuminanceDCT(const vpLuminanceDCT &other); - vpLuminanceDCT &operator=(const vpLuminanceDCT &other) = default; - void map(const vpImage &I, vpColVector &s) vp_override; void inverse(const vpColVector &s, vpImage &I) vp_override; void interaction(const vpImage &I, const vpMatrix &LI, const vpColVector &s, vpMatrix &L) vp_override; @@ -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 m_dIdrPlanes; //! Luminance interaction matrix, seen as six image planes vpLuminanceDCT::vpMatrixZigZagIndex m_zigzag; //! zigzag indexing helper - }; /** @@ -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 mapping); vpFeatureLuminanceMapping(const vpFeatureLuminance &luminance, std::shared_ptr mapping); void init() vp_override; @@ -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); @@ -420,12 +410,10 @@ class VISP_EXPORT vpFeatureLuminanceMapping : public vpBasicFeature std::shared_ptr &getMapping() { return m_mapping; } private: - std::shared_ptr m_mapping; vpFeatureLuminance m_featI; vpMatrix m_LI; //! Photometric interaction matrix vpImage I; - }; END_VISP_NAMESPACE #endif diff --git a/modules/visual_features/src/visual-feature/vpFeatureLuminance.cpp b/modules/visual_features/src/visual-feature/vpFeatureLuminance.cpp index 2082124cf1..3d281d5239 100644 --- a/modules/visual_features/src/visual-feature/vpFeatureLuminance.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureLuminance.cpp @@ -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 @@ -30,8 +29,7 @@ * * Description: * Luminance feature. - * -*****************************************************************************/ + */ /*! \file vpFeatureLuminance.cpp @@ -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() @@ -121,7 +119,7 @@ vpFeatureLuminance::vpFeatureLuminance(const vpFeatureLuminance &f) } /*! - Copy operator. + Copy operator. */ vpFeatureLuminance &vpFeatureLuminance::operator=(const vpFeatureLuminance &f) { @@ -237,7 +235,6 @@ vpFeatureLuminance &vpFeatureLuminance::build(vpImage &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$ */ @@ -379,8 +376,3 @@ vpFeatureLuminance *vpFeatureLuminance::duplicate() const } END_VISP_NAMESPACE -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/modules/visual_features/src/visual-feature/vpFeatureLuminanceMapping.cpp b/modules/visual_features/src/visual-feature/vpFeatureLuminanceMapping.cpp index 5f24777c6e..e167e6d8d7 100644 --- a/modules/visual_features/src/visual-feature/vpFeatureLuminanceMapping.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureLuminanceMapping.cpp @@ -95,7 +95,6 @@ void vpLuminancePCA::init(const std::shared_ptr &basis, const std::sha m_border = vpFeatureLuminance::DEFAULT_BORDER; } - vpLuminancePCA::vpLuminancePCA(const vpLuminancePCA &other) : vpLuminanceMapping(other.m_mappingSize) { *this = other; @@ -496,7 +495,6 @@ void vpLuminanceDCT::interaction(const vpImage &, const vpMatrix } } - // Feature luminance mapping vpFeatureLuminanceMapping::vpFeatureLuminanceMapping(const vpCameraParameters &cam, @@ -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; @@ -555,7 +552,6 @@ vpFeatureLuminanceMapping *vpFeatureLuminanceMapping::duplicate() const return new vpFeatureLuminanceMapping(*this); } - void vpFeatureLuminanceMapping::build(vpImage &I) { m_featI.build(I); @@ -563,8 +559,6 @@ void vpFeatureLuminanceMapping::build(vpImage &I) m_mapping->map(I, s); } - - vpColVector vpFeatureLuminanceMapping::error(const vpBasicFeature &s_star, unsigned int select) { if (select != FEATURE_ALL) { @@ -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; diff --git a/modules/visual_features/test/feature/testLuminanceMapping.cpp b/modules/visual_features/test/feature/testLuminanceMapping.cpp index 23633a0e54..02b1a76d5e 100644 --- a/modules/visual_features/test/feature/testLuminanceMapping.cpp +++ b/modules/visual_features/test/feature/testLuminanceMapping.cpp @@ -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 visp@inria.fr + * + * 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 #include @@ -14,7 +52,6 @@ using namespace VISP_NAMESPACE_NAME; #endif - vpMatrix orthogonalBasis(unsigned n, unsigned seed) { vpUniRand rand(seed); diff --git a/modules/visual_features/test/feature/testPoint.cpp b/modules/visual_features/test/feature/testPoint.cpp index 2ce5a46ff3..171ddba6ba 100644 --- a/modules/visual_features/test/feature/testPoint.cpp +++ b/modules/visual_features/test/feature/testPoint.cpp @@ -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 @@ -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 #include