Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of gr-peach-opencv-project-sd-card by
Moments Class Reference
[Structural Analysis and Shape Descriptors]
struct returned by cv::moments More...
#include <types.hpp>
Public Member Functions | |
Moments () | |
the default constructor | |
Moments (double m00, double m10, double m01, double m20, double m11, double m02, double m30, double m21, double m12, double m03) | |
the full constructor | |
Data Fields | |
spatial moments | |
CV_PROP_RW double | m00 |
CV_PROP_RW double | m10 |
CV_PROP_RW double | m01 |
CV_PROP_RW double | m20 |
CV_PROP_RW double | m11 |
CV_PROP_RW double | m02 |
CV_PROP_RW double | m30 |
CV_PROP_RW double | m21 |
CV_PROP_RW double | m12 |
CV_PROP_RW double | m03 |
central moments | |
CV_PROP_RW double | mu20 |
CV_PROP_RW double | mu11 |
CV_PROP_RW double | mu02 |
CV_PROP_RW double | mu30 |
CV_PROP_RW double | mu21 |
CV_PROP_RW double | mu12 |
CV_PROP_RW double | mu03 |
central normalized moments | |
CV_PROP_RW double | nu20 |
CV_PROP_RW double | nu11 |
CV_PROP_RW double | nu02 |
CV_PROP_RW double | nu30 |
CV_PROP_RW double | nu21 |
CV_PROP_RW double | nu12 |
CV_PROP_RW double | nu03 |
Detailed Description
struct returned by cv::moments
The spatial moments are computed as:
The central moments are computed as:
where is the mass center:
The normalized central moments are computed as:
- Note:
,
, hence the values are not stored.
The moments of a contour are defined in the same way but computed using the Green's formula (see <http://en.wikipedia.org/wiki/Green_theorem>). So, due to a limited raster resolution, the moments computed for a contour are slightly different from the moments computed for the same rasterized contour.
- Note:
- Since the contour moments are computed using Green formula, you may get seemingly odd results for contours with self-intersections, e.g. a zero area (m00) for butterfly-shaped contours.
Definition at line 838 of file types.hpp.
Constructor & Destructor Documentation
Moments | ( | ) |
the default constructor
Definition at line 443 of file moments.cpp.
Moments | ( | double | m00, |
double | m10, | ||
double | m01, | ||
double | m20, | ||
double | m11, | ||
double | m02, | ||
double | m30, | ||
double | m21, | ||
double | m12, | ||
double | m03 | ||
) |
the full constructor
Definition at line 450 of file moments.cpp.
Generated on Tue Jul 12 2022 14:48:01 by
