當前位置: 首頁>>代碼示例>>C#>>正文


C# Image.Split方法代碼示例

本文整理匯總了C#中System.Image.Split方法的典型用法代碼示例。如果您正苦於以下問題:C# Image.Split方法的具體用法?C# Image.Split怎麽用?C# Image.Split使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Image的用法示例。


在下文中一共展示了Image.Split方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateHistogram

        public void CreateHistogram(Image<Bgr, Byte> img)
        {
            Image<Gray, Byte>[] channels = img.Split();
            Image<Gray, Byte> blueChannel = channels[0];
            Image<Gray, Byte> greenChannel = channels[1];
            Image<Gray, Byte> redChannel = channels[2];

            //Red colour channel
            DenseHistogram dhRed = new DenseHistogram(BIN_SIZE, new RangeF(0.0f, BIN_DEPTH));
            dhRed.Calculate<Byte>(new Image<Gray, Byte>[1] { redChannel }, false, null);
            redChart.ClearHistogram();
            redChart.AddHistogram("Red Channel", System.Drawing.Color.Red, dhRed);
            redChart.Refresh();

            //Green colour Channel
            DenseHistogram dhGreen = new DenseHistogram(BIN_SIZE, new RangeF(0.0f, BIN_DEPTH));
            dhGreen.Calculate<Byte>(new Image<Gray, Byte>[1] { greenChannel }, false, null);
            greenChart.ClearHistogram();
            greenChart.AddHistogram("Green Channel", System.Drawing.Color.Green, dhGreen);

            greenChart.Refresh();

            //Blue colour Channel
            DenseHistogram dhBlue = new DenseHistogram(BIN_SIZE, new RangeF(0.0f, BIN_DEPTH));
            dhBlue.Calculate<Byte>(new Image<Gray, Byte>[1] { blueChannel }, false, null);
            blueChart.ClearHistogram();
            blueChart.Show();
            blueChart.AddHistogram("Blue Channel", System.Drawing.Color.Blue, dhBlue);
            blueChart.Refresh();
        }
開發者ID:JamesMasterman,項目名稱:SeaScan,代碼行數:30,代碼來源:HistogramView.cs

示例2: addAlphaToBgrImage

        public static Image<Bgra, Byte> addAlphaToBgrImage(Image<Bgr, Byte> bgrImage, Image<Gray, Byte> alphaImage)
        {
            Image<Gray, Byte>[] channels = bgrImage.Split();
            Image<Bgra, Byte> imageWithAlpha = new Image<Bgra,byte>(bgrImage.Width, bgrImage.Height);
            CvInvoke.cvMerge(channels[0], channels[1], channels[2], alphaImage, imageWithAlpha);

            for (int i = 0; i < 3; ++i) channels[i].Dispose();

            return imageWithAlpha;
        }
開發者ID:swkrueger,項目名稱:signrider,代碼行數:10,代碼來源:Utilities.cs


注:本文中的System.Image.Split方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。