guassian smoothening formula application

可紊 提交于 2020-01-12 23:14:49

问题


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.


回答1:


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:

  • Image Processing for Dummies with C# and GDI+

  • Fast Gaussian Blur v1.3

  • Fast Gaussian Blur Algorithm in C#

  • Image processing C# tutorial 4 – Gaussian blur

  • Fast Gaussian Blur Algorithm in C#

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:

  • The C# Image Library offers a Gaussian blur among its handful of image processing filters, and is incredibly easy to use.

  • The AForge.NET Framework provides a Gaussian blur as one of many filters in its extensive image processing library.


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);
    }
}


来源:https://stackoverflow.com/questions/4191557/guassian-smoothening-formula-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!