/** * Segmented output image with watersheds. This is a sub-image of {@link #getOutputBorder()} to remove * the outside border of -1 valued pixels. */ public GrayS32 getOutput() { output.subimage(1,1,output.width-1,output.height-1,outputSub); return outputSub; }
@Override public void process(GrayU8 input) { waveletTran.transform(input, transform); // System.out.println("BOOF: num levels " + waveletTran.getLevels()); // System.out.println("BOOF: width "+transform.getWidth()+" "+transform.getHeight()); UtilWavelet.adjustForDisplay(transform, waveletTran.getLevels(), 255); // if needed, crop the transform for visualization GrayS32 transform = this.transform; if (transform.width != bitmap.getWidth() || transform.height != bitmap.getHeight()) transform = transform.subimage(0, 0, bitmap.getWidth(), bitmap.getHeight(), null); VisualizeImageData.grayMagnitude(transform, 255, bitmap, bitmapTmp); } }
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); }
storage = InputSanityCheck.checkDeclare(input, storage); storage = storage.subimage(0,0,input.width,input.height, null); storage.subImage = false; height += height%2; GrayS32 levelIn = input.subimage(0,0,width,height, null); GrayS32 levelOut = output.subimage(0,0,width,height, null); storage.reshape(width,height); inverse1(desc,levelIn,levelOut, storage,Integer.MIN_VALUE,Integer.MAX_VALUE); levelIn = input.subimage(0,0,width,height, null); levelOut = output.subimage(0,0,width,height, null); } else { levelIn = input;