Computes the camera control points as weighted sum of null points.

@param beta Beta values which describe the weights of null points
@param nullPts Null points that the camera point is a weighted sum of
@param cameraPts The output
197535
public static void computeCameraControl(double beta[],
											List<Point3D_F64> nullPts[],
											FastQueue<Point3D_F64> cameraPts ,
											int numControl )
	{
		cameraPts.reset();
		for( int i = 0; i < numControl; i++ ) {
			cameraPts.grow().set(0,0,0);
		}

		for( int i = 0; i < numControl; i++ ) {
			double b = beta[i];
//			System.out.printf("%7.3f ", b);

			for( int j = 0; j < numControl; j++ ) {
				Point3D_F64 s = cameraPts.get(j);
				Point3D_F64 p = nullPts[i].get(j);
				s.x += b*p.x;
				s.y += b*p.y;
				s.z += b*p.z;
			}
		}
	}
1277773
public void setPixels(int view , List<Point2D_F64> pixelsInView ) {
		if( pixelsInView.size() != pixels.numCols )
			throw new IllegalArgumentException("Pixel count must be constant and match "+pixels.numCols);

		int row = view*2;
		for (int i = 0; i < pixelsInView.size(); i++) {
			Point2D_F64 p = pixelsInView.get(i);
			pixels.set(row,i,p.x);
			pixels.set(row+1,i,p.y);
			pixelScale = Math.max(Math.abs(p.x),Math.abs(p.y));
		}
	}
621621
public boolean prunePoints(int count) {
		// create a lookup table from old to new point indexes
		int oldToNew[] = new int[ structure.points.length ];

		// list of remaining points
		List<SceneStructureProjective.Point> remainingP = new ArrayList<>();
		for (int pointIdx = 0; pointIdx < structure.points.length; pointIdx++) {
			SceneStructureProjective.Point sp = structure.points[pointIdx];

			if( sp.views.size < count) {
				// remove observations of this point from each view
				for (int i = 0; i < sp.views.size; i++) {
					int viewIdx = sp.views.data[i];
					SceneObservations.View ov = observations.views[viewIdx];
					int localIdx = ov.point.indexOf(pointIdx);
					if( localIdx == -1 )
						throw new RuntimeException("Point not in view's observation!?");
					ov.remove(localIdx);
				}
			} else {
				oldToNew[pointIdx] = remainingP.size();
				remainingP.add(sp);
			}
		}

		// if all of them are still remaining nothing changed
		if( remainingP.size() == structure.points.length )
			return false;

		// update point references
		for (int viewIdx = 0; viewIdx < structure.views.length; viewIdx++) {
			SceneObservations.View so = observations.views[viewIdx];

			for (int i = 0; i < so.point.size; i++) {
				so.point.data[i] = oldToNew[ so.point.data[i]];
			}
		}

		// create a new array with just the remaining points
		structure.points = new SceneStructureProjective.Point[remainingP.size()];
		for (int i = 0; i < remainingP.size(); i++) {
			structure.points[i] = remainingP.get(i);
		}
		return true;
	}
297185
def set_position(self, point, reset=False):
        
        if isinstance(point, np.ndarray):
            if point.ndim != 1:
                point = point.ravel()
        self.camera.SetPosition(point)
        if reset:
            self.reset_camera()
        self.camera_set = True
        self._render()
643591
public void setFromPoints(Point2D[] points) {
		if (points == null || points.length == 0) {
			setEmpty();
			return;
		}

		Point2D pt = points[0];
		setCoords(pt.x, pt.y);
		for (int i = 1; i < points.length; i++) {
			Point2D pt2d = points[i];
			mergeNE(pt2d.x, pt2d.y);
		}
	}
534383
public void setPoints(Iterable<Point> points) {
		if (points==null) throw new NullPointerException();
		this.points.clear();
		for (Point p : points) {
			this.points.add(new Point(p));
		}
		repaint();
	}
419692
public void addDatapoints(Map<Long, Double> datapoints) {
		if (datapoints != null) {
			_datapoints.putAll(datapoints);
		}
	}
1264804
public void setProjectionMatrix(float x1, float y1, float z1, float w1,
            float x2, float y2, float z2, float w2, float x3, float y3,
            float z3, float w3, float x4, float y4, float z4, float w4) {
        NativeCustomCamera.setProjectionMatrix(getNative(), x1, y1, z1, w1, x2,
                y2, z2, w2, x3, y3, z3, w3, x4, y4, z4, w4);
    }
464598
private void sortPoints() {
		final ControlPoint firstPt = (ControlPoint)list.get(0);
		final ControlPoint lastPt  = (ControlPoint)list.get(list.size()-1);
		Comparator compare = new Comparator() {
			public int compare(Object first, Object second) {
				if (first == firstPt) {
					return -1;
				}
				if (second == lastPt) {
					return -1;
				}
				
				float a = ((ControlPoint) first).pos;
				float b = ((ControlPoint) second).pos;
				return (int) ((a-b) * 10000);
			}
		};
		Collections.sort(list, compare);
	}
