Beispiel #1
0
        /// <summary>
        /// Returns the sum squared difference between this hash and the other hash.
        /// </summary>
        /// <param name="other">The <see cref="PerceptualHash"/> to get the distance of.</param>
        /// <returns>The sum squared difference between this hash and the other hash.</returns>
        public double SumSquaredDistance(IPerceptualHash other)
        {
            Throw.IfNull(nameof(other), other);

            return
                (_channels[PixelChannel.Red].SumSquaredDistance(other.GetChannel(PixelChannel.Red)) +
                 _channels[PixelChannel.Green].SumSquaredDistance(other.GetChannel(PixelChannel.Green)) +
                 _channels[PixelChannel.Blue].SumSquaredDistance(other.GetChannel(PixelChannel.Blue)));
        }
        public HSImageScanner(IEventAggregator events, IScanAreaProvider scanAreaProvider, IPerceptualHash imageHasher, ITemplateMatcher templateMatcher)
        {
            this.events = events;
            this.events.Subscribe(this);
            this.scanAreaProvider    = scanAreaProvider;
            this.imageHasher         = imageHasher;
            this.templateMatcher     = templateMatcher;
            this.ThreshHold          = 9;
            this.ThreshHoldForHeroes = 12;
            this.BaseResolution      = 900;

            // TODO: fix, this is hacky
            BasePath = AppDomain.CurrentDomain.BaseDirectory;
            this.LoadScanAreas();
        }
Beispiel #3
0
 public AreaDesignerViewModel(IEventAggregator events,
                              IScanAreaProvider scanAreaProvider,
                              ICaptureEngine captureEngine,
                              IPerceptualHash hasher,
                              ICornerDetector cornerDetecter)
 {
     // TODO: use MEF
     this.hasher         = hasher;
     this.cornerDetecter = cornerDetecter;
     DisplayName         = "Area Designer";
     this.events         = events;
     this.captureEngine  = captureEngine;
     Order               = 2000;
     regions             = new BindableCollection <RegionModel>();
     this.scanAreasModel = new ScanAreasModel(scanAreaProvider);
     this.events         = events;
     events.Subscribe(this);
 }