Automated Shallot Classification on Conveyor Belts Using Watershed Transform and Otsu Thresholding
Received: 9 September 2025 | Revised: 13 October 2025, 5 November 2025, and 28 November 2025 | Accepted: 29 November 2025 | Online: 9 February 2026
Corresponding author: Indrabayu
Abstract
Manual classification of shallots often lacks precision, especially when bulbs overlap or have irregular shapes on conveyor systems. This study presents an automated computer vision approach combining Otsu thresholding and the watershed transform to detect and measure shallot diameters. Data were collected from video recordings under varying conveyor speeds and camera distances. The processing pipeline—consisting of preprocessing, segmentation, and feature extraction achieved a segmentation accuracy of 99.57% and a diameter estimation Mean Absolute Percentage Error (MAPE) as low as 2.84%. These results demonstrate a significant improvement in separating overlapping objects and measuring irregular shapes. This system contributes to the literature on post-harvest classification automation and shows strong potential for implementation in industrial shallot processing lines to enhance efficiency, ensure consistent quality, and significantly reduce reliance on manual labor. However, the system's performance may vary under extreme lighting conditions, indicating opportunities for further improvement.
Keywords:
shallot, Otsu thresholding, watershed transform, computer vision, agricultural automationDownloads
References
Shallot Production in South Sulawesi Province by Regency/City (Quintal), Sulawesi Selatan, Indonesia: BPS of South Sulawesi Province, Dec. 2021.
H. Susanto, D. Histifarina, K. Hamdani, and Kusyaeri, Shallot Cultivation from SEEDS: Learning and Field Experience, Jakarta Indonesia: CV Sarnu Untung Publishing, 2022.
H. Cheng, L. Damerow, Y. Sun, and M. Blanke, "Early Yield Prediction Using Image Analysis of Apple Fruit and Tree Canopy Features with Neural Networks," Journal of Imaging, vol. 3, no. 1, Jan. 2017, Art. no. 6. DOI: https://doi.org/10.3390/jimaging3010006
H. C. Bazame, J. P. Molin, D. Althoff, and M. Martello, "Detection, Classification, and Mapping of Coffee Fruits During Harvest with Computer Vision," Computers and Electronics in Agriculture, vol. 183, Apr. 2021, Art. no. 106066. DOI: https://doi.org/10.1016/j.compag.2021.106066
A. A. Boatswain Jacques, V. I. Adamchuk, J. Park, G. Cloutier, J. J. Clark, and C. Miller, "Towards a Machine Vision-Based Yield Monitor for the Counting and Quality Mapping of Shallots," Frontiers in Robotics and AI, vol. 8, Apr. 2021, Art. no. 627067. DOI: https://doi.org/10.3389/frobt.2021.627067
A. La Ode Muh Armadi, Indrabayu, and I. Nurtanio, "Snacks Detection Under Overlapped Conditions Using Computer Vision," in 2023 IEEE International Conference on Industry 4.0, Artificial Intelligence, and Communications Technology, Bali, Indonesia, Jul. 2023, pp. 360–364. DOI: https://doi.org/10.1109/IAICT59002.2023.10205599
A. Susanto, Z. H. Dewantoro, C. A. Sari, D. R. I. M. Setiadi, E. H. Rachmawanto, and I. U. W. Mulyono, "Shallot Quality Classification Using HSV Color Models and Size Identification based on Naive Bayes Classifier," Journal of Physics: Conference Series, vol. 1577, no. 1, Jul. 2020, Art. no. 012020. DOI: https://doi.org/10.1088/1742-6596/1577/1/012020
Z. Ouyang, L. Li, W. Tian, R. Hong, P. Zan, and B. Yang, "Fitting Algorithm for Overlapped Spherical Fruits Based on Geometry and Hough Transform," in 2020 IEEE 11th International Conference on Software Engineering and Service Science, Beijing, China, Oct. 2020, pp. 420–423. DOI: https://doi.org/10.1109/ICSESS49938.2020.9237651
O. Vite-Chávez, J. Flores-Troncoso, R. Olivera-Reyna, and J. U. Munoz, "Improvement Procedure for Image Segmentation of Fruits and Vegetables Based on the Otsu Method," Image Analysis and Stereology, Oct. 2023. DOI: https://doi.org/10.5566/ias.2939
K. Dutta, D. Talukdar, and S. S. Bora, "Segmentation of Unhealthy Leaves in Cruciferous Crops for Early Disease Detection Using Vegetative Indices and Otsu Thresholding of Aerial Images," Measurement, vol. 189, Feb. 2022, Art. no. 110478. DOI: https://doi.org/10.1016/j.measurement.2021.110478
T. A. Putra, Yuhandri, and A. Ramadhanu, "Implementation of Watershed Algorithm for Rice Plant Image Segmentation to Analyze Growth Levels of Plant Image," in 2025 International Conference on Data Science and Its Applications, Jakarta, Indonesia, Jul. 2025, pp. 510–515. DOI: https://doi.org/10.1109/ICoDSA67155.2025.11157152
J. A. Fracarolli, F. F. A. Pavarin, W. Castro, and J. Blasco, "Computer Vision Applied to Food and Agricultural Products," Revista Ciência Agronômica, vol. 51, no. 5, 2020. DOI: https://doi.org/10.5935/1806-6690.20200087
R. A. Shandookh, T. M. Salman, and A. H. Miry, "Crop Sorting Using Image Segmentation and Artificial Intelligence: A Review," in 2022 Fifth College of Science International Conference of Recent Trends in Information Technology, Baghdad, Iraq, Nov. 2022, pp. 118–124. DOI: https://doi.org/10.1109/CSCTIT56299.2022.10145693
D. K. Barbole, P. M. Jadhav, and S. B. Patil, "A Review on Fruit Detection and Segmentation Techniques in Agricultural Field," in Second International Conference on Image Processing and Capsule Networks, vol. 300, J. I.-Z. Chen, J. M. R. S. Tavares, A. M. Iliyasu, and K.-L. Du, Eds. Cham, Switzerland: Springer International Publishing, 2022, pp. 269–288. DOI: https://doi.org/10.1007/978-3-030-84760-9_24
N. Otsu, "A Threshold Selection Method from Gray-Level Histograms," IEEE Transactions on Systems, Man, and Cybernetics, vol. 9, no. 1, pp. 62–66, Jan. 1979. DOI: https://doi.org/10.1109/TSMC.1979.4310076
R. C. Gonzalez and R. E. Woods, Digital Image Processing, 4th Global edition. New York City, NY, USA: Pearson Education, 2018.
D. Zhang and G. Lu, "Review of Shape Representation and Description Techniques," Pattern Recognition, vol. 37, no. 1, pp. 1–19, Jan. 2004. DOI: https://doi.org/10.1016/j.patcog.2003.07.008
Hasriani, Indrabayu, and I. Nurtanio, "Classifying the Size of Shallots Using Watershed Transformation Algorithm," in 2024 11th International Conference on Electrical Engineering, Computer Science and Informatics, Yogyakarta, Indonesia, Sept. 2024, pp. 683–688. DOI: https://doi.org/10.1109/EECSI63442.2024.10776565
L. Wang, J. Liu, J. Zhang, J. Wang, and X. Fan, "Corn Seed Defect Detection Based on Watershed Algorithm and Two-Pathway Convolutional Neural Networks," Frontiers in Plant Science, vol. 13, Feb. 2022, Art. no. 730190. DOI: https://doi.org/10.3389/fpls.2022.730190
M. Haralick and L. G. Shapiro, Computer and Robot Vision, vol. 1. Boston, MA, USA: Addison-Wesley, 1992.
A. O. Raji and A. O. Alamutu, "Prospects of Computer Vision Automated Sorting Systems in Agricultural Process Operations in Nigeria," Agricultural Engineering International: CIGR Journal, vol. 7, pp. 1–10, Feb. 2005.
R. Szeliski, Computer Vision: Algorithms and Applications. London, UK: Springer London, 2011. DOI: https://doi.org/10.1007/978-1-84882-935-0
J. Redmon and A. Farhadi, "YOLOv3: An Incremental Improvement." arXiv, 2018.
S. Widodo, Biomedical Image Feature Extraction: Equipped with Matlab Source Code, Jakarta, Indonesia: Pustaka Rumah Cinta Publishing, 2020.
Downloads
How to Cite
License
Copyright (c) 2025 Indrabayu, Misita Anwar, Intan Sari Areni, A. Ais Prayogi, Anugrayani Bustamin, Haryanti Rivai, Muhammad Abdillah Rahmat

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain the copyright and grant the journal the right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) after its publication in ETASR with an acknowledgement of its initial publication in this journal.
