Пример #1
0
        //private IntPtr _sharedPtr;

        /// <summary>
        /// Create a shape context distance extractor
        /// </summary>
        /// <param name="comparer">The histogram cost extractor, use ChiHistogramCostExtractor as default</param>
        /// <param name="transformer">The shape transformer, use ThinPlateSplineSphapeTransformer as default</param>
        /// <param name="nAngularBins">Establish the number of angular bins for the Shape Context Descriptor used in the shape matching pipeline.</param>
        /// <param name="nRadialBins">Establish the number of radial bins for the Shape Context Descriptor used in the shape matching pipeline.</param>
        /// <param name="innerRadius">Set the inner radius of the shape context descriptor.</param>
        /// <param name="outerRadius">Set the outer radius of the shape context descriptor.</param>
        /// <param name="iterations">Iterations</param>
        public ShapeContextDistanceExtractor(
            HistogramCostExtractor comparer, IShapeTransformer transformer,
            int nAngularBins  = 12,
            int nRadialBins   = 4,
            float innerRadius = 0.2f,
            float outerRadius = 3,
            int iterations    = 3)
        {
            _ptr = ShapeInvoke.cveShapeContextDistanceExtractorCreate(nAngularBins, nRadialBins, innerRadius, outerRadius, iterations, comparer, transformer.ShapeTransformerPtr, ref _shapeDistanceExtractorPtr, ref _sharedPtr);
        }
 /// <summary>
 /// Create a shape context distance extractor
 /// </summary>
 /// <param name="comparer">The histogram cost extractor</param>
 /// <param name="transformer">The shape transformer</param>
 /// <param name="nAngularBins">Establish the number of angular bins for the Shape Context Descriptor used in the shape matching pipeline.</param>
 /// <param name="nRadialBins">Establish the number of radial bins for the Shape Context Descriptor used in the shape matching pipeline.</param>
 /// <param name="innerRadius">Set the inner radius of the shape context descriptor.</param>
 /// <param name="outerRadius">Set the outer radius of the shape context descriptor.</param>
 /// <param name="iterations">Iterations</param>
 public ShapeContextDistanceExtractor(
    HistogramCostExtractor comparer, ShapeTransformer transformer,
    int nAngularBins = 12, 
    int nRadialBins = 4, 
    float innerRadius = 0.2f, 
    float outerRadius = 3, 
    int iterations = 3)
 {
    _ptr = ShapeInvoke.cvShapeContextDistanceExtractorCreate(nAngularBins, nRadialBins, innerRadius, outerRadius, iterations, comparer, transformer);
 }