简体   繁体   中英

Bad result on shape recognition using invariant moments

My project is shape recognition of leaf. I use Invariant Moments to feature extraction and City Block Distance to compute the distance between test image and image in database. Bust the result i get is very bad. I can say the recognition is only get less then 50% of match. for example:

This is test image

在此处输入图片说明

But that match with this image:

在此处输入图片说明

I convert that image into binary image using otsu threshold, so the image looking good on shape. My question, is this the normal? or Do I have an error in my coding? This is my coding using City Block Distance:

CityBlock[j] = Math.abs(bMom1 - DB.GetBentukMoment1(j)) + Math.abs(bMom2 - DB.GetBentukMoment2(j)) +
                                Math.abs(bMom3 - DB.GetBentukMoment3(j)) + Math.abs(bMom4 - DB.GetBentukMoment4(j)) +
                                Math.abs(bMom5 - DB.GetBentukMoment5(j)) + Math.abs(bMom6 - DB.GetBentukMoment6(j)) +
                                Math.abs(bMom7 - DB.GetBentukMoment7(j));

If i uses the same image on that coding, the result didn't give 0 value. Why? is it because double data type?

Finally i know the problem on my application, the double value that i save to database with double data type has change, so i use Text data type to store the double value, then i parse that to double, and then i get the zero value for same image. But i think invariant moments is not good for matching on binary image, its better used on canny image. That because for some matching on binary image i still get the problem like my question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM