Glass Size Measurement Method, Medium and Electronic Device Based on Multi-Line Scan Camera

By performing perspective transformation and free transformation in the multi-line scanning camera measurement system, the measurement accuracy problem caused by inconsistent installation angles of each camera is solved, and high-precision glass size measurement is achieved.

CN119756185BActive Publication Date: 2025-05-30HANGZHOU LIPO SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510245380.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-05-30
Estimated Expiration
2045-03-04

AI Technical Summary

Technical Problem

When multi-line scan cameras measure glass with large area, the installation angles of each line scan camera cannot be completely unified, resulting in inconsistent pixel sizes and affecting measurement accuracy.

Method used

Through calibration steps and mapping steps, perspective transformation and free transformation, the multi-line scanning camera calibration images and measurement images are corrected to achieve a unified scale of the camera grid, and image stitching is performed to determine the size of the glass.

Benefits of technology

The accuracy and pixel size consistency of multi-line scanning cameras when measuring glass is improved, and high-precision cross-camera distance measurement is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119756185B_ABST
    Figure CN119756185B_ABST
Patent Text Reader

Abstract

The present invention discloses a glass size measurement method, medium and electronic device based on a multi-line scanning camera. The glass size measurement method includes: a calibration step S1 and a mapping step S2. The calibration step S1 includes: step S11, obtaining a calibration image of the multi-line scanning camera; step S12, establishing a cross-camera coordinate system for the multi-line scanning camera; step S13, determining a compensation reference for the glass to be measured in the mapping step; step S14, performing a perspective transformation on the calibration image of the multi-line scanning camera; step S15, performing a free transformation on the calibration image of the multi-line scanning camera after the perspective transformation; and step S16, stitching the calibration image of the multi-line scanning camera after the free transformation, and the calibration is completed. The beneficial effect of the present invention is: high-precision cross-camera ranging of the multi-line scanning camera is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to glass size measurement. In particular, it relates to a glass size measurement method, medium and electronic device based on a multi-line scan camera. Background Art

[0002] Currently, for large-area glass, machine vision technology can be used to achieve size measurement. This method involves using a multi-line scan camera for image stitching and ranging across cameras. However, its disadvantage is that the measurement accuracy is not high enough. Summary of the Invention

[0003] The applicant found that the reason for the insufficient accuracy in measuring large-area glass with a multi-line scan camera is that there are slight differences in the installation angles of each line scan camera, and it is impossible to achieve complete unity, resulting in inconsistent pixel sizes between cameras, which in turn affects the measurement accuracy.

[0004] The technical problem to be solved by the present invention is that the measurement accuracy is affected because the installation angles of each line scan camera cannot be completely unified, and to provide a glass size measurement method, medium and electronic device based on a multi-line scan camera.

[0005] To achieve the above object, a technical solution provided by the present invention is: a glass size measurement method based on multi-line scan camera image stitching, including: a calibration step S1 and a mapping step S2.

[0006] The calibration step S1 includes: step S11, obtaining a calibration image of the multi-line scan camera; step S12, establishing a cross-camera coordinate system for the multi-line scan camera; step S13, determining a compensation reference for the glass to be measured in the mapping step; step S14, performing a perspective transformation on the calibration image of the multi-line scan camera, aiming to correct the camera grid of the cross-camera coordinate system to the same scale as much as possible to achieve pre-correction of the calibration image of the multi-line scan camera; step S15, performing a free transformation on the calibration image of the multi-line scan camera after perspective transformation, aiming to correct the camera grid of the cross-camera coordinate system to the same scale to achieve correction of the calibration image of the multi-line scan camera; and step S16, stitching the calibration image of the multi-line scan camera after free transformation, and the calibration is completed.

[0007] The mapping step S2 includes: step S21, obtaining the multi-line scan camera measurement image and the calibration parameters determined based on the calibration step S1; step S22, performing deviation compensation on the multi-line scan camera measurement image; step S23, performing perspective transformation on the multi-line scan camera measurement image; step S24, performing free transformation on the multi-line scan camera measurement image after perspective transformation; step S25, performing stitching on the multi-line scan camera measurement image after free transformation; and step S26, determining the size of the glass to be measured based on the stitched multi-line scan camera measurement image.

