コード例 #1
0
ファイル: Monitor.cs プロジェクト: allisterb/Fss
        public virtual ApiResult Start()
        {
            ThrowIfNotInitialized();
            Detectors.ForEach(d => QueueObserverThreads.Add(new Thread(() => ObserveDetectorQueue(d, Global.CancellationTokenSource.Token))));
            QueueObserverThreads.ForEach(t => t.Start());
            int enabled = 0;

            foreach (TDetector d in Detectors)
            {
                if (d.Enable() == ApiResult.Success)
                {
                    enabled++;
                }
                else
                {
                    Error("Could not enable detector.");
                }
            }
            if (enabled > 0)
            {
                Status = ApiStatus.Ok;
                return(ApiResult.Success);
            }
            else
            {
                Status = ApiStatus.Error;
                return(ApiResult.Failure);
            }
        }
コード例 #2
0
        private VolumeCollection SetVolumeByDetection(List <Models.Approach> approaches, List <Controller_Event_Log> detectorEvents)
        {
            var controllerEventLogRepository = MOE.Common.Models.Repositories.ControllerEventLogRepositoryFactory.Create();

            foreach (var approach in approaches)
            {
                foreach (var detector in approach.Detectors)
                {
                    if (detector.DetectionTypes.Any(d => d.DetectionTypeID == DetectionType.DetectionTypeID))
                    {
                        if (detector.LaneType.LaneTypeID == 1)
                        {
                            Detectors.Add(detector);
                            detectorEvents.AddRange(controllerEventLogRepository.GetEventsByEventCodesParamWithOffsetAndLatencyCorrection(
                                                        detector.Approach.SignalID, _approachVolumeOptions.StartDate,
                                                        _approachVolumeOptions.EndDate, new List <int> {
                                82
                            }, detector.DetChannel,
                                                        detector.GetOffset(), detector.LatencyCorrection));
                        }
                    }
                }
            }
            return(new VolumeCollection(_approachVolumeOptions.StartDate, _approachVolumeOptions.EndDate, detectorEvents, _approachVolumeOptions.SelectedBinSize));
        }
