Line Detection



Hi, I have recently been given a project to study the lines
of an agate crystal using edge detection techniques. I am
using Canny, Sobel and Prewitt masks to detect the lines. I
want to further the project by determining the number of
lines in the agate crystals after the edge detection
techniques have taken place.

I am trying to pin point where the first white pixel is. The
code I'm using is:

% setting image to equal im
im = imread ('agate.tif');
% converting image to greyscale
im2 = rgb2gray (im);
% applying the canny mask with a threshold
im3 = edge (im2, 'canny', 10/255);
% incrementing x and y by 1 upto 200
x = 1:1:200;
y = 1:1:200;
% generates pixels values (1 (white)/0 (black))
pix = im3(x,y);

I wish determine the first pixel with a value of 1 and
locate it's co-ordinates. By doing so it will allow me to
trace it's neighbouring white pixels and see if there is a
continuous line.

Could anyone please give me advice on how I can extract the
co-ordinates of the first white pixel found?

Thanks,

Adam


.