Commit 61c27ac8 authored by Juan Manuel Perez's avatar Juan Manuel Perez Committed by Vadim Pisarevsky

Shape module added

parent 4b203f7b
set(the_description "Shape descriptors and matchers.")
ocv_define_module(shape opencv_core opencv_imgproc opencv_video)
EMD-L1
======
Computes the "minimal work" distance between two weighted point configurations base on the papers "EMD-L1: An efficient and Robust Algorithm
for comparing histogram-based descriptors", by Haibin Ling and Kazunori Okuda; and "The Earth Mover's Distance is the Mallows Distance:
Some Insights from Statistics", by Elizaveta Levina and Peter Bickel.
.. ocv:function:: float EMDL1( InputArray signature1, InputArray signature2 )
:param signature1: First signature, a single column floating-point matrix. Each row is the value of the histogram in each bin.
:param signature2: Second signature of the same format and size as ``signature1``.
Cost Matrix for Histograms Common Interface
===========================================
.. highlight:: cpp
A common interface is defined to ease the implementation of some algorithms pipelines, such
as the Shape Context Matching Algorithm. A common class is defined, so any object that implements
a Cost Matrix builder inherits the
:ocv:class:`HistogramCostExtractor` interface.
HistogramCostExtractor
----------------------
.. ocv:class:: HistogramCostExtractor : public Algorithm
Abstract base class for histogram cost algorithms. ::
class CV_EXPORTS_W HistogramCostExtractor : public Algorithm
{
public:
CV_WRAP virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix) = 0;
CV_WRAP virtual void setNDummies(int nDummies) = 0;
CV_WRAP virtual int getNDummies() const = 0;
CV_WRAP virtual void setDefaultCost(float defaultCost) = 0;
CV_WRAP virtual float getDefaultCost() const = 0;
};
NormHistogramCostExtractor
--------------------------
.. ocv:class:: NormHistogramCostExtractor : public HistogramCostExtractor
A norm based cost extraction. ::
class CV_EXPORTS_W NormHistogramCostExtractor : public HistogramCostExtractor
{
public:
CV_WRAP virtual void setNormFlag(int flag) = 0;
CV_WRAP virtual int getNormFlag() const = 0;
};
CV_EXPORTS_W Ptr<HistogramCostExtractor>
createNormHistogramCostExtractor(int flag=cv::DIST_L2, int nDummies=25, float defaultCost=0.2);
EMDHistogramCostExtractor
-------------------------
.. ocv:class:: EMDHistogramCostExtractor : public HistogramCostExtractor
An EMD based cost extraction. ::
class CV_EXPORTS_W EMDHistogramCostExtractor : public HistogramCostExtractor
{
public:
CV_WRAP virtual void setNormFlag(int flag) = 0;
CV_WRAP virtual int getNormFlag() const = 0;
};
CV_EXPORTS_W Ptr<HistogramCostExtractor>
createEMDHistogramCostExtractor(int flag=cv::DIST_L2, int nDummies=25, float defaultCost=0.2);
ChiHistogramCostExtractor
-------------------------
.. ocv:class:: ChiHistogramCostExtractor : public HistogramCostExtractor
An Chi based cost extraction. ::
class CV_EXPORTS_W ChiHistogramCostExtractor : public HistogramCostExtractor
{};
CV_EXPORTS_W Ptr<HistogramCostExtractor> createChiHistogramCostExtractor(int nDummies=25, float defaultCost=0.2);
EMDL1HistogramCostExtractor
-------------------------
.. ocv:class:: EMDL1HistogramCostExtractor : public HistogramCostExtractor
An EMD-L1 based cost extraction. ::
class CV_EXPORTS_W EMDL1HistogramCostExtractor : public HistogramCostExtractor
{};
CV_EXPORTS_W Ptr<HistogramCostExtractor>
createEMDL1HistogramCostExtractor(int nDummies=25, float defaultCost=0.2);
**********************************
shape. Shape Distance and Matching
**********************************
The module contains algorithms that embed a notion of shape distance.
These algorithms may be used for shape matching and retrieval, or shape
comparison.
.. toctree::
:maxdepth: 2
shape_distances
shape_transformers
histogram_cost_matrix
emdL1
*****
shape
*****
The module contains algorithms that embed a notion of shape distance.
These algorithms may be used for shape matching and retrieval, or shape
comparison.
.. toctree::
:maxdepth: 2
shape_distances
shape_transformers
histogram_cost_matrix
emdL1
This diff is collapsed.
Shape Transformers and Interfaces
=================================
.. highlight:: cpp
A virtual interface that ease the use of transforming algorithms in some pipelines, such as
the Shape Context Matching Algorithm. Thus, all objects that implement shape transformation
techniques inherit the
:ocv:class:`ShapeTransformer` interface.
ShapeTransformer
----------------
.. ocv:class:: ShapeTransformer : public Algorithm
Abstract base class for shape transformation algorithms. ::
class CV_EXPORTS_W ShapeTransformer : public Algorithm
{
public:
CV_WRAP virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape,
std::vector<DMatch>& matches) = 0;
CV_WRAP virtual float applyTransformation(InputArray input, OutputArray output=noArray()) = 0;
CV_WRAP virtual void warpImage(InputArray transformingImage, OutputArray output,
int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT,
const Scalar& borderValue=Scalar()) const = 0;
};
ShapeTransformer::estimateTransformation
----------------------------------------
Estimate the transformation parameters of the current transformer algorithm, based on point matches.
.. ocv:function:: void estimateTransformation( InputArray transformingShape, InputArray targetShape, std::vector<DMatch>& matches )
:param transformingShape: Contour defining first shape.
:param targetShape: Contour defining second shape (Target).
:param matches: Standard vector of Matches between points.
ShapeTransformer::applyTransformation
-------------------------------------
Apply a transformation, given a pre-estimated transformation parameters.
.. ocv:function:: float applyTransformation( InputArray input, OutputArray output=noArray() )
:param input: Contour (set of points) to apply the transformation.
:param output: Output contour.
ShapeTransformer::warpImage
---------------------------
Apply a transformation, given a pre-estimated transformation parameters, to an Image.
.. ocv:function:: void warpImage( InputArray transformingImage, OutputArray output, int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar() )
:param transformingImage: Input image.
:param output: Output image.
:param flags: Image interpolation method.
:param borderMode: border style.
:param borderValue: border value.
ThinPlateSplineShapeTransformer
-------------------------------
.. ocv:class:: ThinPlateSplineShapeTransformer : public Algorithm
Definition of the transformation ocupied in the paper "Principal Warps: Thin-Plate Splines and Decomposition
of Deformations", by F.L. Bookstein (PAMI 1989). ::
class CV_EXPORTS_W ThinPlateSplineShapeTransformer : public ShapeTransformer
{
public:
CV_WRAP virtual void setRegularizationParameter(double beta) = 0;
CV_WRAP virtual double getRegularizationParameter() const = 0;
};
/* Complete constructor */
CV_EXPORTS_W Ptr<ThinPlateSplineShapeTransformer>
createThinPlateSplineShapeTransformer(double regularizationParameter=0);
ThinPlateSplineShapeTransformer::setRegularizationParameter
-----------------------------------------------------------
Set the regularization parameter for relaxing the exact interpolation requirements of the TPS algorithm.
.. ocv:function:: void setRegularizationParameter( double beta )
:param beta: value of the regularization parameter.
AffineTransformer
-----------------
.. ocv:class:: AffineTransformer : public Algorithm
Wrapper class for the OpenCV Affine Transformation algorithm. ::
class CV_EXPORTS_W AffineTransformer : public ShapeTransformer
{
public:
CV_WRAP virtual void setFullAffine(bool fullAffine) = 0;
CV_WRAP virtual bool getFullAffine() const = 0;
};
/* Complete constructor */
CV_EXPORTS_W Ptr<AffineTransformer> createAffineTransformer(bool fullAffine);
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_SHAPE_HPP__
#define __OPENCV_SHAPE_HPP__
#include "opencv2/shape/emdL1.hpp"
#include "opencv2/shape/shape_transformer.hpp"
#include "opencv2/shape/hist_cost.hpp"
#include "opencv2/shape/shape_distance.hpp"
namespace cv
{
CV_EXPORTS bool initModule_shape();
}
#endif
/* End of file. */
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_EMD_L1_HPP__
#define __OPENCV_EMD_L1_HPP__
#include "opencv2/core.hpp"
namespace cv
{
/****************************************************************************************\
* EMDL1 Function *
\****************************************************************************************/
CV_EXPORTS float EMDL1(InputArray signature1, InputArray signature2);
}//namespace cv
#endif
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_HIST_COST_HPP__
#define __OPENCV_HIST_COST_HPP__
#include "opencv2/imgproc.hpp"
namespace cv
{
/*!
* The base class for HistogramCostExtractor.
*/
class CV_EXPORTS_W HistogramCostExtractor : public Algorithm
{
public:
CV_WRAP virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix) = 0;
CV_WRAP virtual void setNDummies(int nDummies) = 0;
CV_WRAP virtual int getNDummies() const = 0;
CV_WRAP virtual void setDefaultCost(float defaultCost) = 0;
CV_WRAP virtual float getDefaultCost() const = 0;
};
/*! */
class CV_EXPORTS_W NormHistogramCostExtractor : public HistogramCostExtractor
{
public:
CV_WRAP virtual void setNormFlag(int flag) = 0;
CV_WRAP virtual int getNormFlag() const = 0;
};
CV_EXPORTS_W Ptr<HistogramCostExtractor>
createNormHistogramCostExtractor(int flag=DIST_L2, int nDummies=25, float defaultCost=0.2);
/*! */
class CV_EXPORTS_W EMDHistogramCostExtractor : public HistogramCostExtractor
{
public:
CV_WRAP virtual void setNormFlag(int flag) = 0;
CV_WRAP virtual int getNormFlag() const = 0;
};
CV_EXPORTS_W Ptr<HistogramCostExtractor>
createEMDHistogramCostExtractor(int flag=DIST_L2, int nDummies=25, float defaultCost=0.2);
/*! */
class CV_EXPORTS_W ChiHistogramCostExtractor : public HistogramCostExtractor
{};
CV_EXPORTS_W Ptr<HistogramCostExtractor> createChiHistogramCostExtractor(int nDummies=25, float defaultCost=0.2);
/*! */
class CV_EXPORTS_W EMDL1HistogramCostExtractor : public HistogramCostExtractor
{};
CV_EXPORTS_W Ptr<HistogramCostExtractor>
createEMDL1HistogramCostExtractor(int nDummies=25, float defaultCost=0.2);
} // cv
#endif
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifdef __OPENCV_BUILD
#error this is a compatibility header which should not be used inside the OpenCV library
#endif
#include "opencv2/shape.hpp"
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_SHAPE_SHAPE_DISTANCE_HPP__
#define __OPENCV_SHAPE_SHAPE_DISTANCE_HPP__
#include "opencv2/core.hpp"
#include "opencv2/shape/hist_cost.hpp"
#include "opencv2/shape/shape_transformer.hpp"
namespace cv
{
/*!
* The base class for ShapeDistanceExtractor.
* This is just to define the common interface for
* shape comparisson techniques.
*/
class CV_EXPORTS_W ShapeDistanceExtractor : public Algorithm
{
public:
CV_WRAP virtual float computeDistance(InputArray contour1, InputArray contour2) = 0;
};
/***********************************************************************************/
/***********************************************************************************/
/***********************************************************************************/
/*!
* Shape Context implementation.
* The SCD class implements SCD algorithm proposed by Belongie et al.in
* "Shape Matching and Object Recognition Using Shape Contexts".
* Implemented by Juan M. Perez for the GSOC 2013.
*/
class CV_EXPORTS_W ShapeContextDistanceExtractor : public ShapeDistanceExtractor
{
public:
CV_WRAP virtual void setAngularBins(int nAngularBins) = 0;
CV_WRAP virtual int getAngularBins() const = 0;
CV_WRAP virtual void setRadialBins(int nRadialBins) = 0;
CV_WRAP virtual int getRadialBins() const = 0;
CV_WRAP virtual void setInnerRadius(float innerRadius) = 0;
CV_WRAP virtual float getInnerRadius() const = 0;
CV_WRAP virtual void setOuterRadius(float outerRadius) = 0;
CV_WRAP virtual float getOuterRadius() const = 0;
CV_WRAP virtual void setRotationInvariant(bool rotationInvariant) = 0;
CV_WRAP virtual bool getRotationInvariant() const = 0;
CV_WRAP virtual void setShapeContextWeight(float shapeContextWeight) = 0;
CV_WRAP virtual float getShapeContextWeight() const = 0;
CV_WRAP virtual void setImageAppearanceWeight(float imageAppearanceWeight) = 0;
CV_WRAP virtual float getImageAppearanceWeight() const = 0;
CV_WRAP virtual void setBendingEnergyWeight(float bendingEnergyWeight) = 0;
CV_WRAP virtual float getBendingEnergyWeight() const = 0;
CV_WRAP virtual void setImages(InputArray image1, InputArray image2) = 0;
CV_WRAP virtual void getImages(OutputArray image1, OutputArray image2) const = 0;
CV_WRAP virtual void setIterations(int iterations) = 0;
CV_WRAP virtual int getIterations() const = 0;
CV_WRAP virtual void setCostExtractor(Ptr<HistogramCostExtractor> comparer) = 0;
CV_WRAP virtual Ptr<HistogramCostExtractor> getCostExtractor() const = 0;
CV_WRAP virtual void setStdDev(float sigma) = 0;
CV_WRAP virtual float getStdDev() const = 0;
CV_WRAP virtual void setTransformAlgorithm(Ptr<ShapeTransformer> transformer) = 0;
CV_WRAP virtual Ptr<ShapeTransformer> getTransformAlgorithm() const = 0;
};
/* Complete constructor */
CV_EXPORTS_W Ptr<ShapeContextDistanceExtractor>
createShapeContextDistanceExtractor(int nAngularBins=12, int nRadialBins=4,
float innerRadius=0.2, float outerRadius=2, int iterations=3,
const Ptr<HistogramCostExtractor> &comparer = createChiHistogramCostExtractor(),
const Ptr<ShapeTransformer> &transformer = createThinPlateSplineShapeTransformer());
/***********************************************************************************/
/***********************************************************************************/
/***********************************************************************************/
/*!
* Hausdorff distace implementation based on
*/
class CV_EXPORTS_W HausdorffDistanceExtractor : public ShapeDistanceExtractor
{
public:
CV_WRAP virtual void setDistanceFlag(int distanceFlag) = 0;
CV_WRAP virtual int getDistanceFlag() const = 0;
CV_WRAP virtual void setRankProportion(float rankProportion) = 0;
CV_WRAP virtual float getRankProportion() const = 0;
};
/* Constructor */
CV_EXPORTS_W Ptr<HausdorffDistanceExtractor> createHausdorffDistanceExtractor(int distanceFlag=cv::NORM_L2, float rankProp=0.6);
} // cv
#endif
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_SHAPE_SHAPE_TRANSFORM_HPP__
#define __OPENCV_SHAPE_SHAPE_TRANSFORM_HPP__
#include <vector>
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
namespace cv
{
/*!
* The base class for ShapeTransformer.
* This is just to define the common interface for
* shape transformation techniques.
*/
class CV_EXPORTS_W ShapeTransformer : public Algorithm
{
public:
/* Estimate, Apply Transformation and return Transforming cost*/
CV_WRAP virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape,
std::vector<DMatch>& matches) = 0;
CV_WRAP virtual float applyTransformation(InputArray input, OutputArray output=noArray()) = 0;
CV_WRAP virtual void warpImage(InputArray transformingImage, OutputArray output,
int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT,
const Scalar& borderValue=Scalar()) const = 0;
};
/***********************************************************************************/
/***********************************************************************************/
/*!
* Thin Plate Spline Transformation
* Implementation of the TPS transformation
* according to "Principal Warps: Thin-Plate Splines and the
* Decomposition of Deformations" by Juan Manuel Perez for the GSOC 2013
*/
class CV_EXPORTS_W ThinPlateSplineShapeTransformer : public ShapeTransformer
{
public:
CV_WRAP virtual void setRegularizationParameter(double beta) = 0;
CV_WRAP virtual double getRegularizationParameter() const = 0;
};
/* Complete constructor */
CV_EXPORTS_W Ptr<ThinPlateSplineShapeTransformer>
createThinPlateSplineShapeTransformer(double regularizationParameter=0);
/***********************************************************************************/
/***********************************************************************************/
/*!
* Affine Transformation as a derivated from ShapeTransformer
*/
class CV_EXPORTS_W AffineTransformer : public ShapeTransformer
{
public:
CV_WRAP virtual void setFullAffine(bool fullAffine) = 0;
CV_WRAP virtual bool getFullAffine() const = 0;
};
/* Complete constructor */
CV_EXPORTS_W Ptr<AffineTransformer> createAffineTransformer(bool fullAffine);
} // cv
#endif
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "precomp.hpp"
namespace cv
{
class AffineTransformerImpl : public AffineTransformer
{
public:
/* Constructors */
AffineTransformerImpl()
{
fullAffine = true;
name_ = "ShapeTransformer.AFF";
}
AffineTransformerImpl(bool _fullAffine)
{
fullAffine = _fullAffine;
name_ = "ShapeTransformer.AFF";
}
/* Destructor */
~AffineTransformerImpl()
{
}
virtual AlgorithmInfo* info() const { return 0; }
//! the main operator
virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape, std::vector<DMatch> &matches);
virtual float applyTransformation(InputArray input, OutputArray output=noArray());
virtual void warpImage(InputArray transformingImage, OutputArray output,
int flags, int borderMode, const Scalar& borderValue) const;
//! Setters/Getters
virtual void setFullAffine(bool _fullAffine) {fullAffine=_fullAffine;}
virtual bool getFullAffine() const {return fullAffine;}
//! write/read
virtual void write(FileStorage& fs) const
{
fs << "name" << name_
<< "affine_type" << fullAffine;
}
virtual void read(const FileNode& fn)
{
CV_Assert( (String)fn["name"] == name_ );
fullAffine = (int)fn["affine_type"];
}
private:
bool fullAffine;
Mat affineMat;
float transformCost;
protected:
String name_;
};
void AffineTransformerImpl::warpImage(InputArray transformingImage, OutputArray output,
int flags, int borderMode, const Scalar& borderValue) const
{
CV_Assert(!affineMat.empty());
warpAffine(transformingImage, output, affineMat, transformingImage.getMat().size(), flags, borderMode, borderValue);
}
static Mat _localAffineEstimate(const std::vector<Point2f>& shape1, const std::vector<Point2f>& shape2,
bool fullAfine)
{
Mat out(2,3,CV_32F);
int siz=2*shape1.size();
if (fullAfine)
{
Mat matM(siz, 6, CV_32F);
Mat matP(siz,1,CV_32F);
int contPt=0;
for (int ii=0; ii<siz; ii++)
{
Mat therow = Mat::zeros(1,6,CV_32F);
if (ii%2==0)
{
therow.at<float>(0,0)=shape1[contPt].x;
therow.at<float>(0,1)=shape1[contPt].y;
therow.at<float>(0,2)=1;
therow.row(0).copyTo(matM.row(ii));
matP.at<float>(ii,0) = shape2[contPt].x;
}
else
{
therow.at<float>(0,3)=shape1[contPt].x;
therow.at<float>(0,4)=shape1[contPt].y;
therow.at<float>(0,5)=1;
therow.row(0).copyTo(matM.row(ii));
matP.at<float>(ii,0) = shape2[contPt].y;
contPt++;
}
}
Mat sol;
solve(matM, matP, sol, DECOMP_SVD);
out = sol.reshape(0,2);
}
else
{
Mat matM(siz, 4, CV_32F);
Mat matP(siz,1,CV_32F);
int contPt=0;
for (int ii=0; ii<siz; ii++)
{
Mat therow = Mat::zeros(1,4,CV_32F);
if (ii%2==0)
{
therow.at<float>(0,0)=shape1[contPt].x;
therow.at<float>(0,1)=shape1[contPt].y;
therow.at<float>(0,2)=1;
therow.row(0).copyTo(matM.row(ii));
matP.at<float>(ii,0) = shape2[contPt].x;
}
else
{
therow.at<float>(0,0)=-shape1[contPt].y;
therow.at<float>(0,1)=shape1[contPt].x;
therow.at<float>(0,3)=1;
therow.row(0).copyTo(matM.row(ii));
matP.at<float>(ii,0) = shape2[contPt].y;
contPt++;
}
}
Mat sol;
solve(matM, matP, sol, DECOMP_SVD);
out.at<float>(0,0)=sol.at<float>(0,0);
out.at<float>(0,1)=sol.at<float>(1,0);
out.at<float>(0,2)=sol.at<float>(2,0);
out.at<float>(1,0)=-sol.at<float>(1,0);
out.at<float>(1,1)=sol.at<float>(0,0);
out.at<float>(1,2)=sol.at<float>(3,0);
}
return out;
}
void AffineTransformerImpl::estimateTransformation(InputArray _pts1, InputArray _pts2, std::vector<DMatch>& _matches)
{
Mat pts1 = _pts1.getMat();
Mat pts2 = _pts2.getMat();
CV_Assert((pts1.channels()==2) & (pts1.cols>0) & (pts2.channels()==2) & (pts2.cols>0));
CV_Assert(_matches.size()>1);
if (pts1.type() != CV_32F)
pts1.convertTo(pts1, CV_32F);
if (pts2.type() != CV_32F)
pts2.convertTo(pts2, CV_32F);
// Use only valid matchings //
std::vector<DMatch> matches;
for (size_t i=0; i<_matches.size(); i++)
{
if (_matches[i].queryIdx<pts1.cols &&
_matches[i].trainIdx<pts2.cols)
{
matches.push_back(_matches[i]);
}
}
// Organizing the correspondent points in vector style //
std::vector<Point2f> shape1; // transforming shape
std::vector<Point2f> shape2; // target shape
for (size_t i=0; i<matches.size(); i++)
{
Point2f pt1=pts1.at<Point2f>(0,matches[i].queryIdx);
shape1.push_back(pt1);
Point2f pt2=pts2.at<Point2f>(0,matches[i].trainIdx);
shape2.push_back(pt2);
}
// estimateRigidTransform //
Mat affine;
estimateRigidTransform(shape1, shape2, fullAffine).convertTo(affine, CV_32F);
if (affine.empty())
affine=_localAffineEstimate(shape1, shape2, fullAffine); //In case there is not good solution, just give a LLS based one
affineMat = affine;
}
float AffineTransformerImpl::applyTransformation(InputArray inPts, OutputArray outPts)
{
Mat pts1 = inPts.getMat();
CV_Assert((pts1.channels()==2) & (pts1.cols>0));
//Apply transformation in the complete set of points
Mat fAffine;
transform(pts1, fAffine, affineMat);
// Ensambling output //
if (outPts.needed())
{
outPts.create(1,fAffine.cols, CV_32FC2);
Mat outMat = outPts.getMat();
for (int i=0; i<fAffine.cols; i++)
outMat.at<Point2f>(0,i)=fAffine.at<Point2f>(0,i);
}
// Updating Transform Cost //
Mat Af(2, 2, CV_32F);
Af.at<float>(0,0)=affineMat.at<float>(0,0);
Af.at<float>(0,1)=affineMat.at<float>(1,0);
Af.at<float>(1,0)=affineMat.at<float>(0,1);
Af.at<float>(1,1)=affineMat.at<float>(1,1);
SVD mysvd(Af, SVD::NO_UV);
Mat singVals=mysvd.w;
transformCost=std::log((singVals.at<float>(0,0)+FLT_MIN)/(singVals.at<float>(1,0)+FLT_MIN));
return transformCost;
}
Ptr <AffineTransformer> createAffineTransformer(bool fullAffine)
{
return Ptr<AffineTransformer>( new AffineTransformerImpl(fullAffine) );
}
} // cv
This diff is collapsed.
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include <stdlib.h>
#include <math.h>
#include <vector>
#define VHIGH 1e10;
/****************************************************************************************\
* For EMDL1 Framework *
\****************************************************************************************/
typedef struct cvEMDEdge* cvPEmdEdge;
typedef struct cvEMDNode* cvPEmdNode;
struct cvEMDNode
{
int pos[3]; // grid position
float d; // initial value
int u;
// tree maintainance
int iLevel; // level in the tree, 0 means root
cvPEmdNode pParent; // pointer to its parent
cvPEmdEdge pChild;
cvPEmdEdge pPEdge; // point to the edge coming out from its parent
};
struct cvEMDEdge
{
float flow; // initial value
int iDir; // 1:outward, 0:inward
// tree maintainance
cvPEmdNode pParent; // point to its parent
cvPEmdNode pChild; // the child node
cvPEmdEdge pNxt; // next child/edge
};
typedef std::vector<cvEMDNode> cvEMDNodeArray;
typedef std::vector<cvEMDEdge> cvEMDEdgeArray;
typedef std::vector<cvEMDNodeArray> cvEMDNodeArray2D;
typedef std::vector<cvEMDEdgeArray> cvEMDEdgeArray2D;
typedef std::vector<float> floatArray;
typedef std::vector<floatArray> floatArray2D;
/****************************************************************************************\
* EMDL1 Class *
\****************************************************************************************/
class EmdL1
{
public:
EmdL1()
{
m_pRoot = NULL;
binsDim1 = 0;
binsDim2 = 0;
binsDim3 = 0;
dimension = 0;
nMaxIt = 500;
}
~EmdL1()
{
}
float getEMDL1(cv::Mat &sig1, cv::Mat &sig2);
void setMaxIteration(int _nMaxIt);
private:
//-- SubFunctions called in the EMD algorithm
bool initBaseTrees(int n1=0, int n2=0, int n3=0);
bool fillBaseTrees(float *H1, float *H2);
bool greedySolution();
bool greedySolution2();
bool greedySolution3();
void initBVTree();
void updateSubtree(cvPEmdNode pRoot);
bool isOptimal();
void findNewSolution();
void findLoopFromEnterBV();
float compuTotalFlow();
private:
int dimension;
int binsDim1, binsDim2, binsDim3; // the hitogram contains m_n1 rows and m_n2 columns
int nNBV; // number of Non-Basic Variables (NBV)
int nMaxIt;
cvEMDNodeArray2D m_Nodes; // all nodes
cvEMDEdgeArray2D m_EdgesRight; // all edges to right
cvEMDEdgeArray2D m_EdgesUp; // all edges to upward
std::vector<cvEMDNodeArray2D> m_3dNodes; // all nodes for 3D
std::vector<cvEMDEdgeArray2D> m_3dEdgesRight; // all edges to right, 3D
std::vector<cvEMDEdgeArray2D> m_3dEdgesUp; // all edges to upward, 3D
std::vector<cvEMDEdgeArray2D> m_3dEdgesDeep; // all edges to deep, 3D
std::vector<cvPEmdEdge> m_NBVEdges; // pointers to all NON-BV edges
std::vector<cvPEmdNode> m_auxQueue; // auxiliary node queue
cvPEmdNode m_pRoot; // root of the BV Tree
cvPEmdEdge m_pEnter; // Enter BV edge
int m_iEnter; // Enter BV edge, index in m_NBVEdges
cvPEmdEdge m_pLeave; // Leave BV edge
int m_nItr; // number of iteration
// auxiliary variables for searching a new loop
std::vector<cvPEmdEdge> m_fromLoop;
std::vector<cvPEmdEdge> m_toLoop;
int m_iFrom;
int m_iTo;
};
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// Intel License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of Intel Corporation may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "precomp.hpp"
namespace cv
{
class HausdorffDistanceExtractorImpl : public HausdorffDistanceExtractor
{
public:
/* Constructor */
HausdorffDistanceExtractorImpl(int _distanceFlag = NORM_L1, float _rankProportion=0.6)
{
distanceFlag = _distanceFlag;
rankProportion = _rankProportion;
name_ = "ShapeDistanceExtractor.HAU";
}
/* Destructor */
~HausdorffDistanceExtractorImpl()
{
}
virtual AlgorithmInfo* info() const { return 0; }
//! the main operator
virtual float computeDistance(InputArray contour1, InputArray contour2);
//! Setters/Getters
virtual void setDistanceFlag(int _distanceFlag) {distanceFlag=_distanceFlag;}
virtual int getDistanceFlag() const {return distanceFlag;}
virtual void setRankProportion(float _rankProportion)
{
CV_Assert((_rankProportion>0) & (_rankProportion<=1));
rankProportion=_rankProportion;
}
virtual float getRankProportion() const {return rankProportion;}
//! write/read
virtual void write(FileStorage& fs) const
{
fs << "name" << name_
<< "distance" << distanceFlag
<< "rank" << rankProportion;
}
virtual void read(const FileNode& fn)
{
CV_Assert( (String)fn["name"] == name_ );
distanceFlag = (int)fn["distance"];
rankProportion = (int)fn["rank"];
}
private:
int distanceFlag;
float rankProportion;
protected:
String name_;
};
//! Hausdorff distance for a pair of set of points
static float _apply(const Mat &set1, const Mat &set2, int distType, double propRank)
{
// Building distance matrix //
Mat disMat(set1.cols, set2.cols, CV_32F);
int K = int(propRank*(disMat.rows-1));
for (int r=0; r<disMat.rows; r++)
{
for (int c=0; c<disMat.cols; c++)
{
Point2f diff = set1.at<Point2f>(0,r)-set2.at<Point2f>(0,c);
disMat.at<float>(r,c) = norm(Mat(diff), distType);
}
}
Mat shortest(disMat.rows,1,CV_32F);
for (int ii=0; ii<disMat.rows; ii++)
{
Mat therow = disMat.row(ii);
double mindis;
minMaxIdx(therow, &mindis);
shortest.at<float>(ii,0) = float(mindis);
}
Mat sorted;
cv::sort(shortest, sorted, SORT_EVERY_ROW | SORT_DESCENDING);
return sorted.at<float>(K,0);
}
float HausdorffDistanceExtractorImpl::computeDistance(InputArray contour1, InputArray contour2)
{
Mat set1=contour1.getMat(), set2=contour2.getMat();
if (set1.type() != CV_32F)
set1.convertTo(set1, CV_32F);
if (set2.type() != CV_32F)
set2.convertTo(set2, CV_32F);
CV_Assert((set1.channels()==2) & (set1.cols>0));
CV_Assert((set2.channels()==2) & (set2.cols>0));
return std::max( _apply(set1, set2, distanceFlag, rankProportion),
_apply(set2, set1, distanceFlag, rankProportion) );
}
Ptr <HausdorffDistanceExtractor> createHausdorffDistanceExtractor(int distanceFlag, float rankProp)
{
return Ptr<HausdorffDistanceExtractor>(new HausdorffDistanceExtractorImpl(distanceFlag, rankProp));
}
} // cv
This diff is collapsed.
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "precomp.hpp"
/* End of file. */
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__
#include <vector>
#include <cmath>
#include <iostream>
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/shape.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/private.hpp"
#include "opencv2/opencv_modules.hpp"
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include "test_precomp.hpp"
CV_TEST_MAIN("cv")
#include "test_precomp.hpp"
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wmissing-declarations"
# if defined __clang__ || defined __APPLE__
# pragma GCC diagnostic ignored "-Wmissing-prototypes"
# pragma GCC diagnostic ignored "-Wextra"
# endif
#endif
#ifndef __OPENCV_TEST_PRECOMP_HPP__
#define __OPENCV_TEST_PRECOMP_HPP__
#include <iostream>
#include "opencv2/ts.hpp"
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/shape.hpp"
#include "opencv2/opencv_modules.hpp"
#endif
This diff is collapsed.
......@@ -5,7 +5,7 @@
SET(OPENCV_CPP_SAMPLES_REQUIRED_DEPS opencv_core opencv_flann opencv_imgproc
opencv_highgui opencv_ml opencv_video opencv_objdetect opencv_photo opencv_nonfree opencv_softcascade
opencv_features2d opencv_calib3d opencv_legacy opencv_contrib opencv_stitching opencv_videostab opencv_bioinspired)
opencv_features2d opencv_calib3d opencv_legacy opencv_contrib opencv_stitching opencv_videostab opencv_bioinspired opencv_shape)
ocv_check_dependencies(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment