/// <summary> /// Return the default people detector /// </summary> /// <returns>The default people detector</returns> public static float[] GetDefaultPeopleDetector() { using (Util.VectorOfFloat desc = new VectorOfFloat()) { CvHOGDescriptorPeopleDetectorCreate(desc); return(desc.ToArray()); } }
/// <summary> /// /// </summary> /// <param name="image"></param> /// <param name="winStride"></param> /// <param name="locations"></param> /// <returns></returns> public float[] Compute(Image <Gray, Byte> image, Size winStride, Point[] locations) { using (VectorOfFloat vof = new VectorOfFloat()) { GCHandle handle = GCHandle.Alloc(locations, GCHandleType.Pinned); CvSelfSimDescriptorCompute(_ptr, image, vof, ref winStride, handle.AddrOfPinnedObject(), locations.Length); handle.Free(); return(vof.ToArray()); } }
/// <summary> /// /// </summary> /// <param name="image"></param> /// <param name="winStride"></param> /// <param name="locations"></param> /// <returns></returns> public float[] Compute(Image<Gray, Byte> image, Size winStride, Point[] locations) { using (VectorOfFloat vof = new VectorOfFloat()) { GCHandle handle = GCHandle.Alloc(locations, GCHandleType.Pinned); CvSelfSimDescriptorCompute(_ptr, image, vof, ref winStride, handle.AddrOfPinnedObject(), locations.Length); handle.Free(); return vof.ToArray(); } }
/// <summary> /// /// </summary> /// <param name="image">The image</param> /// <param name="winStride">Window stride. Must be a multiple of block stride. Use Size.Empty for default</param> /// <param name="padding">Padding. Use Size.Empty for default</param> /// <param name="locations">Locations for the computation. Can be null if not needed</param> /// <returns>The descriptor vector</returns> public float[] Compute(IInputArray image, Size winStride = new Size(), Size padding = new Size(), Point[] locations = null) { using (VectorOfFloat desc = new VectorOfFloat()) using (InputArray iaImage = image.GetInputArray()) { if (locations == null) { CvHOGDescriptorCompute(_ptr, iaImage, desc, ref winStride, ref padding, IntPtr.Zero); } else { using (VectorOfPoint vp = new VectorOfPoint(locations)) { CvHOGDescriptorCompute(_ptr, iaImage, desc, ref winStride, ref padding, vp); } } return(desc.ToArray()); } }
/// <summary> /// /// </summary> /// <param name="image">The image</param> /// <param name="winStride">Window stride. Must be a multiple of block stride.</param> /// <param name="padding"></param> /// <param name="locations">Locations for the computation. Can be null if not needed</param> /// <returns>The descriptor vector</returns> public float[] Compute(Image <Bgr, Byte> image, Size winStride, Size padding, Point[] locations) { using (VectorOfFloat desc = new VectorOfFloat()) { if (locations == null) { CvHOGDescriptorCompute(_ptr, image, desc, winStride, padding, IntPtr.Zero); } else { using (MemStorage stor = new MemStorage()) { Seq <Point> locationSeq = new Seq <Point>(stor); CvHOGDescriptorCompute(_ptr, image, desc, winStride, padding, locationSeq); } } return(desc.ToArray()); } }
/// <summary> /// /// </summary> /// <param name="image"></param> /// <param name="winStride"></param> /// <param name="padding"></param> /// <param name="locations">Locations for the computation. Can be null if not needed</param> /// <returns>The descriptor vector</returns> public float[] Compute(Image<Bgr, Byte> image, Size winStride, Size padding, Point[] locations) { using (VectorOfFloat desc = new VectorOfFloat()) { if (locations == null) CvHOGDescriptorCompute(_ptr, image, desc, winStride, padding, IntPtr.Zero); else { using (MemStorage stor = new MemStorage()) { Seq<Point> locationSeq = new Seq<Point>(stor); CvHOGDescriptorCompute(_ptr, image, desc, winStride, padding, locationSeq); } } return desc.ToArray(); } }