Recognize specific color area of an image (measure the width of a tree trunk from a photo)

Theoretically, it can be done. In practice, it doesn't really work.
Look this topic: