Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. from the input contours, a set of matching points is calulated, then estimateRigidTransform() is called on those corresponding points, resulting in an affine transform matrix, which is saved internally.

  2. vector<Point2f> (or vector<Point>, which will get converted internally.)

  3. the matches are just a way to transport corresponding point indices here.


all in all, this class is part of the shapecontext matching, and probably should not be used "out-of-context". (it's also an abstract class, you cannot make an instance of it)

    cv::Ptr <cv::ShapeContextDistanceExtractor> mysc = cv::createShapeContextDistanceExtractor();
    mysc->setIterations(1);
    // specify a distance, chisquare, emd, normhistogram, etc.
    mysc->setCostExtractor(createChiHistogramCostExtractor(30,0.15f));
    // specify a transformation, tps or affine. *this is your shapetransformer in action* !
    mysc->setTransformAlgorithm( createThinPlateSplineShapeTransformer() );

    vector <Point2f> query1; vector <Point2f> query2;  // 2 shapes
    double d = mysc->computeDistance(query1, query2);
  1. from the input contours, a set of matching points is calulated, then estimateRigidTransform() is called on those corresponding points, resulting in an affine transform matrix, which is saved internally.

  2. vector<Point2f> (or vector<Point>, which will get converted internally.)

  3. the matches are just a way to transport corresponding point indices here.


all in all, this class is part of the shapecontext matching, and probably should not be used "out-of-context". (it's also an abstract class, you cannot make an instance of it)

 cv::Ptr <cv::ShapeContextDistanceExtractor> mysc = cv::createShapeContextDistanceExtractor();
 mysc->setIterations(1);
 // specify a distance, chisquare, emd, normhistogram, etc.
 mysc->setCostExtractor(createChiHistogramCostExtractor(30,0.15f));
 // specify a transformation, tps or affine. *this is your shapetransformer in action* !
 mysc->setTransformAlgorithm( createThinPlateSplineShapeTransformer() );

 vector <Point2f> query1; vector <Point2f> query2;  // 2 shapes
    double d = mysc->computeDistance(query1, query2);
  1. from the input contours, a set of matching points is calulated, then estimateRigidTransform() is called on those corresponding points, resulting in an affine transform matrix, which is saved internally.

  2. vector<Point2f> (or vector<Point>, which will get converted internally.)

  3. the matches are just a way to transport corresponding point indices here.


all in all, this class is part of the shapecontext matching, and probably should not be used "out-of-context". (it's also an abstract class, you cannot make an instance of it)

cv::Ptr <cv::ShapeContextDistanceExtractor> mysc = cv::createShapeContextDistanceExtractor();
mysc->setIterations(1);
// specify a distance, chisquare, emd, normhistogram, etc.
mysc->setCostExtractor(createChiHistogramCostExtractor(30,0.15f));
// specify a transformation, tps or affine. *this is your shapetransformer in action* !
mysc->setTransformAlgorithm( createThinPlateSplineShapeTransformer() );

vector <Point2f> query1; vector <Point2f> query2;  // 2 shapes
 double d = mysc->computeDistance(query1, query2);
query2);  // final result.
  1. in the case of an affine transform (i'll spare you the thin-plate-spline ...) from the input contours, a set of matching points is calulated, then estimateRigidTransform() is called on those corresponding points, resulting in an affine transform matrix, which is saved internally.internally.

  2. vector<Point2f> (or vector<Point>, which will get converted internally.)

  3. the matches are just a way to transport corresponding point indices here.


all in all, this class is part of the shapecontext matching, and probably should not be used "out-of-context". (it's also an abstract class, you cannot make an instance of it)

cv::Ptr <cv::ShapeContextDistanceExtractor> mysc = cv::createShapeContextDistanceExtractor();
mysc->setIterations(1);
// specify a distance, chisquare, emd, normhistogram, etc.
mysc->setCostExtractor(createChiHistogramCostExtractor(30,0.15f));
// specify a transformation, tps or affine. *this is your shapetransformer in action* !
mysc->setTransformAlgorithm( createThinPlateSplineShapeTransformer() );

vector <Point2f> query1; vector <Point2f> query2;  // 2 shapes
double d = mysc->computeDistance(query1, query2);  // final result.
  1. in the case of an affine transform (i'll spare you the thin-plate-spline ...) from the input contours, a set of matching points is calulated, then estimateRigidTransform() is called on those corresponding points, resulting in an affine transform matrix, which is saved internally.

  2. vector<Point2f> (or vector<Point>, which will get converted internally.)

  3. the matches are just a way to transport corresponding point indices here.


all in all, this class is part of the shapecontext matching, and probably should not be used "out-of-context". (it's also an abstract class, you cannot make an instance of it)

here is a usage example:

cv::Ptr <cv::ShapeContextDistanceExtractor> mysc = cv::createShapeContextDistanceExtractor();
mysc->setIterations(1);
// specify a distance, chisquare, emd, normhistogram, etc.
mysc->setCostExtractor(createChiHistogramCostExtractor(30,0.15f));
// specify a transformation, tps or affine. *this is your shapetransformer in action* !
mysc->setTransformAlgorithm( createThinPlateSplineShapeTransformer() );

vector <Point2f> query1; vector <Point2f> query2;  // 2 shapes
double d = mysc->computeDistance(query1, query2);  // final result.
  1. in the case of an affine transform (i'll spare you the thin-plate-spline ...) from the input contours, a set of matching points is calulated, then estimateRigidTransform() is called on those corresponding points, resulting in an affine transform matrix, which is saved internally.

  2. vector<Point2f> (or vector<Point>, which will get converted internally.)

  3. the matches are just a way to transport corresponding point indices here.


all in all, this class is part of the shapecontext matching, matching, and probably should not be used "out-of-context". (it's also an abstract class, you cannot make an instance of it)

here is a usage example:

cv::Ptr <cv::ShapeContextDistanceExtractor> mysc = cv::createShapeContextDistanceExtractor();
mysc->setIterations(1);
// specify a distance, chisquare, emd, normhistogram, etc.
mysc->setCostExtractor(createChiHistogramCostExtractor(30,0.15f));
// specify a transformation, tps or affine. *this is your shapetransformer in action* !
mysc->setTransformAlgorithm( createThinPlateSplineShapeTransformer() );

vector <Point2f> query1; vector <Point2f> query2;  // 2 shapes
double d = mysc->computeDistance(query1, query2);  // final result.
  1. in the case of an affine transform (i'll spare you the thin-plate-spline ...) from the input contours, a set of matching points is calulated, then estimateRigidTransform() is called on those corresponding points, resulting in an affine transform matrix, which is saved internally.. (so, there is an output, but you're not supposed to access it)

  2. vector<Point2f> (or vector<Point>, which will get converted internally.)

  3. the matches are just a way to transport corresponding point indices here.


all in all, this class is part of the shapecontext matching, and probably should not be used "out-of-context". (it's also an abstract class, you cannot make an instance of it)

here is a usage example:

cv::Ptr <cv::ShapeContextDistanceExtractor> mysc = cv::createShapeContextDistanceExtractor();
mysc->setIterations(1);
// specify a distance, chisquare, emd, normhistogram, etc.
mysc->setCostExtractor(createChiHistogramCostExtractor(30,0.15f));
// specify a transformation, tps or affine. *this is your shapetransformer in action* !
mysc->setTransformAlgorithm( createThinPlateSplineShapeTransformer() );

vector <Point2f> query1; vector <Point2f> query2;  // 2 shapes
double d = mysc->computeDistance(query1, query2);  // final result.