Emgu-WPF學習使用 - 顏色映射

來源:互聯網
上載者:User

標籤:rhs   pat   string   led   draw   lang   rom   type   origin   

原文:Emgu-WPF學習使用 - 顏色映射

            string sFile = "";            if (!String.IsNullOrEmpty(AppConstUtils.GDefaultFile) && File.Exists(AppConstUtils.GDefaultFile))                sFile = AppConstUtils.GDefaultFile;            else                sFile = GlobalVar.DATAS_PATH + "Samples/Test5.jpg";            System.Drawing.Image imgOrigin = System.Drawing.Image.FromFile(sFile);            Bitmap barcodeBitmap = new Bitmap(imgOrigin);            Image<Bgr, byte> imgSrc = new Image<Bgr, byte>(barcodeBitmap);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgSrc, "原始圖");            imgOrigin.Dispose();            barcodeBitmap.Dispose();            Image<Gray, byte> imgGray = new Image<Gray, byte>(imgSrc.Size);            CvInvoke.CvtColor(imgSrc, imgGray, ColorConversion.Bgr2Gray);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgGray, "灰階化->");            Image<Bgr, byte> imgColorAutumn = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorAutumn, ColorMapType.Autumn);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorAutumn, "灰階化->Autumn顏色映射");            Image<Bgr, byte> imgColorBone = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorBone, ColorMapType.Bone);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorBone, "灰階化->Bone顏色映射");            Image<Bgr, byte> imgColorCool = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorCool, ColorMapType.Cool);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorCool, "灰階化->Cool顏色映射");            Image<Bgr, byte> imgColorHot = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorHot, ColorMapType.Hot);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorHot, "灰階化->Hot顏色映射");            Image<Bgr, byte> imgColorHsv = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorHsv, ColorMapType.Hsv);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorHsv, "灰階化->Hsv顏色映射");            Image<Bgr, byte> imgColorJet = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorJet, ColorMapType.Jet);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorJet, "灰階化->Jet顏色映射");            Image<Bgr, byte> imgColorOcean = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorOcean, ColorMapType.Ocean);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorOcean, "灰階化->Ocean顏色映射");            Image<Bgr, byte> imgColorPink = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorPink, ColorMapType.Pink);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorPink, "灰階化->Pink顏色映射");            Image<Bgr, byte> imgColorRainbow = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorRainbow, ColorMapType.Rainbow);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorRainbow, "灰階化->Rainbow顏色映射");            Image<Bgr, byte> imgColorSpring = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorSpring, ColorMapType.Spring);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorSpring, "灰階化->Spring顏色映射");            Image<Bgr, byte> imgColorSummer = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorSummer, ColorMapType.Summer);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorSummer, "灰階化->Summer顏色映射");            Image<Bgr, byte> imgColorWinter = new Image<Bgr, byte>(imgSrc.Size);            CvInvoke.ApplyColorMap(imgGray, imgColorWinter, ColorMapType.Winter);            AppUtils.AttachImageItem(this.WpDemo1Zm, imgColorWinter, "灰階化->Winter顏色映射");

Emgu-WPF學習使用 - 顏色映射

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.