[0008] As a preferred solution of the glass size measurement method, in step S11, the multi-line scan camera calibration image includes a calibration plate and the glass to be measured, and the calibration plate completely covers the glass to be measured; in step S21, the multi-line scan camera measurement image includes the glass to be measured.

[0009] As a preferred solution of the glass size measurement method, in step S13, determine the coordinates of the midpoint of the edge straight line of the glass to be measured in the cross-camera coordinate system; in step S22, calculate the difference between the midpoint of the edge straight line of the glass to be measured in the multi-line scan camera measurement image and the multi-line scan camera calibration image, and translate the multi-line scan camera measurement image by this difference to perform deviation compensation.

[0010] As a preferred solution of the glass size measurement method, in step S15, according to the corner point distribution of the perspective transformation result, recalculate the size of the camera grid, calculate the target corner point position according to the row and column numbers of the corner point grid and the position of the first corner point of each line scan camera calibration image, and then calculate the transformation relationship of the FFD free transformation according to the source data points and the target data points.

[0011] As a preferred solution of the glass size measurement method, in step S16, use the camera grid in the common field of view of adjacent line scan cameras to calculate the rigid transformation relationship between adjacent cameras, and complete image stitching according to the rigid transformation matrix.

[0012] As a preferred solution of the glass size measurement method, the calibration step S1 is only executed once.

[0013] As a preferred solution of the glass size measurement method, the mapping step S2 is repeatedly executed to batch measure the sizes of different glasses to be measured.

[0014] Another technical solution provided by the present invention: a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the glass size measurement method are implemented.

[0015] Another technical solution provided by the present invention: An electronic device includes a memory and a processor. The memory stores a computer program, and the processor is communicatively connected to the memory. It is characterized in that when the computer program is called, the steps of the glass size measurement method are executed.

[0016] Compared with the prior art, the beneficial effects of the present invention are at least as follows: Through perspective transformation and free transformation, the calibration images and measurement images of the multi-line scan camera are corrected, solving the problems of inaccurate ranging in the moving direction of the multi-line scan camera and the difficulty in making the pixel sizes consistent in the moving direction due to the stitching of the multi-line scan cameras, enabling the multi-line scan camera to complete high-precision image stitching with uniform pixel sizes, and thus completing high-precision cross-camera ranging of the multi-line scan camera.

[0017] In addition to the technical problems solved by the present invention, the technical features constituting the technical solutions, and the beneficial effects brought by these technical features of the technical solutions described above, other technical problems that the present invention can solve, other technical features included in the technical solutions, and the beneficial effects brought by these technical features will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flowchart of the glass size measurement method of the present invention.

[0019] Figure 2 is a flowchart of the calibration step S1 of the glass size measurement method of the present invention.

[0020] Figure 3 is a flowchart of the mapping step S2 of the glass size measurement method of the present invention.

[0021] Figure 4 is a schematic structural diagram of the electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0022] The present invention will be further described in detail below with reference to the accompanying drawings through specific embodiments. It should be noted here that the description of these embodiments is for helping to understand the present invention, but does not constitute a limitation to the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0023] Refer to Figures 1 to 3 , this embodiment provides a glass size measurement method based on multi-line scan camera image stitching. The glass size measurement method includes: a calibration step S1, a mapping step S2, etc.

[0024] The calibration step S1 is only executed once and is executed after the position of the multi-line scan camera is fixed. The mapping step S2 can be repeatedly executed for the purpose of batch measuring the sizes of different measured glasses.

[0025] The calibration step S1 includes:

