Example #1
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);
        }