private void draw( int x0 , int y0 , GrayU8 layer ) { output.subimage(x0,y0,x0+layer.width,y0+layer.height,sub); sub.setTo(layer); }
/** * Reshapes data so that the un-padded image has the specified shape. */ public void reshape(int width , int height ) { if( padded == null ) { binary.reshape(width, height); } else { binary.reshape(width + 2, height + 2); binary.subimage(1, 1, width + 1, height + 1, subimage); } }
public static void processBorderHorizontal(GrayU8 orig , GrayS32 deriv , Kernel1D_S32 kernel , ImageBorder_S32 borderType ) { borderType.setImage(orig); ConvolveJustBorder_General_SB.horizontal(kernel, borderType,deriv); GrayU8 origSub; GrayS32 derivSub; origSub = orig.subimage(0,0,orig.width,2, null); derivSub = deriv.subimage(0,0,orig.width,2, null); ConvolveImageNoBorder.horizontal(kernel,origSub,derivSub); origSub = orig.subimage(0,orig.height-2,orig.width,orig.height, null); derivSub = deriv.subimage(0,orig.height-2,orig.width,orig.height, null); ConvolveImageNoBorder.horizontal(kernel,origSub,derivSub); }
public static void processBorderVertical(GrayU8 orig , GrayS32 deriv , Kernel1D_S32 kernel , ImageBorder_S32 borderType) { borderType.setImage(orig); ConvolveJustBorder_General_SB.vertical(kernel,borderType,deriv); GrayU8 origSub; GrayS32 derivSub; origSub = orig.subimage(0,0,2,orig.height, null); derivSub = deriv.subimage(0,0,2,orig.height, null); ConvolveImageNoBorder.vertical(kernel,origSub,derivSub); origSub = orig.subimage(orig.width-2,0,orig.width,orig.height, null); derivSub = deriv.subimage(orig.width-2,0,orig.width,orig.height, null); ConvolveImageNoBorder.vertical(kernel,origSub,derivSub); }
public static void processBorderHorizontal(GrayU8 orig , GrayS16 deriv , Kernel1D_S32 kernel , ImageBorder_S32 borderType ) { borderType.setImage(orig); ConvolveJustBorder_General_SB.horizontal(kernel, borderType,deriv); GrayU8 origSub; GrayS16 derivSub; origSub = orig.subimage(0,0,orig.width,2, null); derivSub = deriv.subimage(0,0,orig.width,2, null); ConvolveImageNoBorder.horizontal(kernel,origSub,derivSub); origSub = orig.subimage(0,orig.height-2,orig.width,orig.height, null); derivSub = deriv.subimage(0,orig.height-2,orig.width,orig.height, null); ConvolveImageNoBorder.horizontal(kernel,origSub,derivSub); }
public static void processBorderVertical(GrayU8 orig , GrayS16 deriv , Kernel1D_S32 kernel , ImageBorder_S32 borderType) { borderType.setImage(orig); ConvolveJustBorder_General_SB.vertical(kernel,borderType,deriv); GrayU8 origSub; GrayS16 derivSub; origSub = orig.subimage(0,0,2,orig.height, null); derivSub = deriv.subimage(0,0,2,orig.height, null); ConvolveImageNoBorder.vertical(kernel,origSub,derivSub); origSub = orig.subimage(orig.width-2,0,orig.width,orig.height, null); derivSub = deriv.subimage(orig.width-2,0,orig.width,orig.height, null); ConvolveImageNoBorder.vertical(kernel,origSub,derivSub); }
private void processSubimage( int x0 , int y0 , int x1 , int y1 , List<LineParametric2D_F32> found ) { D derivX = (D)this.derivX.subimage(x0,y0,x1,y1); D derivY = (D)this.derivY.subimage(x0,y0,x1,y1); GrayU8 binary = this.binary.subimage(x0,y0,x1,y1); alg.transform(derivX, derivY, binary); FastQueue<LineParametric2D_F32> lines = alg.extractLines(); float intensity[] = alg.getFoundIntensity(); for( int i = 0; i < lines.size; i++ ) { // convert from the sub-image coordinate system to original image coordinate system LineParametric2D_F32 l = lines.get(i).copy(); l.p.x += x0; l.p.y += y0; found.add(l); post.add(l, intensity[i]); } }
ImageMiscOps.fillBorder(border, 0, 1); border.subimage(1,1,border.width-1,border.height-1, null).setTo(binary);