Binarizing images of similar background and object color(Threshold)?

As shown in the example picture below, if the background and the color of the object to be obtained are similar, What would be good to use as a preprocessing before proceeding with binarization?

import cv2
img = cv2.imread(‘image.jpg’, cv2.IMREAD_GRAYSCALE)

ret, binary = cv2.threshold(img, 127, 255, cv2.THRESH_BINARY)

cv2.imshow(‘img’, img)
cv2.imshow(‘binary’, binary)

I used the code below, but it’s hard to separate.
What is the pre-processing method for neat binarization?

The difference between the two areas is not in color, but in texture. So you have to use a texture based segmentation on the image.

See this old answer of mine about some algorithms you can use in this case.