コード例 #3
0
        public void Report(folderNode folder)
        {
            builderForText reporter = new builderForText();

            Detectors.Report(reporter);
            Candidates.Report(reporter, nameof(Candidates));

            AcceptedCandidates.Report(reporter, nameof(AcceptedCandidates));

            DeclinedCandidates.Report(reporter, nameof(DeclinedCandidates));

            DeclinedByDetectorCandidates.Report(reporter, nameof(DeclinedByDetectorCandidates));

            NodeDictionaryGraphStyleSettings style = new NodeDictionaryGraphStyleSettings();


            var initialGraph = InitialGraph.BuildDirectedGraph(style);

            initialGraph.Save(folder.pathFor("InitialGraph.dgml", imbSCI.Data.enums.getWritableFileMode.overwrite, "Initial content graph of chunk detection"));

            var finalGraph = CurrentGraph.BuildDirectedGraph(style);

            finalGraph.Save(folder.pathFor("FinalGraph.dgml", imbSCI.Data.enums.getWritableFileMode.overwrite, "Final content graph of chunk detection"));

            CurrentGraphStates.Save(folder, "StateGraph");

            foreach (var chunk in DetectedChunks)
            {
                chunk.PublishAnnotation(initialGraph, "#f7941d", style);
            }

            initialGraph.Save(folder.pathFor("InitialGraphWithAnnotation.dgml", imbSCI.Data.enums.getWritableFileMode.overwrite, "Initial content graph of chunk detection with chunks annoted"));
            folder.SaveText(reporter.GetContent(), "report.txt");
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: BasterBenea/Async-Examples
        /// <summary>
        /// Intended to be used with or without an existing server
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ServerAvailableButton_Click(object sender, EventArgs e)
        {
            ButtonsSetup(false);

            var operation = new Detectors();
            var results   = await operation.SqlServerIsAvailable(ServerNameTextBox.Text);

            if (results)
            {
                MessageBox.Show($"Server {ServerNameTextBox.Text} found, press okay to connect");
                await _serverOperaions.ConnectServerAsync(ServerNameTextBox.Text);

                if (_serverOperaions.IsSuccessFul)
                {
                    MessageBox.Show("Connected successfully");
                }
                else
                {
                    MessageBox.Show($"Connection failed with\n{_serverOperaions.LastExceptionMessage}");
                }
            }
            else
            {
                MessageBox.Show($"Server {ServerNameTextBox.Text} not found");
            }

            ButtonsSetup();
        }
コード例 #5
0
        public ModuleInfo GetModule(SoftwareInfo software, byte[] buffer, string hashName)
        {
            var tuples = Detectors
                         .Select(d => GetBytes(d, software, hashName))
                         .ToArray();

            return(GetValue(buffer, tuples));
        }
コード例 #6
0
        /*An ECB/CBC detection oracle
         * Now that you have ECB and CBC working:
         *
         * Write a function to generate a random AES key; that's just 16 random bytes.
         *
         * Write a function that encrypts data under an unknown key --- that is, a function that generates a random key and encrypts under it.
         *
         * The function should look like:
         *
         * encryption_oracle(your-input)
         * => [MEANINGLESS JIBBER JABBER]
         * Under the hood, have the function append 5-10 bytes (count chosen randomly) before the plaintext and 5-10 bytes after the plaintext.
         *
         * Now, have the function choose to encrypt under ECB 1/2 the time, and under CBC the other half (just use random IVs each time for CBC). Use rand(2) to decide which to use.
         *
         * Detect the block cipher mode the function is using each time. You should end up with a piece of code that, pointed at a block box that might be encrypting ECB or CBC, tells you which one is happening.
         */
        static void Main(string[] args)
        {
            byte[]       dbuf   = File.ReadAllBytes(".\\tux.ppm");
            BinaryReader reader = new BinaryReader(new MemoryStream(dbuf));

            System.Console.WriteLine(Detectors.AESModeDetector(dbuf));
            System.Console.ReadKey();
        }
コード例 #7
0
        private SoftwareInfo GetSoftware(byte[] buffer)
        {
            var tuples = Detectors
                         .Select(GetBytes)
                         .ToArray();

            return(GetValue(buffer, tuples));
        }
コード例 #8
0
 /// <summary>
 /// Detects the sentences in the specified input.
 /// </summary>
 /// <param name="input">The input.</param>
 /// <param name="detector">The detector.</param>
 /// <returns>The sentences.</returns>
 public Sentence[] Detect(Token[] input, SentenceDetectorLanguage detector)
 {
     if (!Detectors.ContainsKey(detector))
     {
         return(Array.Empty <Sentence>());
     }
     return(Detectors[detector].DetectSentences(input));
 }
コード例 #9
0
        public override string ToString()
        {
            var baseString = (Owner != null) ? string.Format("[{0}] ", Owner) : "";

            baseString += (_hasValue) ? string.Format("{0} {1}", TimeStamp, Value) : string.Format("{0}", TimeStamp);

            return(Detectors.Aggregate(baseString, (current, detectionMethod) => current + string.Format(" [{0}]", detectionMethod.Name)));
        }
コード例 #10
0
        public IDataBlock Build()
        {
            PreConditions.Operation().IsInvalidIf((Detectors == null || Detectors.Count() == 0), "Detector was not set")
            .And.IsInvalidIf((InputFile == null), "InputFile was not set")
            .And.IsInvalidIf(((StartOffset < 0) || (StartOffset >= InputFile.Length)), "StartOffset is invalid")
            .And.IsInvalidIf(((EndOffset <= StartOffset) /*|| (EndOffset > InputFile.Length)*/), "EndOffset is invalid");

            return(new DataBlock(this));
        }
コード例 #11
0
 private void Instance_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "FilterText")
     {
         Workflows.Refresh();
         Detectors.Refresh();
         WorkItemQueues.Refresh();
     }
 }
