91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 27.85MB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發布日期: 2023-07-28
  • 語言: C#
  • 標簽: 魔棒??

資源簡介

一個類似PS的魔棒工具的實現,可以看我的2篇博文,使用漫水填充算法與邊緣檢測,獲取邊界與區域掩碼圖。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Drawing.Drawing2D;
using?Emgu.CV;
using?Emgu.Util;
using?Emgu.CV.Structure;
?

namespace?magic_wand
{
????public?partial?class?FormMain?:?Form
????{
????????public?FormMain()
????????{
????????????InitializeComponent();
????????????pictureBox1.Cursor?=?Cursors.Cross;
????????}
????????private?string?curFileName;
????????private?static?Bitmap?srcBitmap;
????????private?Random?rgb?=?new?Random();
????????private?Color?fillColor;
????????//private?Color?bacColor;
????????private?Point?lastPoint?=?new?Point(00);
??????
????????Emgu.CV.Util.VectorOfVectorOfPoint?contours?=?new?Emgu.CV.Util.VectorOfVectorOfPoint();

????????private?void?btn_open_Click(object?sender?EventArgs?e)
????????{
????????????OpenImage();
????????????if?(srcBitmap?!=?null)
????????????{
????????????????pictureBox1.Image?=?(Image)srcBitmap;
????????????????pictureBox1.Width?=?srcBitmap.Width;
????????????????pictureBox1.Height?=?srcBitmap.Height;
????????????}
????????}
?
????????//open
????????private?void?OpenImage()
????????{
????????????try
????????????{
????????????????OpenFileDialog?ofd?=?new?OpenFileDialog();
????????????????ofd.Filter?=?“All?pic|*.bmp;*.jpg;*.png;*gif|bmp?files?|*.bmp|jpeg?files?|*.jpg|png?files??|*.png“;
????????????????ofd.title?=?“打開“;
????????????????ofd.ShowHelp?=?true;
????????????????if?(ofd.ShowDialog()?==?DialogResult.OK)
????????????????{
????????????????????curFileName?=?ofd.FileName;
????????????????????srcBitmap?=?new?Bitmap(curFileName);
????????????????????
????????????????}
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????MessageBox.Show(ex.Message);
????????????}
????????}
????????//save
?
????????///?
????????///?Flood?fill?algorithm.
????????///?

????????///?The?source?image.
????????///?The?start?point.
????????///?The?color?to?be?filled.
????????///?One?parameter?to?control?fill?effectfrom?0?to?255.
????????///?
????????public?Bitmap?FloodFill(Bitmap?src?Point?location?Color?fillColor?int?threshould)
????????{
????????????try
????????????{
????????????????Bitmap?srcbmp?=?src;
????????????????Bitmap?dstbmp?=?new?Bitmap(src.Widthsrc.Height);
????????????????int?w?=?srcbmp.Width;
????????????????int?h?=?srcbmp.Height;
????????????????Stack?fillPoints?=?new?Stack(w?*?h);
????????????????System.Drawing.Imaging.BitmapData?bmpData?=?srcbmp.LockBits(new?Rectangle(0?0?srcbmp.Width?srcbmp.Height)?System.Drawing.Imaging.ImageLockMode.ReadOnly?System.Drawing.Imaging.PixelFormat.Format24bppRgb);
????????????????System.Drawing.Imaging.BitmapData?dstbmpData?=?dstb

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-25?19:19??漫水加邊緣獲取\
?????文件????????3740??2017-12-12?20:54??漫水加邊緣獲取\UpgradeLog.xml
?????目錄???????????0??2017-12-13?14:43??漫水加邊緣獲取\magic_wand\
?????文件????????9879??2017-12-25?19:55??漫水加邊緣獲取\magic_wand\FormMain.Designer.cs
?????文件???????13425??2017-12-25?20:02??漫水加邊緣獲取\magic_wand\FormMain.cs
?????文件????????5814??2017-12-25?19:55??漫水加邊緣獲取\magic_wand\FormMain.resx
?????文件?????????494??2017-12-13?11:02??漫水加邊緣獲取\magic_wand\Program.cs
?????目錄???????????0??2017-12-12?20:54??漫水加邊緣獲取\magic_wand\Properties\
?????文件????????1358??2012-10-15?14:15??漫水加邊緣獲取\magic_wand\Properties\AssemblyInfo.cs
?????文件????????2865??2017-12-12?20:54??漫水加邊緣獲取\magic_wand\Properties\Resources.Designer.cs
?????文件????????5612??2012-10-15?14:15??漫水加邊緣獲取\magic_wand\Properties\Resources.resx
?????文件????????1112??2017-12-12?20:54??漫水加邊緣獲取\magic_wand\Properties\Settings.Designer.cs
?????文件?????????249??2012-10-15?14:15??漫水加邊緣獲取\magic_wand\Properties\Settings.settings
?????目錄???????????0??2017-12-13?10:16??漫水加邊緣獲取\magic_wand\bin\
?????目錄???????????0??2017-12-13?14:43??漫水加邊緣獲取\magic_wand\bin\Debug\
?????文件??????115712??2015-06-30?05:22??漫水加邊緣獲取\magic_wand\bin\Debug\Emgu.CV.UI.dll
?????文件???????34738??2015-06-30?05:22??漫水加邊緣獲取\magic_wand\bin\Debug\Emgu.CV.UI.xml
?????文件??????382464??2015-06-30?05:22??漫水加邊緣獲取\magic_wand\bin\Debug\Emgu.CV.dll
?????文件?????1061180??2015-06-30?05:22??漫水加邊緣獲取\magic_wand\bin\Debug\Emgu.CV.xml
?????文件???????19456??2015-06-30?05:22??漫水加邊緣獲取\magic_wand\bin\Debug\Emgu.Util.dll
?????文件???????17339??2015-06-30?05:22??漫水加邊緣獲取\magic_wand\bin\Debug\Emgu.Util.xml
?????文件???????17408??2017-12-25?19:55??漫水加邊緣獲取\magic_wand\bin\Debug\FloodFillTest.exe
?????文件???????40448??2017-12-25?19:55??漫水加邊緣獲取\magic_wand\bin\Debug\FloodFillTest.pdb
?????文件???????11608??2017-12-25?19:58??漫水加邊緣獲取\magic_wand\bin\Debug\FloodFillTest.vshost.exe
?????文件?????????490??2010-03-17?22:39??漫水加邊緣獲取\magic_wand\bin\Debug\FloodFillTest.vshost.exe.manifest
?????文件??????307200??2014-09-14?04:49??漫水加邊緣獲取\magic_wand\bin\Debug\ZedGraph.dll
?????目錄???????????0??2017-12-12?21:12??漫水加邊緣獲取\magic_wand\bin\Debug\x64\
?????文件????13839360??2015-06-29?23:40??漫水加邊緣獲取\magic_wand\bin\Debug\x64\cvextern.dll
?????文件?????1498624??2015-06-29?23:40??漫水加邊緣獲取\magic_wand\bin\Debug\x64\cvextern_test.exe
?????文件??????660128??2013-10-05?12:58??漫水加邊緣獲取\magic_wand\bin\Debug\x64\msvcp120.dll
?????文件??????963232??2013-10-05?12:58??漫水加邊緣獲取\magic_wand\bin\Debug\x64\msvcr120.dll
............此處省略32個文件信息

評論

共有 條評論

相關資源