生成的C#白噪声图像 [英] Generate white noise image in C#

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

问题描述

我需要能够产生在C#code白噪声的图像。是否有一个算法,我可以用它来填充白噪声的形象呢?

I need to be able to generate a white noise image in C# code. Is there an algorithm I can use to fill the image with white noise?

我已经找到了如何做到这一点这里 VB的例子,但我不能将它移植到.NET自己。

I have found the VB example of how to do it here, but I can't port it to .net myself.

推荐答案

应该是沿着这些路线很简单,不是吗?

Should be something very simple along these lines, no?

foreach(var pixel in image)
{
    pixel = rand()>0.5 ? white : black;
}

这篇关于生成的C#白噪声图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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