- Jara Arroyo, Miguel
- García Mayorga, Ismael
- Parra Idarraga, Óscar
- Caballero Cortes, Marcos
Este notebook tiene como objetivo la detección de tomates maduros en una plantación a partir de imágenes extraídas de un video. Para lograrlo, se emplean filtros espaciales y filtros morfológicos que permiten, respectivamente, mejorar la calidad de las imágenes y refinar las regiones detectadas. Las imágenes utilizadas provienen del dataset disponible en datasetninja.com/tomatod.
En este paso se utiliza un filtro espacial. Las imágenes son cargadas en formato RGB y suavizadas mediante un filtro gaussiano, lo que permite reducir el ruido y facilitar los pasos posteriores. Posteriormente, se realiza una conversión al espacio de color HSV para aislar mejor los colores asociados a los tomates maduros.
Se trabaja sobre las imágenes en el espacio de color HSV. Se definen rangos específicos para el color rojo, considerando tanto tonos intermedios como extremos. A partir de estos rangos, se generan máscaras binarias que permiten segmentar las regiones rojas en la imagen.
En este paso se aplican filtros morfológicos. Se utilizan operaciones de cierre (dilatación seguida de erosión) para eliminar pequeñas imperfecciones o áreas de ruido, y operaciones de apertura (erosión seguida de dilatación) para perfeccionar las formas de las regiones detectadas. Esto se realiza utilizando un kernel elíptico.
Una vez filtradas las regiones mediante operaciones espaciales y morfológicas, se identifican los contornos de las áreas segmentadas. Sobre estas regiones se dibujan rectángulos alrededor de cada tomate detectado. Además, se calculan y muestran las características de cada tomate, como su posición, dimensiones y área.
El resultado final es una imagen procesada donde los tomates maduros están claramente identificados. Cada tomate está numerado y marcado con un rectángulo, acompañado de un registro detallado con sus características.
Tsironis V., Bourou S., Stentoumis C. (2020). tomatOD: Evaluation of object detection algorithms on a new real-world tomato dataset.
ISPRS - International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences.
Disponible en: https://github.com/up2metric/tomatOD
- Jara Arroyo, Miguel
- García Mayorga, Ismael
- Parra Idarraga, Óscar
- Caballero Cortes, Marcos
This notebook aims to detect ripe tomatoes in a plantation using images extracted from a video. The process employs spatial filters and morphological filters to enhance image quality and refine detected regions. The images used come from the dataset available at datasetninja.com/tomatod.
This step involves the application of a spatial filter. Images are loaded in RGB format and smoothed using a Gaussian filter, which reduces noise and facilitates subsequent processing steps. Then, the images are converted to the HSV color space to better isolate the colors associated with ripe tomatoes.
The images are processed in the HSV color space. Specific ranges for the color red, covering both intermediate and extreme tones, are defined. Based on these ranges, binary masks are generated to segment the red regions in the image.
At this stage, morphological filters are applied. Closing operations (dilation followed by erosion) are used to eliminate small imperfections or noisy areas, and opening operations (erosion followed by dilation) are used to refine the shapes of the detected regions. These operations are performed using an elliptical kernel.
After filtering the regions using spatial and morphological operations, contours of the segmented areas are identified. Rectangles are drawn around each detected tomato, and the characteristics of each tomato, such as position, dimensions, and area, are calculated and displayed.
The final output is a processed image where ripe tomatoes are clearly identified. Each tomato is numbered and marked with a rectangle, accompanied by a detailed record of its characteristics.
Tsironis V., Bourou S., Stentoumis C. (2020). tomatOD: Evaluation of object detection algorithms on a new real-world tomato dataset.
ISPRS - International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences.
Available at: https://github.com/up2metric/tomatOD
