예제 #1
0
        private void Separate(object parameter)
        {
            int rows  = anomalyData.GetLength(0);
            int cols  = anomalyData.GetLength(1);
            int index = Convert.ToInt32(parameter);

            if (index == 0)
            {
                resultData = Separation.TrendAnalysis(anomalyData, power);
            }
            else if (index == 1)
            {
                resultData = Separation.FilterTrendAnalysis(anomalyData, FiltData, power);
            }
            else if (index == 2)
            {
                resultData = Separation.InterpolateCut(anomalyData, expendMethod, radius, times);
            }
            else if (index == 3)
            {
                resultData = Separation.MoveAverage(anomalyData, secondData, expendMethod, radiusMin, radiusMax, radiusTick, out int bestRadius);
                Radius     = bestRadius;
            }
            else if (index == 4)
            {
                resultData = Separation.MoveAverage(anomalyData, expendMethod, radius);
            }
            else if (index == 5)
            {
                resultData = Separation.FilterMoveAverage(anomalyData, FiltData, expendMethod, radius);
            }
            else if (index == 6)
            {
                resultData = FiltData;
            }
            else if (index == 7)
            {
                resultData = Separation.FilterProject(anomalyData, expendMethod, project);
            }
            else if (index == 8)
            {
                resultData = EdgeDetection.ExpandRestore(FFT.idft_2D(EdgeDetection.延拓(FrqData, 延拓高度)).GetRe());
            }

            var zmin = EdgeDetection.GetDataMin(resultData);
            var zmax = EdgeDetection.GetDataMax(resultData);

            ResultMin = zmin;
            ResultMax = zmax;
            ResultMap = GetMap(resultData, zmin, zmax);

            if (index != 6)
            {
                secondResultData = new double[rows, cols];
                for (int i = 0; i < rows; i++)
                {
                    for (int j = 0; j < cols; j++)
                    {
                        secondResultData[i, j] = anomalyData[i, j] - resultData[i, j];
                    }
                }
            }
            else
            {
                secondResultData = Separation.AverageFill(resultData);
            }

            zmin            = EdgeDetection.GetDataMin(secondResultData);
            zmax            = EdgeDetection.GetDataMax(secondResultData);
            SecondResultMin = zmin;
            SecondResultMax = zmax;
            SecondResultMap = GetMap(secondResultData, zmin, zmax);
        }
예제 #2
0
        private void EdgeDetect(object parameter)
        {
            int index = Convert.ToInt32(parameter);

            if (index == 0)
            {
                resultData = Tempxdrdata;
            }
            else if (index == 1)
            {
                resultData = Tempydrdata;
            }
            else if (index == 2)
            {
                resultData = Tempzdrdata;
            }
            else if (index == 3)
            {
                resultData = EdgeDetection.Thdr(Tempxdrdata, Tempydrdata);
            }
            else if (index == 4)
            {
                resultData = EdgeDetection.Asm(Tempxdrdata, Tempydrdata, Tempzdrdata);
            }
            else if (index == 5)
            {
                resultData = EdgeDetection.Tilt(Tempzdrdata, EdgeDetection.Thdr(Tempxdrdata, Tempydrdata));
            }
            else if (index == 6)
            {
                resultData = EdgeDetection.Theta(EdgeDetection.Thdr(Tempxdrdata, Tempydrdata), EdgeDetection.Asm(Tempxdrdata, Tempydrdata, Tempzdrdata));
            }
            else if (index == 7)
            {
                resultData = EdgeDetection.Nstd(Tempxdrdata, Tempydrdata, Tempzdrdata, winSize);
            }
            else if (index == 8)
            {
                resultData = EdgeDetection.Gdo(Tempxdrdata, Tempydrdata, Tempzdrdata, alpha, theta);
            }
            else if (index == 9)
            {
                resultData = EdgeDetection.Ita2(Tempxdrdata, Tempydrdata, Tempzdrdata);
            }
            else if (index == 10)
            {
                resultData = EdgeDetection.ETA1(Tempxdrdata, Tempydrdata, Tempzdrdata);
            }
            else if (index == 11)
            {
                resultData = EdgeDetection.HFTilt(Tempxdrdata, Tempydrdata, VxxData, VyyData, VxyData);
            }
            else if (index == 12)
            {
                resultData = EdgeDetection.HFTheta(Tempxdrdata, Tempydrdata, VxxData, VyyData, VxyData);
            }
            else if (index == 13)
            {
                var asmData = EdgeDetection.Asm(Tempxdrdata, Tempydrdata, Tempzdrdata);
                double[,] asmZdrData, asmXdrData, asmYdrData;
                if (isFrqDomain)
                {
                    var asmFrqData = FFT.fft_2D(new Complex2D(EdgeDetection.MinCurveExpand(asmData)));
                    asmZdrData = EdgeDetection.ExpandRestore(FFT.idft_2D(EdgeDetection.Zdrf(asmFrqData)).GetRe());
                    asmYdrData = EdgeDetection.ExpandRestore(FFT.idft_2D(EdgeDetection.Ydrf(asmFrqData)).GetRe());
                    asmXdrData = EdgeDetection.ExpandRestore(FFT.idft_2D(EdgeDetection.Xdrf(asmFrqData)).GetRe());
                }
                else
                {
                    asmZdrData = EdgeDetection.Zdr(asmData);
                    asmYdrData = EdgeDetection.Ydr(asmData);
                    asmXdrData = EdgeDetection.Xdr(asmData);
                }
                var asmThdrData = EdgeDetection.Thdr(asmXdrData, asmYdrData);
                resultData = EdgeDetection.Tilt(asmZdrData, asmThdrData);
            }
            else if (index == 14)
            {
                var tiltData = EdgeDetection.Tilt(Tempzdrdata, EdgeDetection.Thdr(Tempxdrdata, Tempydrdata));
                double[,] tiltXdrData, tiltYdrData;
                if (isFrqDomain)
                {
                    var tiltFrqData = FFT.fft_2D(new Complex2D(EdgeDetection.MinCurveExpand(tiltData)));
                    tiltYdrData = EdgeDetection.ExpandRestore(FFT.idft_2D(EdgeDetection.Ydrf(tiltFrqData)).GetRe());
                    tiltXdrData = EdgeDetection.ExpandRestore(FFT.idft_2D(EdgeDetection.Xdrf(tiltFrqData)).GetRe());
                }
                else
                {
                    tiltYdrData = EdgeDetection.Ydr(tiltData);
                    tiltXdrData = EdgeDetection.Xdr(tiltData);
                }

                resultData = EdgeDetection.Thdr(tiltXdrData, tiltYdrData);
            }
            else if (index == 15)
            {
                resultData = EdgeDetection.GuassNoise(anomalyData);
            }
            else if (index == 16)
            {
                resultData = EdgeDetection.Idct(EdgeDetection.Zdrf(EdgeDetection.Dct(anomalyData, false)));
            }

            var zmin = EdgeDetection.GetDataMin(resultData);
            var zmax = EdgeDetection.GetDataMax(resultData);

            ResultMin = zmin;
            ResultMax = zmax;
            ResultMap = GetMap(resultData, zmin, zmax);
        }