Find a specific line in a picture
In general, you want an edge detector, like the Canny edge detector, for this kind of problem. The Hough transform is useful for extracting lines rather than edges.

However, in this specific case, you're better off doing something like:

imdata = imread('grayblue.jpg');
colidx = find(diff(imdata(1,:) ~= 0);


since it's such a simple image.