code: public static void regionBorders( GrayS32 pixelToRegion , int borderColor ,
  									  Bitmap output , byte[] storage) {
  		if( storage == null )
  			storage = declareStorage(output,null);
  
  		GrayU8 binary = new GrayU8(pixelToRegion.width,pixelToRegion.height);
  		ImageSegmentationOps.markRegionBorders(pixelToRegion, binary);
  		int indexOut = 0;
  		for( int y = 0; y < binary.height; y++ ) {
  			for( int x = 0; x < binary.width; x++ ) {
  				if( binary.unsafe_get(x,y) != 0 )  {
  					storage[indexOut++] = (byte)(borderColor & 0xFF);
  					storage[indexOut++] = (byte)((borderColor >> 8) & 0xFF);
  					storage[indexOut++] = (byte)((borderColor >> 16) & 0xFF);
  					storage[indexOut++] = (byte)0xFF;
  				} else {
  					indexOut += 4;
  				}
  			}
  		}
  
  		output.copyPixelsFromBuffer(ByteBuffer.wrap(storage));
  	}
docs: Draws border pixels of each region using the specified color.
  
  @param pixelToRegion Conversion from pixel to region
  @param borderColor RGB value of border pixel
  @param output Where the output is written to
  @param storage Optional working buffer for Bitmap image. Can be null.