If the images stay like this, you can probably do a pretty easy way of just counting the bits line by line (but this works only, if they remain horizontal or vertical). This will give you some kind of a histogram along the y-coordinate, that lets you average your y-coordinate for one of the lines.
% Read the image
img = imread('To_detect_curves.png');
% Convert it to BW
img = rgb2gray(img);
% Get the size of the image for the loops
[width,height] = size(img);
bits_per_line = zeros(height,1);
% Sum over all lines (rows)
for idx=1:height
bits_per_line(idx) = sum(img(idx,:));
end
plot(1:height,bits_per_line)
As a result you will be having something like the following, where you can easily determine the Y coordinate for your lines.

This will surely not help you with more complex images, but for the image you provided it should do. If you have more information on what you want to do exactly, let us know.