def __init__(self, wsize, threshold, integration=IntegrationType.MEAN, sampling=2.0): UnaryPredicate1D.__init__(self) self._wsize = wsize self._threshold = threshold self._integration = integration self._func = DensityF1D(self._wsize, self._integration, sampling) self._func2 = DensityF1D(self._wsize, IntegrationType.MAX, sampling)
def __call__(self, inter): result = self._functor(inter) - self._lmin sigma = (self._sigmaMax - self._sigmaMin) / (self._lmax - self._lmin) * result + self._sigmaMin t = (self._tmax - self._tmin) / (self._lmax - self._lmin) * result + self._tmin sigma = max(sigma, self._sigmaMin) self._func = DensityF1D(sigma, self._integration, self._sampling) return (self._func(inter) < t)
def __init__(self, wsize, threshold, functor, funcmin=0.0, funcmax=1.0, integration=IntegrationType.MEAN): UnaryPredicate1D.__init__(self) self._threshold = float(threshold) self._functor = functor self._funcmin = float(funcmin) self._funcmax = float(funcmax) self._func = DensityF1D(wsize, integration)
def __call__(self, inter): func = DensityF1D(self._wsize, self._integration) res = self._functor(inter) k = (res - self._funcmin) / (self._funcmax - self._funcmin) return (func(inter) < (self._threshold * k))