高斯平滑公式应用

发布于 2024-10-02 06:45:41 字数 94 浏览 8 评论 0原文

如何对数组中的图应用高斯平滑公式?

这些数组被映射到颜色并绘制在图表上。 我想要应用高斯平滑后颜色的线性渐变。

我也想知道确切的高斯平滑公式。

How to apply guassian smoothening formula for a graph which is in array?

these array are mapped to a color and plotted on the graph.
i want the linear gradient of color after applying guassian smoothening..

I want to know the exact guassian smoothening formula too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

中性美 2024-10-09 06:45:41

我相信您所要求的通常在照片编辑应用程序中称为“高斯模糊”。它只是使用高斯函数模糊图像的结果,导致视觉噪声和细节减少。您可以阅读有关高斯模糊高斯函数一般介绍了专门讨论该主题的优秀维基百科文章,包括公式的性质以及这些函数的常见实现方式。使用的基本算法通常是相同的,但有几种不同的实现方法,主要是尝试加速任务的计算速度。

如果您正在寻找已编写的应用高斯模糊的代码,请查看以下链接:

如果您正在寻找不需要您执行或阅读任何内容的直接解决方案如果您自己编码,有一些很棒的开源框架可供使用:

至于如何将高斯模糊应用于数组中的图形,如果您需要更具体的帮助(例如发布表示相关图形对象的代码),则需要提供更多详细信息。

为了完整起见,我假设您有一系列图像,每个图像代表一个图形,存储在一个数组中。 (尽管如此,如果您只是使用标准数组,您可能会考虑转向强类型集合,例如 List。)要将效果应用到图表,您只需迭代数组中的每个图像,然后为特定的图像应用必要的代码您决定实施:

public void SmoothGraphs(List<Image> graphs)
{
    foreach (Image graph in graphs)
    {
        //Apply your Gaussian blur method to the image

        //(for example, with AForge.NET, you might use the following code:)
        GaussianBlur filter = new GaussianBlur(4, 11);
        filter.ApplyInPlace(graph);
    }
}

I believe what you're asking for is typically called a "Gaussian blur" in photo-editing applications. It is simply the result of blurring an image using a Gaussian function, resulting in a reduction of visual noise and detail. You can read more about the Gaussian blur and Gaussian functions in general on the excellent Wikipedia articles devoted to the subjects, including the nature of the formulae and how these functions are commonly implemented. The basic algorithm used is generally the same, but there are a few different approaches to implementing it, mainly attempting to speed up the task computationally.

If you're looking for code that's already written to apply a Gaussian blur, check out these links:

If you're looking for a drop-in solution that doesn't require you to do or read any coding yourself, there are a couple of great, open-source frameworks available:

As far as how to apply a Gaussian blur to a graph in an array, you're going to need to provide more details if you want more specific help (like posting the code representing the graph objects in question).

For the sake of completeness, I'm going to assume that you have a series of Images, each representing a graph, stored in an array. (Although, if you're just using a standard array, you might consider moving to a strongly-typed collection, like a List<Image>.) To apply the effect to your graphs, you can simply iterate through each image in the array and apply the necessary code for the specific implementation you settle upon:

public void SmoothGraphs(List<Image> graphs)
{
    foreach (Image graph in graphs)
    {
        //Apply your Gaussian blur method to the image

        //(for example, with AForge.NET, you might use the following code:)
        GaussianBlur filter = new GaussianBlur(4, 11);
        filter.ApplyInPlace(graph);
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文