The program should detect circles and colour them in red. The symmetry method was suggested where I assume each pixel is a center of a circle and check the four points r (radius) distance from it. If they are the same, draw a circle. However in the code bellow I get way to many unnecessary circles
static boolean isCenterOfCircle(int row, int col, int r, BufferedImage image) {
//getPixels gets the color of the current pixel.
if(getPixel(row,col,image) == getPixel(row+r,col,image)
|| getPixel(row,col,image) == getPixel(row-r,col,image)
|| getPixel(row,col,image) == getPixel(row,col+r,image)
|| getPixel(row,col,image) == getPixel(row,col-r,image)){
return true;
}else{
return false;
}
}