This is a common problem in biological images: the background of the image varies dramatically and of course a simple threshold will not work well. Here is the trick to solving the problem in CellProfiler:
You might try running a CorrectIlluminationCalculate module, using the Background intensity option with a neighborhood and smoothing size a bit bigger than your typical objects of interest, and don’t rescale the illumination function.
Then, use the CorrectIlluminationApply module using the subtract option.
These two modules should, together, find and remove the smoothly varying background in your image while leaving the objects intact.
Give it a try and post the image and pipeline you are trying on a public website somewhere if it’s not working and we might be able to improve the settings.
You might also make use of an adaptive thresholding option in the IdentifyPrim module if you have not tried that already.