Comparing Two Contours: Rotation invariant?
I found one approach for estimate the orientation of two contours here , which rotates one contour and checks the distance to the original. I changed the headers to
#include <opencv2/core.hpp>
#include <opencv2/shape.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv_modules.hpp>
#include <iostream>
#include <fstream>
#include <string.h>
and the main to:
int main(int argc, char* argv[])
It may be kind of a stupid question, but first of all i don't know, why the transformation of the contours should improve the result of computeDistance. Is the <cv::shapecontextdistanceextractor> not invariant to rotation and translation, because it does an internal fit?
If this would be the case, my results would be coherent, because I always get 0 as distance (but unfortunately no image as well). Also the result from an other program, where i match rotated contours with cv::shapecontextdistanceextractor> as well as the hausdorff metric seems not to be wrong (small distances, but no exact 0).
Well, that question specifically asked about orientation, not translation. By removing the translation, it removes a complication and makes the results easier to understand.
the cv::shapecontextdistanceextractor IS invariant to rotation and translation, because it does an internal fit.
so how can this part of the code work if the extractor is invariant?
}
edit: Because if its invariant dist would be independent of the angle - or do I understand something wrong?