A Very Fast Image Stitching Algorithm for PET Bottle Caps

Xiao Xiang Zhu, Zixiao Liu, Xin Zhang, Tingting Sui, Ming LiJournal of Imaging 2022 · DOI

TL;DR

This paper introduces a novel, very fast image stitching algorithm designed to create a seamless, planar panoramic view of PET bottle caps. By accurately modeling the cap's geometry and camera positions, the algorithm overcomes distortions inherent in capturing cylindrical surfaces, paving the way for more efficient and accurate defect detection in manufacturing.

What Problem Does This Paper Address?

In industries like food and beverage, quality control of PET bottle caps is crucial. Machine vision systems are increasingly used for defect detection, but a significant challenge arises from the cylindrical shape of the bottle cap. Capturing a complete, undistorted view of the cap's surface with a single camera is difficult. Using multiple cameras can lead to overlapping image regions and, more importantly, cylindrical distortions when projecting the curved surface onto a flat image. These distortions can negatively impact subsequent defect detection algorithms, reducing their accuracy and efficiency. Traditional image stitching methods, while useful for planar scenes, often struggle with the complex geometry and lack of texture found on bottle caps, or they are too slow for real-time industrial applications. This paper aims to bridge this gap by proposing a fast and accurate method for generating a 360° planar representation of the bottle cap surface.

Methods

The core of the proposed solution, termed the Fast Image Stitching Algorithm (FISA), involves several key steps:

  • 3D Cap Modeling and Camera Calibration: The process begins by establishing a 3D model of the PET bottle cap. Crucially, the intrinsic and extrinsic parameters of four industrial cameras, strategically placed around the cap, are meticulously calibrated. This calibration provides the precise spatial relationship between the cameras and the cap.
  • Spatial Relationship Determination: Using the calibrated camera parameters and the 3D cap model, the algorithm calculates the mapping relationship between 3D points on the cap's surface and their corresponding 2D pixel locations in the captured images. This is achieved through projective geometry and solving for camera poses.
  • Best View Selection: Instead of processing full images, the algorithm identifies the "best view" regions from each camera that capture the most relevant parts of the cap's surface. This optimization reduces computational load.
  • Cylindrical Back-Projection and Unfolding: The selected "best view" image regions are then subjected to a cylindrical back-projection. This process effectively "unfolds" the curved surface into a planar representation.
  • Image Stitching: Finally, these unfolded planar segments are stitched together seamlessly to create a complete, 360° panoramic image of the bottle cap's side. A simple fading-in and fading-out fusion algorithm is employed for smooth transitions between stitched segments.

The algorithm emphasizes speed by avoiding time-consuming feature point searching and matching common in traditional stitching methods. It leverages geometric information and matrix operations for efficiency.

Datasets

The paper does not explicitly mention training datasets. Instead, it focuses on an experimental setup using four industrial cameras to capture images of PET bottle caps. The evaluation is performed on three different samples of bottle caps, and the results are presented based on these captured images. No new benchmark dataset is introduced.

Key Insights and Ideas

  • Geometry-Centric Approach: The algorithm's strength lies in its reliance on precise geometric modeling of both the bottle cap and the camera system, rather than solely on image features. This makes it robust to low-texture surfaces.
  • Optimized Image Acquisition: By identifying and processing only the "best view" regions from each camera, the algorithm significantly reduces the amount of data that needs to be processed, contributing to its speed.
  • Direct Mapping for Speed: The method bypasses complex feature matching by establishing a direct mapping between 3D cap points and 2D image pixels, a key factor in its "very fast" performance.
  • Flexibility in Image Quality vs. Speed: The paper highlights that different settings can be chosen to balance image quality and computational time, allowing for adaptation to specific application needs.

Key Results

The experimental results demonstrate the effectiveness and speed of the proposed FISA algorithm:

  • Speed: The average unfolding and stitching time for a 1.6-megapixel color cap image was remarkably fast, reaching as low as 123.6 ms for one sample at a 1x scale. When using reduced image quality settings (3x scale), the time was further reduced to 61.6 ms. This represents a significant speedup, with the paper claiming a reduction of almost 40% compared to a previous method [19].
  • Accuracy: The algorithm successfully unfolds the side images of the bottle cap correctly, producing a good imaging effect. The stitched results show that curves drawn on the cap surface coincide properly, indicating accurate stitching.
  • Defect Detection Application: The stitched panoramic images were then used for defect detection, with average detection times as low as 6.97 ms, demonstrating the practical utility of the fast stitching process.

Limitations and Future Work

  • Limitations:
    • The paper notes that for non-cylindrical caps (like frustum cones), minor joint defects can occur in the stitching result, although these are deemed to have minimal impact on subsequent defect detection.
  • The accuracy of the stitching is dependent on the accuracy of the edge extraction, which can be challenging if the cap edge is not clearly defined.
  • Future Work: The authors mention that investigating tubes with different radii will be a focus for their future work.

Summary updated

Abstract

In the beverage, food and drug industry, more and more machine vision systems are being used for the defect detection of Polyethylene Terephthalate (PET) bottle caps. In this paper, in order to address the result of cylindrical distortions that influence the subsequent defect detection in the imaging process, a very fast image stitching algorithm is proposed to generate a panorama planar image of the surface of PET bottle caps. Firstly, the three-dimensional model of the bottle cap is established. Secondly, the relative poses among the four cameras and the bottle cap in the three-dimensional space are calculated to obtain the mapping relationship between three-dimensional points on the side surface of the bottle cap and image pixels taken by the camera. Finally, the side images of the bottle cap are unfolded and stitched to generate a planar image. The experimental results demonstrate that the proposed algorithm unfolds the side images of the bottle cap correctly and very fast. The average unfolding and stitching time for 1.6-megapixel color caps image can reach almost 123.6 ms.
BibTeX
@article{zhu2022very,
  author = {Xiao Xiang Zhu and Zixiao Liu and Xin Zhang and Tingting Sui and Ming Li},
  title = {{A Very Fast Image Stitching Algorithm for PET Bottle Caps}},
  journal = {Journal of Imaging},
  year = {2022},
  doi = {10.3390/jimaging8100275},
}
Figure