예제 #1
0
        public void DetectAndLabel()
        {
            while (true)
            {
                if (newImageAvailable && currentImage != null)
                {
                    var sw = new Stopwatch();
                    sw.Start();
                    YoloItemListInfo yoloOutput = DetectAndLabelAngGetItem(currentImage);
                    sw.Stop();
                    Console.WriteLine("Temps de calcul Yolo : " + sw.Elapsed.TotalMilliseconds);

                    //sortie items uniquement
                    OnYoloItemList(yoloOutput);

                    //sortie bitmap et items entourés
                    YoloBitmapItemInfo yoloBitmapInfo = new YoloBitmapItemInfo(DrawBorder2Image(currentImage, yoloOutput.items), yoloOutput.items);
                    currentImageDescriptor = "ImageDebug3";
                    OnYoloImageProcessedAndLabelledReady(yoloBitmapInfo.bmp, currentImageDescriptor);
                }
                else
                {
                    Thread.Sleep(5);
                }
            }
        }
예제 #2
0
        public virtual void OnYoloItemList(YoloItemListInfo yoloInfo)
        {
            var handler = OnYoloItemListEvent;

            if (handler != null)
            {
                handler(this, new YoloItemListInfoArgs {
                    YoloResult = yoloInfo
                });
            }
        }