I think you need a tomato type classification using neural networks.
Matlab Neural Networks toolbox can be used for this purpose. The back-progation model is strongly recommended in this case. You need to define the attributes of your tomatoes, the number of classes and have a sample of learning data.