如何在vb.net中将图像转换为矩阵 [英] how can convert image to matrix in vb.net

查看:160
本文介绍了如何在vb.net中将图像转换为矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好吧

如何在vb.net中将图像转换为二维(数组)矩阵???

感谢您的关注。

hi everybody
how can I convert an image to 2 dimensional(array)matrix in vb.net???
thanks for your attention.

推荐答案

我看起来你的问题是从一些现有图像中提取位。好吧,你可以使用 System.Drawing.Bitmap 。配方的第一部分是:不要使用 GetPixel ,因为它会非常慢。您可以使用 System.Drawing.Bitmap.LockBits

http://msdn.microsoft.com/en-us/library/system.drawing。 bitmap.lockbits%28v = vs.110%29.aspx [ ^ ]。



这里可以找到一个简单的代码示例: http://msdn.microsoft.com/en-us/library /5ey6h79d%28v=vs.110%29.aspx [ ^ ]。



您需要获得每个步幅你应该解释为你的矩阵(或列;它取决于观点)的一行。



-SA
I looks like your problem is to extract bits from some existing image. Well, you can use System.Drawing.Bitmap. First part of the recipe is: don't use GetPixel, as it would be prohibitively slow. You can get quick yes reliable access to bits by using System.Drawing.Bitmap.LockBits:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.lockbits%28v=vs.110%29.aspx[^].

A simple code sample can be found here: http://msdn.microsoft.com/en-us/library/5ey6h79d%28v=vs.110%29.aspx[^].

You will need to get each stride which you should interpret as a row of your matrix (or column; it depends on point of view).

—SA


这篇关于如何在vb.net中将图像转换为矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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