diff --git a/modules/fastcv/CMakeLists.txt b/modules/fastcv/CMakeLists.txt index 74356f37e4b..677accd8fe6 100644 --- a/modules/fastcv/CMakeLists.txt +++ b/modules/fastcv/CMakeLists.txt @@ -1,18 +1,22 @@ -set(the_description "FastCV extension module") -ocv_define_module(fastcv opencv_core opencv_imgproc opencv_features2d opencv_video WRAP python java) - -if (FASTCV_DIR) - if(NOT ARM AND NOT AARCH64) - # the reason this warning is not fatal is to enable proper code analysis - # in your favourite IDE - message(WARNING "FastCV supports ARM platform only!") - endif() +if((ARM OR AARCH64) AND (ANDROID OR (UNIX AND NOT APPLE AND NOT IOS AND NOT XROS))) + set(the_description "FastCV extension module") + set(FCV_MODULE_HEADER_DIR "${CMAKE_CURRENT_BINARY_DIR}/inc") + set(FCV_MODULE_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/libs") # here you can change the library to a specific one - set(FASTCV_LIB "/libs/Android/lib64/libfastcvopt.so") + set(FASTCV_LIB "${FCV_MODULE_LIB_DIR}/libfastcvopt.so") + if((NOT EXISTS ${FCV_MODULE_HEADER_DIR}) OR (NOT EXISTS ${FCV_MODULE_LIB_DIR})) + include("${CMAKE_CURRENT_SOURCE_DIR}/fastcv.cmake") + download_fastcv("${CMAKE_CURRENT_BINARY_DIR}") + endif() - ocv_module_include_directories("${FASTCV_DIR}/inc") - ocv_target_link_libraries(${the_module} LINK_PRIVATE "${FASTCV_DIR}/${FASTCV_LIB}") + ocv_define_module(fastcv opencv_core opencv_imgproc opencv_features2d opencv_video WRAP python java) + ocv_module_include_directories( + "${CMAKE_CURRENT_SOURCE_DIR}/include" + ${FCV_MODULE_HEADER_DIR}) + ocv_target_link_libraries(${the_module} ${FASTCV_LIB}) ocv_target_compile_definitions(${the_module} PRIVATE FAST_CV_FOUND) +else() + message(FATAL_ERROR "FastCV supports ARM Platform on Android and Linux only!") endif() diff --git a/modules/fastcv/fastcv.cmake b/modules/fastcv/fastcv.cmake new file mode 100644 index 00000000000..e891ae38588 --- /dev/null +++ b/modules/fastcv/fastcv.cmake @@ -0,0 +1,35 @@ +function(download_fastcv root_dir) + + # Commit SHA in the opencv_3rdparty repo + set(FASTCV_COMMIT "65f40fc8f7a6aac44936ae9538e69edede6c4b15") + + # Define actual FCV versions + if(ANDROID) + if(AARCH64) + set(FCV_PACKAGE_NAME "fastcv_android_aarch64_2024_10_24.tgz") + set(FCV_PACKAGE_HASH "8a259eea80064643bad20f72ba0b6066") + else() + set(FCV_PACKAGE_NAME "fastcv_android_arm32_2024_10_24.tgz") + set(FCV_PACKAGE_HASH "04d89219c44d54166b2b7f8c0ed5143b") + endif() + elseif(UNIX AND NOT APPLE AND NOT IOS AND NOT XROS) + message("FastCV: fastcv lib for Linux is not supported for now!") + endif(ANDROID) + + # Download Package + set(OPENCV_FASTCV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FASTCV_COMMIT}/fastcv/") + + ocv_download( FILENAME ${FCV_PACKAGE_NAME} + HASH ${FCV_PACKAGE_HASH} + URL ${OPENCV_FASTCV_URL} + DESTINATION_DIR ${root_dir} + ID FASTCV + STATUS res + UNPACK + RELATIVE_URL) + + if(NOT res) + message("FastCV: package download failed! Please download FastCV manually and put it at ${root_dir}.") + endif() + +endfunction() \ No newline at end of file diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.010000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.010000.png deleted file mode 100644 index 7c738589e3e..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.010000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.050000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.050000.png deleted file mode 100644 index ecbbb59249e..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.050000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.100000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.100000.png deleted file mode 100644 index 591d8442693..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_0.100000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_1.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.010000_1.000000.png deleted file mode 100644 index e965ca7e751..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_1.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_5.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.010000_5.000000.png deleted file mode 100644 index 08c4f2c03b6..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.010000_5.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.010000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.010000.png deleted file mode 100644 index f31082cdc47..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.010000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.050000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.050000.png deleted file mode 100644 index 782b90e1ace..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.050000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.100000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.100000.png deleted file mode 100644 index 39b8b40e63c..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_0.100000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_1.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.030000_1.000000.png deleted file mode 100644 index 5b6d4104a11..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_1.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_5.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.030000_5.000000.png deleted file mode 100644 index 215aeeaeba6..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.030000_5.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.010000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.010000.png deleted file mode 100644 index 46122a83528..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.010000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.050000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.050000.png deleted file mode 100644 index 683592a1071..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.050000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.100000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.100000.png deleted file mode 100644 index d6fc1957f0f..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_0.100000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_1.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.100000_1.000000.png deleted file mode 100644 index b2d941c93fd..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_1.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_5.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_0.100000_5.000000.png deleted file mode 100644 index 37025661fea..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_0.100000_5.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.010000.png b/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.010000.png deleted file mode 100644 index 709b480aaaf..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.010000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.050000.png b/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.050000.png deleted file mode 100644 index 2c07c8f9fb2..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.050000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.100000.png b/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.100000.png deleted file mode 100644 index 2971ffdd43a..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_0.100000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_1.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_1.000000_1.000000.png deleted file mode 100644 index 7808b7f8493..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_1.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_5.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_1.000000_5.000000.png deleted file mode 100644 index 92ad56e4b06..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_1.000000_5.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.010000.png b/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.010000.png deleted file mode 100644 index c495b10142c..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.010000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.050000.png b/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.050000.png deleted file mode 100644 index 21a68b2806f..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.050000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.100000.png b/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.100000.png deleted file mode 100644 index e9f7d65f2c0..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_0.100000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_1.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_5.000000_1.000000.png deleted file mode 100644 index f5197253468..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_1.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_5.000000.png b/modules/fastcv/misc/bilateral_recursive/rec_5.000000_5.000000.png deleted file mode 100644 index b24def32d1d..00000000000 Binary files a/modules/fastcv/misc/bilateral_recursive/rec_5.000000_5.000000.png and /dev/null differ diff --git a/modules/fastcv/misc/hough/kandinsky-circles.jpg b/modules/fastcv/misc/hough/kandinsky-circles.jpg deleted file mode 100644 index b4388a46b68..00000000000 Binary files a/modules/fastcv/misc/hough/kandinsky-circles.jpg and /dev/null differ diff --git a/modules/fastcv/misc/hough/kandinsky-circles_2.jpg b/modules/fastcv/misc/hough/kandinsky-circles_2.jpg deleted file mode 100644 index 889431be013..00000000000 Binary files a/modules/fastcv/misc/hough/kandinsky-circles_2.jpg and /dev/null differ