Back to previous page

Project developed during my M.Sc. studies

Autonomous and Generalized Robotic Box Picking and Stacking

Python · OpenCV · Intel RealSense · KUKA · Summer semester 2024/2025

As a course project of the M.Sc. in Cybernetics and Robotics at CTU in Prague, our team of four built a system at the CIIRC Testbed for Industry 4.0 that sorts incoming boxes into a crate. Boxes of any shape arrive on a conveyor, an Intel RealSense D435i RGB-D camera measures each one, and a KUKA arm picks it by its center and places it in the crate. In this project, I led the team and built the computer vision part of the system.

From the problem to the real run: camera calibration, depth segmentation, color contours, lifting the corners into 3D and the empirical correction with a Random Forest. Music and sound effects: original, synthesized for this video. Visuals include project footage, slides and screenshots.

For every box and at each frame, the vision pipeline outputs its location (the 3D center of its top face), its angle relative to the belt's motion and its shape (L, W, H). The depth image isolates the box top by keeping only the closest depths, [min, min + K·σ]. The color image gives its contour: a bilateral filter, Canny edges, cv2.findContours and cv2.approxPolyDP down to a 4-vertex polygon. The four corners are then lifted into 3D with the intrinsic matrix K and the depth of the box top.

Depth heatmap of a box on the conveyor and the mask of the box kept from its closest depths
Real detection window: binary masks with their area, and the fitted box on the color image with L x W x H = 23.7 x 17.3 x 12.0
First image: depth frame of a box and the mask kept from its closest depths. Second image: real detection window from a run, with the masks, their area and the fitted box with its dimensions in centimeters.

The estimates were precise but not accurate, so a Random Forest learned an empirical correction offset, trained with positions from the robot's TCP and dimensions measured with a tape. The boxes were detected properly and placed in the computed order and location. Camera calibration was done by Ángel Hurtado, the Python-to-KUKA communication through OPC UA and a PLC by Semih Akten, and the quasi-optimal crate packing, a greedy online algorithm, by Amit Sawant.