[0026] Step S11, obtaining a calibration image of a multi-line scan camera. In the calibration image of the multi-line scan camera, a calibration board and a glass to be measured are included. The calibration board completely covers the glass to be measured. Specifically, in implementation, the calibration image of the multi-line scan camera is composed of multiple calibration images captured by the multi-line scan camera. The calibration board can be a checkerboard calibration board. The length and width of the calibration board are respectively greater than the length and width of the glass to be measured. Preferably, the line scan camera is a 4k line scan camera.

[0027] Step S12, establishing a cross-camera coordinate system for the multi-line scan camera according to the corner positions of the calibration board in the calibration image of the multi-line scan camera. Among them, the X-axis of the cross-camera coordinate system is perpendicular to the conveying direction of the glass to be measured, and the Y-axis of the cross-camera coordinate system is parallel to the conveying direction of the glass to be measured.

[0028] Step S13, determining the coordinates of the midpoint of the edge straight line of the glass to be measured in the cross-camera coordinate system, denoted as OffsetY. Among them, the edge straight line is parallel to the conveying direction of the glass to be measured. The purpose is to determine the compensation reference of the glass to be measured in the Y-axis direction in the mapping step. Since the triggering timing of each shot by the multi-line scan camera is inconsistent, that is, there may be a large deviation in each group of pictures in the Y-axis direction, deviation compensation is required. It should be noted that since the device for conveying the glass to be measured has a centering mechanism, generally there is no deviation in each group of pictures in the X-axis direction, and deviation compensation is not required.

[0029] Step S14, performing a perspective transformation on the calibration image of the multi-line scan camera. The purpose is to correct the camera grid of the cross-camera coordinate system to the same scale as much as possible, and realize the pre-correction of the calibration image of the multi-line scan camera. When the installation angle of the camera of the multi-line scan camera is too inclined, if directly using free transformation for correction, the result is that it cannot complete the task due to too large deformation. Through the pre-correction of step S14, the above problems can be well solved.

[0030] Step S15, performing a free transformation on the calibration image of the multi-line scan camera after perspective transformation. The purpose is to correct the camera grid of the cross-camera coordinate system to the same scale, and realize the correction of the calibration image of the multi-line scan camera: according to the corner distribution of the result of the perspective transformation, recalculate the size of the camera grid. According to the row and column numbers of the corner grid and the position of the first corner of each calibration image of the line scan camera, calculate the target corner position, and then calculate the transformation relationship of the FFD free transformation according to the source data points and the target data points.

[0031] Step S16: Stitch the freely transformed calibrated images of the multi-line scan camera. Calculate the rigid transformation relationship between adjacent cameras using the camera grids in the common field of view of adjacent line scan cameras. Complete the image stitching according to the rigid transformation matrix, and the calibration is completed.

[0032] The mapping step S2 includes:

[0033] Step S21: Obtain the measurement images of the multi-line scan camera and the calibration parameters determined based on the calibration step S1. In the measurement images of the multi-line scan camera, only the glass to be measured is included, and the calibration plate is not included.

[0034] Step S22: Calculate the difference between the midpoints of the edge lines of the glass to be measured in the measurement images of the multi-line scan camera and the calibrated images of the multi-line scan camera, denoted as OffsetDiffY. Translate the measurement images of the multi-line scan camera by OffsetDiffY to perform deviation compensation in the Y-axis direction.

[0035] Step S23: Perform perspective transformation on the measurement images of the multi-line scan camera.

[0036] Step S24: Perform free transformation on the measurement images of the multi-line scan camera after perspective transformation.

[0037] Step S25: Stitch the measurement images of the multi-line scan camera after free transformation.

[0038] Step S26: Determine the size of the glass to be measured based on the stitched measurement images of the multi-line scan camera.

[0039] Through perspective transformation and free transformation, the calibration images and measurement images of the multi-line scan camera are corrected, solving the problems of inaccurate ranging in the movement direction of the multi-line scan camera and the difficulty in making the pixel sizes consistent in the movement direction due to the stitching of the multi-line scan camera. This enables the multi-line scan camera to complete high-precision image stitching with a unified pixel size, thereby completing high-precision cross-camera ranging of the multi-line scan camera.

