State object for calculating various image moments. More...
Inherits object.
Public Member Functions | |
float | central_moment (self, int x_order, int y_order, int normalization) |
Gets one of the central image moments. More... | |
cvb.foundation.HuMoments | hu_moments (self) |
Gets the seven Hu moments of the image. More... | |
float | spatial_moment (self, int x_order, int y_order, int normalization, Optional[cvb.Point2D] offset) |
Gets one of the spatial image moments. More... | |
Properties | |
calculation_preference = property | |
int: The preference of speed versus accuracy chosen, when this object was created (see cvb.foundation.MomentsCalculation). | |
State object for calculating various image moments.
Calculate the moments on the input ImagePlane and area of interest.
image_plane : cvb.ImagePlane Plane on which to calculate the moments.
aoi : Optional[cvb.Rect] Area of interest to calculate the moments (default entire plane).
preference : int Speed or accuracy, MomentsCalculation.FavorNone by default.
float central_moment | ( | self, | |
int | x_order, | ||
int | y_order, | ||
int | normalization | ||
) |
Gets one of the central image moments.
x_order : int X-order of the moment to retrieve (see cvb.foundation.MomentsOrder).
y_order : int Y-order of the moment to retrieve (see cvb.foundation.MomentsOrder).
normalization : int Whether or not to normalize (see cvb.foundation.MomentsNormalization).
float The central moment.
cvb.foundation.HuMoments hu_moments | ( | self | ) |
float spatial_moment | ( | self, | |
int | x_order, | ||
int | y_order, | ||
int | normalization, | ||
Optional[cvb.Point2D] | offset | ||
) |
Gets one of the spatial image moments.
x_order : int X-order of the moment to retrieve (see cvb.foundation.MomentsOrder).
y_order : int Y-order of the moment to retrieve (see cvb.foundation.MomentsOrder).
normalization : int Whether or not to normalize (see cvb.foundation.MomentsNormalization).
offset : Optional[cvb.Point2D] Offset of the moments (optional, by default uses the offset used when creating this object).
float The spatial moment.