I have a bw image which has a black background and contains a number of white pixels (like stars in night sky). First, one of these pixels is chosen, and its coordinates are saved in a 1*2 matrix named FirstPixel. Then, all the other pixels are one by one chosen. Rows and Cols are two 1*numel(find(pic)) matrices, containing X and Y coordinates of these pixels, respectively.
I want to draw a line between the first chosen pixel and all the other pixels, which mostly looks like beams of light being emitted from the origin FirstPixel.
I have written some codes using plot
… but the answer was terribly wrong!
Like this:
pic = imread( 'interest points' );
figure, imshow ( pic );
hold on
plot([Rows (1,:)' Cols (1,:)'],[FirstPixel (1,1)' FirstPixel (1,2)'], 'r-');
any help?!
Thanks in advance :)