问题
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