src/main/java/eu/digitisation/image/Bimage.java
private Color background() {
        Counter<Integer> colors = new Counter<Integer>();

        for (int x = 0; x < getWidth(); ++x) {
            for (int y = 0; y < getHeight(); ++y) {
                int rgb = getRGB(x, y);
                colors.inc(rgb);
            }
        }

        Integer mu = colors.maxValue();
        for (Integer n : colors.keySet()) {
            if (colors.get(n).equals(mu)) {
                return new Color(n);
            }
        }
        return null;
    }
/**
     * Finds the background (statistical mode of the rgb value for pixels in the
     * image)
     *
     * @return the mode of the color for pixels in this image
     */
Finds the background (statistical mode of the rgb value for pixels in the
image)

@return the mode of the color for pixels in this image
Finds the background ( statistical mode of the rgb value for pixels in the image ) @return the mode of the color for pixels in this image
private Color background() {
        Counter<Integer> colors = new Counter<Integer>();
        for (int x = 0; x < getWidth(); ++x) {
            for (int y = 0; y < getHeight(); ++y) {
                int rgb = getRGB(x, y);
                colors.inc(rgb);
            }
        }
        Integer mu = colors.maxValue();
        for (Integer n : colors.keySet()) {
            if (colors.get(n).equals(mu)) {
                return new Color(n);
            }
        }
        return null;
    }
private Color background ( ) { Counter < Integer > colors = new Counter < Integer > ( ) ; for ( int x = 0 ; x < getWidth ( ) ; ++ x ) { for ( int y = 0 ; y < getHeight ( ) ; ++ y ) { int rgb = getRGB ( x , y ) ; colors . inc ( rgb ) ; } } Integer mu = colors . maxValue ( ) ; for ( Integer n : colors . keySet ( ) ) { if ( colors . get ( n ) . equals ( mu ) ) { return new Color ( n ) ; } } return null ; }
Finds the background (statistical mode of the rgb value for pixels in the
 image)
Finds the background ( statistical mode of the rgb value for pixels in the image )