diff --git a/CMakeLists.txt b/CMakeLists.txt index b0b8331c42..4789c8db78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ ############################################################################# # # 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 @@ -1896,7 +1896,7 @@ endif() status("") status(" Library dirs:") if(USE_EIGEN3) - status(" Eigen3 include dir:" "${Eigen3_DIR}") + status(" Eigen3 dir:" "${Eigen3_DIR}") endif() if(USE_MKL) status(" MKL include dir:" "${MKL_INCLUDE_DIRS}") @@ -1910,6 +1910,16 @@ endif() if(USE_PCL) status(" PCL dir:" "${PCL_DIR}") endif() +if(USE_PANDA3D) + if(Panda3D_DIR) + status(" Panda3D dir:" "${Panda3D_DIR}") + else() + status(" Panda3D dir:" "$ENV{Panda3D_DIR}") + endif() +endif() +if(USE_YARP) + status(" Yarp dir:" "${YARP_DIR}") +endif() # ========================== auxiliary ========================== status("") diff --git a/ChangeLog.txt b/ChangeLog.txt index f85f39e125..2d9bc0549b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -85,12 +85,13 @@ ViSP 3.x.x (Version in development) . [#1296] Unable to parse camera parameters with vpXmlParserCamera::parse() when camera name is empty . [#1307] Cannot set cxx standard when configuring for Visual Studio . [#1320] Broken links in the documentation - . [#1337] The pose of the automatic datageneration pipeline from blenderproc seems wrong + . [#1337] The pose of the automatic data generation pipeline from blenderproc seems wrong . [#1341] SVD computation fails with Lapack when m < n . [#1370] encountered compilation errors while building the ViSP library . [#1424] Unable to detect Yarp 3.9.0 . [#1485] Build issue around nlohmann_json usage with VTK 9.2.0 or more recent version used as an embedded 3rdparty by PCL + . [#1487] Segfault with vpCannyEdgeDetection with a certain image . [#1494] Memory management issue in vpArray2D::resize() . [#1495] vpMeLine is unable to seek extremities ---------------------------------------------- diff --git a/tutorial/imgproc/brightness/tutorial-brightness-adjustment.cpp b/tutorial/imgproc/brightness/tutorial-brightness-adjustment.cpp index c0fd9c5112..e522ce22ff 100644 --- a/tutorial/imgproc/brightness/tutorial-brightness-adjustment.cpp +++ b/tutorial/imgproc/brightness/tutorial-brightness-adjustment.cpp @@ -173,7 +173,7 @@ int main(int argc, const char **argv) std::stringstream ss_gray; ss_gray << input_name << "_adjust_alpha=" << alpha << "_beta=" << beta << "_gray.png"; display(I_display, I_color_res, I_color_adjust, I_gray_res, I_gray_adjust, I_gray_display, - "Brightness and contrast adjustment. Click to continue.", ss_color.str(), ss_gray.str()); + "Brightness and contrast adjustment. Click to continue.", ss_color.str(), ss_gray.str()); //! [Gamma correction] if (method != VISP_NAMESPACE_NAME::GAMMA_MANUAL) { diff --git a/tutorial/imgproc/hough-transform/drawingHelpers.cpp b/tutorial/imgproc/hough-transform/drawingHelpers.cpp index 322f8ca071..7e7d14d0b1 100644 --- a/tutorial/imgproc/hough-transform/drawingHelpers.cpp +++ b/tutorial/imgproc/hough-transform/drawingHelpers.cpp @@ -11,6 +11,7 @@ using namespace VISP_NAMESPACE_NAME; bool drawingHelpers::display(vpImage< vpRGBa> &I, const std::string &title, const bool &blockingMode) { vpDisplay::display(I); + vpDisplay::setTitle(I, title); vpDisplay::displayText(I, 15, 15, "Left click to continue...", vpColor::red); vpDisplay::displayText(I, 35, 15, "Right click to stop...", vpColor::red); vpDisplay::flush(I); diff --git a/tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp b/tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp index 04742e05c7..5b17e5d36b 100644 --- a/tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp +++ b/tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp @@ -22,7 +22,9 @@ using namespace VISP_NAMESPACE_NAME; #endif -bool run_detection(const vpImage &I_src, vpImage &I_disp, vpImage &I_dispCanny, vpCircleHoughTransform &detector, const int &nbCirclesToDetect, const bool &blockingMode, const bool &displayCanny) +bool run_detection(const vpImage &I_src, vpImage &I_disp, vpImage &I_dispCanny, + vpCircleHoughTransform &detector, const int &nbCirclesToDetect, const bool &blockingMode, + const bool &displayCanny) { double t0 = vpTime::measureTimeMicros(); //! [Run detection] @@ -60,23 +62,17 @@ bool run_detection(const vpImage &I_src, vpImage &I_disp, } #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17) std::optional> opt_mask = std::nullopt; - std::optional>>> opt_votingPoints = std::nullopt; -#elif (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) - vpImage *opt_mask = nullptr; - std::vector>> *opt_votingPoints = nullptr; - detector.computeVotingMask(I_src, detectedCircles, &opt_mask, &opt_votingPoints); // Get, if available, the voting points + std::optional > > > opt_votingPoints = std::nullopt; #else - vpImage *opt_mask = NULL; - std::vector > > *opt_votingPoints = NULL; + vpImage *opt_mask = nullptr; + std::vector > > *opt_votingPoints = nullptr; detector.computeVotingMask(I_src, detectedCircles, &opt_mask, &opt_votingPoints); // Get, if available, the voting points #endif #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17) if (opt_votingPoints) -#elif (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) - if (opt_votingPoints != nullptr) #else - if (opt_votingPoints != NULL) + if (opt_votingPoints != nullptr) #endif { const unsigned int crossSize = 3; @@ -94,25 +90,14 @@ bool run_detection(const vpImage &I_src, vpImage &I_disp, } } #if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_17) -#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) - if (opt_mask != nullptr) -#else - if (opt_mask != NULL) -#endif - { + if (opt_mask != nullptr) { delete opt_mask; } -#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) - if (opt_votingPoints != nullptr) -#else - if (opt_votingPoints != NULL) -#endif - { + if (opt_votingPoints != nullptr) { delete opt_votingPoints; } #endif -//! [Iterate detections] - + //! [Iterate detections] if (displayCanny) { vpImage edgeMap = detector.getEdgeMap(); drawingHelpers::display(edgeMap, I_dispCanny, "Edge map", blockingMode); @@ -511,39 +496,9 @@ int main(int argc, char **argv) //! [Algo init] std::cout << detector; - //! [Display init] vpImage I_src; vpImage I_disp; vpImage I_dispCanny; - // Read the (first) image - char *filename = new char[opt_input.size() + 50]; - if (opt_input.find("%") != std::string::npos) { - // Read the first frame - sprintf(filename, opt_input.c_str(), 0); - } - else { - // Simply get the filename - strcpy(filename, opt_input.c_str()); - } - std::string filenameAsStr(filename); - delete[] filename; - vpImageIo::read(I_src, filenameAsStr); - I_disp.resize(I_src.getHeight(), I_src.getWidth()); - I_dispCanny.resize(I_src.getHeight(), I_src.getWidth()); -#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) - std::shared_ptr dColor = vpDisplayFactory::createDisplay(I_disp, -1, -1, "Input image");; - std::shared_ptr dCanny(nullptr); - if (opt_displayCanny) { - dCanny = vpDisplayFactory::createDisplay(I_dispCanny, I_src.getWidth() + 40, -1, "Edge-map"); - } -#else - vpDisplay *dColor = vpDisplayFactory::allocateDisplay(I_disp, -1, -1, "Input image");; - vpDisplay *dCanny(nullptr); - if (opt_displayCanny) { - dCanny = vpDisplayFactory::allocateDisplay(I_dispCanny, I_src.getWidth() + 40, -1, "Edge-map"); - } -#endif - //! [Display init] //! [Manage video] if (opt_input.find("%") != std::string::npos) { @@ -552,11 +507,38 @@ int main(int argc, char **argv) vpVideoReader g; g.setFileName(opt_input); g.open(I_src); + + //! [Display init] + I_disp.resize(I_src.getHeight(), I_src.getWidth()); + I_dispCanny.resize(I_src.getHeight(), I_src.getWidth()); +#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) + std::shared_ptr dColor = vpDisplayFactory::createDisplay(I_disp, -1, -1, "Input image");; + std::shared_ptr dCanny(nullptr); + if (opt_displayCanny) { + dCanny = vpDisplayFactory::createDisplay(I_dispCanny, I_src.getWidth() + 40, -1, "Edge-map"); + } +#else + vpDisplay *dColor = vpDisplayFactory::allocateDisplay(I_disp, -1, -1, "Input image");; + vpDisplay *dCanny(nullptr); + if (opt_displayCanny) { + dCanny = vpDisplayFactory::allocateDisplay(I_dispCanny, I_src.getWidth() + 40, -1, "Edge-map"); + } +#endif + //! [Display init] while (!g.end() && hasToContinue) { g.acquire(I_src); hasToContinue = run_detection(I_src, I_disp, I_dispCanny, detector, opt_nbCirclesToDetect, false, opt_displayCanny); vpTime::wait(40); } + +#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) + delete dColor; + if (dCanny != nullptr) { + if (opt_displayCanny) { + delete dCanny; + } + } +#endif } //! [Manage video] else { @@ -567,15 +549,35 @@ int main(int argc, char **argv) } // Read the image and perform detection on it vpImageIo::read(I_src, opt_input); + + I_disp.resize(I_src.getHeight(), I_src.getWidth()); + I_dispCanny.resize(I_src.getHeight(), I_src.getWidth()); +#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) + std::shared_ptr dColor = vpDisplayFactory::createDisplay(I_disp, -1, -1, "Input image");; + std::shared_ptr dCanny(nullptr); + if (opt_displayCanny) { + dCanny = vpDisplayFactory::createDisplay(I_dispCanny, I_src.getWidth() + 40, -1, "Edge-map"); + } +#else + vpDisplay *dColor = vpDisplayFactory::allocateDisplay(I_disp, -1, -1, "Input image");; + vpDisplay *dCanny(nullptr); + if (opt_displayCanny) { + dCanny = vpDisplayFactory::allocateDisplay(I_dispCanny, I_src.getWidth() + 40, -1, "Edge-map"); + } +#endif + run_detection(I_src, I_disp, I_dispCanny, detector, opt_nbCirclesToDetect, true, opt_displayCanny); - //! [Manage single image] - } #if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11) - delete dColor; - if (dCanny != nullptr) { - delete dCanny; - } + delete dColor; + if (dCanny != nullptr) { + if (opt_displayCanny) { + delete dCanny; + } + } #endif + //! [Manage single image] + } + return EXIT_SUCCESS; }