c#处置 图片 想实现ps里面的滤镜中“照亮边缘”的功能,求思路

c#处理 图片 想实现ps里面的滤镜中“照亮边缘”的功能,求思路
c#处理 图片 想实现ps里面的滤镜中“照亮边缘”的功能,求思路


比如有没有第三方的DLL可以调用啊,

或者“照亮边缘” 这个功能,是怎么操作像素的实现功能的。有图片处理相关的教程,给点链接,

c#处置 图片 想实现ps里面的滤镜中“照亮边缘”的功能,求思路
------解决思路----------------------
发张图片看看什么样
------解决思路----------------------
参考

这个就是我们所说的曝光了!

/// <summary>
        /// 光照效果
        ///原理: 对图像中的某一范围内的像素的亮度分别进行处理.
        /// </summary>
        /// <param name="m_Iimage"></param>
        /// <param name="showPb"></param>
        private void GuangZhao(Image m_PreImage)
        {
            //以光照效果显示图像                 
            Graphics MyGraphics = this.picAft.CreateGraphics();

            MyGraphics.Clear(Color.White);
            Bitmap MyBmp = new Bitmap(m_PreImage , m_PreImage.Width , m_PreImage.Height);
            int MyWidth = MyBmp.Width;
            int MyHeight = MyBmp.Height;
            Bitmap MyImage = MyBmp.Clone(new RectangleF(0 , 0 , MyWidth , MyHeight) , System.Drawing.Imaging.PixelFormat.DontCare);
            int A = Width / 2;
            int B = Height / 2;
            //MyCenter图片中心点,发亮此值会让强光中心发生偏移                 
            Point MyCenter = new Point(MyWidth / 2 , MyHeight / 2);
            //R强光照射面的半径,即”光晕”                 
            int R = Math.Min(MyWidth / 2 , MyHeight / 2);
            for (int i = MyWidth - 1; i >= 1; i--)
            {
                for (int j = MyHeight - 1; j >= 1; j--)
                {
                    float MyLength = (float)Math.Sqrt(Math.Pow((i - MyCenter.X) , 2) + Math.Pow((j - MyCenter.Y) , 2));
                    //如果像素位于”光晕”之内                         
                    if (MyLength < R)
                    {
                        Color MyColor = MyImage.GetPixel(i , j);
                        int r , g , b;
                        //220亮度增加常量,该值越大,光亮度越强                             
                        float MyPixel = 220.0f * (1.0f - MyLength / R);
                        r = MyColor.R + (int)MyPixel;
                        r = Math.Max(0 , Math.Min(r , 255));
                        g = MyColor.G + (int)MyPixel;
                        g = Math.Max(0 , Math.Min(g , 255));
                        b = MyColor.B + (int)MyPixel;
                        b = Math.Max(0 , Math.Min(b , 255));
                        //将增亮后的像素值回写到位图                            
                        Color MyNewColor = Color.FromArgb(255 , r , g , b);
                        MyImage.SetPixel(i , j , MyNewColor);
                    }
                }
                //重新绘制图片                     

            }
            MyGraphics.DrawImage(MyImage , new Rectangle(0 , 0 , MyWidth , MyHeight));
            this.picAft.Image = MyImage;
        }

c#处置 图片 想实现ps里面的滤镜中“照亮边缘”的功能,求思路
------解决思路----------------------
照亮边缘滤镜是 于 最大值和 最小值滤镜有关的, 其参数里的边缘宽度应该是最大值算法半径+最小值最小值半径的意思。

我估计其算法应该是  Value = (MaxValue(R) - MinValue(R)) * Brightness 

其中的Brightness 是调节结果亮度的参数。 至于那个平滑度我现在还在试验中。

你可以直接使用matlab的rangefilter会的得到类似的结果。 


------解决思路----------------------
刚想说二楼虾扯蛋,大神就已经解决了。