From: Siddharth Magazine on
I have got the pixel values for two black points in an image with a white background. That is [x1, y1] and [x2, y2], but now i need to just identify the two black points in the image with a mark or something automatically. Is their a matlab code available to do that, i mean, with the help of the pixel values available, how can you get the two black points marked? Please help me on this.
From: ImageAnalyst on
You mean like putting crosshairs over them?:

% Read in standard MATLAB grayscale demo image.
grayImage = imread('cameraman.tif');
imshow(grayImage, []);
title('Original Grayscale Image');
set(gcf, 'Position', get(0,'Screensize')); % Enlarge figure to full
screen.

x1 = 115;
y1 = 50;
hold on; % Prevent image from getting blown away when we plot.
plot(x1, y1, 'r+', 'MarkerSize', 30);

x2 = 70;
y2 = 150;
plot(x2, y2, 'r+', 'MarkerSize', 30);