How do I recover the signal from an ECG image
Sorry, I use Mathematica, but it should be really easy to implement the idea into Matlab. I give the code anyway, so when my description is not detailed enough, you can get the rest from the code.

Basic idea is: you look at your image column-wise. Process every column of pixels separately. Note, that in the plot, I inverted the gray-values. So black is 1 and white is 0.
If you plot the (inverted) brightness-pixel-values you have basically only two situations. The first one is, when your column is not on a vertical grid line. The the plot looks like



The second situation is, where you are directly on a vertical grid line. Then the grid line influences the brightness of the whole column



But what you see is, that your dark EEG seems to be always the maximum. Therefore, the very complex algorithm is: Go through every column and take the position of the most black pixel.

img = ColorConvert[
   ImagePad[
    Import["http://i.stack.imgur.com/500Kg.jpg"], {{0, -20}, {0, 0}}],
    "Grayscale"];

Image[
 Transpose[Function[With[{m = Min[#]},
     Map[Function[{v}, If[v == m, 1, 0]], #]]] /@ 
   Transpose[ImageData[img, "Real"]]
  ]
 ]


Note, that I croped a bit of the right side of you image, since it was completely white there. The result is



Now you can join the points or interpolate them in every way you like and you get your EEG