-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathContourTreeComp.cpp
36 lines (27 loc) · 1004 Bytes
/
ContourTreeComp.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**------------------------------------------------------------------------
* All Rights Reserved
* Author: Diego Macrini
*-----------------------------------------------------------------------*/
#include <RootHeader.h>
#include "ContourTreeComp.h"
#include <Tools/HelperFunctions.h>
#include <Tools/UserArguments.h>
//#include <Tools/cv.h>
#include <Tools/CvUtils.h>
#if (_MSC_VER) // microsoft visual studio
#pragma warning(disable : 4996) // disable all deprecation warnings in cvaux.h
#endif
#include <Tools/cv_legacy.h>
using namespace vpl;
extern UserArguments g_userArgs;
double ContourTreeComp::Match(const ShapeDescriptor& sd1,
const ShapeDescriptor& sd2)
{
const ContourTree& ct1 = CastDescriptor<ContourTree>(sd1);
const ContourTree& ct2 = CastDescriptor<ContourTree>(sd2);
double dist = cvMatchContourTrees(ct1, ct2, CV_CONTOUR_TREES_MATCH_I1,
ContourTree::GetParams().similarityThreshold);
ASSERT_VALID_NUM(dist);
ASSERT(dist >= 0);
return dist;
}