Find a specific line in a picture I want to find the line between color blue and color gray in the following picture:



More exactly, the end points of that line.

Is the Hough transform a choice? If yes how should I set up the picture before using Hough?

Any way of solving this would be helpful.
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.