コード例 #12
0
        public async Task Save(bool skipOnline = false)
        {
            await Save <Project>(skipOnline);

            foreach (var workflow in Workflows.ToList())
            {
                if (workflow.projectid != _id)
                {
                    workflow.projectid = _id;
                }
                await workflow.Save(skipOnline);
            }
            foreach (Detector detector in Detectors.ToList())
            {
                if (detector.projectid != _id)
                {
                    detector.projectid = _id;
                }
                await detector.Save(skipOnline);
            }
            foreach (WorkitemQueue wiq in WorkItemQueues.ToList())
            {
                if (wiq.projectid != _id)
                {
                    wiq.projectid = _id;
                }
                await wiq.Save(skipOnline);
            }
            GenericTools.RunUI(() =>
            {
                if (System.Threading.Monitor.TryEnter(RobotInstance.instance.Projects, Config.local.thread_lock_timeout_seconds * 1000))
                {
                    try
                    {
                        var exists = RobotInstance.instance.Projects.FindById(_id);
                        if (exists == null)
                        {
                            RobotInstance.instance.Projects.Add(this);
                        }
                        if (exists != null)
                        {
                            RobotInstance.instance.Projects.UpdateItem(exists, this);
                        }
                    }
                    finally
                    {
                        System.Threading.Monitor.Exit(RobotInstance.instance.Projects);
                    }
                }
                else
                {
                    throw new LockNotReceivedException("Saving Project");
                }
            });
        }
コード例 #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultSentenceDetector"/> class.
        /// </summary>
        /// <param name="detectors">The detectors.</param>
        /// <param name="tokenizer">The tokenizer.</param>
        public DefaultSentenceDetector(IEnumerable <IDetector> detectors, ITokenizer tokenizer)
        {
            Detectors = detectors.Where(x => x.GetType().Assembly != typeof(DefaultSentenceDetector).Assembly).ToDictionary(x => x.Name);
            foreach (var Detector in detectors.Where(x => x.GetType().Assembly == typeof(DefaultSentenceDetector).Assembly &&
                                                     !Detectors.ContainsKey(x.Name)))
            {
                Detectors.Add(Detector.Name, Detector);
            }

            Tokenizer = tokenizer;
        }
コード例 #14
0
 private bool CheckIfTagExists(Detection detection)
 {
     if (!Detectors.ContainsKey(detection.HostName))
     {
         Tag removedTag;
         var removed = Tags.TryRemove(detection.TagId, out removedTag);
         //TODO: Shouldn't a TagRemoved event be fired here?
         return(false);
     }
     return(Tags.ContainsKey(detection.TagId));
 }
コード例 #15
0
            public bool Equals(DataBlock other)
            {
                if (other == null)
                {
                    return(false);
                }
                if (other == this)
                {
                    return(true);
                }

                if (other.DataFormat != DataFormat)
                {
                    return(false);
                }
                if (!other.Detectors.Count().Equals(Detectors.Count()))
                {
                    return(false);
                }
                for (int i = 0; i < other.Detectors.Count(); i++)
                {
                    if (!other.Detectors.ElementAt(i).Equals(Detectors.ElementAt(i)))
                    {
                        return(false);
                    }
                }
                if (!other.InputFile.Equals(InputFile))
                {
                    return(false);
                }
                if (other.StartOffset != StartOffset)
                {
                    return(false);
                }
                if (other.EndOffset != EndOffset)
                {
                    return(false);
                }
                if (other.IsFullFile != IsFullFile)
                {
                    return(false);
                }
                if (!Equals(other.ReferenceHeader, ReferenceHeader))
                {
                    return(false);
                }
                if (!other.CodecStreams.SequenceEqual(other.CodecStreams))
                {
                    return(false);
                }
                return(true);
            }
