![]() |
OpenCV 4.11.0
开源计算机视觉库
|
枚举 | |
| 枚举 | cv::cuda::MomentsOrder { cv::cuda::FIRST_ORDER_MOMENTS = 1 , cv::cuda::SECOND_ORDER_MOMENTS = 2 , cv::cuda::THIRD_ORDER_MOMENTS = 3 } |
| 图像矩的阶数。 更多… | |
函数 | |
| Moments | cv::cuda::convertSpatialMoments (Mat spatialMoments, const MomentsOrder order, const int momentsType) |
| 将从 cuda::spatialMoments 返回的空间图像矩转换为 cv::Moments。 | |
| Moments | cv::cuda::moments (InputArray src, const bool binaryImage=false, const MomentsOrder order=MomentsOrder::THIRD_ORDER_MOMENTS, const int momentsType=CV_64F) |
| 计算栅格化形状最多 3 阶的所有矩。 | |
| int | cv::cuda::numMoments (const MomentsOrder order) |
| 返回小于或等于最大图像矩 *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()) |
| 计算栅格化形状最多 3 阶的所有空间矩。 | |
#include <opencv2/cudaimgproc.hpp>
图像矩的阶数。
| FIRST_ORDER_MOMENTS | 一阶矩 |
| SECOND_ORDER_MOMENTS | 二阶矩。 |
| THIRD_ORDER_MOMENTS | 三阶矩。 |
| 枚举值 | |
|---|---|
| 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>
将从 cuda::spatialMoments 返回的空间图像矩转换为 cv::Moments。
| spatialMoments | 从 cuda::spatialMoments 返回的空间矩。 |
| order | 使用 cuda::spatialMoments 计算图像矩时使用的阶数。 |
| momentsType | 使用 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>
计算栅格化形状最多 3 阶的所有矩。
该函数计算栅格化形状最多 3 阶的矩。结果以 cv::Moments 结构体的形式返回。
| src | 栅格图像(单通道二维数组)。 |
| binaryImage | 如果为真,则所有非零图像像素都视为 1。 |
| order | 要计算的最大矩的阶数,低阶矩需要较少的计算。 |
| momentsType | 计算矩时使用的精度。可用类型为 CV_32F 和 CV_64F,CV_32F 的性能比 CV_64F 高一个数量级。如果图像较小,则 CV_32F 的精度可以等于或非常接近 CV_64F。 |
| int cv::cuda::numMoments | ( | const MomentsOrder | order | ) |
#include <opencv2/cudaimgproc.hpp>
返回小于或等于最大图像矩 *order* 的图像矩的数量。
| 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() ) |
#include <opencv2/cudaimgproc.hpp>
计算栅格化形状最多 3 阶的所有空间矩。
cuda::moments() 的异步版本,它只计算光栅化形状的最高三阶空间矩(非中心化或归一化)。每个矩作为1D moments 数组中的列条目返回。
| src | 栅格图像(单通道二维数组)。 | |
| [输出] | moments | 每个列条目包含一个空间图像矩的1D数组。 |
| binaryImage | 如果为真,则所有非零图像像素都视为 1。 | |
| order | 要计算的最大矩的阶数,低阶矩需要较少的计算。 | |
| momentsType | 计算矩时使用的精度。可用类型为 CV_32F 和 CV_64F,CV_32F 的性能比 CV_64F 高一个数量级。如果图像较小,则 CV_32F 的精度可以等于或非常接近 CV_64F。 | |
| stream | 异步版本的Stream。 |
参见opencv_contrib_source_code/modules/cudaimgproc/test/test_moments.cpp中的CUDA_TEST_P(Moments, Async)测试示例。