基本信息
源码名称:C#人脸识别案例(图片识别、智能识别)
源码大小:2.48M
文件格式:.zip
开发语言:C#
更新时间:2024-11-04
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

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

本次赞助数额为: 2 元 
   源码介绍
    图片识别、智能识别


        #region 转换按钮事件
        // 转换按钮事件
        private void button2_Click(object sender, EventArgs e)
        {
            int startX = 0;
            int startY = 0;
            int width = -1;
            int height = -1;

            string img_path = txt_imgpath.Text; // 图片路径
            if (String.IsNullOrEmpty(img_path)) // 图片非空验证
            {
                MessageBox.Show("请先选择图片!");
                return;
            }
            try
            {
                Image img = Image.FromFile(img_path);
                width = img.Width;
                height = img.Height;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
            txt_result.Text = Marshal.PtrToStringAnsi(OCRpart(img_path, -1, startX, startY, width, height));
        }
        #endregion

        #region 浏览事件
        // 浏览事件
        private void btn_imgpath_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            txt_imgpath.Text = openFileDialog1.FileName;
        }
        // 浏览图片
        private void txt_imgpath_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            txt_imgpath.Text = openFileDialog1.FileName;
        }
        #endregion