Пример #1
0
        /// <summary>
        /// Zwraca strukturę zawierającą dane wyjściowe powyżej zadanego progu RMS</summary>
        /// <param name="RMSthresholdValue">Wartość progowa</param>
        /// <param name="measurements">Dane pomiarowe</param>
        /// <param name="samplesInPeriod">(opcjonalnie)Liczba próbek w okresie. Jeśli 0 - to liczba próbek na okres zostanie policzona automatycznie</param>
        public threshold getRMSValuesOverThreshold(float RMSthresholdValue, List <float> measurements, int samplesInPeriod = 0)
        {
            threshold    currTh    = new threshold();
            List <float> RMSvalues = new List <float>();

            foreach (List <float> period in getListOfFullPeriods(measurements, samplesInPeriod))
            {
                RMSvalues.Add(calculateRMS(period));
            }

            List <float> getPeriodsOverTherhold = (List <float>)RMSvalues.Where(item => item > RMSthresholdValue).ToList();

            if (getPeriodsOverTherhold.Count > 0)
            {
                currTh.durationInMiliSec = 20 * getPeriodsOverTherhold.Count();
                currTh.averageRMS        = getPeriodsOverTherhold.Select(x => x).Average();
                currTh.maxRMS            = getPeriodsOverTherhold.Select(x => x).Max();
                currTh.RMSvalues         = getPeriodsOverTherhold;
            }
            else
            {
                currTh.durationInMiliSec = 0;
                currTh.averageRMS        = 0;
                currTh.maxRMS            = calculateMaxRMS(measurements);
            }
            currTh.selectedSampleRate   = samplesInPeriod;
            currTh.calculatedSampleRate = getSamplesPerPeriod(measurements);
            return(currTh);
        }
Пример #2
0
 public Verify.Response verify(String photo1, String photo2, Bbox bbox1 = null, Bbox bbox2 = null, threshold threshold = threshold.low, mf_selector mf_selector = mf_selector.biggest)
 {
     Verify.Request request = new Verify.Request();
     request.photo1      = photo1;
     request.photo2      = photo2;
     request.bbox1       = bbox1;
     request.bbox2       = bbox2;
     request.threshold   = threshold;
     request.mf_selector = mf_selector;
     Verify.Response response = do_request <Verify.Response>("/v0/verify", request);
     return(response);
 }
 foreach (var(threshold, result) in others)
Пример #4
0
 public Identify.Results identify(String photo, uint?x1 = null, uint?y1 = null, uint?x2 = null, uint?y2 = null, threshold threshold = threshold.low, uint n = 1, mf_selector mf_selector = mf_selector.biggest)
 {
     Identify.Request request = new Identify.Request();
     request.photo       = photo;
     request.x1          = x1;
     request.y1          = y1;
     request.x2          = x2;
     request.y2          = y2;
     request.threshold   = 0;
     request.n           = n;
     request.mf_selector = 0;
     Identify.Response response = do_request <Identify.Response>("/v0/identify", request);
     return(response.results);
 }
Пример #5
0
 if (TryParseThresholds(threshold, noise, out var testThreshold, out var noiseThreshold))
 {