What is the best approach to classify an image containing either text or image?
The segment with text (I assume with a background) should contains text clearly visible from the background, then the text segment should have a lot of peaks in the transitions from text to background. The segment icon normally shouldn't have many peaks because in general there are few variations in an image. So if you make a stft of a part of a segment the text should have more harmonics than the icon.
However if the icon is similar to the text or if it has many peaks this idea can't works. You can also find the color density, a single color text on a single color background has the color density concentrated in two points. This is only an idea and it must to be improved.