% Load and display image
img = imread('peppers-g.png');
imshow(img)
axis on

% Get location clicked by user (rounded to nearest pixel)
p = round(ginput(1));

% Draw "crosshairs" in image data
img(p(2)-2:p(2)+2,:) = 255;
img(:,p(1)-2:p(1)+2) = 255;
img(p(2),:) = 0;
img(:,p(1)) = 0;

% Display modified image
imshow(img)
axis on
