gpt4 book ai didi

c# - 在C#中生成白噪声图像

转载 作者:太空狗 更新时间:2023-10-29 18:12:31 25 4
gpt4 key购买 nike

我需要能够在 C# 代码中生成白噪声图像。有没有一种算法可以用来用白噪声填充图像?

我已经找到了如何操作的 VB 示例 here ,但我自己无法将其移植到 .net。

最佳答案

White Noise不是黑色或白色(根据定义)。它还包含灰度。

所以我们已经接近:

foreach(var pixel in image) 
{
//do that for all RGB (depending on Image format)
pixel = rand() * 255;
}

white noise

关于c# - 在C#中生成白噪声图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7981301/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com