OpenCV
4.10.0-dev
Open Source Computer Vision
|
Enumerations | |
enum | cv::cuda::MomentsOrder { cv::cuda::FIRST_ORDER_MOMENTS = 1 , cv::cuda::SECOND_ORDER_MOMENTS = 2 , cv::cuda::THIRD_ORDER_MOMENTS = 3 } |
Order of image moments. More... | |
Functions | |
Moments | cv::cuda::convertSpatialMoments (Mat spatialMoments, const MomentsOrder order, const int momentsType) |
Converts the spatial image moments returned from cuda::spatialMoments to cv::Moments. | |
Moments | cv::cuda::moments (InputArray src, const bool binaryImage=false, const MomentsOrder order=MomentsOrder::THIRD_ORDER_MOMENTS, const int momentsType=CV_64F) |
Calculates all of the moments up to the 3rd order of a rasterized shape. | |
int | cv::cuda::numMoments (const MomentsOrder order) |
Returns the number of image moments less than or equal to the largest image moments order. | |
void | cv::cuda::spatialMoments (InputArray src, OutputArray moments, const bool binaryImage=false, const MomentsOrder order=MomentsOrder::THIRD_ORDER_MOMENTS, const int momentsType=CV_64F, Stream &stream=Stream::Null()) |
Calculates all of the spatial moments up to the 3rd order of a rasterized shape. | |
#include <opencv2/cudaimgproc.hpp>
Order of image moments.
FIRST_ORDER_MOMENTS | First order moments |
SECOND_ORDER_MOMENTS | Second order moments. |
THIRD_ORDER_MOMENTS | Third order moments. |
Enumerator | |
---|---|
FIRST_ORDER_MOMENTS | |
SECOND_ORDER_MOMENTS | |
THIRD_ORDER_MOMENTS |
Moments cv::cuda::convertSpatialMoments | ( | Mat | spatialMoments, |
const MomentsOrder | order, | ||
const int | momentsType | ||
) |
#include <opencv2/cudaimgproc.hpp>
Converts the spatial image moments returned from cuda::spatialMoments to cv::Moments.
spatialMoments | Spatial moments returned from cuda::spatialMoments. |
order | Order used when calculating image moments with cuda::spatialMoments. |
momentsType | Precision used when calculating image moments with cuda::spatialMoments. |
Moments cv::cuda::moments | ( | InputArray | src, |
const bool | binaryImage = false , |
||
const MomentsOrder | order = MomentsOrder::THIRD_ORDER_MOMENTS , |
||
const int | momentsType = CV_64F |
||
) |
#include <opencv2/cudaimgproc.hpp>
Calculates all of the moments up to the 3rd order of a rasterized shape.
The function computes moments, up to the 3rd order, of a rasterized shape. The results are returned in the structure cv::Moments.
src | Raster image (single-channel 2D array). |
binaryImage | If it is true, all non-zero image pixels are treated as 1's. |
order | Order of largest moments to calculate with lower order moments requiring less computation. |
momentsType | Precision to use when calculating moments. Available types are CV_32F and CV_64F with the performance of CV_32F an order of magnitude greater than CV_64F. If the image is small the accuracy from CV_32F can be equal or very close to CV_64F. |
int cv::cuda::numMoments | ( | const MomentsOrder | order | ) |
#include <opencv2/cudaimgproc.hpp>
Returns the number of image moments less than or equal to the largest image moments order.
order | Order of largest moments to calculate with lower order moments requiring less computation. |
void cv::cuda::spatialMoments | ( | InputArray | src, |
OutputArray | moments, | ||
const bool | binaryImage = false , |
||
const MomentsOrder | order = MomentsOrder::THIRD_ORDER_MOMENTS , |
||
const int | momentsType = CV_64F , |
||
Stream & | stream = Stream::Null() |
||
) |
#include <opencv2/cudaimgproc.hpp>
Calculates all of the spatial moments up to the 3rd order of a rasterized shape.
Asynchronous version of cuda::moments() which only calculates the spatial (not centralized or normalized) moments, up to the 3rd order, of a rasterized shape. Each moment is returned as a column entry in the 1D moments array.
src | Raster image (single-channel 2D array). | |
[out] | moments | 1D array with each column entry containing a spatial image moment. |
binaryImage | If it is true, all non-zero image pixels are treated as 1's. | |
order | Order of largest moments to calculate with lower order moments requiring less computation. | |
momentsType | Precision to use when calculating moments. Available types are CV_32F and CV_64F with the performance of CV_32F an order of magnitude greater than CV_64F. If the image is small the accuracy from CV_32F can be equal or very close to CV_64F. | |
stream | Stream for the asynchronous version. |
see the CUDA_TEST_P(Moments, Async) test inside opencv_contrib_source_code/modules/cudaimgproc/test/test_moments.cpp for an example.