System and method for efficient 3D reconstruction of objects using a telecentric line scan camera
By using a telecentric lens on a line scanning camera and carrying out corresponding camera models and calibration procedures, the problem of stereoscopic image correction of perspective line scanning cameras is solved, high-accuracy 3D reconstruction is achieved, and the practicality of line scanning cameras in stereoscopic reconstruction applications is improved. performance and availability.
Patent Information
- Application Number
- CN202010692742.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-17
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-07-17
AI Technical Summary
In the existing technology, the stereoscopic images of perspective line scanning cameras are difficult to correct to epipolar standard geometric shapes, resulting in limited accuracy of stereoscopic reconstruction, and precise alignment of sensor lines is complex and expensive, limiting the practicality of line scan cameras in stereoscopic reconstruction applications. .
A line scan camera with a telecentric lens is used for stereoscopic reconstruction. Through the camera model and calibration program, image correction and lens distortion modeling are achieved to ensure high accuracy of 3D reconstruction, and can effectively correct even when the sensor line is not installed accurately. image.
It achieves high-accuracy stereoscopic reconstruction using a generally configured line scan camera, simplifies the sensor line alignment process, reduces cost and complexity, and improves the usability and accuracy of 3D reconstruction.
Smart Images

Figure CN113538589B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates generally to machine vision systems and, more particularly, to 3D reconstruction of objects from 2D images. Background Art
[0002] Applications of 3D Reconstruction
[0003] Efficient and accurate reconstruction of scenes (objects) from images is very important for numerous computer vision, especially machine vision applications. For example, printed circuit boards (PCBs) can be robustly inspected for missing or incorrectly placed electronic components by using 3D reconstruction of the PCB (Steger et al., 2018, Chapter 3.10.1). Furthermore, 3D generated objects can be measured to check for their correct shape or size, for example, by comparing the reconstructed surface to a reference object (Steger et al., 2018, Chapter 4.13). Another example is object recognition for pick-and-place applications, where the exact 3D pose (position and orientation) of an object must be determined in the 3D data in order to be able to grasp the object using a robot (Steger et al., 2018, Chapter 4.14).
[0004] 3D Reconstruction Technology
[0005] In the machine vision industry, there are many different technologies available for 3D image acquisition devices that return 3D data. The principle behind most 3D image acquisition devices is triangulation. One of the most prominent representatives of 3D reconstruction based on triangulation is stereo reconstruction, in which a scene is observed using at least two cameras in different positions (Steger et al., 2018, Chapter 2.5.1). By identifying corresponding points in the image and intersecting their associated lines of sight in 3D space, the 3D coordinates of the points can be obtained. Another representative is 3D reconstruction based on the light sheet principle, also commonly referred to as laser triangulation (Steger et al., 2018, Chapter 2.5.2). A light sheet sensor consists of a camera and a laser projector that projects a laser plane onto the scene. The intersection of the laser plane with the object is extracted as a line in the camera image. Each image point on the extracted line represents a line of sight in the camera that intersects the laser plane in 3D to obtain a reconstructed point. In order to reconstruct the complete shape of an object with a light sheet sensor, the object must be moved relative to the sensor. The third category of 3D sensors based on triangulation are structured light sensors (Steger et al., 2018, Chapter 2.5.3). They consist of a camera and a projector that projects a pattern onto the scene. Based on the deformation of the pattern in the camera image, the 3D shape of the object can be inferred. In addition to triangulation, the second widespread 3D reconstruction principle is time-of-flight (TOF) measurement. TOF sensors emit radiation and measure the time difference between the emission of the radiation and its return to the sensor after reflection from the object surface (Steger et al., 2018, Chapter 2.5.4).
[0006] Stereo reconstruction
[0007] The present invention focuses on stereo reconstruction, as it is one of the most prominent principles of 3D reconstruction. There are many commercial stereo sensors available, where usually two cameras are housed in a single housing. However, a more flexible setup is to use two or more individual cameras. In this case, the hardware and settings can be optimally selected or adjusted for the task to be solved: for example, the resolution and size of the sensor, the type of lens, the focal length of the lens and the relative orientation of the cameras can be optimally selected for a given application. These parameters affect the accuracy, robustness and field of view of the stereo reconstruction.
[0008] While stereo sensors are usually calibrated at the factory, the individual setups must be calibrated in situ before 3D reconstruction can be performed. Calibration means determining the parameters of the intrinsic orientation of all cameras and their relative orientation. The relative orientation describes the position and orientation of two cameras relative to each other and is usually represented by a rigid 3D transformation (Steger et al., 2018, Chapter 3.10.1.1). In the following, the rigid 3D transformation will also be denoted as pose. The intrinsic orientation of the camera describes the projection of a given 3D point in the camera coordinate system to a 2D point in the image coordinate system. For example, the intrinsic orientation of an area scan camera with a perspective (centripetal) lens can be described by the following parameters: principal distance, row and column coordinates of the principal points, horizontal and vertical pixel spacing on the sensor, and parameters modeling lens distortion (Steger et al., 2018, Chapter 3.9.1). In addition, the extrinsic orientation is usually modeled, which is determined by the position and orientation of the camera system relative to a world coordinate system. The origin of the world coordinate system is usually defined by the origin of the calibration object (see below) used to perform the calibration. Therefore, extrinsic orientations most often describe the pose of the calibrated object relative to a previously chosen reference camera (Steger, 2017).
[0009] To perform calibration, all cameras must acquire images of suitable calibration objects with known control points. These images will be referred to as calibration images in the following. Although 3D calibration objects are sometimes used, in most machine vision applications, planar calibration objects are preferred (Steger et al., 2018, Chapter 3.9.4.1). They are easier to manufacture accurately than 3D calibration objects. In addition, they can be handled more easily by the user. They also allow cameras to be calibrated in applications where backlighting is necessary, for example, by using transparent calibration objects on which opaque control points are applied, or vice versa. Planar calibration objects can also be used to easily define planes in the world by simply placing the calibration object on the plane of interest in the world. Measurements in the image can be converted into measurements in world coordinates in the defined plane (Steger et al., 2018, Chapter 3.9.5). Planar calibration objects with circular markings are often used, since their center points can be determined with high accuracy (Lenz and Fritsch, 1990; Lanser et al., 1995; Lanser, 1997; Steger et al., 2018, Chapter 3.9.4.1). Due to degeneracies that occur when calibrating with planar calibration objects and a single calibration image (Steger et al., 2018, Chapter 3.9.4.3), the camera is usually calibrated by using multiple calibration images, in which the planar calibration object is acquired in different poses (Steger et al., 2018, Chapter 3.9.4.4). Alternatively, uncalibrated stereo methods can also be applied. In these cases, the calibration images do not necessarily need to contain the calibration objects.
[0010] Telecentric lens
[0011] In some machine vision applications, telecentric lenses are used instead of perspective lenses. Telecentric lenses perform a telecentric projection on the object side. Therefore, they perform a parallel projection of the world to the image (Steger et al., 2018, Chapter 2.2.4). Especially in measurement applications, the use of telecentric lenses can improve accuracy because they eliminate perspective distortion. Telecentric lenses are constructed so that an aperture diaphragm is placed at the image-side focal point, which filters out all light rays that are not parallel to the optical axis (Steger et al., 2018, Chapter 2.2.4). Due to their parallel projection in object space, the diameter of the telecentric lenses must be chosen to be at least as large as the object to be imaged.
[0012] Camera models for area scan cameras
[0013] (Steger, 2017) proposed a general-purpose camera model for area scan cameras and a suitable calibration procedure for cameras with perspective cameras and telecentric lenses. The calibration procedure allows calibration of any combination of perspective and telecentric camera setups (including support for tilted lenses).
[0014] Binocular Stereo-Image Correction
[0015] A calibrated camera setup is a prerequisite for stereo reconstruction. To simplify the following discussion, we restrict ourselves to the case of binocular stereo, i.e., to the case of two cameras. However, the concepts can be easily extended to more than two cameras. Corresponding points in both images must be determined in order to reconstruct a 3D point. It is well known that for a given point in the first image, the corresponding point in the second image must lie on the so-called epipolar line (Steger et al., 2018, Chapter 3.10.1.3). In order to speed up the search for corresponding points, it is common practice to transform the two input images into a representation that conforms to the epipolar standard geometry (Steger et al., 2018, Chapter 3.10.1.4). This transformation is called stereo image rectification. The parameters of the transformation can be derived from the results of the camera calibration. The rectified images have no lens distortion and corresponding image points in both images lie in the same image row. Therefore, the search for corresponding points can be limited to a single image row and can therefore be performed very efficiently. This is particularly important for applications that target dense reconstruction, i.e., applications that require the 3D coordinates of multiple pixels in the input images.
[0016] Binocular Stereo – Stereo Matching
[0017] The process of determining corresponding points in images is called stereo matching. In order to obtain a dense reconstruction, stereo matching tries to find a corresponding point in the second corrected image for each point (pixel) in the first corrected image. Since it is known that corresponding points in the corrected images must be located in the same image row, the relevant information for 3D reconstruction is the column coordinates of the corresponding points in the corrected images. More specifically, the depth of a 3D point (i.e., its distance from the camera) depends only on the difference in the column coordinates of its corresponding points in the corrected images. This difference is called disparity (Steger et al., 2018, Chapter 3.10.1.5).
[0018] Therefore, the main goal of dense reconstruction is to find the disparity for each pixel in the first corrected image. For example, an overview of different dense stereo reconstruction algorithms can be found in (Scharstein and Szeliski, 2002; Brown et al., 2003). In machine vision applications, the determination of disparity is usually considered as a template matching problem (Steger et al., 2018, Chapter 3.10.1.6): Template matching attempts to find the most similar point in the second image that is located in the same image row for each point in the first image. Similarity is usually measured by comparing a rectangular image patch around a point in the first image with a rectangular image patch around all possible corresponding points in the second image. The most common similarity measures are the sum of the absolute gray value differences, the sum of the squares of the gray value differences, and the normalized cross-correlation (Steger et al., 2018, Chapter 3.10.1.6). Dense stereo reconstruction based on template matching combines efficient computation (in terms of both memory and computation time) with an accuracy sufficient for most applications. Alternative approaches to dense disparity estimation are based on variational methods that are able to compute disparity even in low-texture image regions. It is important to note that all effective methods for dense disparity estimation assume that the input image pair has been previously rectified to epipolar standard geometry.
[0019] Line scan cameras
[0020] In some machine vision applications, line scan cameras are preferred over surface scan cameras. The advantage of line scan cameras is that they have a higher resolution per unit price than surface scan cameras. Currently, the number of lines available for line scan cameras is as high as 16384 pixels (Steger et al., 2018, Chapter 2.3.4). In order to obtain a 2D image of an object with a line scan camera, multiple 1D images are stacked over time while the camera is moved relative to the object. Therefore, the height of the resulting image is essentially infinite because it corresponds to the number of 1D images acquired over time. In the present invention, the movement of the camera relative to the object is represented as relative motion. Relative motion is typically achieved by moving the camera over a stationary object or mounting the camera above a moving object (Steger et al., 2018, Chapter 2.3.1.1). In most machine vision applications using line scan cameras, linear motion at a constant speed is applied. Relative motion can be achieved, for example, by a linear motion slider, a conveyor belt, or other linear actuators. A camera model for a line scan camera with a perspective lens is described in (Steger et al., 2018, Chapter 3.9.3). Stereo reconstruction using a perspective line scan camera
[0021] The accuracy of stereo reconstruction is naturally limited by the image resolution. Therefore, for applications that have high requirements for reconstruction accuracy, it is very desirable to use high-resolution line scan cameras instead of area scan cameras for stereo reconstruction.
[0022] Unfortunately, stereo images from perspective line scan cameras cannot usually be corrected to epipolar standard geometry (Gupta and Hartley, 1997; Kim, 2000; Habib et al., 2005a, b). This prevents efficient stereo reconstruction and therefore prevents the general use of line scan cameras for stereo reconstruction. However, in (Habib et al., 2005a, b), two special ideal configurations of line scan cameras with perspective lenses are shown, which can indeed be corrected: the ideal cross-track configuration and the ideal along-track configuration, where the sensor lines of the two sensors must be precisely aligned relative to each other in a certain way. Moreover, these configurations assume the absence of lens distortion. Based on these two configurations, several perspective line scan stereo systems for industrial applications have been proposed in the literature (Calow et al., 2010; Ilchev et al., 2012; Lilienblum and Al-Hamadi, 2015; Sun et al., 2016; Sun et al., 2017; Godber et al., 1995). In these systems, the sensor lines are manually aligned to one of two ideal configurations, for example by using suitable adjustment devices. Unfortunately, the papers do not disclose in detail how the precise alignment of the sensor lines is achieved and how much time is necessary to align the sensors. As a result, stereo with perspective line scan cameras is complex, requiring expensive precision equipment and tedious manual labor. Therefore, being able to perform efficient stereo reconstruction using line scan cameras that are not limited to one of the two ideal configurations would be a major step forward from a practicality and usability point of view. Furthermore, even if the lines can be precisely aligned relative to each other, if the sensor lines are not mounted exactly behind the principal point, lens distortion will again prevent the correct correction of the image. Ignoring lens distortion can adversely affect the accuracy of the 3D reconstruction. Summary of the invention
[0023] The invention is set forth in the claims. It relates to a method and apparatus for reconstructing a 3D scene using at least two line scan cameras with telecentric lenses. In the present invention, the terms "3D scene", "3D object" and "3D objects" are used synonymously. The invention also relates to a system or apparatus for performing and / or implementing the described method. The method is computer-implemented.
[0024] In the present invention, systems and methods are described that allow stereo reconstruction to be performed using a line scan camera of a general configuration. Thus, tedious precise alignment of the sensor lines becomes redundant. The method of the present disclosure requires that a telecentric lens, rather than a perspective lens, be mounted on the line scan camera. In this case, stereo correction can be utilized to accurately correct the image. The corrected image can be used to perform efficient stereo matching. The method includes a camera model and a calibration procedure that allows the imaging process to be accurately modeled, including the modeling of lens distortions, even if the sensor lines are not mounted exactly behind the principal point. This ensures a high accuracy of the resulting 3D reconstruction.
[0025] In a preferred embodiment of the present invention, the system includes two or more line scan cameras with telecentric lenses for acquiring images of the 3D object to be reconstructed. In the present invention, line scan cameras with telecentric lenses are also synonymously referred to as telecentric line scan cameras. In addition, in a preferred embodiment, the system further includes a device for performing relative movement of the 3D object relative to the telecentric line scan camera. In a preferred embodiment, the device performs linear movement at a constant speed, for example, by a linear motion slider, a conveyor belt or by other linear actuators. In a preferred embodiment, the system further includes a computer configured to perform a method including the steps described below. Steps one to three deal with the calibration of the system and are performed offline, i.e., after setting up the system and before acquiring images of the 3D object to be reconstructed. Steps four to seven are performed online and include image acquisition of the 3D object, telecentric image correction, parallax estimation and actual 3D reconstruction.
[0026] In a first step, one or more telecentric line scan calibration images of a calibration object are acquired with each telecentric line scan camera. The pose of the calibration object varies with the calibration image. The calibration object has a plurality of control points with known 3D coordinates in world units (world coordinates). The telecentric line scan calibration images are acquired by performing a relative motion of the calibration object relative to the telecentric line scan cameras. For each pose of the calibration object and each camera, the acquired 1D image lines are stacked on top of each other, thereby producing a telecentric line scan calibration image. In a preferred embodiment, multiple telecentric line scan images of a planar calibration object are acquired with each telecentric line scan camera. In an alternative embodiment, a single telecentric line scan image is acquired with each telecentric line scan camera. As a result, a set of telecentric line scan calibration images is obtained for each camera, wherein the set contains at least one image. For a meaningful calibration, it is important to acquire all images by performing the same relative motion between the telecentric line scan camera and the calibration object.
[0027] In a second step, a camera calibration is performed based on the telecentric line scan calibration images. For this purpose, a suitable camera model is defined, which accurately describes the image creation process and one or more relative poses between the cameras. In a preferred embodiment, the 2D positions of visible control points of the calibration object are automatically measured in the telecentric calibration images (image coordinates). Furthermore, the correspondence between the measured 2D image points and the 3D points of the calibration object is automatically determined. The parameters of the camera model are determined by minimizing the error of the 2D coordinates of the image points of the extracted control points in the associated telecentric line scan calibration images and the 3D coordinates of the corresponding points of the calibration object.
[0028] As a result of the calibration, the values of the camera parameters are obtained. The camera parameters include the parameters of the internal orientation of all cameras, the parameters of the relative orientation between all cameras, and the parameters of the absolute orientation of the calibration objects in all telecentric line scan calibration images.
[0029] In a third step, based on the camera parameters obtained from the camera calibration in the second step, a telecentric correction mapping is calculated, which can be used to correct a telecentric line scan image pair in a pair of telecentric line scan cameras. The telecentric correction mapping represents a stereo image correction and thus describes a geometric transformation of the telecentric line scan image pair to an epipolar standard geometry. Thus, when the mapping is applied to the telecentric line scan image pair, the obtained corrected telecentric line scan image pair has no lens distortion and corresponding image points are located in the same image row.
[0030] In a preferred embodiment of the present invention, the first three steps described above are performed offline, after setting up or modifying the system. Therefore, these three steps need to be re-executed only when the camera settings are changed and this change affects the parameters estimated during the camera calibration. The telecentricity correction map is stored for later use in the online stage. In a preferred embodiment, the correction map is stored as a lookup table (LUT) to enable effective correction in the online stage. The LUT stores the position of the corresponding pixel in the original telecentric line scan image for each pixel in the corrected telecentric line scan image. The LUT may optionally contain weights for appropriate gray value interpolation to obtain a higher quality corrected image, resulting in higher accuracy of the final 3D reconstruction.
[0031] In a fourth step, the online phase starts with acquiring telecentric line scan images of the 3D object to be reconstructed using the setup previously calibrated using the methods described in the first three steps. Since for 3D reconstruction at least two cameras are required, in a preferred embodiment a pair of telecentric line scan cameras is used to acquire telecentric line scan image pairs. In an alternative embodiment, telecentric line scan image pairs are selected from more than two telecentric line scan cameras. Each telecentric line scan image is created by performing the same relative motion applied during the acquisition of the telecentric line scan calibration images in the first step.
[0032] In the fifth step, the acquired telecentric line scan image pair of the 3D object to be reconstructed is corrected by applying the telecentric correction mapping of the corresponding telecentric line scan camera pair calculated in step 3. Corresponding points in the resulting corrected telecentric line scan image pair are located in the same image row. In addition, the resulting corrected telecentric line scan image pair has no lens distortion.
[0033] In an optional sixth step, the disparity from the resulting corrected telecentric line scan image pair is calculated by one of the different available stereo matching methods using epipolar standard geometry. In a preferred embodiment of the invention, a method for dense disparity estimation is applied, generating a disparity image containing a disparity value for each defined pixel. For example, in case of occlusions or in low texture image parts, undefined pixels may occur, where the corresponding pixel cannot be reliably determined. In a preferred embodiment, a dense disparity estimation method based on template matching is applied.
[0034] In an optional seventh step, the disparity calculated in the sixth step is converted to a distance. The conversion is performed based on the interior direction and the relative direction of the corrected telecentric line scan image pair. In a preferred embodiment, the distance is calculated for each defined pixel in the disparity image, thereby generating a range image. In a preferred embodiment, the range image represents a reconstruction of the 3D object. In an alternative embodiment, the distance values are further converted to 3D coordinates based on their row and column coordinates in the range image and based on the interior direction of the corrected telecentric line scan image pair.
[0035] According to one aspect, the present invention provides a system for reconstructing a 3D object using at least two line scan cameras. The system comprises:
[0036] (a) at least two telecentric line scan cameras;
[0037] (b) at least one device configured to perform relative motion of the 3D object relative to the telecentric line scan camera; and
[0038] (c) a computer having:
[0039] (c1) acquiring a set of telecentric line scan calibration images with each telecentric line scan camera while performing the relative motion, wherein the set comprises one or more images;
[0040] (c2) performing camera calibration based on the set of telecentric line scan calibration images;
[0041] (c3) calculating a telecentric correction mapping based on the camera calibration result, which corrects the telecentric line scan image pair of a pair of telecentric line scan cameras;
[0042] (c4) acquiring a pair of telecentric line scan images of the 3D object using a pair of telecentric line scan cameras while performing the relative motion; and
[0043] (c5) Correcting the telecentric line scan image pair of the 3D object using the telecentric correction map to generate a corrected telecentric line scan image pair.
[0044] The computer may be further configured to perform calculation of a disparity from the corrected telecentric line scan image pair, wherein the disparity represents the reconstructed 3D object.
[0045] The computer may be further configured to perform conversion of the disparity into distance, thereby producing a reconstruction of the 3D object.
[0046] The computer may be further configured to perform a conversion of the disparity into 3D coordinates, thereby producing a reconstruction of the 3D object.
[0047] The relative motion is preferably a linear motion.The linear motion may have a constant speed, or the linear motion may have a variable speed and the image acquisition of the telecentric linescan images is appropriately triggered to ensure the constant speed.
[0048] The calibration image may be an image of a calibration object. The calibration object may be a planar calibration object. The calibration object may be a 3D calibration object.
[0049] Preferably, in the camera calibration, camera parameters are determined, the camera parameters comprising parameters for the exterior direction of the telecentric line scan calibration image and, for each telecentric line scan camera, parameters for the relative direction and the interior direction.
[0050] Telecentricity correction mapping can correct a pair of telecentric line scan images from a pair of telecentric line scan cameras to epipolar standard geometry.
[0051] The telecentricity correction map may be stored in a lookup table. According to one embodiment, correcting the telecentric line scan image pair comprises applying the lookup table to the telecentric line scan image pair.
[0052] Computing the disparity from the corrected telecentric line scan pair may include generating a dense disparity estimate of the disparity image.
[0053] Furthermore, converting the disparity to a distance may include computing a range image.
[0054] According to one embodiment, camera calibration is performed by applying a sparse Levenberg-Marquardt algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The present invention will be more fully understood from the following detailed description taken in conjunction with the accompanying drawings, in which:
[0056] Figure 1 The steps of the off-line part of the invention are shown, which mainly include camera calibration and calculation of telecentricity correction map.
[0057] Figure 2 The steps of the online part of the present invention are shown, which mainly include image correction, calculation of disparity values and optionally conversion of the disparity values into distance values or 3D coordinates.
[0058] Figure 3 A camera model for a centripetal line scan camera is shown.
[0059] Figure 4 An example stereo setup with two telecentric line scan cameras is shown. The cameras are mounted in a along-the-track configuration. A linear light source is used to cover the footprint of the two sensor lines. An encoder triggers image acquisition to ensure constant speed and simultaneous acquisition with two cameras; and
[0060] Figure 5 Two examples of planar calibration objects with circular control points are shown. DETAILED DESCRIPTION
[0061] In a preferred embodiment of the present invention, the system includes two telecentric line scan cameras 401 (see Figure 4 ) for acquiring images of the 3D object 403 to be reconstructed. In an alternative embodiment of the present invention, the system includes a multi-view setup of at least two telecentric line scan cameras. A multi-view setup of more than two cameras may be helpful, for example, to expand the area in the reconstructible world. Therefore, the proportion of the obscured object portion may also be minimized. Alternatively or additionally, a larger number of cameras may improve the accuracy of the 3D reconstruction due to observing certain parts of the object from multiple directions. Within the scope of the present disclosure, "two or more cameras" does not necessarily mean that two or more physical cameras must be used. Instead, two or more cameras can also be implemented by using only a single physical camera and using this camera to acquire images from different angles. For example, a single telecentric line scan camera can be mounted on a robot arm that follows multiple different predetermined paths to implement multiple cameras.
[0062] Furthermore, in a preferred embodiment, the system additionally comprises a device 404 that performs a relative motion of the 3D object relative to the telecentric line scan camera. In a preferred embodiment, the device performs a linear motion at a constant speed, for example by a linear motion slide, a conveyor belt or by other linear actuators. In an alternative embodiment, a linear motion of variable speed can be used. In the latter case, an encoder 406 that triggers 407 image acquisition is used to ensure equidistant image acquisition. Thereby, variable speed motion can be easily converted into constant speed motion. Therefore, by using an encoder, the camera model assuming a constant speed can also be applied to applications in which a device for achieving relative motion is used that does not provide a constant speed motion.
[0063] In a preferred embodiment, the system additionally comprises a computer configured to perform a method comprising seven steps described in detail below. Steps 1 to 3 deal with calibration of the system and are performed offline, i.e. after setting up the system and before acquiring an image of the 3D object to be reconstructed. The individual steps of the offline phase are Figure 1 Steps 4 to 7 are performed online, including image acquisition of the 3D object, telecentric image correction, disparity estimation, and actual 3D reconstruction. The individual steps of the online stage are as follows Figure 2 shown.
[0064] Get a collection of telecentric line scan calibration images
[0065] In a first step 101, one or more telecentric line scan calibration images are acquired with each telecentric line scan camera. In a preferred embodiment of the invention, the calibration images are images of the calibration objects. In alternative embodiments of the invention, uncalibrated stereo methods are applied, for which the calibration images do not necessarily need to contain calibration objects. When calibration objects are used, the pose of the calibration objects varies from calibration image to calibration image. The calibration objects have a plurality of control points with 3D coordinates in known world units (world coordinates). In a preferred embodiment, a planar calibration object with circular control points is used (Steger et al., 2018, Chapter 3.9.4.1). In an alternative embodiment, a planar calibration object with a chessboard design is used. Other designs of calibration objects may be easily used without departing from the scope of the invention. If a planar calibration object is used, at least two telecentric line scan calibration images are generally necessary to unambiguously determine all camera parameters (see below). In an alternative embodiment, a single telecentric line scan calibration image is used to determine a subset of camera parameters while keeping the remaining camera parameters at fixed values. In another alternative embodiment, a 3D calibration object is used. In contrast to a planar calibration object, the control points of a 3D calibration object are not in the same plane. Depending on the design of the 3D calibration object, it is also possible to determine all camera parameters using a single calibration image.
[0066] Telecentric line scan calibration images are acquired by performing a relative motion of the calibration object with respect to the telecentric line scan cameras. For each pose of the calibration object and each camera, the acquired 1D image lines are stacked on top of each other, thereby generating a telecentric line scan calibration image. In a preferred embodiment, multiple telecentric line scan images of the planar calibration object are acquired with each telecentric line scan camera. In an alternative embodiment, a single telecentric line scan image is acquired with each telecentric line scan camera. As a result, in step 102, a set of telecentric line scan calibration images is obtained for each camera, wherein the set contains at least one image. For a meaningful calibration, it is important that all images are acquired by performing the same relative motion.
[0067] Camera Calibration
[0068] In a second step (103), a camera calibration is performed based on the telecentric line scan calibration images. For this purpose, a suitable camera model is defined that accurately describes the image creation process and one or more relative poses between the cameras. In a preferred embodiment, the 2D positions of the visible control points of the calibration object are automatically measured in the telecentric line scan calibration images (image coordinates). Furthermore, the correspondence between the measured 2D image points and the 3D points of the calibration object is automatically determined (Steger et al., 2018, Chapter 3.9.4.1). In an alternative embodiment, the 2D image points are manually measured by the user in the calibration images and the correspondence is also specified by the user. The parameters of the camera model (camera parameters) are determined by minimizing the error associating the 2D coordinates of the image points of the control points extracted in the telecentric line scan calibration images with the 3D coordinates of the corresponding points of the calibration object.
[0069] In the following, a camera model suitable for calibrating a system of arbitrary number (multi-view setup) of telecentric line scan cameras is described in detail.
[0070] The camera model of the multi-view setup of the telecentric line scan camera is based on the camera model of the multi-view setup of the area scan camera. Therefore, first, the camera model for the multi-view setup of the area scan camera is reviewed.
[0071] Camera model for multi-view setup of area scan cameras
[0072] The camera model for the area scan camera is based on the description in (Steger 2017, Section 6.1). It is able to use n c The camera models the multi-view setting. To calibrate the camera, n calibration objects in different poses are used. o Image. Each pose l(l=1,...,n o) defines the point transformation from the calibration object coordinate system to the camera coordinate system of the reference camera r. In the following, we will assume r = 1 without loss of generality, since we can renumber the cameras arbitrarily. Let p o =(x o ,y o ,z o ) Τ represents a point in the calibration object coordinate system. The transformation of a point from the calibration object coordinate system to the reference camera coordinate system can be described as:
[0073] p l =R l p o +t l (1)
[0074] Among them, t l =(t l,x ,t l,y ,t l,z ) T is the translation vector, and R l is the rotation matrix. R l Parameterized by Euler angles to R l =R x (α l )R y (β l )R z (γ l ). This transformation is called the exterior orientation.
[0075] Then point p l Transform to camera k (k = 1, ..., n c )’s camera coordinate system:
[0076] p k =R k p l +t k (2)
[0077] Among them, R k =R x (α k )R y (β k )R z (γ k ) and t k =(t k,x ,t k,y ,t k,z ) T describes the relative pose of camera k relative to camera 1. Therefore, according to the above convention, for k = 1, R k =I and t k= 0. Therefore, if we only calibrate a single camera, the transformation in (2) is redundant and can be omitted.
[0078] Other parameterizations of transformations or rotations may be used without departing from the scope of the present invention, such as axis-angle parameterizations, quaternions, etc.
[0079] Next, point p k =(x k ,y k ,z k ) Τ Projected into the image plane (image plane coordinate system). For a centripetal lens, the projection is given as follows:
[0080]
[0081] where c is the principal distance of the lens. For a telecentric lens, the projection is given by:
[0082]
[0083] Where m is the magnification of the lens.
[0084] Then, the undistorted point (x u ,y u ) T is distorted into a point (x d ,y d ) T In a preferred embodiment of the present invention, one of the following two distortion models is applied (Steger 2017, Section 6.1; Steger et al., 2018, Chapter 3.9.1.3): the division model (Lenz and Fritsch, 1990; Lanser, 1997; Blahusch et al., 1999; Fitzgibbon 2001; Steger 2012) and the polynomial model (Brown 1966, 1971).
[0085] In the division model, the undistorted point (x u ,y u ) T Calculate according to the distortion point using the following formula:
[0086]
[0087] in, The division model can be inverted analytically:
[0088]
[0089] in The division model only supports radial distortion.
[0090] The polynomial model supports radial and tangential distortion. The undistorted point is calculated as follows:
[0091]
[0092] The polynomial model cannot be inverted analytically. The computation of the distorted points from the undistorted points must be performed by a digital root finding algorithm.
[0093] A different distortion model may easily be applied without departing from the scope of the invention, for example because it better fits the distortion of the used lens than a division or polynomial model.
[0094] Finally, the distorted point (x d ,y d ) T Transform to image coordinate system:
[0095]
[0096] Among them, s x and y represents the pixel pitch on the sensor, (c x ,c y ) T is the principal point. The x-coordinate refers to the horizontal axis in the image (increasing to the right), and the y-coordinate refers to the vertical axis (increasing downward).
[0097] Therefore, the camera model of a telecentric area scan camera consists of the following camera parameters:
[0098] Six parameters of the external direction (in n o Model the pose of the calibration object in the image): α l , β l , γ l , t l,x , t l,y , and t l,z .
[0099] ·n c Six parameters of the relative orientation of the camera with respect to camera 1: α k , β k , γ k , t k,x , t k,y , and t k,z .
[0100] The interior direction of each camera (for simplicity, we omit the superscript k here): c or m; κ or K1, K2, K3, P1, P2; s x ,sy , c x , c y .
[0101] The calibration of the camera model is described in detail in (Steger 2017, Sections 9 and 10).
[0102] The above parameterization is very intuitive for machine vision users (Steger 2017, Section 6.1). All parameters have easy-to-understand physical meanings. x and x The approximate initial values of the internal orientation parameters can be read from the data table of the lens (c or m), or can be easily obtained in other ways (the initial value of the principal point can be set to the center of the image, and the distortion coefficients can usually be set to 0). In addition, the calibration results are easy to check for validity.
[0103] Camera model for a single centripetal line scan camera
[0104] The camera model for a telecentric line scan camera is based on the camera model for a centripetal line scan camera, which was first described in (MVTec Software GmbH 2005a, b). Therefore, in this section, the camera model for a single centripetal line scan camera is reviewed. Details of the camera model for a centripetal line scan camera can also be found in (Steger et al., 2018, Chapter 3.9.3). The camera model assumes a single centripetal line scan camera. This model is then extended to a single telecentric line scan camera and subsequently to a multi-view setup for a telecentric line scan camera.
[0105] exist Figure 3 The model of a single centripetal line scan camera is visualized in . The model assumes that the relative motion between the line scan camera 301 and the object 307 is linear and constant in velocity. Therefore, the motion vector v in the camera coordinate system can be expressed as x ,v y ,v z ) T 306 to describe the camera motion. The vector v is described in meters per scan line in the (reference) camera coordinate system (i.e., in mPixels). -1 ). This definition of v assumes a moving camera and a stationary object. If the camera is stationary and the object is moving, for example on a conveyor belt, a negative motion vector -v can be used.
[0106] The origin of the camera coordinate system 303 is located at the center of the entrance pupil of the lens. The x-axis is parallel to the sensor line and perpendicular to the z-axis. The y-axis is perpendicular to the sensor line and to the z-axis. It is oriented so that the motion vector has a positive y-component, i.e., if a stationary object is assumed, the y-axis points in the direction of the camera motion.
[0107] As with the area scan camera, the transformation from the calibrated object coordinate system 302 to the camera coordinate system 303 is given by (1). In contrast to the area scan camera, the exterior direction refers only to the first line of the image. Since the camera moves relative to the object, the exterior direction is different for each line. However, because we assume linear motion, the motion vector v can be used to calculate the exterior direction for all lines. Therefore, a single exterior direction is sufficient.
[0108] For the highest measurement accuracy, the camera model should support line scan cameras, since their sensor lines are not perfectly aligned with the optical axis. Therefore, the sensor line is modeled as a specific line of the virtual area scan camera. We use the principal point (c x ,c y ) T The misalignment is modeled (304). y The semantics of the camera are slightly different from those of an area scan camera: y = 0 means that the sensor line is perfectly aligned with the optical axis in the y direction. The principal point defines the origin of the image plane coordinate system.
[0109] The remaining parameters of the camera model are the same as those of the area scan camera (see above): c is the principal distance 308, the lens distortion is described by (5) or (7), s x 309 and s y 310 describes the pixel pitch on the sensor.
[0110] To calculate a given point p in the camera coordinate system k For the projection, we can use p k Along the straight line p k -tv moves, where t represents the number of scan lines acquired since the first scan line. As the point moves, if it projects to point p on the sensor line s =(x s ,0) T , then it must intersect the ray from the image point at some point. The above definition of the principal point implies that the y coordinate of the point on the sensor line is 0. To obtain the ray (311) for the concentric camera, (8) is inverted:
[0111]
[0112] The lens distortion is then corrected by applying (5) or (7) to obtain the undistorted coordinates in the image plane coordinate system (304). For a centripetal lens, the rays are given by:
[0113] (0,0,0) T +λ(x u ,y u ,c) T(10)
[0114] Let us assume that point p is s Transformed into the distorted image point p d , that is, (x d ,y d ) T =(s x (x s -c x ),-s y c y ) T . Furthermore, let us call the undistorted function u(p) = (u x (x d ,y d ),u y (x d ,y d )) T . The intersection of the moving point and the ray then yields the following system of equations:
[0115]
[0116] For the division model (5), the system of equations is specifically used to:
[0117]
[0118] in
[0119] For the division and polynomial distortion model, the system of equations (11) is a polynomial system of equations. It is necessary to d Solve. The system of equations (12) for the solution model can be solved analytically, while the system of equations for the polynomial system can be solved numerically. Once t and x are determined d , we can transform the point to the image coordinate system by the following formula:
[0120]
[0121] Therefore, the interior orientation of a line scan camera with a centripetal lens is given by the following parameters: c; κ or K1, K2, K3, P1, P2; s x ,s y , c x , c y , v x , v y , and v z Thus, in a preferred embodiment of the invention, the motion vector v is part of an interior direction, since it affects the projection of a given point in the camera coordinate system (see (11)). In an alternative embodiment of the invention, the motion vector is part of an exterior direction.
[0122] It is important to note that for a centripetal line scan camera, if c y ≠ 0, it is not possible to completely remove lens distortion. In this case, the rays for the image point do not project to a single point in the rectified image. Therefore, completely removing lens distortion requires that 3D reconstruction is usable, since we can reconstruct a unique 3D point that can be projected into the rectified image.
[0123] Camera model for a single telecentric linescan camera
[0124] The first part of the camera model for a single telecentric line scan camera is the same as the first part of the camera model for a single centroidal line scan camera: points are transformed from the calibration object coordinate system to the camera coordinate system via (1) and (2). k Projected into the image, the same method is used for a centripetal line scan camera: the line on which the point moves intersects the ray of light from the point it is projected onto. The equation for the ray of light from a telecentric lens is given by
[0125] (x u / m,y u / m,0) T +λ(0,0,1) T (14)
[0126] This leads to the following system of equations:
[0127] u x (x d ,y d ) / m=x k -tv x (15)
[0128] u y (x d ,y d ) / m=y k -tv y (16)
[0129] λ=z k -tv z (17)
[0130] where u(p)=(u x (x d ,y d ),u y (x d ,y d )) T The definition of is the same as in the concentric case. It can be seen that λ does not appear in (15) and (16). Therefore, z k and v zNeither affects the projection, and (17) can be omitted. Therefore, a line scan camera with a telecentric lens performs orthogonal projection, similar to an area scan camera with a telecentric lens.
[0131] For the polynomial model, (15) and (16) are d A system of polynomial equations of degree 7 is defined in and t. Therefore, these equations cannot be solved analytically, that is, a numerical root-finding algorithm must be used to solve them. However, for the division model, an analytical solution is available. Applying (15) and (16) specifically to the division model yields the following system of equations:
[0132] ux d / m=x k -tv x (18)
[0133] uy d / m=y k -tv y (19)
[0134] Among them again Because of y d =-s y c y is a constant, so (19) can be solved for t:
[0135]
[0136] Substituting (20) into (18) and according to x d The power of the result sorts the terms:
[0137]
[0138] Item x k -y k v x / v y is the line (x k ,y k ) T -t(v x ,v y ) T intersects the x-axis (or in 3D the line (x k ,y k ,z k ) T -t(v x ,v y ,v z ) T The x coordinate of the point where it intersects the plane xz. Let x0:=x k -y k vx / v y .item For x d = the reciprocal of the undistorted factor u with 0. Let Using the definitions of x0 and d0, as follows:
[0139]
[0140] Therefore, for κ ≠ 0 and x0 ≠ 0, we have:
[0141]
[0142] For κ = 0 or x0 = 0, (22) simplifies to a linear equation. We examine these two cases in turn. For x0 = 0, we have:
[0143]
[0144] In both cases, x obtained from (23) and (24) d Inserting the value of into (20) will return the value of t. For κ = 0, we have:
[0145]
[0146] In this case, (20) can be simplified to:
[0147]
[0148] For κ = 0, y d , that is, c y , is meaningless. Therefore, if we know a priori that κ=0, c y (and, therefore, y d ) should be set to 0, which further simplifies the equation to:
[0149]
[0150]
[0151] If there is lens distortion, then from (23) we can see that there are two possible solutions that can be projected into the image, while in the absence of distortion, then from (24) and (25) we can see that there is a unique solution. It can be shown that the correct solution to (23) is always given by:
[0152]
[0153] The image point (x i ,y i ) TFirst, invert (13):
[0154]
[0155] Next, for (x k ,y k ) T Solve (15) and (16):
[0156] x k =u x (x d ,y d ) / m+tv x (31)
[0157] y k =u y (x d ,y d ) / m+tv y (32)
[0158] where y d =-s y c y . The light is given by:
[0159] (x k ,y k ,0) T +λ(0,0,1) T (33)
[0160] Compared to a line scan camera with a centripetal lens, for a line scan camera with a telecentric lens, the lens distortion can be completely eliminated because (15) and (16) do not depend on z k . Given an image point (x i ,y i ) T , we can use (30)-(32) to calculate the corresponding point (x k ,y k ) T This point can then be projected into the rectified camera with all distortion coefficients set to 0. In addition, the point can be projected into the rectified camera with all distortion coefficients set to 0. x Set to min(s x ,mv y ), then v y Set to s x / m to remove any skew in the pixels. This method ensures that no aliasing will occur when the image is corrected.
[0161] Calibration of a single telecentric line scan camera
[0162] Camera calibration is the process of determining the camera parameters, i.e. the parameters of the internal and external directions in the case of a single telecentric line scan camera. The camera is calibrated by using a calibration object. The calibration object contains a sufficient number of control points whose 3D world coordinates must be known. As described in the background of the invention, different types of calibration objects can be used for this task. In a preferred embodiment of the invention, a planar calibration object with circular control points is used. Two examples of this type of calibration object are shown in FIG. Figure 5 As shown. Although in the following description, a planar calibration object with circular control points is used for illustration purposes, other calibration objects may be used for calibration without departing from the scope of the present invention. In an alternative embodiment, for example, a planar calibration object with a checkerboard pattern is used for calibration. In another alternative embodiment, a 3D calibration object is used, where the control points are not limited to being located in a single plane.
[0163] Let the known 3D coordinates of the center of the control point of the calibration object be represented by p j (j=1,...,n m , where n m Indicates the number of control points on the calibration object. The user obtains the n o image. Let's use e l (l=1,...,n o ) denotes the external orientation parameters of the calibration object in image l, i denotes the internal orientation parameters of the camera, and π denotes the projection of a point in the calibration object coordinate system to the image coordinate system (see above). In addition, if a control point j of observation l of the calibration object can be seen by the camera, then let ν jl is a function of 1, otherwise it is a function of 0. Finally, let p jl represents the position of control point j in image l. Then, the camera is calibrated by minimizing the following function:
[0164]
[0165] Minimization is performed by using an appropriate optimization algorithm (e.g., Gauss-Newton algorithm, gradient descent algorithm, Levenberg-Marquardt algorithm or similar method). In a preferred embodiment of the present invention, a suitable version of the sparse Levenberg-Marquardt algorithm described in (Hartley and Zisserman, 2003, Appendix A6) is used.
[0166] When using a planar calibration object with circular control points, the points p are extracted by fitting an ellipse (Fitzgibbon et al., 1999) to the edges extracted using a sub-pixel accurate edge extractor. jl(Steger 1998, Chapter 3.3; Steger 2000). As discussed by Steger (2017, Section 5.2) and Mallo and Whelan (2007), this leads to a bias in the point positions. Since telecentric linescan cameras perform orthographic projection, there is no perspective bias, i.e., the bias consists only of distortion bias. The bias can be removed using the method described for centroidal linescan cameras by Steger (2018, Section 10).
[0167] The optimization of (34) requires initial values for the unknown camera parameters. Initial values for the internal orientation parameters, except for the motion vectors, can be obtained from the specifications of the camera and lens, as described in the section Camera Model for Multiview Setup for Area Scan Cameras. In contrast to area scan cameras, c is usually y = 0 is used as the initial value. The usual v is known from the considerations leading to the line scan camera setup y Finally, we can usually x Set to 0. Using the known initial value of the interior direction, the image point p can be converted to jl Transformed into metric coordinates in the camera coordinate system. This allows the OnP algorithm described by Steger (2018) to obtain an estimate of the exterior orientation of the calibrated object.
[0168] Model Degradation
[0169] The parameters of the telecentric line scan camera model are too large. m and s x The values of cannot be determined simultaneously. This can be done by fixing s at a user-specified initial value. x In addition, like the centripetal line scan camera, s y It is only used to specify the principal point in pixels, so it remains fixed at the initial value specified by the user.
[0170] Like a telecentric surface scan camera, (c x ,c y ) T is defined only by the lens distortion of the telecentric line scan camera. If there is no lens distortion, then (c x ,c y ) T and (t l,x ,t l,y ) T has the same effect. Therefore, in this case, (c x ,c y ) T Should remain fixed at an initial value specified by the user (usually, c x is set to the horizontal image center and c y set to 0).
[0171] Like for centroidal linescan cameras, the parameters P1 and P2 of the polynomial distortion model are highly dependent on the other parameters of the telecentric linescan camera model, especially when the radial distortion is small. Therefore, they cannot usually be determined reliably. Therefore, in practice, they should be set to 0 and excluded from the calibration.
[0172] Since they have no effect on the projection, it is also impossible to determine t z and v z (See the Camera Model for a Single Telecentric Line Scan Camera section.) One possible solution to this problem is to leave v at the user-specified initial value. z And t z Set to 1m.
[0173] There is a v y Therefore, the user must specify v with the correct sign. y to ensure that the calibration converges to the correct solution.
[0174] Like telecentric surface scanning, the rotation of the pose of the planar calibration object can only be determined twice ambiguously. The two sets of pose parameters (α l ,β l ,γ l ) and (-α l ,-β l ,γ l ) (with the same translation vector) produce the same point in the image. If the correct external orientation of the object is required in the application, the user must resolve this ambiguity by choosing the correct pose based on prior knowledge.
[0175] The rotation and speed v of the plane calibration object around the x-axis can be y and pan t y In addition, the rotation of the plane calibration object around the y-axis can be combined with the magnification m, speed v x and pan t x Swap different values of .
[0176] A telecentric line scan camera cannot be fully calibrated from a single image of a planar calibration object. Therefore, if all parameters are to be determined unambiguously, the camera must be calibrated using multiple images of a planar calibration object with different exterior orientations.
[0177] In machine vision applications, it is sometimes important to calibrate all camera parameters from a single image. As shown in the above discussion, if a planar calibration object is used, this will result in camera parameters that differ from their true values. However, if the calibration residuals are small enough, a consistent camera geometry is obtained within the plane defined by the exterior orientation of the calibration object (and all planes parallel to it). Therefore, the image or features extracted from it can be corrected to this plane. On the other hand, algorithms that rely only on interior orientation (e.g., complete elimination of radial distortion) are less useful because of the uncertainty regarding m and v. y The ambiguity of implies that we cannot reliably undistort images or features extracted from images to have square pixels.
[0178] Camera model for a multi-view setup of a telecentric line scan camera
[0179] In order to perform stereo reconstruction using a line scan camera with a telecentric lens, a stereo setup of at least two cameras is required. To this end, the camera model for a single telecentric line scan camera described in the Camera model for a single telecentric line scan camera section is extended to the multi-view case. This can be done in a similar manner to an area scan camera, which is described in the Camera model for a multi-view setup for an area scan camera section. Therefore, at step 104, the camera model for a multi-view setup for a telecentric line scan camera includes the following camera parameters:
[0180] Six parameters of the external direction (in n o The pose of the modeled calibration object in the image): α l , β l , γ l , t l,x , t l,y , and t l,z .
[0181] ·n c Six parameters of the relative orientation of the camera with respect to camera 1: α k , β k , γ k , t k,x , t k,y , and t k,z .
[0182] The interior direction of each camera: m k κ k or K k,1 , K k,2 , K k,3 , P k,1 , P k,2 ;s k,x ,s k,y , c k,x , c k,y , vk,x , v k,y , and v k,z .
[0183] This camera model is able to model cameras that move independently relative to a fixed object. Therefore, each camera has a separate motion vector v k =(v k,x ,v k,y ,v k,z ) T .
[0184] Alternatively, if the cameras are mounted rigidly relative to each other and the object performs a motion relative to the cameras, the motion vectors of the individual cameras are related to each other by the respective relative directions. In this case, the camera model consists of only a single global motion vector v = (v x ,v y ,v z ) T , for example, the global motion vector is described in the camera coordinate system of a reference camera (eg, camera 1). In this case, the camera model consists of the following camera parameters (step 104):
[0185] Six parameters of the external direction (in n o The pose of the simulated calibration object in the image): α l , β l , γ l , t l,x , t l,y , and t l,z .
[0186] ·n c Six parameters of the relative orientation of the camera relative to camera 1: α k , β k , γ k , t k,x , t k,y , and t k,z .
[0187] The interior direction of each camera: m k κ k or K k,1 , K k,2 , K k,3 , P k,1 , P k,2 ;s k,x ,s k,y , c k,x , c k,y .
[0188] Motion vector of reference camera 1: v x , v y , and vz
[0189] As described in the section Camera Model for Multi-view Setup of Area Scan Cameras, we transform the point p in the camera coordinate system of the reference camera into l Transform to camera k (k = 1, ..., n c ) camera coordinate system. Therefore, the motion vector v of camera k can be obtained from the motion vector v of the reference camera by multiplying the motion vector v of the reference camera by the rotation matrix of the corresponding relative direction. k :
[0190] v k =R k v (35)
[0191] Calibration of a multi-view setup for a telecentric line scan camera
[0192] The multi-view setup of the telecentric line scan camera (103) is calibrated based on the calibration of a single telecentric line scan camera, which is described in the section on calibration of a single telecentric line scan camera. For the case where the cameras move independently relative to a fixed object, i.e., each camera is assigned a separate motion vector, the multi-view setup of the telecentric line scan camera can be calibrated, for example, by minimizing the following function:
[0193]
[0194] In contrast to the case of a single camera (see (34)), for camera n c If a control point j of observation l of the calibration object is visible in camera k, then ν jkl is a function of 1, otherwise it is a function of 0. In addition, p jkl represents the position of control point j in image l of camera k. Finally, r k (k=1,...,n c ) represents the relative orientation parameter of camera k relative to reference camera 1. Note that the interior orientation i of camera k k Also includes the motion vector v for each camera k .
[0195] For the case where the cameras are rigidly mounted relative to each other and the object moves relative to the cameras, for example a multi-view setup of a telecentric line scan camera can be calibrated by minimizing the following function:
[0196]
[0197] In this case, the motion vector of the reference camera v is a global parameter in the optimization. It is transformed to camera k by applying (35) with the parameters of the rotation part of the relative orientation.
[0198] In an alternative embodiment, by observing p jkl Individual weights are introduced to perform the minimization, for example to take into account knowledge about the accuracy of the observations during optimization. Furthermore, in (36) and (37), the error is minimized in the image coordinate system. In an alternative embodiment, the minimization is performed in the image plane coordinate system, as described by Steger (2018, Section 3.9.4.2) for calibrating area scan cameras.
[0199] As a result of the calibration, the values of the camera parameters are obtained (step 104). The camera parameters include parameters of the internal and relative directions of all cameras and parameters of the absolute directions of the calibrated objects in all images. Furthermore, in the case of a single motion vector, the camera parameters additionally include the three components of the global motion vector, since in this case the motion vector is not part of the individual internal directions.
[0200] It can be easily appreciated that the calibration of two cameras is a special case of the described multi-camera calibration. Therefore, a detailed description would be redundant and is therefore omitted in this description. Furthermore, the camera model and calibration can be easily extended to support arbitrary mixtures of individual and global motion vectors. An example application where mixed motion vectors are useful is a three-camera system where two of the three cameras are rigidly connected to each other so that the two cameras share the same motion vector when the third camera undergoes a separate motion.
[0201] Calculation of telecentricity correction map
[0202] In a third step 105, based on the camera parameters resulting from the camera calibration, a telecentric correction map (106) is calculated, which corrects the telecentric line scan image pair of a pair of telecentric line scan cameras. Thus, in case of a multi-view setup with more than two cameras, a pair of telecentric line scan cameras will be selected for stereo reconstruction.
[0203] The telecentricity correction mapping describes the geometric transformation of a telecentric line scan image pair to the epipolar standard geometry, also known as stereo image correction. Thus, when the mapping is applied to a telecentric line scan image pair, the resulting corrected telecentric line scan image pair has no lens distortion and the corresponding image points are located in the same image row.
[0204] Conceptually, the first part of the calculation of the telecentric correction map is to remove the lens distortion, if any. As described in the Camera Model for a Single Telecentric Line Scan Camera section, for a line scan camera with a telecentric lens, it is possible to completely remove the lens distortion. Therefore, for each raw image of a telecentric line scan image pair, a map is calculated that contains the corresponding pixel in the raw image for each pixel in the corrected image. In the corrected image, all distortion coefficients are set to 0. In addition, for example, by setting sx Set to min(s x ,mv y ), then v y Set to s x / m, which removes any skew in the pixels. This ensures that there will be no aliasing when you correct the image.
[0205] The second part of the calculation of the telecentric correction map is the geometric transformation of the telecentric line scan image pair to the epipolar standard geometry. Due to the first part of the correction described above, it can be assumed that the telecentric line scan image pair is already free of lens distortion and pixel skew and has square pixels.
[0206] An important aspect of the present invention is the fact that a telecentric line scan camera without distortion can be represented as a telecentric area scan camera. More specifically, with parameter m l =m,s x,l =s x ,s y,l =s y ,c x,l =c x ,c y,l =c y ,v x,1 =0 and v y,1 =v y =s x A telecentric line scan camera with a resolution of 1000 x 1000 (see the camera model for a single telecentric line scan camera section) can be represented by a camera with parameters m. a =m,s x,a =s x ,s y,a =s x ,c x,a =c x , and c y,a =c y s y / s x A telecentric area scan camera representation is shown in Figure 1 (see the Camera Model for Multi-View Setups with Area Scan Cameras section). This allows us to use the existing stereo reconstruction functionality for telecentric area scan cameras as well as telecentric line scan cameras.
[0207] In addition to the telecentricity correction map, the calibrated camera parameters of the telecentric line scan camera are returned from this step. These camera parameters are denoted as calibrated camera parameters (step 107).
[0208] In a preferred embodiment of the invention, the existing stereo reconstruction functionality for telecentric area scan cameras is used to correct the telecentric line scan images to the epipolar standard configuration. For example, when using the software HALCON (MVTec Software GmbH, 2019), the operator gen_binocular_rectification_map calculates a suitable correction map. Optionally, the affine fundamental matrix (Hartley and Zisserman, 2003, Chapter 14.2) is calculated and the image is transformed to the epipolar standard configuration by the method described in (Hartley and Zisserman, 2003, Chapters 11.12). Explicit methods for calculating the epipolar correction transformation are given by Morgan et al. (2006) and Liu et al. (2016).
[0209] Although both correction parts (correction of lens distortion and correction to epipolar standard geometry) can be performed consecutively, in a preferred embodiment of the invention, they are combined into a single correction step. The advantage of the combination is that the calculation time is less than performing them separately, because only a single (instead of two) telecentric correction maps need to be applied in the online stage.
[0210] In a preferred embodiment of the present invention, the first three steps described above are performed offline after the system is set up. Therefore, these three steps need to be re-executed only when the camera settings are changed and this change affects the parameters estimated during the camera calibration. The telecentricity correction map is stored for later use in the online stage. In a preferred embodiment, the correction map is stored as a lookup table (LUT) to enable effective correction in the online stage. The LUT stores the position of the corresponding pixel in the original telecentric line scan image for each pixel in the corrected telecentric line scan image. The LUT can optionally contain weights for appropriate gray value interpolation to obtain a higher quality corrected image, resulting in a higher accuracy of the final 3D reconstruction.
[0211] Get telecentric line scan image pairs of 3D objects
[0212] In a fourth step (201), the online phase starts with acquiring telecentric line scan images of the 3D object to be reconstructed by using the setup previously calibrated with the methods described in the first three steps. Since at least two cameras are necessary for 3D reconstruction, in a preferred embodiment, a pair of telecentric line scan images with a pair of telecentric line scan cameras is acquired (203). For the reconstruction of the 3D object, a single image pair is sufficient. In an alternative embodiment, a pair of telecentric line scan images is selected from a multi-view setup of more than two telecentric line scan cameras (203). Each telecentric line scan image is created by performing a relative motion in the same way as performed during the acquisition of the telecentric line scan calibration images in the first step.
[0213] Correction of telecentric line scan image pairs
[0214] In a fifth step 204, the acquired telecentric line scan image pair of the 3D object to be reconstructed is corrected by using the telecentric correction mapping (106 / 202) calculated in step three 105 for the corresponding pair of telecentric line scan cameras. In a preferred embodiment of the present invention, the correction is effectively performed by applying the LUT calculated in step three. For example, when using the software HALCON (MVTec Software GmbH, 2019), the operator map_image can be used to apply the telecentric correction mapping. As a result, a corrected telecentric line scan image pair (205) is obtained. Corresponding points in the corrected telecentric line scan image pair are located in the same image row. In addition, the resulting corrected telecentric line scan image pair has no lens distortion.
[0215] Compute disparity from corrected telecentric line scan image pairs
[0216] In a sixth step 206, the disparity (208) from the resulting corrected telecentric line scan image pair 205 is calculated by one of the different available stereo matching methods using epipolar standard geometry (see Binocular Stereo - Stereo Matching section). In a preferred embodiment of the present invention, a method for dense disparity estimation is applied, resulting in a disparity image containing a disparity value for each defined pixel. For example, in the case of occlusions or in low-texture image parts, undefined pixels may appear, where the corresponding pixel cannot be reliably determined. In an alternative embodiment, the disparity is calculated for a selected set of pixels. In a preferred embodiment, a dense disparity estimation method based on template matching is applied (Steger et al., 2018, Chapter 3.10). In another preferred embodiment, a dense disparity estimation method based on variational methods is applied. Such a method is able to calculate disparity even in low-texture image areas. Due to the modular structure of the method described in the present invention, other alternative disparity estimation methods can be easily integrated without departing from the scope of the present invention.
[0217] The disparity of a 3D point is closely related to its distance from the calibrated camera (see next section). Hence, in a preferred embodiment of the invention, the calculated disparity represents a reconstruction of the 3D object.
[0218] Parallax to distance conversion
[0219] In a seventh step 209, the disparity 208 calculated in the sixth step 206 is converted into a distance (step 210). For this conversion, the corrected camera parameters obtained in the third step 105 are used (step 107 / 207).
[0220] Since the rectified telecentric line scan image pairs are free of lens distortion, each rectified line scan image can be interpreted as an image of an affine camera (Hartley and Zisserman, 2003, Chapter 6.3.4). Therefore, standard algorithms for triangulation (Hartley and Zisserman, 2003, Chapter 14.4) and affine reconstruction (Hartley and Zisserman, 2003, Chapter 14.5) can be used for distance calculations. The distances are usually obtained in the coordinate system of the rectified telecentric line scan image pairs, i.e., they represent the distance of a point to a plane defined by the y-axis of the rectified camera and its baseline.
[0221] In a preferred embodiment, the distance is calculated for each defined pixel in the disparity image, thereby generating a distance image. Disparity implicitly represents corresponding points in the two corrected images. Converting disparity values into distance values is equivalent to intersecting two lines of sight of corresponding points (Steger et al., 2018, Chapter 3.10.1.5). The first line of sight is defined by the point position in the first corrected image and the direction of the optical axis of the first corrected camera. The second line of sight is defined by the point position in the second corrected image and the direction of the optical axis of the second corrected camera. The point position in the second image is obtained as follows: due to the epipolar standard configuration, its row coordinates are the same as the row coordinates in the first image. The column coordinates in the second image correspond to the column coordinates of the first image modified by the disparity values (Steger et al., 2018, Chapter 3.10.1.5).
[0222] In another preferred embodiment, the range image (step 210) represents a reconstruction of the 3D object. In an alternative embodiment, the distance values are further converted to 3D coordinates (step 210) based on their row and column coordinates in the range image and the internal orientation based on the corrected camera parameters (step 107 / 207). For example, the 3D coordinates are stored in a coordinate image with three channels. Alternatively, the 3D coordinates can be stored in a suitable model representation data structure of the 3D object.
[0223] In another preferred embodiment, the reconstructed distance values or reconstructed 3D coordinates, respectively, are transformed back to the coordinate system of one of the original cameras (eg, the reference camera).Such a rigid 3D transformation can be obtained from the relative orientation of the corrected camera parameters and the relative orientation of the original camera parameters.
[0224] Although several particular embodiments of the present invention have been described in detail, various modifications to the preferred embodiments may be made without departing from the spirit and scope of the present invention. Therefore, the above description is not intended to limit the present invention, except as indicated in the appended claims.
[0225] Citations
[0226] · G. Blahusch, W. Eckstein, C. Steger, S. Lanser: Algorithms and evaluation of a high precision tool measurement system. In: 5th International Conference on Artificial Vision Quality Control (5 th International Conference on QualityControl by Artificial Vision), 31-36, 1999.
[0227] DC Brown: Decentering distortion of lenses. Photogrammetric Engineering, 32(3): 444-462, 1966.
[0228] DC Brown: Close-range camera calibration. Photogrammetric Engineering, 37(8): 855-866, 1971.
[0229] · MZ Brown, D. Burschka, and GD Hager: Advances in computational stereo. IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(8), 993–1008, 2003.
[0230] R.Calow, T.Ilchev, E.Lilienblum, M.Schnitzlein and B.Michaelis: Fast line sensor system for simultaneous detection of color and 3D shape (SchnellesZeilensensorsystem zur gleichzeitigenErfassung von Farbe und 3D-Form). In: F.P.León, M.Heizmann (eds.), Forum Bildverarbeitung, KIT Scientific Publishing, Karlsruhe, 181-192, 2010.
[0231] A. Fitzgibbon, M. Pilu, RB Fisher: Direct least square fitting of ellipses. IEEE Transactions on Pattern Analysis and Machine Intelligence, 21(5): 476–480, 1999.
[0232] AW Fitzgibbon: Simultaneous linear estimation of multiple view geometry and lens distortion. In: IEEE Conference on Computer Vision and Pattern Recognition, vol. 1, pp. 125-132, 2001.
[0233] R. Gerdes, R. Otterbach, R. Kammüller: Calibration of digital image processing systems with CCD cameras Part 1: Modeling and procedures. Technisches Messen, 60(6), 255-261, 1993.
[0234] SX Godber, M. Robinson, JP E vans: Line-scan sensor: an alternative sensor modality for the extraction of three-dimensional coordinate information. Optical Engineering 34(10): 3044-3054, 1995.
[0235] · R. Gupta, RI Hartley: Linear pushbroom cameras. IEEE Transactions on Pattern Analysis and Machine Intelligence, 19(9): 963–975, 1997.
[0236] AF Habib, MF Morgan, S. Jeong, KOKim: Epipolar geometry of line cameras moving with constant velocity and attitude. ETRI Journal 27(2): 172–180, 2005a.
[0237] AF Habib, M. Morgan, S. Jeong, KOKim: Analysis of epipolar geometry in linear array scanner scenes. The Photogrammetric Record 20(109): 27-47, 2005b.
[0238] R. Hartley, A. Zisserman: Multiple View Geometry in Computer Vision, 2nd ed., Cambridge University Press, Cambridge, 2003.
[0239] T. Ilchev, E. Lilienblum, B. Joedicke, B. Michaelis, M. Schnitzlein: A stereo line sensor system to highspeed capturing of surfaces in color and 3D shape. In: P. Richard, M. Kraus, R. S. Laramee, J. Braz (eds.), International Conference on Computer Graphics Theory and Applications, 809–812, 2012.
[0240] T. Kim: A study on the epipolarity of linear pushbroom images. Photogrammetric Engineering & Remote Sensing 66(8): 961–966, 2000.
[0241] S. Lanser, C. Zierl, R. Beutlhauser: Multi-image calibration of CCD cameras in pattern recognition, in Mustererkennung (ed. G. Sagerer, S. Posch, F. Kummert), Springer-Verlag, Berlin, Informatik aktuell, 481-491, 1995.
[0242] S. Lanser: Model-based localization based on monocular video images (ModellbasierteLokalisation gestützt auf monokulare Videobilder), PhD thesis, Forschungs- und LehreinheitInformatik IX, Technical University of Munich. Shaker Verlag, Aachen, 1997.
[0243] · R. Lenz, D. Fritsch: Accuracy of videometry with CCD sensors. ISPRS Journal of Photogrammetry and Remote Sensing, 45(2), 90-110, 1990.
[0244] E. Lilienblum, A. Al-Hamadi: A structured light approach for 3-D surface reconstruction with astereo line-scan system. IEEE Transactions on Instrumentation and Measurement, 64(5): 1266–1274, 2015.
[0245] H. Liu, Z. Zhu, Y. L. Yao, J. Dong, S. Chen, X. Zhang, Y. Shang: Epipolar rectification method for a stereovision system with telecentric cameras. Optics and Lasers in Engineering, 83: 99–105, 2016.
[0246] J. Mallon, PF Whelan: Which pattern? Biasing aspects of planar calibration patterns and detection methods. Pattern Recognition Letters 28(9): 921-930, 2007.
[0247] M. Morgan, KOKim, S. Jeong, A. Habib: Epipolar resampling of space-borne linear array scanner scenes using parallel projection. Photogrammetric Engineering & Remote Sensing 72(11): 1255–1263, 2006.
[0248] MVTec Software GmbH: HALCON Application Note: Machine Vision in World Coordinates. HALCON Version 7.1, 2005a.
[0249] MVTec Software GmbH: HALCON / HDevelop Reference Manual. HALCON Version 7.1, 2005b.
[0250] MVTec Software GmbH: HALCON / HDevelop Reference Manual. HALCON Version 19.05, 2019.
[0251] D. Scharstein, R. Szeliski: Ataxonomy and evaluation of dense two-frame stereo correspondence algorithms. International Journal of Computer Vision, 47(1-3), 7-42, 2002.
[0252] C. Steger C: Unbiased extraction of curvilinear structures from 2D and 3D images. PhD, Technical University of Munich, 1998.
[0253] C. Steger: Subpixel-precise extraction of lines and edges. In: International Archives of Photogrammetry and Remote Sensing, Volume XXXIII, Part B3, pp. 141–156, 2000.
[0254] C. Steger: Estimating the fundamental matrix under pure translation and radial distortion. ISPRS Journal of Photogrammetry and Remote Sensing, 74: 202–217, 2012.
[0255] Carsten Steger: A Comprehensive and Versatile Camera Model for Cameras with Tilt Lenses; In: International Journal of Computer Vision 123(2), 121-159, June 2017.
[0256] Carsten Steger, Markus Ulrich, Christian Wiedemann: Machine Vision Algorithms and Applications; Wiley-VCH, Weinheim, 2nd edition, 2018.
[0257] B. Sun, J. Zhu, Lang Yang, S. Yang, Y. Guo: Sensor for in-motion continuous 3D shape measurement based on dual line-scan cameras. Sensors, 16(11): 1949–1–1949–15, 2016.
[0258] B. Sun, J. Zhu, L. Yang, Y. Guo, J. Lin: Stereo line-scan sensor calibration for 3D shape measurement. Applied Optics, 56(28): 7905-7914, 2017.
[0259] M. Ulrich, C. Steger: A camera model for cameras with hypercentric lenses and some example applications, Machine Vision and Appliations, 30(6): 1013-1028, 2019.
Claims
1. A method for reconstructing a 3D object using at least two telecentric line scan cameras and at least one device configured to perform relative motion of the 3D object with respect to the telecentric line scan cameras, thereby enabling acquisition of a telecentric line scan image, the method comprising the following steps: a) providing a set of telecentric line scan calibration images for each telecentric line scan camera, wherein the set comprises one or more images; b) performing camera calibration based on the set of telecentric line scan calibration images; c) calculating a telecentric correction map based on the camera calibration results, wherein the telecentric correction map corrects a pair of telecentric line scan images of a pair of telecentric line scan cameras; d) providing a pair of telecentric line scan cameras with a pair of telecentric line scan images of the 3D object; and e) correcting the telecentric line scan image pair using the telecentric correction map to generate a corrected telecentric line scan image pair.
2. The method according to claim 1, wherein the following additional steps are performed: f) Calculating a disparity from the corrected telecentric linescan image pair, wherein the disparity represents a reconstructed 3D object.
3. The method according to claim 2, wherein the following additional steps are performed: g) converting the disparity into distance, thereby producing a reconstruction of the 3D object.
4. The method according to claim 2, wherein the following additional steps are performed: g) converting the disparity into 3D coordinates, thereby producing a reconstruction of the 3D object. The method of claim 1 , wherein the relative motion is linear motion. The method of claim 5 , wherein the linear motion has a constant speed.
7. The method of claim 5, wherein the linear motion has a variable speed and the image acquisition of the telecentric linescan image is appropriately triggered to ensure a constant speed. The method according to claim 1 , wherein the calibration image is an image of a calibration object. The method according to claim 8 , wherein the calibration object is a planar calibration object.
10. The method of claim 8, wherein the calibration object is a 3D calibration object.
11. The method of claim 1 , wherein in the camera calibration, camera parameters are determined, the camera parameters comprising parameters for exterior orientation of the telecentric line scan calibration images, and for each telecentric line scan camera, parameters for relative orientation and interior orientation.
12. The method of claim 1, wherein the telecentric correction mapping corrects a pair of telecentric line scan images of a pair of telecentric line scan cameras to epipolar standard geometry.
13. The method of claim 1, wherein the telecentricity correction map is stored in a lookup table.
14. The method of claim 13, wherein correcting the telecentric line scan image pair comprises applying the lookup table to the telecentric line scan image pair.
15. The method of claim 2, wherein computing disparity from the corrected telecentric line scan pairs comprises generating a dense disparity estimate of a disparity image. The method of claim 3 , wherein converting the disparity to distance comprises computing a range image.
17. The method of claim 1, wherein the camera calibration is performed by applying a sparse Levenberg-Marquardt algorithm.
18. A system for reconstructing a 3D object using at least two line scan cameras, the system comprising: (a) at least two telecentric line scan cameras; (b) at least one device configured to perform relative motion of the 3D object with respect to the telecentric linescan camera; (c) a computer configured to: (c1) acquiring a set of telecentric line scan calibration images with each telecentric line scan camera while performing the relative motion, wherein the set comprises one or more images; (c2) performing camera calibration based on the set of telecentric line scan calibration images; (c3) calculating a telecentric correction map based on the camera calibration result, wherein the telecentric correction map corrects a pair of telecentric line scan images of a pair of telecentric line scan cameras; (c4) acquiring a pair of telecentric line scan images of the 3D object using a pair of telecentric line scan cameras while performing the relative motion; and (c5) Correcting the telecentric line scan image pair of the 3D object using the telecentric correction map to generate a corrected telecentric line scan image pair.
Citation Information
Patent Citations
Method for determining disperse optical parallax field of stereo vision
CN101356831A
Camera distortion correcting method based on square target model and perspective projection
CN103729841A
