Rotate/Resize Contour Segments
I am using OpenCV 3.1.1 with VS2012 C++ on a Win10 64 bit machine.
I am hoping that this is not a stupid question.
I am working on comparing contour segments for shape matching as in: Xingang, et al., "Bag of Contour Fragments for Robust Shape Classification" (2014). http://dl.acm.org/citation.cfm?id=258
I have a series of points that define a segment of a contour, further I have a series of these segments. What I want to do is normalize each segment so that they have the same X length, with varying Y values.
Further, the segments should be rotated so that the maximum length is along the X axis when you normalize them. For example, horizontal and vertical lines of the same length would normalize to the same value.
If the segments were just straight lines, that would be one problem. However, the segments are likely to have curves, etc.
Once the segments are aligned on the same axis and normalized, you can compare each segment in a way that is both scale and rotation invariant.
The segments are specified by a series of points in a vector. So, my question is: what is the best way to do this?
Thanks for any help.