8/06/2012

Contour compare using OpenCV(source code), cvFindContours, cvMatchShapes

There is shape match function in the OpenCV.
The function name is cvMatchShapes.
This function compares two contours.
If two contours is same, the function returns 0.
conversely, the value of return is larger, more shape different.
So, we use threshold to decide these pair is similar or not.


 






code start

code end

#findcontour, #contour, #compare


source coude

7 comments:

  1. Anonymous30/5/13 01:35

    you have to free storage like that

    cvReleaseMemStorage(&storage);

    ReplyDelete
  2. Good point, thank you very much.
    ^^

    ReplyDelete
  3. This is really helpful. What if the size of the contour is smaller or larger than the template contour but the shape is the same? Do you any idea how it will be the same(0)?

    ReplyDelete
  4. I will check the question, and upload the solution soon.
    Thank you.

    ReplyDelete
  5. is there some answer for the above question.
    I am using the above method to find the difference in a character image.
    so if the font is bigger, how can we handle this.
    Please let me know if you find some answers.
    Thanks in advance

    ReplyDelete
    Replies
    1. I am interesting in your source code, but can not download them. Can you help me?

      Delete