If true then distortion parameters are specified.
197857
public boolean isDistorted() {
		if( radial != null && radial.length > 0 ) {
			for (int i = 0; i < radial.length; i++) {
				if( radial[i] != 0 )
					return true;
			}
		}
		return t1 != 0 || t2 != 0;
	}
637870
async def set_custom_eq(self, target: str, value: str) -> None:
        """"""
        params = {"settings": [{"target": target, "value": value}]}
        return await self.services["audio"]["setCustomEqualizerSettings"](params)
998553
def _validate_calibration_params(strategy='accuracy', min_rate=None,
                                   beta=1.):
    """"""
    if strategy not in ('accuracy', 'f_beta', 'max_tpr',
                        'max_tnr'):
      raise ValueError('Strategy can either be "accuracy", "f_beta" or '
                       '"max_tpr" or "max_tnr". Got "{}" instead.'
                       .format(strategy))
    if strategy == 'max_tpr' or strategy == 'max_tnr':
      if (min_rate is None or not isinstance(min_rate, (int, float)) or
              not min_rate >= 0 or not min_rate <= 1):
        raise ValueError('Parameter min_rate must be a number in'
                         '[0, 1]. '
                         'Got {} instead.'.format(min_rate))
    if strategy == 'f_beta':
      if beta is None or not isinstance(beta, (int, float)):
        raise ValueError('Parameter beta must be a real number. '
                         'Got {} instead.'.format(type(beta)))
962470
private boolean satisfies(EvaluationContext ctx, Object param, UnaryTest test ) {
        return test.apply( ctx, param );
    }
473762
private static boolean multiPointWithinEnvelope_(MultiPoint multipoint_a,
			Envelope envelope_b, double tolerance,
			ProgressTracker progress_tracker) {
		Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();
		multipoint_a.queryEnvelope2D(env_a);
		envelope_b.queryEnvelope2D(env_b);

		if (!envelopeInfContainsEnvelope_(env_b, env_a, tolerance))
			return false;

		if (env_b.getHeight() <= tolerance && env_b.getWidth() <= tolerance)
			return envelopeEqualsEnvelope_(env_a, env_b, tolerance,
					progress_tracker); // treat as point

		if (env_b.getHeight() <= tolerance || env_b.getWidth() <= tolerance) {// treat
																				// as
																				// line

			boolean b_interior = false;

			Envelope2D env_b_deflated = new Envelope2D(), env_b_inflated = new Envelope2D();
			env_b_deflated.setCoords(env_b);
			env_b_inflated.setCoords(env_b);

			if (env_b.getHeight() > tolerance)
				env_b_deflated.inflate(0, -tolerance);
			else
				env_b_deflated.inflate(-tolerance, 0);

			env_b_inflated.inflate(tolerance, tolerance);

			Point2D pt_a = new Point2D();

			for (int i = 0; i < multipoint_a.getPointCount(); i++) {
				multipoint_a.getXY(i, pt_a);

				if (!env_b_inflated.contains(pt_a))
					return false;

				if (env_b.getHeight() > tolerance) {
					if (pt_a.y > env_b_deflated.ymin
							&& pt_a.y < env_b_deflated.ymax)
						b_interior = true;
				} else {
					if (pt_a.x > env_b_deflated.xmin
							&& pt_a.x < env_b_deflated.xmax)
						b_interior = true;
				}
			}

			return b_interior;
		}

		// treat as area

		boolean b_interior = false;

		Envelope2D env_b_deflated = new Envelope2D(), env_b_inflated = new Envelope2D();
		env_b_deflated.setCoords(env_b);
		env_b_inflated.setCoords(env_b);
		env_b_deflated.inflate(-tolerance, -tolerance);
		env_b_inflated.inflate(tolerance, tolerance);

		Point2D pt_a = new Point2D();

		// we loop to find a proper interior intersection (i.e. something inside
		// instead of just on the boundary)
		for (int i = 0; i < multipoint_a.getPointCount(); i++) {
			multipoint_a.getXY(i, pt_a);

			if (!env_b_inflated.contains(pt_a))
				return false;

			if (env_b_deflated.containsExclusive(pt_a))
				b_interior = true;
		}

		return b_interior;
	}
636264
def set_parameters(self, parameters):
        
        if not isinstance(parameters, np.ndarray):
            parameters = np.asarray(parameters)

        # if in two dimensions, flatten with fortran ordering
        if parameters.ndim > 1:
            parameters = parameters.flatten(order='F')

        libfn = utils.get_lib_fn('setTransformParameters%s'%self._libsuffix)
        libfn(self.pointer, parameters.tolist())
983046
public boolean isFullRevision()
	{
		if (this.parts.size() == 1) {
			DiffPart p = this.parts.get(0);
			if (p.getAction() == DiffAction.FULL_REVISION_UNCOMPRESSED) {
				return true;
			}
		}

		return false;
	}
