gussurya_w
gussurya_w

Reputation: 103

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

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

Upvotes: 0

Views: 1389

Answers (1)

ffurrer
ffurrer

Reputation: 105

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

Upvotes: 2

Related Questions