diff --git a/ChangeLog.txt b/ChangeLog.txt index 6af835006b..281b973c9a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -62,6 +62,12 @@ ViSP 3.x.x (Version in development) https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-hsv-segmentation-pcl.html . New tutorial: Rendering a 3D scene with Panda3D https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-panda3d.html + . New tutorial: Using Unscented Kalman Filter to filter your data + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-ukf.html + . New tutorial: Using Particle Filter to filter your data + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-pf.html + . New tutorial: Using Particle Filter to model a wire using polynomial interpolation + https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-pf-curve-fitting.html - Bug fixed . [#1251] Bug in vpDisplay::displayFrame() . [#1270] Build issue around std::clamp and optional header which are not found with cxx17 diff --git a/doc/tutorial/misc/tutorial-pf-curve-fitting.dox b/doc/tutorial/misc/tutorial-pf-curve-fitting.dox index 82a77a20fa..6837047503 100644 --- a/doc/tutorial/misc/tutorial-pf-curve-fitting.dox +++ b/doc/tutorial/misc/tutorial-pf-curve-fitting.dox @@ -1,10 +1,10 @@ /** - \page tutorial-pf-curve-fitting Tutorial: Using Particle Filter to model a wire using polynomial interpolation. + \page tutorial-pf-curve-fitting Tutorial: Using Particle Filter to model a wire using polynomial interpolation \tableofcontents \section tuto-pf-cf-intro Introduction -We suppose that you are already familiar with the \ref tutorial-pf . +We suppose that you are already familiar with the \ref tutorial-pf. The Particle Filters (PF) are a set of Monte Carlo algorithms that permit to approximate solutions for filtering problems even when diff --git a/doc/tutorial/misc/tutorial-pf.dox b/doc/tutorial/misc/tutorial-pf.dox index d31db1bb34..a8f275b0c0 100644 --- a/doc/tutorial/misc/tutorial-pf.dox +++ b/doc/tutorial/misc/tutorial-pf.dox @@ -4,13 +4,13 @@ \section tuto-pf-intro Introduction -We suppose that you are already familiar with the \ref tutorial-ukf . +We suppose that you are already familiar with the \ref tutorial-ukf. The Particle Filters (PF) are a set of Monte Carlo algorithms that permit to approximate solutions for filtering problems even when the state-space and/or measurement space are non-linear. -In this tutorial, we will use a PF on the same use-case than presented in \ref tutorial-ukf . The PF is used to +In this tutorial, we will use a PF on the same use-case than presented in \ref tutorial-ukf. The PF is used to filter the 3D position of a simulated object, which revolves in a plane parallel to the ground around a static point, which is the origin of the world frame \f$ {F}_W \f$. The coordinate frame attached to the object is denoted \f$ {F}_O \f$. The object is observed by a static camera whose coordinate @@ -426,5 +426,5 @@ Finally, we update the renderer that displays the projection in the image of the The program stops once the `Return` key is pressed. \section tuto-pf_next Next tutorial -You are now ready to see the next \ref tutorial-pf-curve-fitting . +You are now ready to see the next \ref tutorial-pf-curve-fitting. */ diff --git a/doc/tutorial/misc/tutorial-ukf.dox b/doc/tutorial/misc/tutorial-ukf.dox index bd4b24a540..7297c2a859 100644 --- a/doc/tutorial/misc/tutorial-ukf.dox +++ b/doc/tutorial/misc/tutorial-ukf.dox @@ -426,15 +426,9 @@ Finally, we update the renderer that displays the projection in the image of the \snippet tutorial-ukf.cpp Update_renderer -\subsubsection tuto-ukf-tutorial-explained-cleaning Details on the cleaning at the end of the program - -Finally, we clean the allocated memory for the renderer: - -\snippet tutorial-ukf.cpp Delete_renderer - The program stops once the `Return` key is pressed. \section tuto-ukf_next Next tutorial -You are now ready to see the next \ref tutorial-pf . +You are now ready to see the next \ref tutorial-pf. */ diff --git a/modules/core/include/visp3/core/vpCannyEdgeDetection.h b/modules/core/include/visp3/core/vpCannyEdgeDetection.h index 0b89b43978..e70360f40e 100644 --- a/modules/core/include/visp3/core/vpCannyEdgeDetection.h +++ b/modules/core/include/visp3/core/vpCannyEdgeDetection.h @@ -81,7 +81,8 @@ class VISP_EXPORT vpCannyEdgeDetection * upper threshold. * \param[in] filteringType : The filtering and gradient operators to apply to the image before the edge detection * operation. - * \param[in] storeEdgePoints : If true, the list of edge-points will be available using \b vpCannyEdgeDetection::getEdgePointsList . + * \param[in] storeEdgePoints : If true, the list of edge-points will be available using + * \b vpCannyEdgeDetection::getEdgePointsList(). */ vpCannyEdgeDetection(const int &gaussianKernelSize, const float &gaussianStdev, const unsigned int &sobelAperture, const float &lowerThreshold = -1.f, const float &upperThreshold = -1.f, @@ -261,7 +262,7 @@ class VISP_EXPORT vpCannyEdgeDetection /** * \brief If set to true, the list of the detected edge-points will be available - * calling the method \b vpCannyEdgeDetection::getEdgePointsList . + * calling the method \b vpCannyEdgeDetection::getEdgePointsList(). * * \param[in] storeEdgePoints The new desired status. */ diff --git a/modules/core/include/visp3/core/vpUniRand.h b/modules/core/include/visp3/core/vpUniRand.h index 14272718e4..7d09b87970 100644 --- a/modules/core/include/visp3/core/vpUniRand.h +++ b/modules/core/include/visp3/core/vpUniRand.h @@ -138,12 +138,13 @@ class VISP_EXPORT vpUniRand void setSeed(uint64_t initstate, uint64_t initseq); /** - * @brief Create a new vector that is a shuffled version of the \b inputVector. - * - * @tparam T : A class that possesses a copy constructor. - * @param inputVector : The input vector that must be shuffled. It will not be modified. - * @return std::vector A vector containing the same objects than \b inputVector, but that are shuffled. - */ + * @brief Create a new vector that is a shuffled version of the \b inputVector. + * + * @tparam T : A class that possesses a copy constructor. + * @param inputVector : The input vector that must be shuffled. It will not be modified. + * @param seed : The seed value. + * @return std::vector A vector containing the same objects than \b inputVector, but that are shuffled. + */ template inline static std::vector shuffleVector(const std::vector &inputVector, const int32_t &seed = -1) { diff --git a/modules/core/test/math/testParticleFilter.cpp b/modules/core/test/math/testParticleFilter.cpp index 09be846b5e..c0c7bec11e 100644 --- a/modules/core/test/math/testParticleFilter.cpp +++ b/modules/core/test/math/testParticleFilter.cpp @@ -215,8 +215,8 @@ class vpParabolaModel * \brief Compute the coefficients of the 2nd degree curve for the simulated data. * The polynomial is written as y = a x^2 + b x + c. * - * \param[in] x0 Horizontal coordinate of the inflexion point. - * \param[in] y0 Vertical coordinate of the inflexion point. + * \param[in] x0 Horizontal coordinate of the inflection point. + * \param[in] y0 Vertical coordinate of the inflection point. * \param[in] x1 Horizontal coordinate of another point of the curve. * \param[in] y1 Vertical coordinate of another point of the curve. * \return vpColVector The coefficients such as v[0] = c ; v[1] = b ; v[2] = a @@ -233,8 +233,8 @@ vpColVector computeABC(const double &x0, const double &y0, const double &x1, con * \brief Compute the coefficients of the 2nd degree curve for the simulated data. * The polynomial is written as y = a x^3 + b x^2 + c x + d. * - * \param[in] x0 Horizontal coordinate of the inflexion point. - * \param[in] y0 Vertical coordinate of the inflexion point. + * \param[in] x0 Horizontal coordinate of the inflection point. + * \param[in] y0 Vertical coordinate of the inflection point. * \param[in] x1 Horizontal coordinate of another point of the curve. * \param[in] y1 Vertical coordinate of another point of the curve. * \return vpColVector The coefficients such as v[0] = d ; v[1] = c ; v[2] = b ; v[3] = a @@ -478,7 +478,7 @@ TEST_CASE("2nd-degree", "[vpParticleFilter][Polynomial interpolation]") /// ----- PF parameters ----- // The maximum amplitude for the likelihood compute. // A particle whose "distance" with the measurements is greater than this value has a likelihood of 0 - const double ampliMaxLikelihood = 15.; + const double ampliMaxLikelihood = 16.; const double sigmaLikelihood = ampliMaxLikelihood / 3.; //:< The corresponding standard deviation const unsigned int nbParticles = 300; //!< Number of particles used by the particle filter const double ratioAmpliMax(0.25); //!< Ratio of the initial guess values to use to add noise to the PF state @@ -565,7 +565,7 @@ TEST_CASE("2nd-degree", "[vpParticleFilter][Polynomial interpolation]") SECTION("Noisy", "Noise is added to the init points") { - const double maxToleratedError = 10.; + const double maxToleratedError = 12.; double x0 = rngCurvePoints.uniform(0., width); double x1 = rngCurvePoints.uniform(0., width); double y0 = rngCurvePoints.uniform(0., height); @@ -752,7 +752,7 @@ TEST_CASE("3rd-degree", "[vpParticleFilter][Polynomial interpolation]") SECTION("Noisy", "Noise is added to the init points") { - const double maxToleratedError = 15.; + const double maxToleratedError = 16.; double x0 = rngCurvePoints.uniform(0., width); double x1 = rngCurvePoints.uniform(0., width); double y0 = rngCurvePoints.uniform(0., height); diff --git a/modules/gui/include/visp3/gui/vpDisplayFactory.h b/modules/gui/include/visp3/gui/vpDisplayFactory.h index 052db7aefd..a43322fefa 100644 --- a/modules/gui/include/visp3/gui/vpDisplayFactory.h +++ b/modules/gui/include/visp3/gui/vpDisplayFactory.h @@ -214,9 +214,9 @@ struct GridSettings }; inline void makeDisplayGridHelper(std::vector> &res, const GridSettings &settings, - unsigned int currRow, unsigned int currCol, - unsigned int currentPixelX, unsigned int currentPixelY, - unsigned int maxRowHeightPixel) + unsigned int currRow, unsigned int currCol, + unsigned int currentPixelX, unsigned int currentPixelY, + unsigned int maxRowHeightPixel) { if (currRow != (settings.rows - 1) && (currCol != settings.cols - 1)) { throw vpException(vpException::dimensionError, "Too few images for the grid size"); diff --git a/tutorial/image/tutorial-canny.cpp b/tutorial/image/tutorial-canny.cpp index 586fdf3b59..2ea2f73fac 100644 --- a/tutorial/image/tutorial-canny.cpp +++ b/tutorial/image/tutorial-canny.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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 tutorial-canny.cpp diff --git a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageConversion.h b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageConversion.h index 7c3abf2c58..323fd65e0c 100644 --- a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageConversion.h +++ b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageConversion.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * This file is part of the ViSP software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #import #import @@ -41,12 +39,11 @@ @interface ImageConversion : NSObject -+ (vpImage)vpImageColorFromUIImage:(UIImage *)image; -+ (vpImage)vpImageGrayFromUIImage:(UIImage *)image; -+ (UIImage *)UIImageFromVpImageColor:(const vpImage &)I; -+ (UIImage *)UIImageFromVpImageGray:(const vpImage &)I; ++ (vpImage)vpImageColorFromUIImage : (UIImage *)image; ++(vpImage)vpImageGrayFromUIImage:(UIImage *)image; ++(UIImage *)UIImageFromVpImageColor:(const vpImage &)I; ++(UIImage *)UIImageFromVpImageGray:(const vpImage &)I; @end #endif - diff --git a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageConversion.mm b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageConversion.mm index 3eab39980f..8d55fdce28 100644 --- a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageConversion.mm +++ b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageConversion.mm @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * This file is part of the ViSP software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplay.h b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplay.h index 30cc1f2328..de0c09a37b 100644 --- a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplay.h +++ b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplay.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * This file is part of the ViSP software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #import #ifdef __cplusplus @@ -41,11 +39,10 @@ @interface ImageDisplay : NSObject -+ (UIImage *)displayLine:(UIImage *)image :(vpImagePoint &)ip1 :(vpImagePoint &)ip2 :(UIColor*)color :(int)tickness; -+ (UIImage *)displayFrame:(UIImage *)image :(const vpHomogeneousMatrix &)cMo :(const vpCameraParameters &)cam - :(double) size :(int)tickness; ++ (UIImage *)displayLine : (UIImage *)image : (vpImagePoint &)ip1 : (vpImagePoint &)ip2 : (UIColor *)color : (int)tickness; ++(UIImage *)displayFrame:(UIImage *)image : (const vpHomogeneousMatrix &)cMo : (const vpCameraParameters &)cam + : (double)size : (int)tickness; @end #endif - diff --git a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplay.mm b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplay.mm index 1b3a369ea4..f94cc3b5be 100644 --- a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplay.mm +++ b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplay.mm @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -137,4 +135,3 @@ + (UIImage *)displayFrame:(UIImage *)image :(const vpHomogeneousMatrix &)cMo :(c @end #endif - diff --git a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplayWithContext.h b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplayWithContext.h index 1b41a85db4..361847e95d 100644 --- a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplayWithContext.h +++ b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplayWithContext.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * This file is part of the ViSP software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #import #ifdef __cplusplus @@ -39,13 +37,13 @@ NS_ASSUME_NONnullptr_BEGIN -@interface ImageDisplay (withContext) +@interface ImageDisplay(withContext) -+ (void)displayLineWithContext:(CGContextRef)context :(std::vector)polygon :(UIColor*)color :(int)tickness; ++ (void)displayLineWithContext :(CGContextRef)context : (std::vector)polygon : (UIColor *)color : (int)tickness; -+ (void)displayFrameWithContext:(CGContextRef)context :(const vpHomogeneousMatrix &)cMo :(const vpCameraParameters &)cam :(double) size :(int)tickness; ++(void)displayFrameWithContext:(CGContextRef)context : (const vpHomogeneousMatrix &)cMo : (const vpCameraParameters &)cam : (double)size : (int)tickness; -+ (void)displayText:(NSString*)text :(double)x :(double)y :(int)width :(int)height :(UIColor*)color :(UIColor*)bgColor; ++(void)displayText:(NSString *)text : (double)x : (double)y : (int)width : (int)height : (UIColor *)color : (UIColor *)bgColor; @end diff --git a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplayWithContext.mm b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplayWithContext.mm index 9c1dc3b57a..151955c4b8 100644 --- a/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplayWithContext.mm +++ b/tutorial/ios/AprilTagLiveCamera/VispHelper/ImageDisplayWithContext.mm @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * This file is part of the ViSP software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #import "ImageDisplayWithContext.h" diff --git a/tutorial/ios/GettingStarted/GettingStarted/ViewController.mm b/tutorial/ios/GettingStarted/GettingStarted/ViewController.mm index 1a390eae40..c59cd350c4 100644 --- a/tutorial/ios/GettingStarted/GettingStarted/ViewController.mm +++ b/tutorial/ios/GettingStarted/GettingStarted/ViewController.mm @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -113,4 +111,3 @@ - (void)didReceiveMemoryWarning { @end #endif - diff --git a/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageConversion.h b/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageConversion.h index 9767439702..7514db6c0d 100644 --- a/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageConversion.h +++ b/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageConversion.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #import #import @@ -41,12 +39,11 @@ @interface ImageConversion : NSObject -+ (vpImage)vpImageColorFromUIImage:(UIImage *)image; -+ (vpImage)vpImageGrayFromUIImage:(UIImage *)image; -+ (UIImage *)UIImageFromVpImageColor:(const vpImage &)I; -+ (UIImage *)UIImageFromVpImageGray:(const vpImage &)I; ++ (vpImage)vpImageColorFromUIImage : (UIImage *)image; ++(vpImage)vpImageGrayFromUIImage:(UIImage *)image; ++(UIImage *)UIImageFromVpImageColor:(const vpImage &)I; ++(UIImage *)UIImageFromVpImageGray:(const vpImage &)I; @end #endif - diff --git a/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageConversion.mm b/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageConversion.mm index 156710a531..431348b513 100644 --- a/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageConversion.mm +++ b/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageConversion.mm @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageDisplay.h b/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageDisplay.h index b552c513ec..657250a336 100644 --- a/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageDisplay.h +++ b/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageDisplay.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #import #ifdef __cplusplus @@ -39,11 +37,10 @@ @interface ImageDisplay : NSObject -+ (UIImage *)displayLine:(UIImage *)image :(vpImagePoint &)ip1 :(vpImagePoint &)ip2 :(UIColor*)color :(int)tickness; -+ (UIImage *)displayFrame:(UIImage *)image :(const vpHomogeneousMatrix &)cMo :(const vpCameraParameters &)cam - :(double) size :(int)tickness; ++ (UIImage *)displayLine : (UIImage *)image : (vpImagePoint &)ip1 : (vpImagePoint &)ip2 : (UIColor *)color : (int)tickness; ++(UIImage *)displayFrame:(UIImage *)image : (const vpHomogeneousMatrix &)cMo : (const vpCameraParameters &)cam + : (double)size : (int)tickness; @end #endif - diff --git a/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageDisplay.mm b/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageDisplay.mm index 1b3a369ea4..f94cc3b5be 100644 --- a/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageDisplay.mm +++ b/tutorial/ios/StartedAprilTag/StartedAprilTag/ImageDisplay.mm @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -137,4 +135,3 @@ + (UIImage *)displayFrame:(UIImage *)image :(const vpHomogeneousMatrix &)cMo :(c @end #endif - diff --git a/tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.h b/tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.h index 9767439702..7514db6c0d 100644 --- a/tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.h +++ b/tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #import #import @@ -41,12 +39,11 @@ @interface ImageConversion : NSObject -+ (vpImage)vpImageColorFromUIImage:(UIImage *)image; -+ (vpImage)vpImageGrayFromUIImage:(UIImage *)image; -+ (UIImage *)UIImageFromVpImageColor:(const vpImage &)I; -+ (UIImage *)UIImageFromVpImageGray:(const vpImage &)I; ++ (vpImage)vpImageColorFromUIImage : (UIImage *)image; ++(vpImage)vpImageGrayFromUIImage:(UIImage *)image; ++(UIImage *)UIImageFromVpImageColor:(const vpImage &)I; ++(UIImage *)UIImageFromVpImageGray:(const vpImage &)I; @end #endif - diff --git a/tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.mm b/tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.mm index 156710a531..431348b513 100644 --- a/tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.mm +++ b/tutorial/ios/StartedImageProc/StartedImageProc/ImageConversion.mm @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/tutorial/ios/StartedImageProc/StartedImageProc/ViewController.mm b/tutorial/ios/StartedImageProc/StartedImageProc/ViewController.mm index 07b7544acf..39d850872d 100644 --- a/tutorial/ios/StartedImageProc/StartedImageProc/ViewController.mm +++ b/tutorial/ios/StartedImageProc/StartedImageProc/ViewController.mm @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/tutorial/kalman/tutorial-ukf.cpp b/tutorial/kalman/tutorial-ukf.cpp index 8bcfa470f6..318c53fd83 100644 --- a/tutorial/kalman/tutorial-ukf.cpp +++ b/tutorial/kalman/tutorial-ukf.cpp @@ -39,11 +39,7 @@ //! [Display_includes] #ifdef VISP_HAVE_DISPLAY #include -#include -#include -#include -#include -#include +#include #endif //! [Display_includes] #include @@ -263,10 +259,12 @@ int main(/*const int argc, const char *argv[]*/) const double radius = 0.25; // Radius of revolution of 0.25m const double w = 2 * M_PI * 10; // Pulsation of the motion of revolution const double phi = 2; // Phase of the motion of revolution - const std::vector markers = { vpColVector({-0.05, 0.05, 0., 1.}) - , vpColVector({0.05, 0.05, 0., 1.}) - , vpColVector({0.05, -0.05, 0., 1.}) - , vpColVector({-0.05, -0.05, 0., 1.}) }; // Vector of the markers sticked on the object + + // Vector of the markers sticked on the object + const std::vector markers = { vpColVector({-0.05, 0.05, 0., 1.}), + vpColVector({0.05, 0.05, 0., 1.}), + vpColVector({0.05, -0.05, 0., 1.}), + vpColVector({-0.05, -0.05, 0., 1.}) }; const unsigned int nbMarkers = static_cast(markers.size()); std::vector markersAsVpPoint; for (unsigned int i = 0; i < nbMarkers; ++i) { @@ -370,22 +368,8 @@ int main(/*const int argc, const char *argv[]*/) // Depending on the detected third party libraries, we instantiate here the // first video device which is available #ifdef VISP_HAVE_DISPLAY - vpDisplay *d = nullptr; -#if defined(VISP_HAVE_X11) - d = new vpDisplayX; -#elif defined(VISP_HAVE_GTK) - d = new vpDisplayGTK; -#elif defined(VISP_HAVE_GDI) - d = new vpDisplayGDI; -#elif defined(VISP_HAVE_D3D9) - d = new vpDisplayD3D; -#elif defined(HAVE_OPENCV_HIGHGUI) - d = new vpDisplayOpenCV; -#endif - vpImage Idisp(800, 800, vpRGBa(255)); - if (d != nullptr) { - d->init(Idisp, 800, 50, "Projection of the markers"); - } + vpImage Idisp(700, 700, vpRGBa(255)); + std::shared_ptr d = vpDisplayFactory::createDisplay(Idisp, 800, -1, "Projection of the markers"); #endif //! [Init_renderer] @@ -475,14 +459,6 @@ int main(/*const int argc, const char *argv[]*/) std::cout << "Press Enter to quit..." << std::endl; std::cin.get(); - //! [Delete_renderer] - // Delete the renderer if it was allocated -#ifdef VISP_HAVE_DISPLAY - if (d != nullptr) { - delete d; - } -#endif -//! [Delete_renderer] return 0; } #else diff --git a/tutorial/mean-drift/tutorial-meandrift.cpp b/tutorial/mean-drift/tutorial-meandrift.cpp index 6f75533925..9e457c151f 100644 --- a/tutorial/mean-drift/tutorial-meandrift.cpp +++ b/tutorial/mean-drift/tutorial-meandrift.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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 tutorial-meandrift.cpp diff --git a/tutorial/misc/npz/tutorial-npz.cpp b/tutorial/misc/npz/tutorial-npz.cpp index 29957ee770..a8415cfa4d 100644 --- a/tutorial/misc/npz/tutorial-npz.cpp +++ b/tutorial/misc/npz/tutorial-npz.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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 tutorial-npz.cpp diff --git a/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-all.cpp b/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-all.cpp index e6cc73930b..9528d18de5 100644 --- a/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-all.cpp +++ b/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-all.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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 tutorial-pf-curve-fitting-all.cpp diff --git a/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-lms.cpp b/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-lms.cpp index e9fa415227..381256e595 100644 --- a/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-lms.cpp +++ b/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-lms.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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 tutorial-pf-curve-fitting-lms.cpp diff --git a/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-pf.cpp b/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-pf.cpp index 1bc29b4cea..9f605abf89 100644 --- a/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-pf.cpp +++ b/tutorial/particle-filter-curve-fitting/tutorial-pf-curve-fitting-pf.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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 tutorial-pf-curve-fitting-pf.cpp diff --git a/tutorial/particle-filter-curve-fitting/vpTutoCommonData.h b/tutorial/particle-filter-curve-fitting/vpTutoCommonData.h index a1f35a3d1a..f6d6757681 100644 --- a/tutorial/particle-filter-curve-fitting/vpTutoCommonData.h +++ b/tutorial/particle-filter-curve-fitting/vpTutoCommonData.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef VP_COMMMON_DATA_H #define VP_COMMMON_DATA_H #include @@ -293,7 +291,7 @@ typedef struct vpTutoCommonData m_IskeletonNoisy.resize(m_I_orig.getHeight(), m_I_orig.getWidth()); // Resize the edge-map. // Init the displays - const int horOffset = 20, vertOffset = 20; + const int horOffset = 20, vertOffset = 25; std::string skeletonTitle("Skeletonized image ("); skeletonTitle += (m_ratioSaltPepperNoise == 0 ? "without" : std::to_string(static_cast(m_ratioSaltPepperNoise * 100.)) + "%"); skeletonTitle += " noise)"; diff --git a/tutorial/particle-filter-curve-fitting/vpTutoMeanSquareFitting.cpp b/tutorial/particle-filter-curve-fitting/vpTutoMeanSquareFitting.cpp index 164bbf72af..a357909b52 100644 --- a/tutorial/particle-filter-curve-fitting/vpTutoMeanSquareFitting.cpp +++ b/tutorial/particle-filter-curve-fitting/vpTutoMeanSquareFitting.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #include "vpTutoMeanSquareFitting.h" diff --git a/tutorial/particle-filter-curve-fitting/vpTutoMeanSquareFitting.h b/tutorial/particle-filter-curve-fitting/vpTutoMeanSquareFitting.h index a68bd7c5b7..66b771ce83 100644 --- a/tutorial/particle-filter-curve-fitting/vpTutoMeanSquareFitting.h +++ b/tutorial/particle-filter-curve-fitting/vpTutoMeanSquareFitting.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef VP_TUTO_MEAN_SQUARE_FITTING_H #define VP_TUTO_MEAN_SQUARE_FITTING_H diff --git a/tutorial/particle-filter-curve-fitting/vpTutoParabolaModel.h b/tutorial/particle-filter-curve-fitting/vpTutoParabolaModel.h index a817911de5..ba71e2cf9f 100644 --- a/tutorial/particle-filter-curve-fitting/vpTutoParabolaModel.h +++ b/tutorial/particle-filter-curve-fitting/vpTutoParabolaModel.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef VP_PARABOLA_MODEL_H #define VP_PARABOLA_MODEL_H diff --git a/tutorial/particle-filter-curve-fitting/vpTutoSegmentation.cpp b/tutorial/particle-filter-curve-fitting/vpTutoSegmentation.cpp index e869b7810b..d533494be3 100644 --- a/tutorial/particle-filter-curve-fitting/vpTutoSegmentation.cpp +++ b/tutorial/particle-filter-curve-fitting/vpTutoSegmentation.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #include "vpTutoSegmentation.h" diff --git a/tutorial/particle-filter-curve-fitting/vpTutoSegmentation.h b/tutorial/particle-filter-curve-fitting/vpTutoSegmentation.h index 344d5c91dd..ce489fa734 100644 --- a/tutorial/particle-filter-curve-fitting/vpTutoSegmentation.h +++ b/tutorial/particle-filter-curve-fitting/vpTutoSegmentation.h @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2024 by Inria. All rights reserved. * @@ -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. - * -*****************************************************************************/ + */ #ifndef VP_TUTO_SEGMENTATION_H #define VP_TUTO_SEGMENTATION_H diff --git a/tutorial/particle-filter/tutorial-pf.cpp b/tutorial/particle-filter/tutorial-pf.cpp index 37656223f6..737ea9e21b 100644 --- a/tutorial/particle-filter/tutorial-pf.cpp +++ b/tutorial/particle-filter/tutorial-pf.cpp @@ -550,10 +550,12 @@ int main(const int argc, const char *argv[]) const double radius = 0.25; // Radius of revolution of 0.25m const double w = 2 * M_PI * 10; // Pulsation of the motion of revolution const double phi = 2; // Phase of the motion of revolution - const std::vector markers = { vpColVector({-0.05, 0.05, 0., 1.}) - , vpColVector({0.05, 0.05, 0., 1.}) - , vpColVector({0.05, -0.05, 0., 1.}) - , vpColVector({-0.05, -0.05, 0., 1.}) }; // Vector of the markers sticked on the object + + // Vector of the markers sticked on the object + const std::vector markers = { vpColVector({-0.05, 0.05, 0., 1.}), + vpColVector({0.05, 0.05, 0., 1.}), + vpColVector({0.05, -0.05, 0., 1.}), + vpColVector({-0.05, -0.05, 0., 1.}) }; const unsigned int nbMarkers = static_cast(markers.size()); std::vector markersAsVpPoint; for (unsigned int i = 0; i < nbMarkers; ++i) { @@ -604,9 +606,6 @@ int main(const int argc, const char *argv[]) if (seedPF < 0) { seedPF = vpTime::measureTimeMicros(); } - else { - seedPF = seedPF; - } //! [Constants_for_the_PF] // Object that converts the pose of the object into measurements @@ -701,8 +700,8 @@ int main(const int argc, const char *argv[]) // Depending on the detected third party libraries, we instantiate here the // first video device which is available #ifdef VISP_HAVE_DISPLAY - vpImage Idisp(800, 800, vpRGBa(255)); - std::shared_ptr d = vpDisplayFactory::createDisplay(Idisp, 800, 50, "Projection of the markers"); + vpImage Idisp(700, 700, vpRGBa(255)); + std::shared_ptr d = vpDisplayFactory::createDisplay(Idisp, 800, -1, "Projection of the markers"); #endif //! [Init_renderer] diff --git a/tutorial/robot/flir-ptu/tutorial-flir-ptu-ibvs.cpp b/tutorial/robot/flir-ptu/tutorial-flir-ptu-ibvs.cpp index b4d2699d27..13e89d0015 100644 --- a/tutorial/robot/flir-ptu/tutorial-flir-ptu-ibvs.cpp +++ b/tutorial/robot/flir-ptu/tutorial-flir-ptu-ibvs.cpp @@ -1,5 +1,4 @@ -/**************************************************************************** - * +/* * ViSP, open source Visual Servoing Platform software. * Copyright (C) 2005 - 2023 by Inria. All rights reserved. * @@ -32,8 +31,7 @@ * tests the control law * eye-in-hand control * velocity computed in the camera frame - * -*****************************************************************************/ + */ /*! \example tutorial-flir-ptu-ibvs.cpp