Question
IN JAVA with explanation plz
Test by entering an image and a reasonable Euclidean distance (that you empirically decide), then take all recalled images from the data structure(nb-tree) and sum them up, pixel for pixel, normalizing the output, so every pixel is still in [0,255] and hence, output the normalized sum image.
Explanation / Answer
public class Point { // Placeholders for xcoordinate, ycoordinate, and quadrants int xcoord = 0; int ycoord =0; double distance = 0.0; String quadrant = ("NW"); //moveUp changes the y coordinate void moveUp (int x) { int moveUp = ycoord + x; ycoord= moveUp; System.out.println(moveUp); } // moveDown changes the y coordinate void moveDown (int y){ int moveDown = ycoord - y; ycoord =moveDown; System.out.println(moveDown);} // moveLeft changes the x coordinate void moveLeft (int f){ int moveLeft = xcoord -f ; xcoord = moveLeft; System.out.println(moveLeft);} // moveRight changes the x coordinate void moveRight (int h) { int moveRight = xcoord +h ; xcoord = moveRight; System.out.println(moveRight);} // This takes the y coordinate and the xcoordinate and places it into a quadrant. Then it returns the quadrant. String quadrant () { if (xcoord >= 0 && ycoord >=0){ return quadrant = ("NE"); } else if ( xcoord < 0 && ycoord < 0 ) { return quadrant = ("SW");} else if (xcoord 0 ){ return quadrant = ("NW");} else if (xcoord >0 && ycoord