503385
private static void checkBehindCamera(SceneStructureMetric structure, SceneObservations observations, BundleAdjustment<SceneStructureMetric> bundleAdjustment) {

		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++;
		}
		structure.views[1].worldToView.T.print();
		if( totalBehind > structure.points.length/2 ) {
			System.out.println("Flipping because it's reversed. score = "+bundleAdjustment.getFitScore());
			for (int i = 1; i < structure.views.length; i++) {
				Se3_F64 w2v = structure.views[i].worldToView;
				w2v.set(w2v.invert(null));
			}
			triangulatePoints(structure,observations);

			bundleAdjustment.setParameters(structure,observations);
			bundleAdjustment.optimize(structure);
			System.out.println("  after = "+bundleAdjustment.getFitScore());
		} else {
			System.out.println("Points not behind camera. "+totalBehind+" / "+structure.points.length);
		}
	}
1107051
private void triangulateFeatures(List<AssociatedTriple> inliers,
									 DMatrixRMaj P1, DMatrixRMaj P2, DMatrixRMaj P3) {
		List<DMatrixRMaj> cameraMatrices = new ArrayList<>();
		cameraMatrices.add(P1);
		cameraMatrices.add(P2);
		cameraMatrices.add(P3);

		// need elements to be non-empty so that it can use set().  probably over optimization
		List<Point2D_F64> triangObs = new ArrayList<>();
		triangObs.add(null);
		triangObs.add(null);
		triangObs.add(null);

		Point4D_F64 X = new Point4D_F64();
		for (int i = 0; i < inliers.size(); i++) {
			AssociatedTriple t = inliers.get(i);

			triangObs.set(0,t.p1);
			triangObs.set(1,t.p2);
			triangObs.set(2,t.p3);

			// triangulation can fail if all 3 views have the same pixel value. This has been observed in
			// simulated 3D scenes
			if( triangulator.triangulate(triangObs,cameraMatrices,X)) {
				structure.points[i].set(X.x,X.y,X.z,X.w);
			} else {
				throw new RuntimeException("Failed to triangulate a point in the inlier set?! Handle if this is common");
			}
		}
	}
1131620
public void set(float sx, float sy, float ex, float ey) {
		super.pointsDirty = true;
		start.set(sx, sy);
		end.set(ex, ey);
		float dx = (ex - sx);
		float dy = (ey - sy);
		vec.set(dx,dy);
		
		lenSquared = (dx * dx) + (dy * dy);
	}
1070926
public List<Motion> findCameraMotions(Camera target , @Nullable List<Motion> storage ) {
		if( storage == null )
			storage = new ArrayList<>();

		for (int i = 0; i < edges.size(); i++) {
			Motion m = edges.get(i);
			if( m.viewSrc.camera == target && m.viewDst.camera == target ) {
				storage.add(m);
			}
		}

		return storage;
	}
180413
@JsonIgnore
    public void setPoints(int[] points) {
        this.points = new ArrayList<>();
        for (int i = 0; i < points.length; i++) {
            this.points.add(points[i]);
        }
    }
1129454
public boolean refine(List<CameraPinhole> calibration , DMatrix4x4 Q ) {
		if( calibration.size() != cameras.size )
			throw new RuntimeException("Calibration and cameras do not match");

		computeNumberOfCalibrationParameters();
		func = new ResidualK();

		if( func.getNumOfInputsN() > 6*calibration.size() )
			throw new IllegalArgumentException("Need more views to refine. eqs="+(3*calibration.size()+" unknowns="+func.getNumOfInputsN()));

		// Declared new each time to ensure all variables are properly zeroed


		// plane at infinity to the null space of Q
		ConvertDMatrixStruct.convert(Q,_Q);
		nullspace.process(_Q,1,p);
		CommonOps_DDRM.divide(p,p.get(3));
		p.numRows=3;

		// Convert input objects into an array which can be understood by optimization
		encode(calibration,p,param);

		// Configure optimization
//		optimizer.setVerbose(System.out,0);
		optimizer.setFunction(func,null); // Compute using a numerical Jacobian
		optimizer.initialize(param.data,converge.ftol,converge.gtol);

		// Tell it to run for at most 100 iterations
		if( !UtilOptimize.process(optimizer,converge.maxIterations) )
			return false;

		// extract solution
		decode(optimizer.getParameters(),calibration,p);
		recomputeQ(p,Q);

		return true;
	}
227973
public void setPreviewResults(java.util.Collection<LifecyclePolicyPreviewResult> previewResults) {
        if (previewResults == null) {
            this.previewResults = null;
            return;
        }

        this.previewResults = new java.util.ArrayList<LifecyclePolicyPreviewResult>(previewResults);
    }
1248928
public void calc(double t, double[] result, double... controlPoints)
    {
        if (result.length < 2)
        {
            throw new IllegalArgumentException("result needs size 2");
        }
        calc(t, (x,y)->{result[0]=x;result[1]=y;}, controlPoints);
    }