code: public void processSkeleton( BinaryFast binary, int[][] kernel ) {
          int oldForeEdge = 0;
          int oldBackEdge = 0;
          while( !(binary.getForegroundEdgePixels().size() == oldForeEdge && binary.getBackgroundEdgePixels().size() == oldBackEdge) ) {
              oldForeEdge = binary.getForegroundEdgePixels().size();
              oldBackEdge = binary.getBackgroundEdgePixels().size();
              for( int i = 0; i < kernel.length; ++i ) {
                  binary = thinBinaryRep(binary, kernel[i]);
                  binary.generateBackgroundEdgeFromForegroundEdge();
              }
          }
      }
docs: Takes an image and a kernel and thins it the specified number of times.
  
  @param binary the BinaryFast input image.
  @param kernel the kernel to apply.