如何从照片中获取像素? [英] how I can get pixel from a photo?

查看:101
本文介绍了如何从照片中获取像素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我是C#的初学者,如何从照片中获取像素?
我用它来计算均值,方差和标准偏差

谢谢.

PS:对不起我的英语

解决方案

最简单的方法是使用 ^ ],但您可能会注意到此方法非常慢.
如果您需要一种快速的方法来访问图像数据,则可以使用unsafe代码.
请参见 [ ^ ]文章.
您也可以查看 [


hi I am beginner at C#, how I can get pixel from a photo?
I use it to calculate mean, varians, and standart deviation

thanks.

PS: sorry for my english

The easiest way is to use Bitmap.GetPixel[^], but you may notice that this method is very slow.
If you need a fast method to access the image data then you can use unsafe code.
See this[^] article for details.
You can also check out this[^] CP article. :)


Use Bitmap.GetPixel

Bitmap bmp = new Bitmap("MyPhoto.jpg");
bmp.GetPixel(10, 10);


这篇关于如何从照片中获取像素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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