I am trying to calculate distance between 2 images using shape context method (C++)
my code is:
cv::Ptr <cv::shapecontextdistanceextractor> mysc = cv::createShapeContextDistanceExtractor(); Mat query = imread("images/26.bmp", IMREAD_GRAYSCALE); vector<point> contQuery = simpleContour(query); Mat iiIm = imread("database/u0/training_Set/35.bmp", IMREAD_GRAYSCALE); vector<point> contii = simpleContour(iiIm); float distance = mysc->computeDistance(contQuery, contii); cout << distance << endl;
But when i add theses lines before the mentioned code:
Mat test = imread("images/8.bmp", IMREAD_GRAYSCALE); vector<point> testContour= simpleContour(test);
distance changes and gives new value, So why calling simpleContour() for another image can change the next values.