private void blackPixel(Pixel pixel, BufferedImage image){
        if(image.getRGB(pixel.x + 1, pixel.y) == Color.WHITE.getRGB() && edgePixels.contains(new Pixel(pixel.x + 1, pixel.y))){
            pixel.label = "" + counter;
        } else if(image.getRGB(pixel.x - 1, pixel.y) == Color.WHITE.getRGB() && edgePixels.contains(new Pixel(pixel.x - 1, pixel.y))){
            pixel.label = "" + counter;
        } else if(image.getRGB(pixel.x, pixel.y + 1) == Color.WHITE.getRGB() && edgePixels.contains(new Pixel(pixel.x, pixel.y + 2))){
            pixel.label = "" + counter;
        } else if(image.getRGB(pixel.x, pixel.y - 1) == Color.WHITE.getRGB() && edgePixels.contains(new Pixel(pixel.x, pixel.y - 1))){
            pixel.label = "" + counter;
        } else counter++;
    }