A method for correcting camera installation angle
By setting a calibration image within the camera's field of view and performing an inverse affine transformation to calculate the minimum Euler distance, the problem of angle correction for area and line array cameras is solved, and image analysis accuracy and test efficiency are improved.
Patent Information
- Application Number
- CN202211600169.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-13
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-12-13
AI Technical Summary
Existing technologies make it difficult to efficiently correct the installation angles of area and line array cameras, resulting in increased image stitching misalignment and analysis errors. In addition, existing methods are difficult to implement or inefficient in actual operations.
The calibration image has a horizontal width twice the width of the camera's field of view and contains a flat edge. The image is scanned by a motion stage and an inverse affine transformation is performed. The minimum Euler distance of the flat edge boundary points is calculated to automatically correct the camera installation angle.
It achieves efficient installation angle correction for linear and area array cameras, reduces image distortion, and improves image analysis accuracy and test efficiency.
Smart Images

Figure CN116452668B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of automatic optical detection, and in particular to a method for correcting a camera installation angle. Background Art
[0002] In the field of automatic optical inspection technology, cameras, light sources, lenses, motion stages, and computing hardware are the main components of the inspection system. Each module can use different types according to different application scenarios, such as the shape, color, and coaxiality of the light source, the field of view, aperture, and telecentricity of the lens, the pixel resolution, linear array or area array of the camera, and the system architecture and real-time performance of the computing hardware.
[0003] Light sources, lenses, and cameras are the core inspection components of automated optical inspection systems. From the perspective of information flow, their main functions are electrical-to-optical signal conversion, optical signal superposition, and optical-to-electrical signal conversion. During the design phase, attention should be paid to parameters such as conversion efficiency and signal-to-noise ratio. During the assembly and debugging phase, the installation space freedom of each component should be considered so that the final assembly imaging effect can meet the design specifications. When an area array camera is used for inspection and the camera's field of view is larger than the size of the inspected workpiece, the camera's installation angle does not need to be considered because the image contains an undistorted image of the entire workpiece surface. However, as accuracy requirements increase, the camera's field of view is often smaller than the size of the inspected workpiece, despite fluctuations in workpiece size. In this case, an overall assessment of the workpiece surface requires splicing, analysis, and evaluation based on multiple scanned images. The scanning mode of the motion stage mostly adopts raster scanning, so the specific requirements for the camera's installation angle are: the camera pixel arrangement direction is perpendicular to the scanning motion direction of the motion stage. If there is a deviation in the camera installation angle on the pixel plane, an affine transformation (rotation transformation or shear transformation) will be generated between the final image and the real image of the workpiece surface, resulting in misalignment in the splicing of the final image, further increasing the error in the image analysis and evaluation results.
[0004] A checkerboard-based camera calibration method is often used in the field of machine vision. By capturing the image of a standard black and white checkerboard after camera imaging and extracting the coordinates of the checkerboard corners, the transformation matrix from the world coordinate system to the camera pixel coordinate system can be obtained. The intrinsic parameter transformation matrix and the extrinsic parameter transformation matrix can be further obtained. The intrinsic parameter matrix can generally be used to correct the distortion of the camera lens, while the extrinsic parameter matrix can be used to obtain the rotation and translation of the camera coordinate system relative to the black and white checkerboard world coordinate system. This camera calibration method is generally used in analysis applications based on a single image, such as workpiece size measurement with a monocular camera or stereo workpiece picking based on binocular camera images. If the same workpiece needs to be photographed from multiple angles and multiple cameras, a calibration image similar to the black and white checkerboard needs to be installed on the workpiece surface for multiple image registration. However, this method is not suitable for most automated optical inspection systems, that is, most workpiece surfaces cannot meet the requirement of including a calibration image in each field of view image.
[0005] Patent CN101365144A proposes a camera angle adjustment method based on a calibration image. This method places multiple equally spaced vertical lines and two parallel horizontal lines on the calibration image. During the scanning process, the linear array CCD camera is adjusted so that the horizontal lines in the calibration image are perpendicular to the image scanning direction, thereby making the pixel arrangement direction of the linear array CCD camera perpendicular to the scanning motion direction. However, this method requires that the vertical lines of the calibration image be completely parallel to the scanning direction, and the horizontal lines be completely perpendicular to the scanning direction. In actual operation, it is very difficult to place the target on the workpiece motion platform and ensure that the image on the target meets this condition, making it difficult to implement.
[0006] To avoid the impact of the correction image's placement angle on the camera's installation angle correction results, patent CN103256919B proposes a circular correction image pattern. By calculating the angle of the straight line fitted to the center point of each column of the circular image's edge points, the linear array camera's installation angle is obtained. Since a tilted installation angle of a linear array camera is equivalent to a shearing transformation of the workpiece surface image, which is equivalent to a shearing stretch of the circular image in the y-direction, this method can be used to calculate the linear array camera's installation angle. However, for area array cameras, a tilted installation angle is equivalent to a rotational transformation of the workpiece surface image. Therefore, the final image of the circular pattern is still not a deformed circle, making it impossible to correct the area array camera's installation angle. On the other hand, to improve the accuracy of camera installation angle correction, the circular pattern needs to cover the entire field of view as much as possible. However, this also results in the circular pattern not being completely within a single field of view during actual operation, resulting in low test efficiency.
[0007] Therefore, it is a technical problem that those skilled in the art urgently need to solve to provide a camera installation angle correction method that has no special requirements for the correction image installation angle, is applicable to both linear array and area array cameras, and has high testing efficiency. Summary of the Invention
[0008] In order to solve the problems in the background technology, the present invention proposes a method for correcting the camera installation angle.
[0009] The technical solution adopted by the present invention comprises the following steps:
[0010] Step 1) establishing a calibration image, wherein the lateral width of the calibration image is greater than twice the width of the camera field of view, and the calibration image contains at least one flat edge for imaging reference during camera installation angle correction;
[0011] Step 2) Place the calibration image on a motion stage with a camera positioned above the stage so that the flat edge in the calibration image falls within the two adjacent left and right fields of view of the camera. The flat edge in the calibration image is as perpendicular as possible to the scanning imaging direction of the motion stage. However, the correction result of the method of the present invention is not affected by the position deviation of the calibration image here.
[0012] Step 3) Move the motion stage along the scanning imaging direction, and by setting the starting and ending points and position spacing of the motion stage grating ruler trigger, the camera triggers imaging to obtain multiple imaging images; during the movement of the motion stage, the grating ruler will trigger the camera imaging according to the real-time position of the motion stage.
[0013] Step 4) The motion stage is translated in a direction perpendicular to the scanning imaging by the distance of the camera field of view, and the start and end points and position spacing of the motion stage grating ruler trigger are set to be the same as in step 3), and the camera is triggered to image again to obtain multiple imaging images;
[0014] Step 5) extracting two left and right images corresponding in position in the scanning imaging direction and containing the same flat edge information from the imaging images obtained in Step 3) and Step 4) respectively; Step 4) translating the motion stage perpendicular to the scanning imaging direction by a distance of the camera field of view so that the boundaries of the two adjacent left and right images are connected and there is no overlapping area, thereby ensuring that the right boundary point of the flat edge in the left image and the left boundary point of the flat edge in the right image correspond to the same point on the calibration image;
[0015] Step 6) Based on the pixels of the two images extracted in step 5), a plane coordinate system is established, with the x direction perpendicular to the motion scanning direction and the y direction parallel to the motion scanning direction, to obtain the coordinates of the right boundary point (x1, y1) of the flat edge in the left image and the coordinates of the left boundary point (x2, y2) of the flat edge in the right image;
[0016] Step 7) The camera installation angle tilt will cause affine transformation. Based on this, the inverse transformation of the affine transformation is performed on the two adjacent camera images to obtain the coordinates of the right boundary point (x′1, y1′) of the left image flat edge and the left boundary point (x′2, y2′) of the right image flat edge after the inverse transformation with the affine transformation angle as the independent variable;
[0017] Step 8) The Euler distance between the two boundary points transformed in step 7) is a function of the corresponding shearing transformation angle α or rotation transformation angle β. The tilt angle α or rotation angle β corresponding to the minimum value of the Euler distance is calculated and obtained. The inverse of the tilt angle α or rotation angle β corresponding to the minimum value is the camera installation tilt angle; the shearing angle α corresponds to the shearing affine inverse transformation of the line array camera image, and the rotation angle β corresponds to the rotation affine inverse transformation of the area array camera image;
[0018] Step 9) Correcting the camera installation angle according to the camera installation tilt angle obtained in step 8).
[0019] When the minimum value calculated in step 8) corresponds to the tilt angle α or the rotation angle β of 0°, it means that the camera installation angle correction is completed, so that the horizontal pixel arrangement direction of the camera is perpendicular to the scanning direction of the motion stage.
[0020] In the step 1), the calibration image is a flat plate with a single flat edge or a flat edge array image engraved on it ( Figure 1 As shown in the right figure), or a workpiece with a flat edge ( Figure 1 left).
[0021] The plurality of imaging images in step 3) include at least one flat edge feature of the calibration image;
[0022] The multiple imaging images in step 4) include at least one flat edge feature of the calibration image.
[0023] In step 3), the camera is triggered to image by setting the motion stage grating ruler position trigger signal:
[0024] If the camera is a line scan camera, the position trigger spacing of the grating scale is the horizontal field of view width divided by the number of horizontal pixels. This means that the spatial dimensions of a single pixel in the vertical and horizontal directions of the line scan camera image are kept the same to avoid compression or stretching of the image. Each image obtained by the line scan camera is a stitched image, and the pixel resolution of the stitched image is the same in the horizontal and vertical directions.
[0025] If the camera is an area array camera, the position trigger spacing of the grating ruler is the longitudinal field height, so that the boundaries of each two adjacent images in the longitudinal direction are connected and there is no overlapping area.
[0026] In step 6), the tilted installation angle of the linear array camera causes a shearing transformation in the imaged image, and the tilted installation angle of the area array camera causes a rotational transformation in the imaged image, resulting in discontinuity of the flat edge features in the two image files, that is, the right boundary point of the flat edge in the left image and the left boundary point of the flat edge in the right image cannot coincide.
[0027] In the step 7):
[0028] The tilt of the linear array camera installation angle will cause a shear affine transformation. In the inverse transformation of the shear affine transformation, the shear angle α is the independent variable, and the coordinates of the two boundary points (x′1, y1′) and (x′2, y2′) are the corresponding dependent variables.
[0029] The tilt of the installation angle of the area array camera will cause a rotational affine transformation. In the inverse transformation of the rotational affine transformation, the rotation angle β is the independent variable, and the coordinates of the two boundary points (x′1, y′1) and (x′2, y′2) are the corresponding dependent variables.
[0030] The shear angle α and the rotation angle β can be positive or negative.
[0031] In step 8), the Euler distance between the two boundary points
[0032] The beneficial effects of the present invention are as follows:
[0033] The camera installation angle correction method of the present invention uses the image transformation characteristics caused by camera installation angle tilt as a starting point. Depending on the camera type, the inverse transformation (shearing or rotation) of the affine transformation is performed on the image. The tilt angle or rotation angle corresponding to the minimum distance between corresponding coordinate points is calculated to determine the camera installation tilt angle. This method has no special requirements for the image installation angle being corrected and is applicable to both linear and area array cameras. It can achieve efficient online camera installation angle calculation and correction through an automated program. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is an example of an optional correction image;
[0035] Figure 2 The diagram shows the left and right adjacent images of the line scan camera imaging the image with flat edge correction when the line scan camera and the image with flat edge correction are at different angles relative to the motion stage. The left column shows the object-side scanning area of the line scan camera and the image with flat edge correction in the ideal installation position and the actual tilted installation position, respectively. The right column shows the image-side imaging of the line scan camera and the image with flat edge correction in the ideal installation position and the actual tilted installation position, respectively.
[0036] Figure 3 This is an explanation of the coordinate shearing transformation of the flat edge boundary points of the left and right adjacent images of the linear array camera;
[0037] Figure 4The diagram shows the left and right adjacent images of the area array camera imaging the image with flat edge correction when the area array camera and the flat edge correction image are at different angles relative to the motion stage scanning imaging direction. The left column shows the object-side scanning area schematic diagrams of the area array camera and the flat edge correction image in the ideal installation position and the actual tilted installation position, respectively. The right column shows the image-side imaging images of the area array camera and the flat edge correction image in the ideal installation position and the actual tilted installation position, respectively.
[0038] Figure 5 This is an explanation of the coordinate rotation transformation of the left and right adjacent image flat edge boundary points of the array camera;
[0039] Figure 6 The corresponding camera installation angle is obtained by calculating the minimum value of the Euler distance between the flat edge boundary points of the left and right adjacent images;
[0040] Figure 7 This is an explanation of how to calculate and solve the installation tilt angle of the array camera using analytical methods. DETAILED DESCRIPTION
[0041] The present invention will be described in more detail below with reference to the accompanying drawings, in which preferred embodiments of the present invention are shown. It should be understood that those skilled in the art may modify the present invention described herein while still achieving the advantageous effects of the present invention. Therefore, the following description should be understood as a general guide for those skilled in the art and not as a limitation of the present invention.
[0042] For the sake of clarity, not all features of actual embodiments are described. In the following description, well-known functions and structures are not described in detail because they would obscure the present invention with unnecessary detail. It should be understood that in the development of any actual embodiment, numerous implementation details must be made to achieve the developer's specific goals, such as adapting from one embodiment to another to accommodate system or business constraints. Furthermore, it should be understood that such development work may be complex and time-consuming, but is nevertheless a routine undertaking for those skilled in the art.
[0043] In order to make the purpose and features of the present invention more obvious and easy to understand, the specific embodiments of the present invention are further described below with reference to the accompanying drawings. It should be noted that the drawings are all in a very simplified form and use non-precise ratios, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. Specific embodiment:
[0045] Step (1) sets a calibration image. The horizontal width of the calibration image is greater than twice the width of the camera field of view. The calibration image contains at least one flat edge, which is used as an imaging reference during the camera installation angle calibration process. The calibration image can be a flat plate engraved with a single flat edge or a flat edge array image, or a workpiece with a flat edge. Figure 1 shown.
[0046] In step (2), the calibration image is placed above the motion stage so that the flat edge of the calibration image falls within the range of the two adjacent left and right fields of view. The flat edge of the calibration image is as perpendicular as possible to the direction of the motion stage imaging scan. However, the correction results of the method of the present invention are not affected by the deviation of the calibration image placement position.
[0047] Furthermore, the existing calibration method requires that the flat edge in the calibration image in step (2) is completely perpendicular to the imaging scanning motion direction of the motion stage, such as Figure 2 and Figure 4 As shown in the first case, this ideal situation is difficult to achieve. The existing calibration method will eventually take the placement angle of the calibration image into account in the camera installation angle. Figure 2 and Figure 4 As shown in case 3, the calibration image is placed at a non-perpendicular angle to the motion direction of the motion stage. The correction method needs to consider the impact of the calibration image placement angle on the correction result.
[0048] Step (3) moves the motion stage along the scanning imaging direction, and by setting the motion stage grating scale position trigger signal and the motion stage trigger start and end points, the camera triggers imaging at a specific starting point to obtain multiple imaging images. The multiple imaging images include at least one flat edge feature of the calibration image.
[0049] Furthermore, the step (3) can trigger the camera to image at a specific position by setting the position trigger signal of the moving stage grating ruler. If the camera is a linear array camera, the position trigger spacing of the grating ruler is the horizontal field width divided by the number of horizontal pixels, that is, the spatial dimensions corresponding to a single pixel in the longitudinal and transverse directions of the linear array camera imaging image are kept the same, avoiding compression or stretching effects on the image; if the camera is an area array camera, the position trigger spacing of the grating ruler is the longitudinal field height, so that the boundaries of each two adjacent images in the longitudinal direction are connected and there is no overlapping area. For a linear array camera, each image is a spliced image, and the pixel resolution of the spliced image is the same in the transverse and longitudinal directions.
[0050] Step (4) is to translate the motion stage perpendicular to the scanning imaging direction by a distance of the camera field of view, set the same motion stage grating scale position trigger signal and the motion stage trigger start and end points as in step (3), and again trigger the camera to image at a specific position to obtain multiple imaging images. The multiple imaging images include at least one flat edge feature of the calibration image.
[0051] Furthermore, in step (4), the motion stage is translated perpendicularly to the scanning imaging direction by a distance of the camera field of view, so that the boundaries of the left and right adjacent images are connected and there is no overlapping area. In this case, it can be ensured that the right boundary point of the flat edge in the left image and the left boundary point of the flat edge in the right image correspond to the same point on the flat edge calibration image.
[0052] Step (5) is to obtain the imaging images of step (3) and step (4), wherein the images obtained in the two steps have the same position coordinates in the scanning imaging direction, and extract the image file containing the flat edge information in the position corresponding image.
[0053] In step (6), if the installation angle of the linear array camera is tilted, the imaging image will produce a shearing transformation, and if the installation angle of the area array camera is tilted, the imaging image will produce a rotational transformation. Therefore, if the camera is tilted, the flat edge features in the two image files are equivalent to the shearing or rotational transformation of the flat edge features within the field of view of the corresponding camera, resulting in discontinuity of the flat edge features in the two image files, that is, the right boundary point of the flat edge feature in the left image and the left boundary point of the flat edge feature in the right image cannot coincide.
[0054] Furthermore, in step (6), if the camera installation angle is tilted, that is, the camera pixel arrangement direction is not completely perpendicular to the motion stage scanning imaging direction, the camera image will produce an affine transformation relative to the original image, such as Figure 2 and Figure 4 As shown in Case 2 and Case 4, it can be seen that regardless of whether the calibration image placement angle is perpendicular to the workpiece stage scanning imaging direction, the tilted installation angle of the area array camera will cause the image to rotate, and the tilted installation angle of the line array camera will cause the image to shear, resulting in discontinuity of the flat edge features in the two image files, that is, the right boundary point of the flat edge feature in the left image cannot coincide with the left boundary point of the flat edge feature in the right image.
[0055] Step (7) establishes a plane coordinate system based on the pixels of the two images, with the x direction perpendicular to the motion scanning direction and the y direction parallel to the motion scanning direction. Obtain the coordinates of the right boundary point of the flat edge feature in the left image (x1, y1) and the corresponding coordinates of the left boundary point of the flat edge feature in the right image (x2, y2). If the camera is a linear array camera, the two images are sheared in the y direction with a corresponding tilt angle α; if the camera is a planar array camera, the two images are rotated with a corresponding rotation angle β. The tilt angle α and the rotation angle β can be positive or negative, and the coordinates of the two boundary points after the coordinate transformation are obtained, which are (x′1, y′1) and (x′2, y′2). Calculate the Euler distance between the coordinates of the two boundary points,
[0056] Furthermore, in step (7):
[0057] like Figure 3 As shown, the shear transformation matrix of the linear array camera is related to the camera tilt angle α and the camera field of view size l:
[0058] Point A coordinate shear transformation matrix:
[0059]
[0060] Point B coordinate shear transformation matrix:
[0061]
[0062] like Figure 5 As shown, the rotation transformation matrix of the area array camera is related to the camera tilt angle β and the camera field of view size l:
[0063] Point A coordinate rotation transformation matrix:
[0064]
[0065] Point B coordinate rotation transformation matrix:
[0066]
[0067] Figure 3 and Figure 5 Points A and B in the image are the flat edge boundary points of adjacent images. They can be considered to correspond to the same point on the calibration image. Regardless of whether the calibration image is tilted or not, the misalignment of points A and B is caused by the tilt of the camera installation angle. Therefore, the inverse transformation of the corresponding affine transformation can be performed according to the camera type. The two adjacent linear (area) array images are sheared (rotated) and the coordinates of points A and B after the affine transformation are obtained. When the camera installation angle is not tilted, points A and B coincide. Therefore, the Euler distance between the coordinates of points A and B after the affine transformation can be used to indicate whether the inverse transformation effect of the affine transformation caused by camera tilt has been achieved.
[0068] In step (8), the transformed Euler distance between the two boundary points is a function of the corresponding shearing transformation angle α or rotation transformation angle β. Therefore, the tilt angle α or rotation angle β corresponding to the minimum value of the Euler distance can be calculated and obtained, which is the inverse transformation corresponding to the shearing transformation caused by the installation tilt angle of the linear array camera or the rotation transformation caused by the installation tilt angle of the area array camera. The inverse of the tilt angle α or rotation angle β corresponding to the minimum value is the camera installation tilt angle.
[0069] Furthermore, the step (8) is performed by Figure 3 and Figure 5It can be seen that the distance between point A and point B reaches its minimum when and only when the inverse affine transformation completely offsets the affine transformation caused by the camera installation angle tilt. When the affine transformation angle α or β increases or decreases, the distance between point A and point B will increase monotonically. Therefore, the tilt angle α or rotation angle β corresponding to the minimum Euler distance obtained by calculation is the camera installation tilt angle, such as Figure 6 shown.
[0070] Step (9) corrects the camera installation angle according to the camera installation inclination angle obtained in step 8). In the actual installation process, steps (3) to (8) can be implemented through an automated program. When the minimum value calculated in step (8) corresponds to the inclination angle α or the rotation angle β of 0°, it means that the camera installation angle correction is completed.
[0071] Furthermore, in step (9), the camera installation angle can be quickly calculated by finding the minimum Euler distance between the two coordinates through affine transformation. Of course, if the camera field of view and the calibrated image feature size are known, the solution can also be obtained through analytical geometry, such as Figure 7 As shown, taking the area array camera as an example, the camera installation tilt angle can be used as a variable to obtain the coordinate analytical expression (M', N', J', K', P', Q', S', T') of the camera field of view corner point (M, N, J, K, P, Q, S, T) after the rotation transformation around the field of view center. According to the coordinate rotation transformation matrix, the coordinate expression (x'1, y'1) of the point (x1, y1) after rotating around the point (a, b) by an angle β is Therefore, the coordinates of points M(0,l), N(0,0), J(l,l), and K(l,0) after rotating around the center point of the field of view (l / 2,l / 2) by an angle β can be obtained as M'(-l / 2*cos(β)-l / 2*sin(β)+l / 2,l / 2*cos(β)-l / 2*sin(β)+l / 2), N'(-l / 2*cos(β)+l / 2*sin(β)+ l / 2,-l / 2*cos(β)-l / 2*sin(β)+l / 2), J'(l / 2*cos(β)-l / 2*sin(β)+l / 2,l / 2*cos(β)+ l / 2*sin(β)+l / 2), K'(l / 2*cos(β)+l / 2*sin(β)+l / 2,-l / 2*cos(β)+l / 2*sin(β)+l / 2); The coordinates of points P(l,l), Q(l,0), S(2l,l), and T(2l,0) after rotating around the center point of the field of view (3l / 2,l / 2) by an angle β are P'(-l / 2*cos(β)-l / 2*sin(β)+3l / 2,l / 2*cos(β)-l / 2*sin(β)+l / 2), Q'(-l / 2*cos(β)+l / 2*sin(β)+3l / 2,-l / 2*cos(β)-l / 2*sin(β)+l / 2), S'(l / 2*cos(β)-l / 2*sin(β)+3l / 2,l / 2*cos(β)+l / 2*sin(β)+l / 2), T'(l / 2*cos(β)+l / 2*sin(β)+3l / 2,-l / 2*cos(β)+l / 2*sin(β)+l / 2). Thus, the equation of the M'N' line is x=n*y+c1, the equation of the J'K' line is x=n*y+c2, and the equation of the P'Q' line is x=n*y+c3, where n=tan(β), β is the camera tilt angle as mentioned above, (c2-c1)*cos(β)=l, and l is the camera field of view width.
[0072] The coordinates of the intersection points of the edge of the camera field of view and the flat edge of the calibration image are points G, C, E and points H, D, F respectively. By setting the unknown variable θ, where θ is the tilt angle of the calibration image, the straight line expressions of the flat edge of the calibration image can be obtained, namely, the GCE straight line equation expression y=m*x+b1, and the HDF straight line equation expression y=m*x+b2, where m=tan(θ), (b2-b1)*cos(θ)=d, and d is the known flat edge feature width of the calibration image.
[0073] By combining the M'N' line, J'K' line, P'Q' line, GCE line, and HDF line, we can obtain the coordinate analytical expressions of the intersection points G, C, E and points H, D, F. This allows us to derive an analytical expression for the pixel coordinates of each point on the camera image. By combining these pixel coordinate expressions with the pixel coordinates of the flat edge features in the actual image, we can calculate the camera's installation tilt angle, as well as the calibration image's placement tilt angle and placement position. However, actual camera setup scenarios require automated programming, so the analytical method requires a complete analytical expression for the camera's installation tilt angle.
Claims
1. A method for correcting a camera installation angle, characterized in that: The following steps are involved: Step 1) establishing a calibration image, wherein the lateral width of the calibration image is greater than twice the width of the camera field of view, and the calibration image contains at least one flat edge; Step 2) Place the calibration image on a motion platform with a camera installed above it so that the flat edge in the calibration image falls within the two adjacent left and right fields of view of the camera; Step 3) Move the motion stage along the scanning imaging direction, and set the starting and ending points and position spacing of the motion stage grating ruler triggering to trigger the camera to obtain multiple imaging images; Step 4) The motion stage is translated in a direction perpendicular to the scanning imaging by the distance of the camera field of view, and the start and end points and position spacing of the motion stage grating ruler trigger are set to be the same as in step 3), and the camera is triggered to image again to obtain multiple imaging images; Step 5) extracting two left and right images that correspond in position in the scanning imaging direction and contain the same flat edge information from the imaging images obtained in step 3) and step 4) respectively; Step 6) Based on the pixels of the two images extracted in step 5), a plane coordinate system is established, with the x direction perpendicular to the motion scanning direction and the y direction parallel to the motion scanning direction, to obtain the coordinates of the right boundary point (x1, y1) of the flat edge in the left image and the coordinates of the left boundary point (x2, y2) of the flat edge in the right image; Step 7) The camera installation angle tilt will cause an affine transformation. Based on this, the inverse transformation of the affine transformation is performed on the two adjacent camera images to obtain the coordinates of the right boundary point of the left flat edge (x′1, y1′) and the left boundary point of the right flat edge (x′2, y2′) with the affine transformation angle as the independent variable after the inverse transformation. Step 8) The Euler distance between the two boundary points transformed in step 7) is a function of the angle α corresponding to the shear transformation or the angle β corresponding to the rotation transformation, and the tilt angle α or the rotation angle β corresponding to the minimum value of the Euler distance is calculated and obtained. The inverse of the tilt angle α or the rotation angle β corresponding to the minimum value is the camera installation tilt angle; Step 9) Correcting the camera installation angle according to the camera installation tilt angle obtained in step 8).
2. The method for correcting a camera installation angle according to claim 1, wherein: In the step 1), the calibration image is a flat plate engraved with a single flat edge or a flat edge array image, or a workpiece with a flat edge.
3. The method for correcting a camera installation angle according to claim 1, wherein: The plurality of imaging images in step 3) include at least one flat edge feature of the calibration image; The multiple imaging images in step 4) include at least one flat edge feature of the calibration image.
4. The method for correcting a camera installation angle according to claim 1, wherein: In step 3), the camera is triggered to image by setting the motion stage grating ruler position trigger signal: If the camera is a linear array camera, the position trigger spacing of the grating ruler is the horizontal field width divided by the horizontal number of pixels; If the camera is an area array camera, the position trigger spacing of the grating ruler is the longitudinal field height, so that the boundaries of each two adjacent images in the longitudinal direction are connected and there is no overlapping area.
5. The method for correcting a camera installation angle according to claim 1, wherein: In the step 6), The tilted installation angle of the linear array camera causes a shearing transformation in the image, while the tilted installation angle of the area array camera causes a rotational transformation in the image, resulting in discontinuity of the flat edge features in the two image files. That is, the right boundary point of the flat edge in the left image cannot coincide with the left boundary point of the flat edge in the right image.
6. The method for correcting a camera installation angle according to claim 1, wherein: In the step 7): The tilt of the linear array camera installation angle will cause a shear affine transformation. In the inverse transformation of the shear affine transformation, the shear angle α is the independent variable, and the coordinates of the two boundary points (x′1, y′1) and (x′2, y′2) are the corresponding dependent variables. The tilt of the installation angle of the area array camera will cause a rotational affine transformation. In the inverse transformation of the rotational affine transformation, the rotation angle β is the independent variable, and the coordinates of the two boundary points (x′1, y′1) and (x′2, y′2) are the corresponding dependent variables.
7. The method for correcting a camera installation angle according to claim 1, wherein: In step 8), the Euler distance between the two boundary points
Citation Information
Patent Citations
Regulating and calibrating method for linear array CCD scanning detection system
CN101365144A
A Correction Method for Angle Tilt of Line Scan Camera
CN103256919B
Method for rapid correction of image dithering
CN104537663A
Image fuzzy correction device and inclination correction device and control methods thereof
CN106911889A