MODI图像转换 [英] MODI Image conversion

查看:87
本文介绍了MODI图像转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在将图像传递给MODI.Image时遇到了麻烦。这里使用什么样的转换?



错误AS无法将'System.Drawing.Bitmap'类型的对象强制转换为'MODI.Image'。



请帮忙。



提前致谢。



Hi,

I am having trouble while passing image to MODI.Image. What kind of casting to be used here?

Error AS "Unable to cast object of type 'System.Drawing.Bitmap' to type 'MODI.Image'."

Please help.

Thanks in advance.

OracleDataReader o_Reader;
            string str_ExtractNumber;
            str_ExtractNumber = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            o_Reader = qry.GetPhotoByNumber(str_ExtractNumber);
            if (o_Reader.HasRows)
            {
                while (o_Reader.Read())
                {
                    Image newImage;
                    byte[] img_blob = (byte[])o_Reader[0];
                    //MemoryStream ms = new MemoryStream();
                    //ms.Read(img_blob, 0, img_blob.Length);
                    using (MemoryStream ms = new MemoryStream(img_blob, 0, img_blob.Length))
                    {
                        ms.Write(img_blob, 0, img_blob.Length);
                        newImage = Image.FromStream(ms, true);
                    }

             
                    MODI.Image img = (MODI.Image)newImage; // Problem occurs here. Error mentioned in Post.
                    img.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
                    MODI.Layout layout = img.Layout;
                    str_ExtractNumber = img.Layout.Text;
                    txt_Extracted.Text = str_ExtractNumber;

                }
            }

推荐答案

请参阅我对该问题的评论。如果可能的话,我会建议摆脱MODI。对于图像处理, System.Drawing 就足够了,但是OCR很难。

请看我过去的回答:我需要一个ocr来拍摄相机图像 [ ^ ]。



特别是,请参阅此CodeProject文章:神经网络OCR [ ^ ]。



-SA
Please see my comment to the question. I would advice to get rid of MODI if possible. For image processing, System.Drawing would be good enough, but OCR is the hard part.
Please see my past answer: i need an ocr for a camera image capture[^].

In particular, see this CodeProject article: Neural Network OCR[^].

—SA


这篇关于MODI图像转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