public static BufferedImage detectVerticalEdges(BufferedImage image, int amount) {
      int width = image.getWidth();
      int height = image.getHeight();
      BufferedImage edgeImage = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_GRAY);
      
      for(int x = 0; x < width; x++)
         for(int y = 0; y < height; y++ )
            edgeImage.setRGB(x, y, WHITE);
      
      for(int x = amount/2; x < width-amount/2; x++) {
         for(int y = amount/2; y < height-amount/2; y++) {
            int sum1 = 0;
            int sum2 = 0;
            
            for(int h = x-amount/2; h < x; h++) {
               for(int i = y-amount/2; i <= y+amount/2; i++) {
                  sum1 += image.getRGB(h, i) & 0x000000FF;
               }
            }
            
            for(int h = x+1; h <= x+amount/2; h++) {
               for(int i = y-amount/2; i <= y+amount/2; i++) {
                  sum2 += image.getRGB(h, i) & 0x000000FF;
               }
            }
            
            sum2 = sum2 * -1;
            
            sum1 = Math.abs(sum1 + sum2);
            
            if(sum1 > THRESHOLD) {
               edgeImage.setRGB(x, y, BLACK);
            }
         }
      }
      
      return edgeImage;
   }