Compute() public method

public Compute ( Byte>.Image image, Size winStride, Size padding, Point locations ) : float[]
image Byte>.Image The image
winStride System.Drawing.Size Window stride. Must be a multiple of block stride. Use Size.Empty for default
padding System.Drawing.Size Padding. Use Size.Empty for default
locations Point Locations for the computation. Can be null if not needed
return float[]
Example #1
0
        public float[] GetVector(Image<Bgr, Byte> im)
        {
            HOGDescriptor hog = new HOGDescriptor();    // with defaults values
            Image<Bgr, Byte> imageOfInterest = Resize(im);
            Point[] p = new Point[imageOfInterest.Width * imageOfInterest.Height];
            int k = 0;
            for (int i = 0; i < imageOfInterest.Width; i++)
            {
                for (int j = 0; j < imageOfInterest.Height; j++)
                {
                    Point p1 = new Point(i, j);
                    p[k++] = p1;
                }
            }

            return hog.Compute(imageOfInterest, new Size(8, 8), new Size(0, 0), p);
        }
        public static Image<Bgr, Byte> Find(Image<Bgr, Byte> image, out long processingTime)
        {
            Stopwatch watch;
            Rectangle[] regions;
            float[] result;

            using (HOGDescriptor des = new HOGDescriptor())
            {
                watch = Stopwatch.StartNew();
                result = des.Compute(image, new Size(16, 16), Size.Empty, null);
                watch.Stop();
                result = result.Where(x => x != 0).ToArray();
                //regions = des.DetectMultiScale(image);
            }

            processingTime = watch.ElapsedMilliseconds;

            return image;
        }