mirror of
https://github.com/d-moco/panSight3DForm.git
synced 2025-01-10 04:27:16 -05:00
增加3D检测算法
This commit is contained in:
parent
cc6859e814
commit
aad93c08e7
471
PanSight3DForm/Form1.Designer.cs
generated
471
PanSight3DForm/Form1.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -132,19 +132,4 @@
|
|||||||
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="hWindowControlHeight.LayoutBitmap" type="System.Resources.ResXNullRef, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value />
|
|
||||||
</metadata>
|
|
||||||
<metadata name="hWindowControlGray.LayoutBitmap" type="System.Resources.ResXNullRef, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value />
|
|
||||||
</metadata>
|
|
||||||
</root>
|
</root>
|
66
PanSight3DForm/GzLinearDetection.cs
Normal file
66
PanSight3DForm/GzLinearDetection.cs
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace PanSight3DForm
|
||||||
|
{
|
||||||
|
public static class GzLinearDetection
|
||||||
|
{
|
||||||
|
//public static float[][] bufferC; // x y z 重新
|
||||||
|
|
||||||
|
|
||||||
|
public static int[][] CheckAlg(float[] buffer, int WLength, int channels, int HLength)
|
||||||
|
{
|
||||||
|
int length = WLength * channels;
|
||||||
|
//bufferC = new float[HLength][];
|
||||||
|
float[][] bufferZ3 = new float[HLength][];
|
||||||
|
for (int j = 0; j < HLength; j++)
|
||||||
|
{
|
||||||
|
//bufferC[j] = new float[length];
|
||||||
|
bufferZ3[j] = new float[WLength];
|
||||||
|
|
||||||
|
//for (int i = 0, k = 2; i < length; i++, k += 3)
|
||||||
|
//{
|
||||||
|
// bufferC[j][i] = buffer[i + j * length];
|
||||||
|
//}
|
||||||
|
for (int i = 0, k = 2; k < length; i++, k += 3)
|
||||||
|
{
|
||||||
|
if (k + j * length < buffer.Length)
|
||||||
|
{
|
||||||
|
bufferZ3[j][i] = buffer[k + j * length];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return DefectDetectMX(bufferZ3,WLength, HLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static int[][] DefectDetectMX(float[][] bufferZ3, int WLength, int HLength)
|
||||||
|
{
|
||||||
|
int[][] defLocZ;
|
||||||
|
defLocZ = new int[HLength][];
|
||||||
|
for (int j = 0; j < HLength; j++)
|
||||||
|
{
|
||||||
|
defLocZ[j] = new int[WLength + 2];
|
||||||
|
int nr = 1;
|
||||||
|
|
||||||
|
for (int i = 1; i < WLength; i++)
|
||||||
|
{
|
||||||
|
if (bufferZ3[j][i] != 0)
|
||||||
|
{
|
||||||
|
defLocZ[j][nr] = i;
|
||||||
|
nr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defLocZ[j][0] = nr - 1;
|
||||||
|
defLocZ[j][nr + 1] = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return defLocZ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -105,6 +105,7 @@
|
|||||||
<Compile Include="Form1.Designer.cs">
|
<Compile Include="Form1.Designer.cs">
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="GzLinearDetection.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<EmbeddedResource Include="DetectForm1.resx">
|
<EmbeddedResource Include="DetectForm1.resx">
|
||||||
|
Loading…
Reference in New Issue
Block a user