<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                (Sketch Filter)素描濾鏡 素描濾鏡的實現方法比較簡單,這里我們直接寫出算法過程如下: 1,對原圖S進行去色命令得到灰度圖A; 2,對A進行反色得到圖像B; 3,對B進行高斯模糊得到圖C; 4,將C與B進行顏色減淡的圖層混合算法: P(x,y) =?Pb(x,y) + (Pb(x,y)* Pc(x,y)) / (256 - Pc(x,y)); 在步驟3中,可以添加變量edgeIntensity(edgeIntensity>=0),來控制素描的邊緣強度; 以上就是素描的算法實現。 核心代碼如下: ~~~ private Bitmap SketchFilterProcess(Bitmap src, int edgeIntensity) { Bitmap gaussBitmap = gf.Apply(src, edgeIntensity); Bitmap dst = new Bitmap(src); int w = dst.Width; int h = dst.Height; BitmapData dstData = dst.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); BitmapData edgeData = gaussBitmap.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); byte* pGauss = (byte*)edgeData.Scan0; byte* pDst = (byte*)dstData.Scan0; int offset = dstData.Stride - w * 4; int gray, graySrc, grayGauss; for (int j = 0; j < h; j++) { for (int i = 0; i < w; i++) { graySrc = (pDst[0] + pDst[1] + pDst[2]) / 3; grayGauss = 255 - (pGauss[0] + pGauss[1] + pGauss[2]) / 3; gray = graySrc + (graySrc * grayGauss) / (256 - grayGauss); gray = Math.Min(255, Math.Max(0, gray)); pDst[0] = (byte)gray; pDst[1] = (byte)gray; pDst[2] = (byte)gray; pDst[3] = (byte)255; pGauss += 4; pDst += 4; } pGauss += offset; pDst += offset; } dst.UnlockBits(dstData); gaussBitmap.UnlockBits(edgeData); return dst; } ~~~ 效果圖如下所示: [![](https://box.kancloud.cn/2016-01-05_568b3324a37ef.jpg)](http://www.zealpixel.com/data/attachment/portal/201507/27/111453xnq45gpgzc55s57s.jpg) 原圖 [![](https://box.kancloud.cn/2016-01-05_568b3324b9b2e.jpg)](http://www.zealpixel.com/data/attachment/portal/201507/27/111453s41clwppcfcnpvej.jpg) 素描濾鏡效果圖 最后放上完整C#/C程序DEMO下載連接:[http://www.zealpixel.com/thread-64-1-1.html](http://www.zealpixel.com/thread-64-1-1.html)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看