{"id":15697008,"url":"https://github.com/cpbridge/monogenic","last_synced_at":"2025-07-05T08:34:17.384Z","repository":{"id":159497151,"uuid":"89600032","full_name":"CPBridge/monogenic","owner":"CPBridge","description":"An implementation of the monogenic signal using C++ and OpenCV","archived":false,"fork":false,"pushed_at":"2021-02-12T05:28:04.000Z","size":21,"stargazers_count":8,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T19:21:19.678Z","etag":null,"topics":["feature-symmetry","image-processing","local-phase","monogenic-signal","opencv"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CPBridge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-27T13:22:57.000Z","updated_at":"2023-11-20T23:11:20.000Z","dependencies_parsed_at":"2023-08-30T16:49:24.518Z","dependency_job_id":null,"html_url":"https://github.com/CPBridge/monogenic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPBridge%2Fmonogenic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPBridge%2Fmonogenic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPBridge%2Fmonogenic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CPBridge%2Fmonogenic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CPBridge","download_url":"https://codeload.github.com/CPBridge/monogenic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253162740,"owners_count":21863970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feature-symmetry","image-processing","local-phase","monogenic-signal","opencv"],"created_at":"2024-10-03T19:10:47.529Z","updated_at":"2025-07-05T08:34:17.379Z","avatar_url":"https://github.com/CPBridge.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monogenic Signal (OpenCV Implementation with Python Bindings)\n\nThis is a basic implementation of the monogenic signal for 2D images using\nthe C++ language and the OpenCV library. As well the monogenic signal, several\nrelated quantities that can be derived from the monogenic signal, such as Feature\nSymmetry and Asymmetry, are also implemented.\n\nThe monogenic signal is an alternative way of representing an image, which has a\nnumber of advantages for further processing. For an introduction to the monogenic\nsignal and derived features with references to the relevant scientific literature,\nplease see [this document](https://chrisbridge.science/docs/intro_to_monogenic_signal.pdf) (PDF). If you find this or the monogenic library useful consider citation of the [work](https://arxiv.org/pdf/1703.09199).\n\n**Python bindings are also provided** using [pybind11](https://github.com/pybind/pybind11) \u0026 [cvnp](https://github.com/pthom/cvnp), allowing you to use this library from Python with seamless NumPy integration.\n\n### Capabilities\n\nFunctions are provided to calculate the following quantities for 2D images:\n\n* Monogenic Signal.\n* Local Energy, Local Phase and Local Orientation to describe the local properties of image.\n* Feature Symmetry and Asymmetry, respond to symmetric 'blobs' and boundaries with robustness to variable contrast.\n* Oriented Feature Symmetry and Asymmetry, as above but also containing the polarity of the symmetry and the orientation of the boundaries.\n\nThis implementation was written with computational efficiency as a key objective,\nsuch that it can be used for video processing applications. It is designed to avoid\nredundant calculations when several quantities are desired from the same input\nimage.\n\nHowever, it is also straightforward and appropriate to use for calculating single\nquantities from still images.\n\n### Dependencies\n\n#### C++ Dependencies\n* A C++ compiler supporting the C++14 standard (requires a relatively modern version of your compiler).\n* The [OpenCV](http://opencv.org) library. Tested on version 4.2 and 4.5.5 but most fairly recent\nversions should be compatible. If you are using GNU/Linux, there will probably\nbe a suitable packaged version in your distribution's repository.\n* (Optional) If you use a C++ compiler supporting the\n[OpenMP](http://openmp.org/wp/) standard (includes most major compilers on major\nplatforms including MSVC, g++ and clang) there may be a small speed boost due to\nparallelisation.\n\n#### Python Dependencies (for Python bindings)\n* Python 3.6 or higher\n* NumPy\n* OpenCV Python (`cv2` installed via `pip install opencv-python`)\n* The project uses Pybind11 and cvnp as submodules (see building instructions below)\n\n### Building the Project\n\n#### Initialize Submodules\n\n**Important**: If you wish to build the Python bindings, you must initialize the git submodules before building:\n\n```bash\ngit submodule update --init --recursive\n```\n\nThis will download the required Pybind11 and cvnp dependencies needed for the Python bindings.\n\n#### Build with CMake\n\nTo build the project, use CMake with the `BUILD_PYTHON_BINDINGS` option on/off to add python bindings, by default it is disabled:\n\n```bash\nmkdir build\ncd build\ncmake -DBUILD_PYTHON_BINDINGS=ON ..\nmake -j$(nproc)\n```\n\nThis will build:\n- The monogenic C++ library\n- The C++ example executable (`monogenic_image_test`)\n\nand, if python bindings are enabled:\n- The Python module (`pymonogenic`)\n\n### Instructions for Use\n\n#### C++ Usage\n\nThe implementation consists of a single C++ class (`monogenicProcessor`), defined\nin the `src/monogenicProcessor.cpp` and `include/monogenic/monogenicProcessor.h`\nfiles. To use the code in your project, you just need to include the `.cpp`\nfile in the usual way, and add the repository's `include/` directory in the\ninclude path.\n\nThere is an example program showing how to use the class in the `example/cpp/`\ndirectory. The comments in this file should demonstrate the basic usage.\n\n#### Python Usage\n\nAfter building the project, the Python module `pymonogenic` will be available. It may be installed in the interpreter's site-packages folder using `make install`. Alternatively add to the `PYTHONPATH` environment variable the path to the build folder that contains the compiled pymonogenic library (`build/python` in the example above), e.g. with `export PYTHONPATH=build/python:${PYTHONPATH}`.\n\n You can use it like this:\n\n```python\nimport cv2\nimport pymonogenic\n\n# Load an image\nimage = cv2.imread('your_image.jpg', cv2.IMREAD_GRAYSCALE)\n\n# Create a processor\nprocessor = pymonogenic.MonogenicProcessor(image.shape[0], image.shape[1], wavelength=50.0)\n\n# Calculate monogenic signal\nprocessor.findMonogenicSignal(image)\n\n# Get results\nfeature_asymmetry = processor.getFeatureAsymmetry()\nfeature_symmetry = processor.getFeatureSymmetry()\neven_part = processor.getEvenFilt()\nodd_y, odd_x = processor.getOddFiltCartesian()\n```\n\n### Running the Examples\n\n#### C++ Example\n\nTo compile and run the C++ example:\n\n```bash\n# Build the project first (see Building section above)\ncd build\n\n# Run the example with a video file\n./monogenic_image_test path/to/your/video_file.avi\n```\n\n#### Python Example\n\nTo run the Python example:\n\n```bash\n# Make sure you've built the project first\ncd example/python\n\n# Run with an image file\npython monogenicImageTest.py path/to/your/image.jpg\n```\n\nThe Python example will:\n- Load and process the specified image\n- Calculate all monogenic signal components\n- Display the results in separate windows (Even filter, Odd Y, Odd X, Feature Symmetry, Feature Asymmetry)\n- Automatically scale the display windows to fit your screen\n\n### Author\n\nWritten by [Christopher Bridge](https://chrisbridge.science/) at the\nUniversity of Oxford's Institute of Biomedical Engineering.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpbridge%2Fmonogenic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcpbridge%2Fmonogenic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpbridge%2Fmonogenic/lists"}