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 ShapeTransformer interface.
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;
};
Estimate the transformation parameters of the current transformer algorithm, based on point matches.
Parameters: |
|
---|
Apply a transformation, given a pre-estimated transformation parameters.
Parameters: |
|
---|
Apply a transformation, given a pre-estimated transformation parameters, to an Image.
Parameters: |
|
---|
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);
Set the regularization parameter for relaxing the exact interpolation requirements of the TPS algorithm.
Parameters: |
|
---|
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);