Home > Articles > All Issues > 2026 > Volume 14, No. 5, 2026 >
JOIG 2026 Vol.14(5):787-795
doi: 10.18178/joig.14.5.787-795

Integration of Computer Vision and CNC Machining for Automated Object Measurement and Customized Packaging

Pablo Guacho, Angélica Quito*, Andrea Pilco, Samuel Peña*, and Marcelo Moyao
School of Mechatronics, Faculty of Digital Engineering and Emerging Technologies, International University of Ecuador UIDE, Quito, Ecuador
Email: davidguacho16@hotmail.com (P.G.); anquitoca@uide.edu.ec (A.Q.); anpilcoat@uide.edu.ec (A.P.); spena@uide.edu.ec (S.P.); mmoya@uide.edu.ec (M.M.)
*Corresponding author

Manuscript received November 5, 2025; revised December 24, 2025; accepted March 9, 2026; published September 11, 2026.

Abstract—This paper presents an integrated computer vision—Computer Numerical Control (CNC) workflow that measures an object’s planar footprint and automatically generates G-code to cut customized cardboard packaging, thereby reducing manual sizing and setup in low-cost manufacturing environments. Specifically, a monocular camera within a controlled enclosure captures a single image, after which contour extraction, centroid estimation, and pixel-to-millimeter calibration are applied to convert pixel distances into metric length and height estimates; these measurements are then translated into CNC laser toolpaths and validated in Laser G-code Real-Time Blink Loop (LaserGRBL) prior to cutting. The approach was evaluated on 59 heterogeneous objects against calliper/ruler measurements, yielding sub-millimetric performance (Mean Absolute Error (MAE): 0.793 mm in length and 0.861 mm in height; RMSE: 1.057 mm and 1.394 mm, respectively). Moreover, most items exhibited errors below 2%, confirming suitability for practical packaging tolerances; nevertheless, occasional outliers (e.g., a 7.49% height error for a small snap-fastener case) indicate that further gains may be achieved through improved illumination control and enhanced contour robustness. Overall, these findings evidence a scalable route to on-demand packaging automation that effectively bridges perception and fabrication for small enterprises.

Keywords—computer vision, Computer Numerical Control (CNC) machining, object measurement, G-code automation, packaging system
 

Cite: Pablo Guacho, Angélica Quito, Andrea Pilco, Samuel Peña, and Marcelo Moya, "Integration of Computer Vision and CNC Machining for Automated Object Measurement and Customized Packaging," Journal of Image and Graphics, Vol. 14, No. 5, pp. 787-795, 2026.


Copyright © 2026 by the authors. This is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited (CC BY 4.0).

Article Metrics in Dimensions