Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
axmand committed Mar 23, 2018
1 parent 61aae7b commit a99f40e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
1 change: 1 addition & 0 deletions Engine.GIS/GEntity/GBitmap2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public Bitmap2(Bitmap bmp = null, string name = "", string dec = "", GRasterLaye
public Bitmap BMP
{
get { return _bitmap; }
set { _bitmap = value; }
}
/// <summary>
/// 图片名
Expand Down
8 changes: 7 additions & 1 deletion Engine.GIS/GOperation/Arithmetic/SuperPixelSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Host.Image.UI/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 22 additions & 5 deletions Host.Image.UI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
/// <summary>
Expand Down Expand Up @@ -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;
}

/// <summary>
/// 更新树视图委托
/// </summary>
Expand Down Expand Up @@ -305,6 +316,12 @@ private void PaintPoint(Bitmap bmp, int x, int y, byte value)
/// <param name="y"></param>
/// <param name="value"></param>
private delegate void PaintPointHandler(Bitmap bmp, int x, int y, byte value);
/// <summary>
///
/// </summary>
/// <param name="bmp"></param>
/// <param name="nodeName"></param>
private delegate void PaintBitmapHandler(Bitmap bmp, string nodeName);

#endregion

Expand Down
15 changes: 0 additions & 15 deletions Host.Image.UI/Main.resx
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,6 @@
<metadata name="map_toolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>137, 17</value>
</metadata>
<data name="DL_CLASS_toolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
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==
</value>
</data>
<metadata name="map_statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>247, 17</value>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion Host.Image.UI/SettingForm/DLClassifyForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit a99f40e

Please sign in to comment.