Android: using hu moments opencv function to get the feature value

自闭症网瘾萝莉.ら 提交于 2019-12-25 02:42:58

问题


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??

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

link : example-humoments-visual-studio


回答1:


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);


来源:https://stackoverflow.com/questions/20783022/android-using-hu-moments-opencv-function-to-get-the-feature-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!