public void add( Cluster c , float distance ) { // make sure it isn't already full. THis should almost never happen ClusterDistance d = clusters.grow(); d.cluster = c; d.distance = distance; }
private void computeSolution( double u , double v ) { double bottom = u*u + v*v - 2*u*v*cos23; if( bottom == 0 ) return; double inner = a2 / bottom; if( inner >= 0 ) { PointDistance3 s = solutions.grow(); s.dist1 = Math.sqrt(inner); s.dist2 = s.dist1*u; s.dist3 = s.dist1*v; } }
private void computeSolution( double u , double v ) { double bottom = u*u + v*v - 2*u*v*cos23; if( bottom == 0 ) return; double inner = a2 / bottom; if( inner >= 0 ) { PointDistance3 s = solutions.grow(); s.dist1 = Math.sqrt(inner); s.dist2 = s.dist1*u; s.dist3 = s.dist1*v; } }
public void addPoint( double x , double y , double z , int rgb ) { ColorPoint3D p = cloud.grow(); p.set(x, y, z); p.rgb = rgb; }
public void addPoint( double hue , double saturation ) { if( Double.isNaN(hue) ) return; points.grow().set(hue,saturation); }
@Override public void run() { points.grow().set(x, y); } });
/** * Discards all previously detected points but does not free its memory. This allows it to be recycled */ public void reset() { tailBlockSize = 0; blocks.reset(); blocks.grow(); sets.reset(); }
public synchronized void setInliers(java.util.List<Point2D_F64> list) { inliers.reset(); if( list != null ) { for( Point2D_F64 p : list ) { inliers.grow().set(p); } } }
@Override protected void fitShape(List<Point2D_I32> contour) { ShapeFittingOps.fitEllipse_I32(contour, 0, false, ellipseStorage); ellipsesWork.grow().set(ellipseStorage.shape); }
@Override protected boolean processSquare(GrayF32 gray, Result result , double edgeInside, double edgeOutside) { GrayU8 binary = foundBinary.grow(); int off = (gray.width-binary.width)/2; gray.subimage(off, off, gray.width - off, gray.width - off, grayNoBorder); threshold.process(grayNoBorder, binary); return true; }
private void addDetections( FastQueue<TldRegion> detections ) { this.detections.reset(); for( TldRegion r : detections.toList() ){ TldRegion a = this.detections.grow(); a.confidence = r.confidence; a.rect.set(r.rect); } }
@Override public boolean process(List<Point> points, FastQueue<Model> estimatedModels) { estimatedModels.reset(); Model m = estimatedModels.grow(); if( alg.process(points,m) ) { return true; } else { estimatedModels.reset(); } return false; }
private void changeValue( int x , int y , int value ) { changed.get(x,y,data); if( data[0] == 0 ) { changed.set(x,y,1); change.grow().set(x,y,value); } }
@Override protected void finalizeShapes() { synchronized (lockGui) { visPoly.reset(); for (int i = 0; i < workPoly.size; i++) { visPoly.grow().set(workPoly.get(i)); } } }
@Override public boolean process(List<Point> points, FastQueue<Model> estimatedModels) { estimatedModels.reset(); Model m = estimatedModels.grow(); if( alg.process(points,m) ) { return true; } else { estimatedModels.reset(); } return false; }
private void addDetections( FastQueue<TldRegion> detections ) { this.detections.reset(); for( TldRegion r : detections.toList() ){ TldRegion a = this.detections.grow(); a.confidence = r.confidence; a.rect.set(r.rect); } }
@Override protected void fitShape(List<Point2D_I32> contour) { if( !alg.process(contour) ) return; PolylineSplitMerge.CandidatePolyline best = alg.getBestPolyline(); Polygon2D_I32 poly = workPoly.grow(); poly.vertexes.resize(best.splits.size); for (int i = 0; i < best.splits.size; i++) { Point2D_I32 p = contour.get(best.splits.get(i)); poly.get(i).set(p); } }
private void createSet( T image , FastQueue<TupleDesc_F64> descs , FastQueue<Point2D_F64> points ) { detector.detect(image); descs.reset(); points.reset(); for( int i = 0; i < detector.getNumberOfFeatures(); i++ ) { points.grow().set(detector.getLocation(i)); descs.add( detector.getDescription(i).copy() ); } }