public ImageRectangle(int x0, int y0, int x1, int y1) { set(x0,y0,x1,y1); }
public ImageRectangle( ImageRectangle orig ) { set(orig); }
public static IntegralKernel kernelDerivXY( int size , IntegralKernel ret ) { if( ret == null ) ret = new IntegralKernel(4); int block = size/3; ret.blocks[0].set(-block-1,-block-1,-1,-1); ret.blocks[1].set(0,-block-1,block,-1); ret.blocks[2].set(0, 0, block, block); ret.blocks[3].set(-block-1,0,-1,block); ret.scales[0] = 1; ret.scales[1] = -1; ret.scales[2] = 1; ret.scales[3] = -1; return ret; }
public static IntegralKernel kernelDerivYY( int size , IntegralKernel ret ) { if( ret == null ) ret = new IntegralKernel(2); int blockW = size/3; int blockH = size-blockW-1; int r1 = blockW/2; int r2 = blockW+r1; int r3 = blockH/2; ret.blocks[0].set(-r3-1,-r2-1,r3,r2); ret.blocks[1].set(-r3-1,-r1-1,r3,r1); ret.scales[0] = 1; ret.scales[1] = -3; return ret; }
/** * Creates a kernel for a symmetric box derivative. * * @param r Radius of the box. width is 2*r+1 * @return Kernel Kernel for derivative. */ public static IntegralKernel kernelDerivX( int r , IntegralKernel ret ) { if( ret == null ) ret = new IntegralKernel(2); ret.blocks[0].set(-r-1,-r-1,-1,r); ret.blocks[1].set(0,-r-1,r,r); ret.scales[0] = -1; ret.scales[1] = 1; return ret; }
public static IntegralKernel kernelDerivXX( int size , IntegralKernel ret ) { if( ret == null ) ret = new IntegralKernel(2); // lobe size int blockW = size/3; // horizontal band size int blockH = size-blockW-1; int r1 = blockW/2; int r2 = blockW+r1; int r3 = blockH/2; ret.blocks[0].set(-r2-1,-r3-1,r2,r3); ret.blocks[1].set(-r1 - 1, -r3 - 1, r1, r3); ret.scales[0] = 1; ret.scales[1] = -3; return ret; }
/** * Creates a kernel for a symmetric box derivative. * * @param r Radius of the box. width is 2*r+1 * @return Kernel Kernel for derivative. */ public static IntegralKernel kernelDerivY( int r , IntegralKernel ret ) { if( ret == null ) ret = new IntegralKernel(2); ret.blocks[0].set(-r-1,-r-1,r,-1); ret.blocks[1].set(-r-1,0,r,r); ret.scales[0] = -1; ret.scales[1] = 1; return ret; }
/** * Creates a kernel for the Haar wavelet "centered" around the target pixel. * * @param r Radius of the box. width is 2*r * @return Kernel for a Haar x-axis wavelet. */ public static IntegralKernel kernelHaarX( int r , IntegralKernel ret) { if( ret == null ) ret = new IntegralKernel(2); ret.blocks[0].set(-r, -r, 0, r); ret.blocks[1].set(0,-r,r,r); ret.scales[0] = -1; ret.scales[1] = 1; return ret; }
/** * Creates a kernel for the Haar wavelet "centered" around the target pixel. * * @param r Radius of the box. width is 2*r * @return Kernel for a Haar y-axis wavelet. */ public static IntegralKernel kernelHaarY( int r , IntegralKernel ret) { if( ret == null ) ret = new IntegralKernel(2); ret.blocks[0].set(-r,-r,r,0); ret.blocks[1].set(-r,0,r,r); ret.scales[0] = -1; ret.scales[1] = 1; return ret; }
/** * Computes the confidence for all the regions which pass the fern test */ protected void computeTemplateConfidence() { double max = 0; for( int i = 0; i < fernRegions.size(); i++ ) { ImageRectangle region = fernRegions.get(i); double confidence = template.computeConfidence(region); max = Math.max(max,confidence); if( confidence < config.confidenceThresholdUpper) continue; TldRegion r = candidateDetections.grow(); r.connections = 0; r.rect.set(region); r.confidence = confidence; } }
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); } }
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); } }
o.connections = ra.connections; o.confidence = ra.confidence; o.rect.set(ra.rect); } else if( ra.connections == 0 ) { System.out.println("Not a maximum but has zero connections?");