高斯平滑

@param x
@param y
@param sigma
@return
176207
private double gaussian(double x, double y, double sigma) {
		double sigma2 = sigma * sigma;
		double t = (x * x + y * y) / (2 * sigma2);
		double u = 1.0 / (2 * Math.PI * sigma2);
		double e = u * Math.exp(-t);
		return e;
	}
481468
function sigma0_64(x)
	{
		var rotr28 = rotr_64(x, 28), rotr34 = rotr_64(x, 34),
			rotr39 = rotr_64(x, 39);

		return new Int_64(
				rotr28.highOrder ^ rotr34.highOrder ^ rotr39.highOrder,
				rotr28.lowOrder ^ rotr34.lowOrder ^ rotr39.lowOrder);
	}
393586
def gauss(x, sigma):
    
    return (np.exp(-np.power(x, 2) / (2 * np.power(sigma, 2))) /
            (sigma * np.sqrt(2 * np.pi)))
1326290
public int get32u8( int x , int y ) {
		int i = startIndex + y*stride+x;
		return ((((GrayU8)bands[0]).data[i]&0xFF) << 24) |
				((((GrayU8)bands[1]).data[i]&0xFF) << 16) |
				((((GrayU8)bands[2]).data[i]&0xFF) << 8) |
				(((GrayU8)bands[3]).data[i]&0xFF);
	}
1202326
def log_gaussian(x, y, x_sigma, y_sigma, mu):
    
    if x_sigma==0.0 or y_sigma==0.0:
        return x * 0.0

    with float_error_ignore():
        x_w = np.divide(np.log(x)-mu, x_sigma*x_sigma)
        y_h = np.divide(np.log(y)-mu, y_sigma*y_sigma)

        return np.exp(-0.5*x_w*x_w + -0.5*y_h*y_h)
564788
public static double logpdf(double x, double mu, double sigma, double xi) {
    x = (x - mu) / sigma;
    // Check support:
    if(x < 0 || (xi < 0 && x > -1. / xi)) {
      return Double.NEGATIVE_INFINITY;
    }
    if(xi == 0) {
      return Double.POSITIVE_INFINITY;
    }
    return ((xi == -1) ? 0. : FastMath.log(1 + xi * x) * (-1 / xi - 1)) - FastMath.log(sigma);
  }
1230136
def _sigma_ee_nonrel(self, gam, eps):
        
        s0 = 4 * r0 ** 2 * alpha / (15 * eps)
        x = 4 * eps / (gam ** 2 - 1)
        sigma_nonrel = s0 * self._F(x, gam)
        sigma_nonrel[np.where(eps >= 0.25 * (gam ** 2 - 1.0))] = 0.0
        sigma_nonrel[np.where(gam * np.ones_like(eps) < 1.0)] = 0.0
        return sigma_nonrel / mec2_unit
480571
public static <T extends ImageBase<T>>
	boolean invokeNativeGaussian(T input, T output, double sigma , int radius, T storage) {
		boolean processed = false;
		if( BOverrideBlurImageOps.gaussian != null ) {
			try {
				BOverrideBlurImageOps.gaussian.processGaussian(input,output,sigma,radius,storage);
				processed = true;
			} catch( RuntimeException ignore ) {}
		}
		return processed;
	}
580199
public static double cdf(double x, double mu, double sigma, double lambda) {
    if(x == Double.NEGATIVE_INFINITY) {
      return 0.;
    }
    if(x == Double.POSITIVE_INFINITY) {
      return 1.;
    }
    final double u = lambda * (x - mu);
    final double v = lambda * sigma;
    final double v2 = v * v;
    final double logphi = FastMath.log(NormalDistribution.cdf(u, v2, v));
    return NormalDistribution.cdf(u, 0., v) - FastMath.exp(-u + v2 * .5 + logphi);
  }
513569
public static double cdf(double x, double sigma) {
    if(x <= 0.) {
      return 0.;
    }
    final double xs = x / sigma;
    return 1. - FastMath.exp(-.5 * xs * xs);
  }
1007268
def _parse_Sigma(self,Sigma_amp,Sigma,dSigmadR,d2SigmadR2):
        
        if isinstance(Sigma,dict):
            Sigma= [Sigma]
        try:
            nsigma= len(Sigma)
        except TypeError:
            Sigma_amp= [Sigma_amp]
            Sigma= [Sigma]
            dSigmadR= [dSigmadR]
            d2SigmadR2= [d2SigmadR2]
            nsigma= 1
        self._nsigma= nsigma
        self._Sigma_amp= Sigma_amp
        self._Sigma= Sigma
        self._dSigmadR= dSigmadR
        self._d2SigmadR2= d2SigmadR2
        if isinstance(Sigma[0],dict):
            self._Sigma_dict= copy.copy(Sigma)
            self._parse_Sigma_dict()
        else:
            self._Sigma_dict= None
        return None
1160242
protected static void gaussianKernel(double xx , double yy , GrayF64 xy , double sigma  , GrayF64 output ) {
		double sigma2 = sigma*sigma;
		double N = xy.width*xy.height;

		for( int y = 0; y < xy.height; y++ ) {
			int index = xy.startIndex + y*xy.stride;

			for( int x = 0; x < xy.width; x++ , index++ ) {

				// (xx + yy - 2 * xy) / numel(x)
				double value = (xx + yy - 2*xy.data[index])/N;

				double v = Math.exp(-Math.max(0, value) / sigma2);

				output.data[index] = v;
			}
		}
	}
1074451
def sigma_s2(self, r, R, kwargs_profile, kwargs_anisotropy, kwargs_light):
        
        beta = self.anisotropy.beta_r(r, kwargs_anisotropy)
        return (1 - beta * R**2/r**2) * self.sigma_r2(r, kwargs_profile, kwargs_anisotropy, kwargs_light)
91112
protected static double calcPosterior(double f, double alpha, double mu, double sigma, double lambda) {
    final double pi = calcP_i(f, mu, sigma);
    final double qi = calcQ_i(f, lambda);
    return (alpha * pi) / (alpha * pi + (1.0 - alpha) * qi);
  }
808510
def function(self, x, y, amp, sigma_x, sigma_y, center_x=0, center_y=0):
        
        c = amp/(2*np.pi*sigma_x*sigma_y)
        delta_x = x - center_x
        delta_y = y - center_y
        exponent = -((delta_x/sigma_x)**2+(delta_y/sigma_y)**2)/2.
        return c * np.exp(exponent)
167920
public static double pdf(double x, double mu, double sigma, double lambda) {
    final double dx = x - mu;
    final double lss = lambda * sigma * sigma;
    final double erfc = NormalDistribution.erfc((lss - dx) / (sigma * MathUtil.SQRT2));
    return erfc > 0. ? .5 * lambda * FastMath.exp(lambda * (lss * .5 - dx)) * erfc : (x == x) ? 0. : Double.NaN;
  }
840647
def get_observed_mmax_sigma(self, default=None):
        
        if not isinstance(self.data['sigmaMagnitude'], np.ndarray):
            obsmaxsig = default
        else:
            obsmaxsig = self.data['sigmaMagnitude'][
                np.argmax(self.data['magnitude'])]
        return obsmaxsig