I am not sure I understood your question correctly. But, I think you need to make a grayscale image, then put a threshold on all pixels inside the tube. Then you can simply count the pixels lower or higher that threshold. It doesn't matter which tool you would like to use, maybe openCV, MATLAB, or even some simpler softwares.
If you could upload higher quality images, I think it was easier to understand what you aim to do.
Try to count nuclear-cytoplasmic ratio by ImageJ. Measure areas of nucleus and area of cytoplasm and count ratio. Also use scale of scale for descriptio of staining, for example: 0- no mucin; 1- weak (criteria); 2 - moderate (criteria); 3- intesive (criteria).