コード例 #16
0
ファイル: OnsetDetector.cs プロジェクト: jlai1997/Pianotes
        private Vector <float> GetActivations(SpectralODF sODF, Detectors detectionFunction)
        {
            Vector <float> activations;

            switch (detectionFunction)
            {
            case Detectors.HFC:
                activations = sODF.HFC();
                break;

            case Detectors.SD:
                activations = sODF.SD();
                break;

            case Detectors.SF:
                activations = sODF.SF();
                break;

            case Detectors.MKL:
                activations = sODF.MKL();
                break;

            case Detectors.PD:
                activations = sODF.PD();
                break;

            case Detectors.WPD:
                activations = sODF.WPD();
                break;

            case Detectors.NWPD:
                activations = sODF.NWPD();
                break;

            case Detectors.CD:
                activations = sODF.CD();
                break;

            case Detectors.RCD:
                activations = sODF.RCD();
                break;

            default:
                throw new Exception("Unsupported detection function");
                break;
            }

            return(activations);
        }
コード例 #17
0
ファイル: AppWindow.cs プロジェクト: sycomix/OLAF
 public AppWindowMonitor(Profile profile, string processName) : base(profile)
 {
     ProcessName       = processName;
     AppWindowActivity = new AppWindowActivity(this, Type, processName, TimeSpan.FromMilliseconds(5000));
     if (AppWindowActivity.Status == ApiStatus.Ok)
     {
         Detectors.Add(AppWindowActivity);
         this.Status = ApiStatus.Initializing;
         Info("Creating app window monitor for process {0}.", processName);
     }
     else
     {
         Error("Could not create AppWindowActivity detector for process {0}.", processName);
         this.Status = ApiStatus.Error;
     }
 }
コード例 #18
0
ファイル: StorageDeviceMonitor.cs プロジェクト: sycomix/OLAF
        public override ApiResult Init()
        {
            if (Status != ApiStatus.Initializing)
            {
                return(ApiResult.Failure);
            }

            if (Detector.Status == ApiStatus.Initialized)
            {
                Detectors.Add(Detector);
                return(SetInitializedStatusAndReturnSucces());
            }
            else
            {
                Error("Storage device activity detector did not initialize.");
                return(SetErrorStatusAndReturnFailure());
            }
        }
コード例 #19
0
        public Report Report(ClrRuntime runtime)
        {
            var report = new Report();

            report.Stats = StatCollectors
                           .Select(s => s(runtime))
                           .ToList();

            report.Metrics = MetricCollectors
                             .Select(m => m(runtime))
                             .Concat(MultiMetricCollectors
                                     .SelectMany(c => c(runtime)))
                             .ToList();

            report.Issues = Detectors.SelectMany(d => d(runtime, report)).ToList();

            return(report);
        }
コード例 #20
0
        public async Task Save()
        {
            await Save <Project>();

            var wfs = Workflows.ToList();
            var dts = Detectors.ToList();

            foreach (var workflow in wfs)
            {
                workflow.projectid = _id;
                await workflow.Save();
            }
            foreach (Detector detector in dts)
            {
                detector.projectid = _id;
                await detector.Save();
            }
        }
コード例 #21
0
        public static void LoadAll( )
        {
            lock ( Locker )
            {
                if (Loaded)
                {
                    return;
                }

                //Todo:Load All internal type
                foreach (TypeInfo type in typeof(Program).GetTypeInfo( ).
                         Assembly.DefinedTypes.
                         Where(type => type.GetCustomAttributes(typeof(DetectorAttribute), false).Any( ) &&
                               typeof(ThingsDetector).GetTypeInfo( ).IsAssignableFrom(type)))
                {
                    Detectors.Add(Activator.CreateInstance(type, Source) as ThingsDetector);
                }

                Loaded = true;
            }
        }
