基本信息
源码名称:基于yoloV3的目标检测
源码大小:647.13M
文件格式:.rar
开发语言:C#
更新时间:2021-12-13
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍

基于yoloV3的目标检测


 public class SharpWindows
        {
            [DllImport("user32.dll", SetLastError = true)]
            private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
            [DllImport("user32.dll", SetLastError = true)]
            private static extern int SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
            private Panel pictureBox;
            private Control Parentform;
            public Window Opencvwin;

            /// <summary>
            /// 创建一个关联窗体
            /// </summary>

            public SharpWindows(Panel _pictureBox, string winname)
            {
                pictureBox = _pictureBox;
                Cv2.NamedWindow(winname);
                Opencvwin = new Window(winname, WindowMode.FullScreen);
                Cv2.SetWindowProperty(Opencvwin.Name, WindowProperty.Fullscreen, 1);
                IntPtr Childwin = FindWindow(null, winname);
                SetParent(Childwin, _pictureBox.Handle);
                Parentform = Control.FromHandle(_pictureBox.Handle);
            }

            /// <summary>
            /// 显示图片
            /// </summary>

            public void Showimg(Mat img)
            {
                try
                {
                    int width = Parentform.Width;
                    int height = Parentform.Height;
                    Cv2.ResizeWindow(Opencvwin.Name, width, height);
                    Cv2.MoveWindow(Opencvwin.Name, Parentform.Left, Parentform.Top);
                    Cv2.SetWindowProperty(Opencvwin.Name, WindowProperty.AutoSize, 1);
                    Opencvwin.ShowImage(img);
                }
                catch (Exception ex)
                {
                    throw (ex);
                }
            }
        }