Your question is not very easy to answer, since you really do not determine which ideal solution should be implemented.
Have you tried im2bw(yourImage, 0.1);
? I use the threshold for which parts should be black, and parts of the shifts should not. I got the results of the descent with this (depending on the purpose, of course). Try it, and if it’s not enough, tell us how you need to improve it, and I will try to help with more advanced methods!
EDIT: Using a threshold of 0.1 and 0.01, respectively, maybe something ~ 0.05 should be fine?


source share