安卓:使用Hu矩的OpenCV函数来获取特征值 [英] Android: using hu moments opencv function to get the feature value

查看:1308
本文介绍了安卓:使用Hu矩的OpenCV函数来获取特征值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目是让叶图像的特征值,然后保存在数据库中的价值。但我不知道如何在Android上使用Hu矩函数的OpenCV的。任何人都可以给我在Android上使用Hu矩函数从OpenCV的例子??

My project is to get the feature value of leaf image and then save that value on database. But i don't know how to use hu moments function from opencv on android. Can anybody give me the example to use hu moments function from opencv on android??

这是,我发现使用视觉工作室humoments的例子:

This is the example that i found of using humoments on visual studio:

cv::Moments mom = cv::moments(contours[0]); 
double hu[7];
cv::HuMoments(mom, hu); // now in hu are your 7 Hu-Moments

链接:例如,humoments - 视觉工作室

推荐答案

我知道这是有点老了,但对于谁在这个问题上落得的:

I know this is kinda old, but for the ones who end up on this question:

Moments mom = new Moments();
mom = Imgproc.moments(contours.get(0), false);
Mat hu = new Mat();
//Hu moments
Imgproc.HuMoments(mom, hu);

这篇关于安卓:使用Hu矩的OpenCV函数来获取特征值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