/// <inheritdoc />
        /// <exception cref="ArgumentNullException">
        /// <paramref name="image"/> is <b>null</b>.
        /// </exception>
        public Features Detect(Imaging.Image image, CancellationToken cancellationToken)
        {
            if (image == null)
            {
                throw new ArgumentNullException(nameof(image));
            }

            DenseVectorPackF vectors = image.HOG(
                this.CellSize,
                this.BlockSize,
                this.BlockStride,
                this.NumberOfBins,
                this.Threshold);

            vectors = DenseVectorPackF.Pack(vectors.Unpack().Where(x => x.Sum() != 0.0f).ToList());

            return(new Features(vectors));
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Features"/> class.
 /// </summary>
 /// <param name="vectors">The feature vectors.</param>
 public Features(DenseVectorPackF vectors)
     : base(vectors)
 {
 }