1295486
protected void ensureAIsLowerPoint() {
		CoordinateSystem3D cs = CoordinateSystem3D.getDefaultCoordinateSystem();
		boolean swap = false;
		if (cs.isZOnUp()) {
			swap = (this.getMedial1().getZ() > this.getMedial2().getZ());
		} else if (cs.isYOnUp()){
			swap = (this.getMedial1().getY() > this.getMedial2().getY());
		}
		if (swap) {
			double x = this.getMedial1().getX();
			double y = this.getMedial1().getY();
			double z = this.getMedial1().getZ();
			this.getMedial1().set(this.getMedial2());
			this.getMedial2().set(x, y, z);
		}
	}
845516
def perturbParams(self, pertSize=1e-3):
        
        params = self.getParams()
        self.setParams(params+pertSize*sp.randn(params.shape[0]))
44058
private static boolean determineVerbosity(String[] args) {
		if (args != null && args.length > 0) {
            for (String arg : args) {
                if ("-c".equals(arg)) {
                    return false;
                }
            }
		}
		return true;
	}
520689
def _constraint(self, params):
        
        if (params["spin1x"]**2 + params["spin1y"]**2 +
                params["spin1z"]**2)**2 > 1:
            return False
        elif (params["spin2x"]**2 + params["spin2y"]**2 +
                  params["spin2z"]**2)**2 > 1:
            return False
        else:
            return True
1298320
private boolean checkBehindCamera(SceneStructureMetric structure ) {

		int totalBehind = 0;
		Point3D_F64 X = new Point3D_F64();
		for (int i = 0; i < structure.points.length; i++) {
			structure.points[i].get(X);
			if( X.z < 0 )
				totalBehind++;
		}

		if( verbose != null ) {
			verbose.println("points behind "+totalBehind+" / "+structure.points.length);
		}

		return totalBehind > structure.points.length/2;
	}
130660
public boolean performBundleAdjustment()
	{
		// Configure the sparse Levenberg-Marquardt solver
		ConfigLevenbergMarquardt configLM = new ConfigLevenbergMarquardt();
		configLM.hessianScaling = false;

		ConfigBundleAdjustment configSBA = new ConfigBundleAdjustment();
		configSBA.configOptimizer = configLM;

		BundleAdjustment<SceneStructureMetric> bundleAdjustment;
		if( robust ) {
			configLM.mixture = 0;
			bundleAdjustment = FactoryMultiView.bundleDenseMetric(true,configSBA);
		} else {
			bundleAdjustment = FactoryMultiView.bundleSparseMetric(configSBA);
		}

		bundleAdjustment.setVerbose(verbose,0);
		// Specifies convergence criteria
		bundleAdjustment.configure(1e-20, 1e-20, 200);

		bundleAdjustment.setParameters(structure,observations);
		return bundleAdjustment.optimize(structure);
	}
1261250
@Override
	protected void validateParameters() {
		super.validateParameters();
		// override some arguments
		parameters.put(OPT_NOPREVIEW, "");
		parameters.put(OPT_RAW, "-");// must be this, then image will be in console!
		parameters.put(OPT_RAW_FORMAT, "rgb");// only support rgb
		parameters.put(OPT_CAMSELECT, Integer.toString(this.camSelect));
		parameters.put(OPT_OUTPUT, "/dev/null");
	}
1313994
boolean computeRectifyH( double f1 , double f2 , DMatrixRMaj P2, DMatrixRMaj H ) {

		estimatePlaneInf.setCamera1(f1,f1,0,0,0);
		estimatePlaneInf.setCamera2(f2,f2,0,0,0);

		if( !estimatePlaneInf.estimatePlaneAtInfinity(P2,planeInf) )
			return false;

		// TODO add a cost for distance from nominal and scale other cost by focal length fx for each view
//		RefineDualQuadraticConstraint refine = new RefineDualQuadraticConstraint();
//		refine.setZeroSkew(true);
//		refine.setAspectRatio(true);
//		refine.setZeroPrinciplePoint(true);
//		refine.setKnownIntrinsic1(true);
//		refine.setFixedCamera(false);
//
//		CameraPinhole intrinsic = new CameraPinhole(f1,f1,0,0,0,0,0);
//		if( !refine.refine(normalizedP.toList(),intrinsic,planeInf))
//			return false;

		K1.zero();
		K1.set(0,0,f1);
		K1.set(1,1,f1);
		K1.set(2,2,1);
		MultiViewOps.createProjectiveToMetric(K1,planeInf.x,planeInf.y,planeInf.z,1,H);

		return true;
	}
446568
def almost_eq(a, b, threshold=0.000001):
    
    if abs(a - b) < threshold:
        return True
    else:
        return False
156063
def shared_parameters(self):
        
        if len(self) == 1:  # Not a vector
            return False
        else:
            params_thusfar = []
            for component in self.values():
                vars, params = seperate_symbols(component)
                if set(params).intersection(set(params_thusfar)):
                    return True
                else:
                    params_thusfar += params
            else:
                return False