Separate the text from the others elements on the image

sorry, but it’s unclear, how you get from image 1 to image 2, and what you want from either

imho, we need to start all over: what is your original image, and how do you expect to extract text from it ?
(maybe a solution does not even use thresholding ?)