Hi Janrex,
For a nice clean image like this, there's a very simple solution. Just compute a row sum; rows with staff lines have a lower sum:
tmp=sum(C,2);
figure;plot(tmp)
Now set those rows to white:
ind=find(tmp<1E5)
C(ind,:)=255;
figure;imagesc(C);axis image;
(The downsampled image above doesn't look great; looks better for real)
If the white lines through the notes cause issues, you could do some morphology to close them (dilate then erode).