コード例 #22
0
 public List <Detector> GetAllDetectorsOfDetectionType(int detectionTypeID)
 {
     if (Detectors != null)
     {
         foreach (var d in Detectors)
         {
             if (d.DetectionTypeIDs == null)
             {
                 d.DetectionTypeIDs = new List <int>();
                 foreach (var dt in d.DetectionTypes)
                 {
                     d.DetectionTypeIDs.Add(dt.DetectionTypeID);
                 }
             }
         }
         return(Detectors
                .Where(d => d.DetectionTypeIDs.Contains(detectionTypeID))
                .ToList());
     }
     return(new List <Detector>());
 }
コード例 #23
0
        private void LoadFilesFromDisk(string folder)
        {
            if (string.IsNullOrEmpty(folder))
            {
                folder = Path;
            }
            var Files = System.IO.Directory.EnumerateFiles(folder, "*.*", System.IO.SearchOption.AllDirectories).OrderBy((x) => x).ToArray();

            foreach (string file in Files)
            {
                if (System.IO.Path.GetExtension(file).ToLower() == ".xaml")
                {
                    Workflows.Add(Workflow.FromFile(this, file));
                }
                else if (System.IO.Path.GetExtension(file).ToLower() == ".json")
                {
                    var      json = System.IO.File.ReadAllText(file);
                    Detector _d   = JsonConvert.DeserializeObject <Detector>(json);
                    if (!string.IsNullOrEmpty(_d._id))
                    {
                        var exists = RobotInstance.instance.Detectors.FindById(_d._id);
                        if (exists != null)
                        {
                            _d._id = null;
                        }
                        else
                        {
                            _d.isLocalOnly = true;
                        }
                    }
                    if (string.IsNullOrEmpty(_d._id))
                    {
                        _d._id = Guid.NewGuid().ToString();
                    }
                    _d.isDirty = true;
                    _d.Start(true);
                    Detectors.Add(_d);
                }
            }
        }
コード例 #24
0
 public override ApiResult Init()
 {
     if (Status != ApiStatus.Initializing)
     {
         return(ApiResult.Failure);
     }
     try
     {
         for (int i = 0; i < Paths.Count; i++)
         {
             KeyValuePair <DirectoryInfo, string> path = Paths.ElementAt(i);
             Detectors.Add(new FileSystemActivity(path.Key.FullName, path.Value, true, this,
                                                  typeof(DirectoryChangesMonitor)));
         }
         return(SetInitializedStatusAndReturnSucces());
     }
     catch (Exception e)
     {
         Error(e, "Error occurred initializing a detector.");
         return(SetErrorStatusAndReturnFailure());
     }
 }
コード例 #25
0
        void tracker_DetectorsReceived(object sender, SonitorEventArgs e)
        {
            var msg = (DetectorsMessage)e.Message;

            DataReceived(this, new DataEventArgs(msg));

            foreach (var det in msg.Detectors)
            {
                bool updated = false;
                Detectors.AddOrUpdate(det.HostName, det, (k, v) =>
                {
                    Detectors[det.HostName] = det;
                    DetectorStateChanged(this, new DetectorEventArgs(Detectors[det.HostName]));
                    updated = true;
                    return(det);
                }
                                      );
                if (!updated)
                {
                    DetectorAdded(this, new DetectorEventArgs(Detectors[det.HostName]));
                }
            }
        }
コード例 #26
0
        private Feature2D GetNativeDetector(Detectors detectors)
        {
            const int numberOfFeatures = 100;

            switch (detectors)
            {
            case Detectors.Surf:
                return(new SURF(100));

            case Detectors.Fast:
                return(new FastDetector());

            case Detectors.ORB:
                return(new ORBDetector(numberOfFeatures: numberOfFeatures));

            case Detectors.Sift:
                return(new SIFT(nFeatures: numberOfFeatures));

            case Detectors.AKAZE:
                return(new AKAZE());

            case Detectors.Brisk:
                return(new Brisk());

            case Detectors.GFTTDetector:
                return(new GFTTDetector(maxCorners: numberOfFeatures));

            case Detectors.MSERDetector:
                return(new MSERDetector());

            case Detectors.StarDetector:
                return(new StarDetector(maxSize: numberOfFeatures));

            default:
                throw new ArgumentException("Don't know type " + detectors);
            }
        }
