Hi Oliver. I think the im2bw function may be of help to you. I tried the following code with the image you had attached and it seems to be working fine. Of course, depending upon your use-case, you would have to manually try different values for the variable 'level' until you get it right. The value 0.515 seems to be appropriate for this particular image.
I = imread('image.png');
level=0.515
A = rgb2gray(I)
imshow(A)
BW = im2bw(I, level)
figure
imshow(BW)
Cheers