import java.applet.*; import java.awt.*; import java.awt.image.*; import java.net.*; import java.util.*; import java.io.*; import java.lang.Math; /** * Thicken is an algorithm to thicken a binary image using a 3x3 kernel. * * @author Simon Horne. */ public class Thicken extends Thread { //Black background /** * Background is black. */ int background = (new Color(0,0,0)).getRGB(); //White foreground /** * Foreground is white. */ int foreground = (new Color(255,255,255)).getRGB(); HitMiss hitmiss; public Thicken() { } /** * Takes a BinaryFast Image and a kernel and applies a single iteration * of the thicken algorithm to the image. * * @param b the BinaryFast image * @param kernel the thickening kernel * @return the new thickened BinaryFast image */ public static BinaryFast ThickenBinaryRep(BinaryFast b, int [] kernel){ Point p; HashSet result = new HashSet(); HashSet inputHashSet = new HashSet(); if(HitMiss.kernelNo1s(kernel)){ for(int j=0;j=0 && p.y+k>0 && p.x+j