예제 #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));
                }
        }
예제 #2
0
        static void Run()
        {
            using (Image <Bgr, Byte> image = new Image <Bgr, byte>("cat.jpg"))
                using (LatentSvmDetector detector = new LatentSvmDetector("cat.xml"))
                {
                    Stopwatch            watch   = Stopwatch.StartNew();
                    MCvObjectDetection[] regions = detector.Detect(image, 0.5f);
                    watch.Stop();

                    foreach (MCvObjectDetection region in regions)
                    {
                        if (region.score > -0.5)
                        {
                            image.Draw(region.Rect, new Bgr(Color.Red), 1);
                        }
                    }

                    ImageViewer.Show(image, String.Format("Object detected in {0} milliseconds", watch.ElapsedMilliseconds));
                }
        }
예제 #3
0
파일: Detector.cs 프로젝트: battyone/visa
 /// <summary>
 ///
 /// </summary>
 /// <param name="label"></param>
 /// <param name="model"></param>
 public DetectorBase(string label, string model)
 {
     _label    = label;
     _model    = model;
     _detector = new LatentSvmDetector(model);
 }
예제 #4
0
 internal static extern Seq cvLatentSvmDetectObjects(
     IplImage image,
     LatentSvmDetector detector,
     MemStorage storage,
     float overlap_threshold,
     int numThreads);