[0040] This embodiment further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which when executed by a processor, implements all or part of the steps of the glass size measurement method in the foregoing solution.

[0041] Those of ordinary skill in the art can understand that all or part of the steps in the methods of the above embodiments can be completed by a program instruction processor. The program can be stored in a computer-readable storage medium, and the storage medium can be a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid state disk (SSD)), etc.

[0042] See Figure 4 , this embodiment also provides an electronic device. The electronic device includes a memory 101 and a processor 102. The memory 101 stores a computer program. The processor 102 is communicatively connected to the memory 101 and, when invoking the computer program, executes all or part of the steps of the glass size measurement method in the foregoing solution.

[0043] In some possible implementations, the memory 101 may include various media capable of storing program codes, such as ROM, RAM, magnetic disks, USB flash drives, memory cards, or optical discs. Specifically, the memory 101 may include a computer system readable medium in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. The memory 101 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0044] The above only expresses the embodiments of the present invention, and the description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the invention patent should be subject to the appended claims.

Claims

1. A glass size measurement method based on multi-line scan camera image stitching, characterized in that: include: Calibration step S1 and mapping step S2; The calibration step S1 includes: step S11, acquiring a multi-line scan camera calibration image; step S12, establishing a cross-camera coordinate system for the multi-line scan camera; step S13, determining a compensation reference for the glass to be measured in the mapping step; step S14, performing a perspective transformation on the multi-line scan camera calibration image; step S15, performing a free transformation on the multi-line scan camera calibration image after the perspective transformation; and step S16, splicing the multi-line scan camera calibration images after the free transformation, and the calibration is completed; The mapping step S2 includes: step S21, acquiring a multi-line scan camera measurement image and a calibration parameter determined based on the calibration step S1; step S22, performing deviation compensation on the multi-line scan camera measurement image; step S23, performing perspective transformation on the multi-line scan camera measurement image; step S24, performing free transformation on the perspective transformed multi-line scan camera measurement image; step S25, performing splicing on the multi-line scan camera measurement image after free transformation; and step S26, determining the size of the measured glass based on the spliced ​​multi-line scan camera measurement image. In step S15, the size of the camera grid is recalculated according to the corner point distribution obtained by the perspective transformation, the target corner point position is calculated according to the number of rows and columns of the corner point grid of each line scan camera calibration image and the position of the first corner point, and then the transformation relationship of the FFD free transformation is calculated according to the source data points and the target data points.

2. The glass size measuring method according to claim 1, characterized in that: In step S11, the multi-line scan camera calibration image includes a calibration plate and the glass to be measured, and the calibration plate completely covers the glass to be measured; in step S21, the multi-line scan camera measurement image includes the glass to be measured.

3. The glass size measuring method according to claim 1, characterized in that: Step S13, determining the coordinates of the midpoint of the edge straight line of the glass to be measured in the cross-camera coordinate system; Step S22, calculating the difference between the midpoint of the edge straight line of the glass to be measured in the multi-line scan camera measurement image and the multi-line scan camera calibration image, and translating the multi-line scan camera measurement image by the difference to compensate for the deviation.

4. The glass size measuring method according to claim 1, characterized in that: In step S16, the rigid transformation relationship between adjacent phases is calculated using the camera grid in the common field of view of the adjacent line scan cameras, and the image stitching is completed according to the rigid transformation matrix.

5. The glass size measuring method according to claim 1, characterized in that: The calibration step S1 is performed only once.

6. The glass size measuring method according to claim 1, characterized in that: The mapping step S2 is repeatedly performed to batch measure the sizes of different measured glasses.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the glass size measurement method according to any one of claims 1 to 4 are implemented.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is communicatively connected to the memory, wherein: When the computer program is called, the steps of the glass size measuring method according to any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • Camera calibration method, object plane size measurement method and equipment system thereof

    CN118898649A

  • Multi-camera fused workpiece surface defect detection method and related equipment

    CN119688592A