Canadian company Agmanic, in collaboration with system integrator Genik, has developed a fully automated robotic application for pumpkin harvesting. Thanks to industrial image processing using advanced technologies such as 3D Vision and artificial intelligence developed working with MVTec, the robots are capable of autonomously handling post-harvest processes.
Like many other regions, the agricultural sector in Canada faces a structural challenge: a labour shortage. For years, tens of thousands of agricultural jobs have remained unfilled during the peak harvest season. This has led to revenue losses in the billions - in 2022 alone, losses totalled 3.5 billion U.S. dollars. The fruit and vegetable sector was particularly hard hit - and the outlook for the future is bleak. By 2030, more than 35,000 jobs in that sector are expected to remain unfilled during the peak season.
The impact is particularly evident in pumpkin cultivation, for example. After the harvest, several processing steps are still required: cleaning, labelling and packaging the products. These processes, also known as finishing, are labour-intensive, repetitive, and must be completed reliably within a short timeframe.
At Les Fermes Emile Gariepy, a pumpkin farm in Quebec, the post-harvest steps had previously been carried out manually. Four employees were needed per shift to load the washing system, monitor the line, and pack the pumpkins into cartons ready for sale. These tasks are particularly prone to staffing shortages because they are seasonal and, at the same time, physically demanding.
"The pumpkin farm wanted to automate the post-harvest processes. However, the task was technically extremely challenging because pumpkins do not behave like industrially manufactured components. They vary considerably in shape, size, weight and orientation. In addition, there are different varieties," explains Peter McLaughlin, CEO and Co-Founder of Agmanic.
Agmanic Vision, based in Quebec, Canada, specializes in AI-powered industrial image processing. Together with Genik, a company specializing in automation and robotics, Agmanic developed an autonomous robotic application consisting of two robotic cells for finishing the pumpkin harvest.
"We developed a platform that accommodates the heterogeneity of the pumpkins by making the solution adaptable to the unlimited variety of shapes and variations. At the heart of the application is the interaction between robots and industrial image processing. Without industrial image processing, it would not have been possible to achieve the high degree of automation in the process," explains McLaughlin.
When selecting the software - the core of the machine vision application - Agmanic chose MVTec HALCON. HALCON is a comprehensive standard software for industrial image processing.
Machine vision and robotics working together
"The customer's overarching objective was to reduce reliance on manual labour, ensure a consistent throughput, process different pumpkin varieties without reconfiguration, and handle the products gently," McLaughlin summarises. The system developed comprises two robotic cells.
The first cell handles bin picking - that is, removing the pumpkins from the harvest bins. The second cell handles bin placing - that is, picking up the pumpkins from the conveyor belt and placing them into cartons. Between the two cells are a brush washing station and an automatic labelling station.
The process begins at the harvest crate. A Basler 3D time-of-flight camera is mounted directly on the tool of the bin-picking robot. It moves with the robot arm and scans the wooden crate from above. This creates a 3D point cloud of the crate's contents. This point cloud maps the spatial structure of the stack of pumpkins. At the same time, the HALCON image processing software analyses the 2D image from the same camera using deep learning-based instance segmentation. The software detects the individual visible pumpkins, regardless of variety, size or orientation.
The 2D detection results and the 3D data are then combined. Based on this, the system can determine the spatial location of each detected pumpkin. In the next step, the image processing software identifies suitable candidates for grasping. To do this, the system checks the position, orientation, and surroundings of each detected pumpkin. It assesses whether the robot can reach the pumpkin and whether collision-free grasping is possible. The best candidate is then selected, and the robot controller receives the appropriate grasping coordinates. After being grasped, the pumpkin is fed into the brush washing station.
At the exit of the washing station, the second robot cell takes over. A stereo 3D camera is permanently installed above the conveyor belt there. It detects the pumpkins as they move and provides the data the robot needs for gripping during the ongoing process. After being picked up from the conveyor belt, the pumpkin is placed in a cardboard box. Another active stereo 3D camera is installed above the cardboard box to be filled. With each cycle, it generates a point cloud of the box's interior. This allows the HALCON machine vision software to detect which areas of the box already contain pumpkins, and where the next pumpkin can be placed. The planning algorithm developed by Agmanic Vision uses this information to determine the optimal placement position.
3D, vision and AI in machine vision
"Neither sensor technology alone, nor traditional rule-based image processing, could have met the requirements. The variation among the pumpkins is simply too great. In addition, the system must not only recognise objects, but also determine their spatial position, calculate gripper points, predict movements, and plan packaging positions. For these reasons, we were looking for extremely powerful machine vision software - and we found it in MVTec HALCON," explains McLaughlin.
Felix Podhorsky, Business Development Manager at MVTec, continues: "HALCON has over 2,100 different operators. This means it can cover virtually all use cases in virtually every industrial sector."
A core technology that plays a decisive role in the system's success is 3D processing. 3D image processing includes, among other things, the processing of point clouds, handeye calibration, and the analysis of 3D data from active stereo cameras. A 3D point cloud is a digital, spatial representation of an object. It consists of many individual measurement points. Each point has at least three coordinates: X, Y, and Z.
First, a 3D camera captures the work area. In this case, the pumpkin farm uses a time-of-flight camera and stereo 3D cameras. They capture not only a 3D image, but also a 2D image. The measurement data is then used to generate 3D points. HALCON then calculates the spatial position from the set of pixels. This results in a point cloud. Each point describes a location on the object's surface. The machine vision software uses this information to determine the object's shape, position, height, distance, volume or orientation. In the case of a pumpkin, for example, it can determine where it is located, how large it is, and where a robot can grasp it.
The point cloud thus provides the object's 3D position. Hand-eye calibration makes this position usable for the robot. To do this, the 3D data is converted into robot coordinates. This allows the robot to precisely grasp, place, or inspect an object. This is precisely why this technology is well-suited for bin picking, robot guidance, and packaging planning.
The other core technology of the system is AI-based instance segmentation. This process assigns objects to a class with pixel-level precision. This deep-learning-based method makes it possible to extract the exact boundaries and shapes of objects - even in complex scenarios where objects are closely packed together. At the pumpkin farm's facility, the deep learning method is tasked with recognising and delineating every single pumpkin in a 2D image. This works even when multiple pumpkins are in a single container or partially touching one another. The system can also process pumpkins of different varieties, shapes, sizes and orientations. This enables HALCON to determine which pumpkin is the next suitable candidate for picking.
"This use case clearly demonstrates the added value offered by AI-based deep learning methods, in particular. They enable the automation of tasks that were previously impossible to automate - simply because AI can recognize patterns in objects that vary and have characteristics that are difficult to define, and thus impossible to program in advance, and can make robust decisions independently," explains Podhorsky.
"In summary, AI recognises the pumpkin as an object in the image. 3D image processing provides information in the form of a point cloud, indicating the pumpkin's position in space. Through hand-eye calibration, this information is translated and transferred into robot coordinates," says McLaughlin.
Vision-based robotic cells process 1,200 pumpkins per hour
The automated post-harvest system at Les Fermes Emile Gariepy has been in operation since 2025 and has met expectations. Reliance on the four employees previously required has been reduced. The fully integrated system processes one pumpkin every three seconds. This amounts to 1,200 pumpkins per hour.
"The system can process different varieties without requiring operator intervention or reconfiguring the line between varieties. It demonstrates how even highly variable agricultural products can be industrially automated, and how this can reduce reliance on seasonal workers," explains McLaughlin.
This application makes it clear that modern machine vision in agriculture goes far beyond simple recognition. It provides the foundation for deploying robots precisely and flexibly, even in challenging and adverse environments.
"Especially in food and agricultural processing, 3D image processing and deep learning are opening up new possibilities for automation. Natural products have long been difficult to automate because they are not standardized. HALCON helps make this variability technically manageable and build robust industrial processes," explains Podhorsky.
Want the latest machine building news straight to your inbox? Become a MachineBuilding member for free today >>