https://github.com/sensoranalyticsaus/hu-invars
Python implementations of Hu's moment invariants for images
https://github.com/sensoranalyticsaus/hu-invars
Last synced: 1 day ago
JSON representation
Python implementations of Hu's moment invariants for images
- Host: GitHub
- URL: https://github.com/sensoranalyticsaus/hu-invars
- Owner: SensorAnalyticsAus
- License: apache-2.0
- Created: 2024-08-27T12:00:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-28T12:01:20.000Z (almost 2 years ago)
- Last Synced: 2025-02-28T00:31:57.549Z (over 1 year ago)
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Hu Invariant Moments
Implementations of Hu's invariants with respect to translation, scale, and rotation using `skimage` and `opencv` APIs.
### Usage
```
git clone https://github.com/SensorAnalyticsAus/hu-invars.git
cd cd hu-invars/
```
With `skimage`
```
python hu.py img/shapes-01.jpg
```
Output:
```
[ 3.0877 6.74289 14.92162 14.59358 29.37642 18.02443 29.83101]
```
With `opencv`
```
python hu-cv2.py img/shapes-01.jpg
```
Output
```
[ 3.0877 6.74289 14.92162 14.59358 29.37642 18.02443 -29.83101]
```
### Refs
* M. K. Hu, "Visual Pattern Recognition by Moment Invariants", IRE Trans. Info. Theory, vol. IT-8, pp.179–187, 1962
* [scikit-image](https://scikit-image.org/docs/stable/api/skimage.measure.html#skimage.measure.moments)
* [opencv image moments](https://docs.opencv.org/3.4/d0/d49/tutorial_moments.html)