diff --git a/modules/core/test/image-with-dataset/testImageFilter.cpp b/modules/core/test/image-with-dataset/testImageFilter.cpp index e6c2be967d..408144adee 100644 --- a/modules/core/test/image-with-dataset/testImageFilter.cpp +++ b/modules/core/test/image-with-dataset/testImageFilter.cpp @@ -552,8 +552,8 @@ int main(int argc, const char *argv[]) I_median_rgba[r][c].B = 3 * (r * 3 + c); } } - std::vector median_rgba = vpImageFilter::median(I_median_rgba); - std::vector expected_median_rgba = { 4, 8, 12 }; + std::vector median_rgba = vpImageFilter::median(I_median_rgba); + std::vector expected_median_rgba = { 4.f, 8.f, 12.f }; for (unsigned int i = 0; i < 3; i++) { bool test_local = (median_rgba[i] == expected_median_rgba[i]); test &= test_local; diff --git a/modules/java/jni/CMakeLists.txt b/modules/java/jni/CMakeLists.txt index 908fcf66e4..7d95d24266 100644 --- a/modules/java/jni/CMakeLists.txt +++ b/modules/java/jni/CMakeLists.txt @@ -31,7 +31,7 @@ vp_add_library(${the_module} ${__type} ${copied_files} ) add_dependencies(${the_module} gen_visp_java_source) - + vp_target_include_directories(${the_module} "${CMAKE_CURRENT_SOURCE_DIR}/../generator/src/cpp") vp_target_include_directories(${the_module} "${VISP_JAVA_BINDINGS_DIR}/gen/cpp") vp_target_include_modules(${the_module} ${VISP_MODULE_${the_module}_DEPS}) @@ -51,17 +51,17 @@ if(BUILD_FAT_JAVA_LIB) endif() if(APPLE) foreach(_dep ${__deps}) - vp_target_link_libraries(${the_module} LINK_PRIVATE -Wl,-force_load "${_dep}") + vp_target_link_libraries(${the_module} PRIVATE -Wl,-force_load "${_dep}") endforeach() # TODO: Just check visp's file once, they had a condition I ignored elseif(((UNIX) OR (VISP_FORCE_FAT_JAVA_LIB_LD_RULES)) AND (NOT VISP_SKIP_FAT_JAVA_LIB_LD_RULES)) - vp_target_link_libraries(${the_module} LINK_PRIVATE -Wl,-whole-archive ${__deps} -Wl,-no-whole-archive) + vp_target_link_libraries(${the_module} PRIVATE -Wl,-whole-archive ${__deps} -Wl,-no-whole-archive) else() - vp_target_link_libraries(${the_module} LINK_PRIVATE ${__deps}) + vp_target_link_libraries(${the_module} PRIVATE ${__deps}) endif() - vp_target_link_libraries(${the_module} LINK_PRIVATE ${__extradeps} ${VISP_LINKER_LIBS}) + vp_target_link_libraries(${the_module} PRIVATE ${__extradeps} ${VISP_LINKER_LIBS}) else() - vp_target_link_libraries(${the_module} LINK_PRIVATE ${__deps} ${VISP_LINKER_LIBS}) + vp_target_link_libraries(${the_module} PRIVATE ${__deps} ${VISP_LINKER_LIBS}) endif() # Additional target properties @@ -74,8 +74,8 @@ set_target_properties(${the_module} PROPERTIES ) if(ANDROID) - vp_target_link_libraries(${the_module} LINK_PUBLIC jnigraphics) - vp_target_link_libraries(${the_module} LINK_PUBLIC log dl z) + vp_target_link_libraries(${the_module} PUBLIC jnigraphics) + vp_target_link_libraries(${the_module} PUBLIC log dl z) # force strip library after the build command # because samples and tests will make a copy of the library before install diff --git a/tutorial/image/tutorial-draw-circle.cpp b/tutorial/image/tutorial-draw-circle.cpp index 9c96ce2762..061d59e14f 100644 --- a/tutorial/image/tutorial-draw-circle.cpp +++ b/tutorial/image/tutorial-draw-circle.cpp @@ -20,10 +20,10 @@ int main() vpDisplay::setTitle(I, "Gray image"); vpDisplay::display(I); //! [Circle display] - vpImageCircle circle(vpImagePoint(I.getHeight()/3, I.getWidth()/3), I.getWidth()/10); + vpImageCircle circle(vpImagePoint(I.getHeight()/3, I.getWidth()/3), I.getWidth()/10.f); // Displays in overlay a red circle on the image // i.e. does not modify I - vpDisplay::displayCircle(I, circle, vpColor::red, 2); + vpDisplay::displayCircle(I, circle, vpColor::red, false, 2); //! [Circle display] vpDisplay::flush(I); vpDisplay::setTitle(I, "Overlay"); @@ -32,7 +32,7 @@ int main() vpDisplay::getClick(I); //! [Circle draw uchar] - vpImageCircle circle2(vpImagePoint(I.getHeight()/3, 2*I.getWidth()/3), I.getWidth()/10); + vpImageCircle circle2(vpImagePoint(I.getHeight()/3, 2*I.getWidth()/3), I.getWidth()/10.f); // Draws a white circle on the image // i.e. modifies I vpImageDraw::drawCircle(I, circle2, 255, 2); @@ -47,7 +47,7 @@ int main() { //! [Circle draw color] - vpImageCircle circle3(vpImagePoint(2*I.getHeight()/3, I.getWidth()/2), I.getWidth()/10); + vpImageCircle circle3(vpImagePoint(2*I.getHeight()/3, I.getWidth()/2), I.getWidth()/10.f); // Draws a blue circle on the image // i.e. modifies I_rgb vpImageDraw::drawCircle(I_rgb, circle3, vpColor::blue, 2); diff --git a/tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp b/tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp index 36144610ab..94691b70f3 100644 --- a/tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp +++ b/tutorial/imgproc/hough-transform/tutorial-circle-hough.cpp @@ -72,8 +72,8 @@ std::string getAvailableTypeInputImage(const std::string &prefix = "<", const st //! [Draw disks] void -drawDisk(vpImage &I, const vpImagePoint ¢er, const unsigned int &radius - , const unsigned int &borderColor, const unsigned int &fillingColor, const unsigned int &thickness, const unsigned int &bckg) +drawDisk(vpImage &I, const vpImagePoint ¢er, const unsigned int &radius, + const unsigned int &borderColor, const unsigned int &fillingColor, const unsigned int &thickness, const unsigned int &bckg) //! [Draw disks] { vpImageDraw::drawCircle(I, center, radius, borderColor, thickness); @@ -146,13 +146,13 @@ generateImage(const TypeInputImage &inputType) } drawDisk(I_src, vpImagePoint(top, left), circleRadius, circleColor, circleColor, circleThickness, bckg); - drawDisk(I_src, vpImagePoint(top, left), circleRadius * 0.50, circleColor / 2, circleColor / 2, circleThickness, circleColor); + drawDisk(I_src, vpImagePoint(top, left), circleRadius / 2, circleColor / 2, circleColor / 2, circleThickness, circleColor); drawDisk(I_src, vpImagePoint(bottom, left), circleRadius, circleColor, circleColor, circleThickness, bckg); - drawDisk(I_src, vpImagePoint(bottom, left), circleRadius * 0.50, circleColor / 2, circleColor / 2, circleThickness, circleColor); + drawDisk(I_src, vpImagePoint(bottom, left), circleRadius / 2, circleColor / 2, circleColor / 2, circleThickness, circleColor); drawDisk(I_src, vpImagePoint(top, right), circleRadius, circleColor, circleColor, circleThickness, bckg); - drawDisk(I_src, vpImagePoint(top, right), circleRadius * 0.50, circleColor / 2, circleColor / 2, circleThickness, circleColor); + drawDisk(I_src, vpImagePoint(top, right), circleRadius / 2, circleColor / 2, circleColor / 2, circleThickness, circleColor); drawDisk(I_src, vpImagePoint(bottom, right), circleRadius, circleColor, circleColor, circleThickness, bckg); - drawDisk(I_src, vpImagePoint(bottom, right), circleRadius * 0.50, circleColor / 2, circleColor / 2, circleThickness, circleColor); + drawDisk(I_src, vpImagePoint(bottom, right), circleRadius / 2, circleColor / 2, circleColor / 2, circleThickness, circleColor); std::cout << "Done drawing" << std::endl << std::flush; return I_src; @@ -196,12 +196,12 @@ int main(int argc, char **argv) const std::string def_jsonFilePath = std::string(""); const int def_nbCirclesToDetect = -1; const int def_gaussianKernelSize = 5; - const double def_gaussianSigma = 1.; + const float def_gaussianSigma = 1.f; const int def_sobelKernelSize = 3; #ifdef HAVE_OPENCV_IMGPROC - const double def_cannyThresh = 150.; + const float def_cannyThresh = 150.f; #else - const double def_cannyThresh = 25.; + const float def_cannyThresh = 25.f; #endif const int def_nbEdgeFilteringIter = 2; const std::pair def_centerXlimits = std::pair(0, 640); @@ -209,31 +209,30 @@ int main(int argc, char **argv) const unsigned int def_minRadius = 0; const unsigned int def_maxRadius = 1000; const int def_dilatationRepet = 1; - const double def_centerThresh = -1.; - const double def_radiusThreshRatio = -1.; - const double def_circlePerfectness = 0.85; - const double def_centerDistanceThresh = 15; - const double def_radiusDifferenceThresh = 15; - + const float def_centerThresh = -1.f; + const float def_radiusThreshRatio = -1.f; + const float def_circlePerfectness = 0.85f; + const float def_centerDistanceThresh = 15.f; + const float def_radiusDifferenceThresh = 15.f; std::string opt_input(def_input); std::string opt_jsonFilePath = def_jsonFilePath; int opt_nbCirclesToDetect = def_nbCirclesToDetect; int opt_gaussianKernelSize = def_gaussianKernelSize; - double opt_gaussianSigma = def_gaussianSigma; + float opt_gaussianSigma = def_gaussianSigma; int opt_sobelKernelSize = def_sobelKernelSize; - double opt_cannyThresh = def_cannyThresh; + float opt_cannyThresh = def_cannyThresh; int opt_nbEdgeFilteringIter = def_nbEdgeFilteringIter; std::pair opt_centerXlimits = def_centerXlimits; std::pair opt_centerYlimits = def_centerYlimits; unsigned int opt_minRadius = def_minRadius; unsigned int opt_maxRadius = def_maxRadius; int opt_dilatationRepet = def_dilatationRepet; - double opt_centerThresh = def_centerThresh; - int opt_radiusThreshRatio = def_radiusThreshRatio; - double opt_circlePerfectness = def_circlePerfectness; - double opt_centerDistanceThresh = def_centerDistanceThresh; - double opt_radiusDifferenceThresh = def_radiusDifferenceThresh; + float opt_centerThresh = def_centerThresh; + float opt_radiusThreshRatio = def_radiusThreshRatio; + float opt_circlePerfectness = def_circlePerfectness; + float opt_centerDistanceThresh = def_centerDistanceThresh; + float opt_radiusDifferenceThresh = def_radiusDifferenceThresh; bool opt_displayCanny = false; for (int i = 1; i < argc; i++) { @@ -257,7 +256,7 @@ int main(int argc, char **argv) i++; } else if (argName == "--gaussian-sigma" && i + 1 < argc) { - opt_gaussianSigma = atof(argv[i + 1]); + opt_gaussianSigma = static_cast(atof(argv[i + 1])); i++; } else if (argName == "--sobel-kernel" && i + 1 < argc) { @@ -265,7 +264,7 @@ int main(int argc, char **argv) i++; } else if (argName == "--canny-thresh" && i + 1 < argc) { - opt_cannyThresh = atof(argv[i + 1]); + opt_cannyThresh = static_cast(atof(argv[i + 1])); i++; } else if (argName == "--edge-filter" && i + 1 < argc) { @@ -282,7 +281,7 @@ int main(int argc, char **argv) i += 2; } else if (argName == "--center-thresh" && i + 1 < argc) { - opt_centerThresh = atof(argv[i + 1]); + opt_centerThresh = static_cast(atof(argv[i + 1])); i++; } else if (argName == "--center-xlim" && i + 2 < argc) { @@ -294,16 +293,16 @@ int main(int argc, char **argv) i += 2; } else if (argName == "--radius-thresh" && i + 1 < argc) { - opt_radiusThreshRatio = atof(argv[i + 1]); + opt_radiusThreshRatio = static_cast(atof(argv[i + 1])); i++; } else if (argName == "--circle-perfectness" && i + 1 < argc) { - opt_circlePerfectness = atof(argv[i + 1]); + opt_circlePerfectness = static_cast(atof(argv[i + 1])); i++; } else if (argName == "--merging-thresh" && i + 2 < argc) { - opt_centerDistanceThresh = atof(argv[i + 1]); - opt_radiusDifferenceThresh = atof(argv[i + 2]); + opt_centerDistanceThresh = static_cast(atof(argv[i + 1])); + opt_radiusDifferenceThresh = static_cast(atof(argv[i + 2])); i += 2; } else if (argName == "--display-edge-map") {