added GC_COLOR_GRAD cost function type into opencv_stitching

This commit is contained in:
Alexey Spizhevoy
2011-05-27 11:41:35 +00:00
parent 8e3777676c
commit 56f7e54cce
7 changed files with 218 additions and 63 deletions

View File

@@ -91,10 +91,17 @@ B Graph::walkBreadthFirst(int from, B body) const
//////////////////////////////////////////////////////////////////////////////
// Some auxiliary math functions
static inline
float normL2(const cv::Point3f& a)
{
return a.x * a.x + a.y * a.y + a.z * a.z;
}
static inline
float normL2(const cv::Point3f& a, const cv::Point3f& b)
{
return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) + (a.z - b.z) * (a.z - b.z);
return normL2(a - b);
}