Emgu.CV.LatentSvmDetector.Detect C# (CSharp) Метод

Detect() публичный Метод

Find rectangular regions in the given image that are likely to contain objects and corresponding confidence levels
public Detect ( Byte>.Image image, float overlapThreshold ) : Emgu.CV.Structure.MCvObjectDetection[]
image Byte>.Image The image to detect objects in
overlapThreshold float Threshold for the non-maximum suppression algorithm, Use default value of 0.5
Результат Emgu.CV.Structure.MCvObjectDetection[]
        public MCvObjectDetection[] Detect(Image<Bgr, Byte> image, float overlapThreshold)
        {
            using (MemStorage stor = new MemStorage())
             {
            IntPtr seqPtr = CvInvoke.cvLatentSvmDetectObjects(image, Ptr, stor, overlapThreshold, -1);
            if (seqPtr == IntPtr.Zero)
               return new MCvObjectDetection[0];
            Seq<MCvObjectDetection> seq = new Seq<MCvObjectDetection>(seqPtr, stor);
            return seq.ToArray();
             }
        }

Usage Example

Пример #1
0
      static void Run()
      {
         using (Mat image = CvInvoke.Imread("cat.jpg", LoadImageType.AnyColor | LoadImageType.AnyDepth))
         using (LatentSvmDetector detector = new LatentSvmDetector(new string[] { "cat.xml" }))
         {
            Stopwatch watch = Stopwatch.StartNew();
            MCvObjectDetection[] regions = detector.Detect(image, 0.5f);
            watch.Stop();

            foreach (MCvObjectDetection region in regions)
            {
               CvInvoke.Rectangle(image, region.Rect, new MCvScalar(0, 0, 255));
            }

            ImageViewer.Show(image, String.Format("Object detected in {0} milliseconds", watch.ElapsedMilliseconds));
         }
      }
All Usage Examples Of Emgu.CV.LatentSvmDetector::Detect