The production of food generated by agriculture has been essential for civilizations throughout time. Tillage of fields has been supported by great technological advances in several areas of knowledge, which have increased the amount of food produced at lower costs. The use of technology applied to modern agriculture has generated a research area called precision agriculture, which has providing crops with resources in an exact amount at a precise moment as one of its most relevant objectives The data analysis process in precision agriculture systems begins with the filtering of the information available, which can come from sources such as images, videos, and spreadsheets. When the information source is digital images, the process is known as segmentation, which consists of assigning a category or label to each pixel of the analyzed image. In recent years, different algorithms of segmentation have been developed that make use of different pixel characteristics, such as color, texture, neighborhood, and superpixels. In this paper, a method to segment images of leaves and fruits of tomato plants is presented, which is carried out in two stages. The first stage is based on the dominance of one of the color channels over the other two, using the RGB color model. In the case of the segmentation of the leaves, the green channel dominance is used, whereas the dominance of red channel is used for the fruits. In the second stage, the false positives generated during the previous stage are eliminated by using thresholds calculated for each pixel that meets the condition of the first stage. The results are measured by applying performance metrics: Accuracy, Precision, Recall, F1-Score, and Intersection over Union. The results for segmentation of the fruit and leaves of the tomato plants with the highest metrics is Accuracy with 98.34% for fruits and Recall with 95.08% for leaves.