diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..58fa0cd558e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +name: OpenCV Windows CI +on: [push, pull_request] +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Setup OpenCV + run: | + choco install cmake -y + git clone https://github.com/opencv/opencv.git + mkdir opencv/build + cd opencv/build + cmake .. + cmake --build . --config Release + - name: Build Module + run: | + mkdir build + cd build + cmake -DOPENCV_DIR=../opencv/build .. + cmake --build . --config Release diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 00000000000..cd5c38bf5ce --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,9 @@ +# OpenCV Contrib Building Instructions + +## Basic Build +```bash +cd +cmake -DOPENCV_EXTRA_MODULES_PATH=/modules +make -j5 + +cmake -DBUILD_opencv_=OFF ... \ No newline at end of file diff --git a/README.md b/README.md index 8d3ecda0413..28423f9414f 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,14 @@ -## Repository for OpenCV's extra modules +# OpenCV Fractal Markers (GSoC 2025 Proposal) -This repository is intended for the development of so-called "extra" modules, -contributed functionality. New modules quite often do not have stable API, -and they are not well-tested. Thus, they shouldn't be released as a part of the -official OpenCV distribution, since the library maintains binary compatibility, -and tries to provide decent performance and stability. +**Project**: OpenCV idea 13 : Integrate Fractal ArUco into OpenCV +**Paper**: [Fractal Markers: A New Approach for Long-Range Marker Pose Estimation Under Occlusion](https://ieeexplore.ieee.org/document/8698871) -So, all the new modules should be developed separately, and published in the -`opencv_contrib` repository at first. Later, when the module matures and gains -popularity, it is moved to the central OpenCV repository, and the development team -provides production-quality support for this module. +## API Proposal +```cpp +// Current implementation: +void detectFractalMarkers(InputArray image, + const Ptr& fractalDict, + OutputArrayOfArrays corners, + const Ptr& params = nullptr); -### How to build OpenCV with extra modules -You can build OpenCV, so it will include the modules from this repository. Contrib modules are under constant development and it is recommended to use them alongside the master branch or latest releases of OpenCV. - -Here is the CMake command for you: - -``` -$ cd -$ cmake -DOPENCV_EXTRA_MODULES_PATH=/modules -$ make -j5 -``` - -As the result, OpenCV will be built in the `` with all -modules from `opencv_contrib` repository. If you don't want all of the modules, -use CMake's `BUILD_opencv_*` options. Like in this example: - -``` -$ cmake -DOPENCV_EXTRA_MODULES_PATH=/modules -DBUILD_opencv_legacy=OFF -``` - -If you also want to build the samples from the "samples" folder of each module, also include the "-DBUILD_EXAMPLES=ON" option. - -If you prefer using the GUI version of CMake (cmake-gui), then, you can add `opencv_contrib` modules within `opencv` core by doing the following: - -1. Start cmake-gui. - -2. Select the opencv source code folder and the folder where binaries will be built (the 2 upper forms of the interface). - -3. Press the `configure` button. You will see all the opencv build parameters in the central interface. - -4. Browse the parameters and look for the form called `OPENCV_EXTRA_MODULES_PATH` (use the search form to focus rapidly on it). - -5. Complete this `OPENCV_EXTRA_MODULES_PATH` by the proper pathname to the `/modules` value using its browse button. - -6. Press the `configure` button followed by the `generate` button (the first time, you will be asked which makefile style to use). - -7. Build the `opencv` core with the method you chose (make and make install if you chose Unix makefile at step 6). - -8. To run, linker flags to contrib modules will need to be added to use them in your code/IDE. For example to use the aruco module, "-lopencv_aruco" flag will be added. - -### Update the repository documentation - -In order to keep a clean overview containing all contributed modules, the following files need to be created/adapted: - -1. Update the README.md file under the modules folder. Here, you add your model with a single-line description. - -2. Add a README.md inside your own module folder. This README explains which functionality (separate functions) is available, links to the corresponding samples, and explains in somewhat more detail what the module is expected to do. If any extra requirements are needed to build the module without problems, add them here also. diff --git a/README_ORIGINAL.md b/README_ORIGINAL.md new file mode 100644 index 00000000000..f7d928726c6 --- /dev/null +++ b/README_ORIGINAL.md @@ -0,0 +1,18 @@ +# OpenCV Fractal Markers (GSoC 2025 Proposal) + +Implementation of hierarchical marker detection from: +[Fractal Markers: A New Approach for Long-Range Marker Pose Estimation Under Occlusion](https://ieeexplore.ieee.org/document/8698871) + +## API Proposal +```cpp +vector> corners; +detectFractalMarkers(image, getFractalDictionary(), corners); + + +## Project Phases +- [x] Phase 1: API Design ( Doxygen documented -->(`aruco/include/opencv2/aruco/fractal_markers.hpp`) ) +- [ ] Phase 2: Core Detection Implementation +- [ ] Phase 3: Occlusion Handling & Optimization + + +Note: This is my first OpenCV contribution. Feedback on API design and implementation approach is welcome! \ No newline at end of file diff --git a/modules/aruco/CMakeLists.txt b/modules/aruco/CMakeLists.txt index e9c97d7739e..a314f34ed09 100644 --- a/modules/aruco/CMakeLists.txt +++ b/modules/aruco/CMakeLists.txt @@ -1,2 +1,7 @@ set(the_description "ArUco Marker Detection") ocv_define_module(aruco opencv_core opencv_imgproc opencv_calib3d opencv_objdetect WRAP python java objc js) + +# Fractal Markers Tests +if(BUILD_TESTS AND HAVE_OPENCV_VIDEOIO) + add_subdirectory(test) +endif() diff --git a/modules/aruco/include/opencv2/aruco/fractal_markers.hpp b/modules/aruco/include/opencv2/aruco/fractal_markers.hpp new file mode 100644 index 00000000000..d3f95268fd1 --- /dev/null +++ b/modules/aruco/include/opencv2/aruco/fractal_markers.hpp @@ -0,0 +1 @@ +// Fractal Markers Header diff --git a/modules/aruco/test/test_fractal.cpp b/modules/aruco/test/test_fractal.cpp new file mode 100644 index 00000000000..ed8ef5d4bbf --- /dev/null +++ b/modules/aruco/test/test_fractal.cpp @@ -0,0 +1,15 @@ +#include "opencv2/aruco/fractal_markers.hpp" +#include "opencv2/ts.hpp" + +namespace opencv_test { +namespace { + +TEST(FractalMarkers, BasicAPI) { + std::vector> corners; + cv::Mat testImage(480, 640, CV_8UC1, cv::Scalar(0)); + auto dict = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_4X4_50); + cv::aruco::DetectorParameters params; + EXPECT_NO_THROW(detectFractalMarkers(testImage, dict, corners, params)); +} +} +}