コード例 #27
0
        /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        * StartDetectorDataAcq is invoked upon establishment of the
        * APCS instance's connection. At that time, there is no
        * guarantee that the Detectors instance has already established
        * all of its underlying NCB command connections. APCS initiates
        * its connection when the above public method, Connect, is
        * invoked, which establishes the APCS connection. Connect may be
        * invoked also from DetectorsApp/MainWindow.xaml.cs.
        *!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
        public bool StartDetectorDataAcq(string reason = null)
        {
            _detectorsAccess.SourcesSynchronized = false;

            // If all of the detector servers are connected, stop the
            // detector timing pulses, then, reset the line identities
            // of the detector servers, then, start the detectors' data
            // connections and, finally, restart the the timing pulses.
            if (!Detectors.CommandIsReady)
            {
                _logger.LogError("All NCB(s) not yet ready");
                return(false);
            }
            if (/*fail?*/ !Apcs.DetectorsTimingEnable(false))
            {
                _logger.LogError("Apcs.DetectorsTimingEnable(false) failed");
                return(false);
            }
            try { Detectors.ResetLineCount(); }
            catch (Exception ex)
            {
                _logger.LogError(ex);
                return(false);
            }
            if (/*fail?*/ !Apcs.DetectorsTimingEnable(true))
            {
                _logger.LogError("Apcs.DetectorsTimingEnable(true) failed");
                return(false);
            }

            _detectorsAccess.SourcesSynchronized = true;

            // All NCBs are connected and APCS timing has been started: the NCBs' LineID counters
            // have been synchronized.
            return(true);
        }
