diff --git a/Engine.GIS/GEntity/GBitmap2.cs b/Engine.GIS/GEntity/GBitmap2.cs index 4fdc16f..748d5b5 100644 --- a/Engine.GIS/GEntity/GBitmap2.cs +++ b/Engine.GIS/GEntity/GBitmap2.cs @@ -28,6 +28,7 @@ public Bitmap2(Bitmap bmp = null, string name = "", string dec = "", GRasterLaye public Bitmap BMP { get { return _bitmap; } + set { _bitmap = value; } } /// /// 图片名 diff --git a/Engine.GIS/GOperation/Arithmetic/SuperPixelSegment.cs b/Engine.GIS/GOperation/Arithmetic/SuperPixelSegment.cs index 2d05f38..698b616 100644 --- a/Engine.GIS/GOperation/Arithmetic/SuperPixelSegment.cs +++ b/Engine.GIS/GOperation/Arithmetic/SuperPixelSegment.cs @@ -55,6 +55,9 @@ public Bitplane(Bitplane bitplane) SetPixel(x, y, bitplane.GetPixel(x, y)); } + public Bitplane() + { } + public Bitplane(int w, int h) { Width = w; @@ -340,7 +343,10 @@ public static SlicPackage Run(Bitmap bmp, double numberOfCenters, double m, Colo public static Bitmap DrawAverage(Bitmap bmp,Center[] centers,Bitplane labels) { - return null; + Bitmap3 bmp3 = new Bitmap3(bmp); + Bitmap3 result = DrawAverage(bmp3, centers, labels); + //result.LABtoRGB(); + return result.GetBitmap(); } private static Bitmap3 DrawEdges(Bitmap3 image, Center[] centers, Bitplane labels, Color edgeColor) diff --git a/Host.Image.UI/Main.Designer.cs b/Host.Image.UI/Main.Designer.cs index 7ad89d3..6e92f9c 100644 --- a/Host.Image.UI/Main.Designer.cs +++ b/Host.Image.UI/Main.Designer.cs @@ -179,7 +179,7 @@ private void InitializeComponent() // // DL_CLASS_toolStripButton // - this.DL_CLASS_toolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("DL_CLASS_toolStripButton.Image"))); + this.DL_CLASS_toolStripButton.Image = global::Host.Image.UI.Properties.Resources.chart_bar1_64; this.DL_CLASS_toolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta; this.DL_CLASS_toolStripButton.Name = "DL_CLASS_toolStripButton"; this.DL_CLASS_toolStripButton.Size = new System.Drawing.Size(60, 37); diff --git a/Host.Image.UI/Main.cs b/Host.Image.UI/Main.cs index fb78228..4b95918 100644 --- a/Host.Image.UI/Main.cs +++ b/Host.Image.UI/Main.cs @@ -102,12 +102,16 @@ private void RunClassify(GRasterLayer rasterLayer, bool useSLIC, string pbName, Center center = centers[i]; float[] input = rasterLayer.GetPixelFloat((int)center.X, (int)center.Y).ToArray(); long classified = model.Classify(input, shapeEuum); - center.L = classified; - center.A = classified; - center.B = classified; + center.L = classified*20; + center.A = classified* 20; + center.B = classified* 20; + Invoke(new UpdateStatusLabelHandler(UpdateStatusLabel), "已处理第"+i+"/"+centers.Length+"个中心", STATUE_ENUM.WARNING); } - bmp = SuperPixelSegment.DrawAverage(bmp, centers, labels); - } + //遍历图片进行绘制 + for (int i = 0; i < rasterLayer.XSize; i++) + for (int j = 0; j < rasterLayer.YSize; j++) + Invoke(new PaintPointHandler(PaintPoint), bmp, i, j, Convert.ToByte(centers[(int)Math.Floor(labels.GetPixel(i, j))].L)); + } } } /// @@ -270,6 +274,13 @@ private void PaintPoint(Bitmap bmp, int x, int y, byte value) //g.DrawLine(Pens.Black, new Point(x, y), new Point(bmp.Width, bmp.Height)); map_pictureBox.Image = bmp; } + + private void PaintBitmap(Bitmap bmp,string nodeName) + { + _imageDic[nodeName].BMP = bmp; + map_pictureBox.Image = bmp; + } + /// /// 更新树视图委托 /// @@ -305,6 +316,12 @@ private void PaintPoint(Bitmap bmp, int x, int y, byte value) /// /// private delegate void PaintPointHandler(Bitmap bmp, int x, int y, byte value); + /// + /// + /// + /// + /// + private delegate void PaintBitmapHandler(Bitmap bmp, string nodeName); #endregion diff --git a/Host.Image.UI/Main.resx b/Host.Image.UI/Main.resx index f2829a8..1bc685d 100644 --- a/Host.Image.UI/Main.resx +++ b/Host.Image.UI/Main.resx @@ -140,21 +140,6 @@ 137, 17 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - 247, 17 diff --git a/Host.Image.UI/SettingForm/DLClassifyForm.cs b/Host.Image.UI/SettingForm/DLClassifyForm.cs index 308d835..00e1735 100644 --- a/Host.Image.UI/SettingForm/DLClassifyForm.cs +++ b/Host.Image.UI/SettingForm/DLClassifyForm.cs @@ -43,7 +43,7 @@ private void button3_Click(object sender, EventArgs e) opg.Filter = "超像素边界|*.json"; if (opg.ShowDialog() == DialogResult.OK) { - textBox2.Text = opg.FileName; + textBox3.Text = opg.FileName; } }