コード例 #28
0
        public static void Init()
        {
            try
            {
                if (Global.Reset.Enabled)
                {
                    Reset.Force(Global.Name, Global.Reset.MaxAge);
                }

                /*
                 * AppDomain.CurrentDomain.UnhandledException +=
                 *  delegate(object sender, UnhandledExceptionEventArgs eventArgs)
                 *  {
                 *      try
                 *      {
                 *          var ex = sender as Exception;
                 *          if (ex != null)
                 *          {
                 *              Global.Logger.AddItem(new LogItem(ex));
                 *          }
                 *      }
                 *      catch (Exception ex)
                 *      {
                 *          Console.WriteLine(ex);
                 *      }
                 *  };
                 *
                 */
                #region GameObjects

                GameObjects.Initialize();

                #endregion GameObjects

                Global.SFX = new SFXUtility();

                #region Parents

                var activators = new Activators();
                var detectors  = new Detectors();
                var drawings   = new Drawings();
                var events     = new Events();
                var others     = new Others();
                var timers     = new Timers();
                var trackers   = new Trackers();

                #endregion Parents

                Global.Features.AddRange(
                    new List <IChild>
                {
                    #region Features

                    new AntiRengar(activators),
                    new AutoJump(activators),
                    new KillSteal(activators),
                    new Potion(activators),
                    new Revealer(activators),
                    new Smite(activators),
                    new Gank(detectors),
                    new Replay(detectors),
                    new Teleport(detectors),
                    new Clock(drawings),
                    new Clone(drawings),
                    //new DamageIndicator(drawings),
                    new Health(drawings),
                    new LaneMomentum(drawings),
                    new LasthitMarker(drawings),
                    new PerfectWard(drawings),
                    new Range(drawings),
                    new WallJumpSpot(drawings),
                    new Waypoint(drawings),
                    new AutoLeveler(events),
                    new Features.Events.Game(events),
                    new Trinket(events),
                    new AntiFountain(others),
                    new AutoLantern(others),
                    new Flash(others),
                    new Humanize(others),
                    new MoveTo(others),
                    new Ping(others),
                    new TurnAround(others),
                    new Ability(timers),
                    new Altar(timers),
                    new Cooldown(timers),
                    new Inhibitor(timers),
                    new Jungle(timers),
                    new Relic(timers),
                    new Destination(trackers),
                    new LastPosition(trackers),
                    new Sidebar(trackers),
                    new Ward(trackers)

                    #endregion Features
                });
                foreach (var feature in Global.Features)
                {
                    try
                    {
                        feature.HandleEvents();
                    }
                    catch (Exception ex)
                    {
                        Global.Logger.AddItem(new LogItem(ex));
                    }
                }
                try
                {
                    Update.Check(
                        Global.Name, Assembly.GetExecutingAssembly().GetName().Version, Global.UpdatePath, 10000);
                }
                catch (Exception ex)
                {
                    Global.Logger.AddItem(new LogItem(ex));
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
コード例 #29
0
ファイル: Reporter.cs プロジェクト: lowgear/dump_analyzer
        public Reporter RegisterDetector(Func <ClrRuntime, Report, IEnumerable <IIssue> > detector)
        {
            Detectors.Add(detector);

            return(this);
        }
コード例 #30
0
        private Vector<float> GetActivations(SpectralODF sODF, Detectors detectionFunction)
        {
            Vector<float> activations;
            switch (detectionFunction)
            {
                case Detectors.HFC:
                    activations = sODF.HFC();
                    break;
                case Detectors.SD:
                    activations = sODF.SD();
                    break;
                case Detectors.SF:
                    activations = sODF.SF();
                    break;
                case Detectors.MKL:
                    activations = sODF.MKL();
                    break;
                case Detectors.PD:
                    activations = sODF.PD();
                    break;
                case Detectors.WPD:
                    activations = sODF.WPD();
                    break;
                case Detectors.NWPD:
                    activations = sODF.NWPD();
                    break;
                case Detectors.CD:
                    activations = sODF.CD();
                    break;
                case Detectors.RCD:
                    activations = sODF.RCD();
                    break;
                default:
                    throw new Exception("Unsupported detection function");
                    break;
            }

            return activations;
        }
コード例 #31
0
 private bool NeedPhaseInformation(Detectors detectionFunction)
 {
     return new Detectors[] { Detectors.PD, Detectors.WPD, Detectors.NWPD, Detectors.CD, Detectors.RCD }.Contains(detectionFunction);
 }
コード例 #32
0
ファイル: Approach.cs プロジェクト: gmonk/ATSPM
 public void SetDetectorEvents(Models.Approach approach, DateTime startdate, DateTime enddate, bool has_pcd,
                               bool has_tmc)
 {
     DetectorEvents =
         Detectors.CombineDetectorDataByApproachAndType(startdate, enddate, approach, has_pcd, has_tmc);
 }
コード例 #33
0
        private Feature2D GetNativeDetector(Detectors detectors)
        {
            const int numberOfFeatures = 100;

            switch (detectors)
            {
                case Detectors.Surf:
                    return new SURF(100);
                case Detectors.Fast:
                    return new FastDetector();
                case Detectors.ORB:
                    return new ORBDetector(numberOfFeatures: numberOfFeatures);
                case Detectors.Sift:
                    return new SIFT(nFeatures: numberOfFeatures);
                case Detectors.AKAZE:
                    return new AKAZE();
                case Detectors.Brisk:
                    return new Brisk();
                case Detectors.GFTTDetector:
                    return new GFTTDetector(maxCorners: numberOfFeatures);
                case Detectors.MSERDetector:
                    return new MSERDetector();
                case Detectors.StarDetector:
                    return new StarDetector(maxSize: numberOfFeatures);
                default:
                    throw new ArgumentException("Don't know type " + detectors);
            }
        }