Dual-camera calibration method, device, terminal equipment and medium
By establishing a mapping relationship between the forward and reverse cameras and the mechanical platform in PCB processing, the problem of increasing time in traditional double-sided processing is solved, and the double-sided processing is achieved by only one benchmarking positioning, which improves processing efficiency and accuracy.
Patent Information
- Application Number
- CN202210995850.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-08-18
AI Technical Summary
In PCB double-sided processing, the traditional positioning method of front and back respectively leads to an increase in processing time and fails to efficiently utilize the processing equipment.
By obtaining the angle between the forward camera and the reverse camera and the zero point coordinates of the mechanical platform, a mapping relationship between the forward mechanical platform and the reverse mechanical platform is established to realize the conversion of spatial positioning information, so as to directly obtain the spatial positioning information of the machining workpiece in the reverse camera.
The working hours of reverse benchmarking work are reduced, the processing positioning efficiency and accuracy are improved, and the alignment calibration work flow during double-sided processing is simplified.
Smart Images

Figure CN115272492B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of device calibration technology, and in particular to a dual-camera calibration method, apparatus, terminal device, and medium, and is specifically applied to a dual-camera calibration method when camera one and camera two are facing each other. Background Art
[0002] In the PCB processing industry, double-sided processing is a demand situation. The double-sided processing system is divided into the front processing system and the back processing system. Each system has its own high-precision mobile platform and positioning camera.
[0003] The traditional processing form is that the double-sided processing systems work independently. That is, for the same product, the front positioning camera aligns and positions the front of the product before the front processing is carried out. At the same time, after the front processing is completed, the back positioning camera repeats the product alignment and positioning on the back of the product before the back processing is carried out. That is, when processing the front and back of the same product, the front and back sides need to be repeatedly aligned and positioned before starting processing.
[0004] This method of separately aligning the front and back sides does not conform to the principle of efficient use of processing equipment and increases the processing time of the same product. Summary of the Invention
[0005] The main purpose of the present invention is to provide a dual-camera calibration method, device, terminal equipment and medium, aiming to solve the technical problem that the current double-sided PCB processing is repeated, resulting in increased processing time. By providing a method that can convert the spatial positioning information in the forward camera into the corresponding spatial positioning information in the reverse camera, the working hours of the reverse-side marking work are saved, thereby improving the processing positioning efficiency.
[0006] To achieve the above object, the present invention provides a dual-camera calibration method, which comprises the following steps:
[0007] Obtaining spatial positioning information of the workpiece in the forward camera, obtaining an angle between the forward camera and the forward mechanical platform, recorded as a first angle, obtaining an angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, obtaining an angle between the forward camera and the reverse camera, recorded as a third angle, a zero point coordinate corresponding to the forward mechanical platform, and a zero point coordinate corresponding to the reverse mechanical platform;
[0008] Determine an angle between the forward mechanical platform and the reverse mechanical platform based on the first angle, the second angle, and the third angle, and record the angle as a fourth angle;
[0009] Based on the fourth angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, the spatial positioning information of the workpiece in the forward camera is converted into corresponding spatial positioning information in the reverse camera.
[0010] Optionally, the step of obtaining an angle between the forward camera and the forward mechanical platform, recorded as a first angle, includes:
[0011] Setting a marking point on the workpiece, which is recorded as a first marking point;
[0012] Moving the forward mechanical platform and the reverse mechanical platform respectively along a preset direction by a first preset distance, to obtain the first marking point after the movement, which is recorded as the second marking point;
[0013] Based on the forward camera coordinates corresponding to the first marking point and the second marking point, and the forward mechanical platform coordinates corresponding to the first marking point and the second marking point, an angle between the forward camera and the forward mechanical platform is determined and recorded as a first angle.
[0014] Optionally, the step of obtaining an angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, includes:
[0015] Based on the reverse camera coordinates corresponding to the first marking point and the second marking point, and the reverse mechanical platform coordinates corresponding to the first marking point and the second marking point, the angle between the reverse camera and the reverse mechanical platform is determined and recorded as the second angle.
[0016] Optionally, after the steps of obtaining the angle between the forward camera and the forward mechanical platform, recorded as a first angle, and obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, the method further includes:
[0017] Determine a forward pixel equivalent of the forward camera based on the forward camera coordinates and the forward mechanical platform coordinates of the first marking point and the forward camera coordinates and the forward mechanical platform coordinates corresponding to the second marking point;
[0018] The reverse pixel equivalent of the reverse camera is determined based on the reverse mechanical platform coordinates and the reverse camera coordinates of the first marking point and the reverse mechanical platform coordinates and the reverse camera coordinates corresponding to the second marking point.
[0019] Optionally, the step of obtaining the zero point coordinate corresponding to the forward mechanical platform and the zero point coordinate corresponding to the reverse mechanical platform includes:
[0020] Determine the zero point coordinates corresponding to the forward mechanical platform based on the forward mechanical coordinates, the forward camera coordinates, the forward pixel equivalent, and the first angle of the first marking point;
[0021] The zero point coordinates corresponding to the reverse mechanical platform are determined based on the reverse mechanical coordinates, the reverse camera coordinates, the reverse pixel equivalent and the second angle of the first marking point.
[0022] Optionally, the step of obtaining the third angle includes:
[0023] Moving the processing platform along a second preset direction and a second preset distance, obtaining the second marking point after the movement in the forward camera and the reverse camera, and recording it as a third marking point;
[0024] Obtaining a forward camera coordinate movement distance and a reverse camera coordinate movement distance of the third marker point;
[0025] The third angle is determined based on the forward camera coordinate movement distance and the reverse camera coordinate movement distance of the third marking point.
[0026] Optionally, the step of determining the third angle based on the forward camera coordinate movement distance and the reverse camera coordinate movement distance of the third marking point includes:
[0027] Obtaining the forward camera coordinates of the third marking point and the reverse camera coordinates of the second marking point;
[0028] Determine a motion vector of the third marker point in the forward camera based on the forward camera coordinates of the third marker point and the reverse camera coordinates of the second marker point, and determine a motion vector of the third marker point in the reverse camera based on the reverse camera coordinates of the third marker point and the reverse camera coordinates of the second marker point;
[0029] The third angle is determined based on a movement vector of the third marking point in the forward camera and the reverse camera.
[0030] In addition, to achieve the above-mentioned object, the present invention further provides a dual-camera calibration device, the dual-camera calibration device comprising:
[0031] an acquisition module, configured to acquire spatial positioning information of the workpiece in the forward camera, acquire an angle between the forward camera and the forward mechanical platform (recorded as a first angle), acquire an angle between the reverse camera and the reverse mechanical platform (recorded as a second angle), acquire an angle between the forward camera and the reverse camera (recorded as a third angle), a zero-point coordinate corresponding to the forward mechanical platform, and a zero-point coordinate corresponding to the reverse mechanical platform;
[0032] a determining module, configured to determine an angle between the forward mechanical platform and the reverse mechanical platform based on the first angle, the second angle, and the third angle, recorded as a fourth angle;
[0033] A conversion module is used to convert the spatial positioning information of the processed workpiece in the forward camera into the corresponding spatial positioning information in the reverse camera based on the fourth angle, the zero point coordinate corresponding to the forward mechanical platform, and the zero point coordinate corresponding to the reverse mechanical platform.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal device, which includes a memory, a processor, and a dual-camera calibration program stored in the memory and runnable on the processor. When the dual-camera calibration program is executed by the processor, the steps of the dual-camera calibration method described above are implemented.
[0035] In addition, to achieve the above-mentioned object, the present invention further provides a computer-readable storage medium, on which a dual-camera calibration program is stored. When the dual-camera calibration program is executed by a processor, the steps of the dual-camera calibration method described above are implemented.
[0036] The present invention provides a dual-camera calibration method, apparatus, terminal device and medium. By obtaining the spatial positioning information of the workpiece in the forward camera, obtaining the angle between the forward camera and the forward mechanical platform, recorded as a first angle, obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, obtaining the angle between the forward camera and the reverse camera, recorded as a third angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, based on the first angle, the second angle and the third angle, determining the angle between the forward mechanical platform and the reverse mechanical platform, recorded as a fourth angle, based on the fourth angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, converting the spatial positioning information of the workpiece in the forward camera into the corresponding spatial positioning information in the reverse camera, wherein the first angle reflects the difference between the forward camera coordinate and the reverse camera coordinate. The mapping relationship of the forward mechanical platform coordinates, the second angle reflects the mapping relationship between the reverse camera coordinates and the reverse mechanical platform coordinates, and the third angle reflects the mapping relationship between the forward camera coordinates and the reverse camera coordinates. By obtaining the above angles and the zero-point coordinates corresponding to the forward mechanical platform and the zero-point coordinates corresponding to the reverse mechanical platform, the mapping relationship between the forward mechanical platform coordinates and the reverse mechanical platform coordinates can be established, that is, any coordinate in the forward camera coordinate system can be converted into the corresponding coordinates in the reverse camera coordinate system according to the mapping relationship. In actual processing applications, only the front and back sides need to be calibrated and positioned once, and subsequent processing of the same product does not require repeated calibration. When the front and back sides are calibrated at the same time, each is responsible for half of the non-repetitive calibration work, thereby simplifying the workflow of aligning and calibrating the front and back sides separately during double-sided processing, saving positioning time for subsequent processing, and thus improving processing and positioning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a schematic diagram of the functional modules of the terminal device to which the dual-camera calibration device of this application belongs;
[0038] Figure 2 This is a flowchart of an exemplary embodiment of a dual-camera calibration method of the present application;
[0039] Figure 3 This is a flowchart of another exemplary embodiment of the dual-camera calibration method of the present application;
[0040] Figure 4 Schematic diagram of the device structure involved in the dual-camera calibration method of this application;
[0041] Figure 5 This is a flowchart of another exemplary embodiment of the dual-camera calibration method of the present application;
[0042] Figure 6This is a flowchart of another exemplary embodiment of the dual-camera calibration method of the present application;
[0043] Figure 7 This is a flowchart of another exemplary embodiment of the dual-camera calibration method of the present application;
[0044] Figure 8 This is a flowchart of another exemplary embodiment of the dual-camera calibration method of the present application.
[0045] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0047] The main solution of the embodiment of the present invention is: by obtaining the spatial positioning information of the processing workpiece in the forward camera, obtaining the angle between the forward camera and the forward mechanical platform, recorded as the first angle, obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as the second angle, obtaining the angle between the forward camera and the reverse camera, recorded as the third angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, based on the first angle, the second angle and the third angle, determining the angle between the forward mechanical platform and the reverse mechanical platform, recorded as the fourth angle, based on the fourth angle and the zero-point coordinate corresponding to the forward mechanical platform And the zero-point coordinates corresponding to the reverse mechanical platform, converting the spatial positioning information of the processed workpiece in the forward camera into the corresponding spatial positioning information in the reverse camera. Traditional double-sided processing requires calibration of the product before processing each side of the front and back. Since the operation of each calibration is similar and the calibration frequency is high, if only one-side calibration is required, double-sided calibration will be performed, which will greatly shorten the processing time. The present application provides a method for converting the front and back coordinates of the processed workpiece. Since there is no need to perform reverse calibration to obtain the reverse coordinates, processing hours are saved, and the front and back sides are respectively responsible for half of the processing area, which shortens the calibration time, thereby greatly improving the processing positioning efficiency and accuracy.
[0048] The forward and reverse directions distinguished in this application are for the purpose of better illustrating the scheme of this application, wherein the forward and reverse directions do not represent the actual forward and reverse directions of the processed workpiece. The forward and reverse directions can be converted to each other, that is, one of the two processed sides is defined as the forward direction, and the corresponding other side is defined as the reverse direction.
[0049] Specifically, refer to Figure 1 , Figure 1This is a schematic diagram of the functional modules of the terminal device to which the dual-camera calibration device of this application belongs. The dual-camera calibration device can be a device independent of the terminal device, capable of obtaining the angle between the forward and reverse cameras and the forward and reverse mechanical platforms, the angle between the forward and reverse cameras, and the zero-point coordinates corresponding to the forward and reverse cameras. It can be hosted on the terminal device in the form of hardware or software. The terminal device can be a smart mobile terminal with data processing capabilities, such as a mobile phone or tablet computer, or a fixed terminal device or server with data processing capabilities.
[0050] In this embodiment, the terminal device to which the dual-camera calibration apparatus belongs includes at least an output module 110 , a processor 120 , a memory 130 , and a communication module 140 .
[0051] The memory 130 stores an operating system and a dual-camera calibration program. The dual-camera calibration device can store information such as angle information, coordinate information, and conversion formula information in the memory 130. The output module 110 can be a display screen, etc. The communication module 140 can include a Wi-Fi module, a mobile communication module, and a Bluetooth module, etc., and communicates with external devices or servers through the communication module 140.
[0052] When the dual-camera calibration program in the memory 130 is executed by the processor, the following steps are implemented:
[0053] Obtaining spatial positioning information of the workpiece in the forward camera, obtaining an angle between the forward camera and the forward mechanical platform, recorded as a first angle, obtaining an angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, obtaining an angle between the forward camera and the reverse camera, recorded as a third angle, a zero point coordinate corresponding to the forward mechanical platform, and a zero point coordinate corresponding to the reverse mechanical platform;
[0054] Determine an angle between the forward mechanical platform and the reverse mechanical platform based on the first angle, the second angle, and the third angle, and record the angle as a fourth angle;
[0055] Based on the fourth angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, the spatial positioning information of the workpiece in the forward camera is converted into corresponding spatial positioning information in the reverse camera.
[0056] Furthermore, the dual-camera calibration program in the memory 130 further implements the following steps before being executed by the processor:
[0057] Setting a marking point on the workpiece, which is recorded as a first marking point;
[0058] Moving the forward mechanical platform and the reverse mechanical platform along a first preset direction by a first preset distance, respectively, to obtain the first marking point after movement, which is recorded as the second marking point;
[0059] Based on the forward camera coordinates corresponding to the first marking point and the second marking point, and the forward mechanical platform coordinates corresponding to the first marking point and the second marking point, an angle between the forward camera and the forward mechanical platform is determined and recorded as a first angle.
[0060] Furthermore, the dual-camera calibration program in the memory 130 further implements the following steps before being executed by the processor:
[0061] Based on the reverse camera coordinates corresponding to the first marking point and the second marking point, and the reverse mechanical platform coordinates corresponding to the first marking point and the second marking point, the angle between the reverse camera and the reverse mechanical platform is determined and recorded as the second angle.
[0062] Furthermore, the dual-camera calibration program in the memory 130 further implements the following steps before being executed by the processor:
[0063] Determine a forward pixel equivalent of the forward camera based on the forward camera coordinates and the forward mechanical platform coordinates of the first marking point and the forward camera coordinates and the forward mechanical platform coordinates corresponding to the second marking point;
[0064] The reverse pixel equivalent of the reverse camera is determined based on the reverse mechanical platform coordinates and the reverse camera coordinates of the first marking point and the reverse mechanical platform coordinates and the reverse camera coordinates corresponding to the second marking point.
[0065] Furthermore, the dual-camera calibration program in the memory 130 further implements the following steps before being executed by the processor:
[0066] Determine the zero point coordinates corresponding to the forward mechanical platform based on the forward mechanical coordinates, the forward camera coordinates, the forward pixel equivalent, and the first angle of the first marking point;
[0067] The zero point coordinates corresponding to the reverse mechanical platform are determined based on the reverse mechanical coordinates, the reverse camera coordinates, the reverse pixel equivalent and the second angle of the first marking point.
[0068] Furthermore, the dual-camera calibration program in the memory 130 further implements the following steps before being executed by the processor:
[0069] Moving the processing platform along a second preset direction and a second preset distance, obtaining the second marking point after the movement in the forward camera and the reverse camera, and recording it as a third marking point;
[0070] Obtaining a forward camera coordinate movement distance and a reverse camera coordinate movement distance of the third marker point;
[0071] The third angle is determined based on the forward camera coordinate movement distance and the reverse camera coordinate movement distance of the third marking point.
[0072] Furthermore, the dual-camera calibration program in the memory 130 further implements the following steps before being executed by the processor:
[0073] Obtaining the forward camera coordinates of the third marking point and the reverse camera coordinates of the second marking point;
[0074] Determine a motion vector of the third marker point in the forward camera based on the forward camera coordinates of the third marker point and the reverse camera coordinates of the second marker point, and determine a motion vector of the third marker point in the reverse camera based on the reverse camera coordinates of the third marker point and the reverse camera coordinates of the second marker point;
[0075] The third angle is determined based on the movement vector of the third marking point in the forward and reverse cameras.
[0076] The present invention provides a dual-camera calibration method, apparatus, terminal device and medium. By obtaining the spatial positioning information of the workpiece in the forward camera, obtaining the angle between the forward camera and the forward mechanical platform, recorded as a first angle, obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, obtaining the angle between the forward camera and the reverse camera, recorded as a third angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, based on the first angle, the second angle and the third angle, determining the angle between the forward mechanical platform and the reverse mechanical platform, recorded as a fourth angle, based on the fourth angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, converting the spatial positioning information of the workpiece in the forward camera into the corresponding spatial positioning information in the reverse camera, wherein the first angle reflects the difference between the forward camera coordinate and the reverse camera coordinate. The mapping relationship of the forward mechanical platform coordinates, the second angle reflects the mapping relationship between the reverse camera coordinates and the reverse mechanical platform coordinates, and the third angle reflects the mapping relationship between the forward camera coordinates and the reverse camera coordinates. By obtaining the above angles and the zero-point coordinates corresponding to the forward mechanical platform and the zero-point coordinates corresponding to the reverse mechanical platform, the mapping relationship between the forward mechanical platform coordinates and the reverse mechanical platform coordinates can be established, that is, any coordinate in the forward camera coordinate system can be converted into the corresponding coordinates in the reverse camera coordinate system according to the mapping relationship. In actual processing applications, only the front and back sides need to be calibrated and positioned once, and subsequent processing of the same product does not require repeated calibration. When the front and back sides are calibrated at the same time, each is responsible for half of the non-repetitive calibration work, thereby simplifying the workflow of aligning and calibrating the front and back sides separately during double-sided processing, saving positioning time for subsequent processing, and thus improving processing and positioning efficiency.
[0077] Based on the above terminal device architecture but not limited to the above architecture, an embodiment of the method of the present application is proposed.
[0078] Reference Figure 2 , Figure 2 This is a flow chart of an exemplary embodiment of a dual-camera calibration method of the present application. The dual-camera calibration method includes:
[0079] Step S1001, obtaining spatial positioning information of the workpiece in the forward camera, obtaining the angle between the forward camera and the forward mechanical platform, recorded as a first angle, obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, obtaining the angle between the forward camera and the reverse camera, recorded as a third angle, the zero point coordinate corresponding to the forward mechanical platform, and the zero point coordinate corresponding to the reverse mechanical platform;
[0080] Specifically, the pixel coordinate system is established with the center of the camera image, referring to Figure 4 , Figure 4 This is a schematic diagram of the device structure involved in the dual-camera calibration method of this application, wherein the positive directions of the X and Y axes of the pixel coordinate system are consistent with the positive directions of the mechanical platform coordinate system, that is, there are five planes, labelled 50 as the forward camera coordinate system plane, labelled 30 as the forward mechanical platform plane, labelled 10 as the workpiece plane, labelled 60 as the reverse camera coordinate system plane, labelled 40 as the reverse mechanical platform plane, and labelled 70 as the device base. Since the cameras are manually installed on the mechanical platform, there are certain angles between them. The angle between the forward camera coordinate system and the forward mechanical platform coordinate system is defined as the first angle, the angle between the reverse camera coordinate system and the reverse mechanical platform coordinate system is defined as the second angle, and the angle between the forward camera coordinate system and the reverse camera coordinate system is defined as the third angle. The above information is obtained to obtain the forward and reverse coordinate conversion formulas for performing forward and reverse camera coordinate conversion.
[0081] Step S1002: determining an angle between the forward mechanical platform and the reverse mechanical platform based on the first angle, the second angle, and the third angle, which is recorded as a fourth angle;
[0082] Specifically, after obtaining the first angle, the second angle, and the third angle in step S1001, the three angles can be added together to obtain the required angle between the forward mechanical platform and the reverse mechanical platform, i.e., the fourth angle. Based on the fourth angle, the coordinates of any point in the forward camera coordinate system can be converted to the coordinates of the corresponding point in the reverse camera coordinate system. The specific formula for the fourth angle β is:
[0083] β=-θ P +α+θ N
[0084] Among them, θ N is the angle between the reverse camera and the reverse mechanical platform, i.e. the first angle; α is the angle between the forward camera and the reverse camera, i.e. the third angle; θ P This is the angle between the forward camera and the forward mechanical platform, i.e., the first angle. Since the counterclockwise direction in the forward camera coordinate system is defined as the positive and negative directions when establishing the forward and reverse camera coordinate systems, the second angle corresponding to the reverse camera is negative. The positive direction is not a limitation and is only used for illustrative purposes. The negative sign exists only to distinguish the angle direction between the camera and the mechanical platform and can be changed according to actual conditions. For example, if the positive X-axis directions of the forward and reverse camera coordinates are consistent, the negative sign can be removed.
[0085] Step S1003, based on the fourth angle, the zero point coordinate corresponding to the forward mechanical platform and the zero point coordinate corresponding to the reverse mechanical platform, convert the spatial positioning information of the workpiece in the forward camera into the corresponding spatial positioning information in the reverse camera.
[0086] Specifically, based on the fourth angle β obtained in step S1002, that is, the angle between the forward and reverse mechanical platforms, the reference value coordinate (X1 P0 , Y1 P0 ), namely the coordinates of the forward mechanical platform and the reference value coordinates of the reverse camera alignment (X1 N0 , Y1 N0 ), that is, the coordinates of the reverse mechanical platform when aligned, are used as parameters in the conversion formula to obtain the conversion formula:
[0087] X pn =(X*-X1 P0 )*sin(β)-(Y*-Y1 P0 )*cos(β)+X1 N0
[0088] Y pn =(X*-X1 P0 )*sin(β)-(Y*-Y1 P0 )*cos(β)+Y1 N0
[0089] Among them, X* represents the X coordinate of any point in the front camera coordinates, Y* represents the Y coordinate of the point, β represents the angle between the forward and reverse mechanical platforms, that is, the fourth angle, X1 P0 and Y1 P0 Indicates the forward reference value coordinates, that is, the zero point coordinates of the forward camera, X1 N0 and Y1 N0 Represents the reverse reference coordinates, i.e., the zero-point coordinates of the reverse camera. This conversion formula can be used to convert the mechanical coordinates (X*, Y*) of the front platform when capturing any feature into the corresponding mechanical coordinates of the reverse platform. This allows for a single front-side alignment of both front and back surfaces, significantly reducing workpiece processing time and improving double-sided alignment efficiency.
[0090] This embodiment adopts the above scheme, specifically by obtaining the spatial positioning information of the processed workpiece in the forward camera, obtaining the angle between the forward camera and the forward mechanical platform, recorded as the first angle, obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as the second angle, obtaining the angle between the forward camera and the reverse camera, recorded as the third angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, based on the first angle, the second angle and the third angle, determining the angle between the forward mechanical platform and the reverse mechanical platform, recorded as the fourth angle, based on the fourth angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform. The zero-point coordinates corresponding to the reverse mechanical platform convert the spatial positioning information of the processed workpiece in the forward camera into the corresponding spatial positioning information in the reverse camera, providing an effective forward and reverse camera coordinate conversion method. Through the first angle, the second angle and the third angle, the fourth angle, that is, the angle formed by the forward and reverse mechanical platforms, is finally determined. Based on the fourth angle and the reference value coordinates of the forward and reverse mechanical platforms, the coordinates of the target point in the forward camera coordinate system can be converted into the corresponding coordinates in the reverse camera coordinate system, and finally, only one alignment is required to complete the double-sided alignment work, which saves the time of repeated alignment in the forward and reverse directions during subsequent processing of the same product, and greatly improves the processing and positioning efficiency of the same product.
[0091] Reference Figure 3 , Figure 3 This is a flowchart of another exemplary embodiment of the dual-camera calibration method of the present application.
[0092] In step S1001, the step of obtaining the angle between the forward camera and the forward mechanical platform, recorded as the first angle, includes:
[0093] Step A100: setting a marking point on the workpiece, which is recorded as a first marking point;
[0094] Specifically, after the forward and reverse cameras are installed on the forward and reverse mechanical platforms and the workpiece is installed on the processing plane, a marking point is first set on the workpiece, recorded as the first marking point, to serve as a reference point to determine the angle information between the forward and reverse cameras and the forward and reverse mechanical platforms. Among them, the first marking point must be able to be photographed by both the forward and reverse cameras and have the same position, such as the positioning through hole of the product.
[0095] Then move the forward camera for the first time until the first marking point can be clearly captured and identified in the pixel image of the forward camera. The forward mechanical platform has a transmission device in the Z-axis direction of the forward camera coordinate system. The purpose of the movement is to allow the camera to focus normally on the marking point on the workpiece, improve the accuracy of recognition, avoid the recognition area being too large or incorrect recognition caused by the first marking point being out of focus due to the forward camera being too close to the first marking point, and improve the accuracy of the alignment.
[0096] After the first move, record the coordinates of the first marker point in the pixel coordinate system of the forward camera, which is (X1 Pccd , Y1 Pccd ), the coordinates of the first mark point in the coordinate system of the positive mechanical platform are (X1 Pmachine , Y1 Pmachine ).
[0097] Step A200, moving the forward mechanical platform and the reverse mechanical platform along a first preset direction by a first preset distance, respectively, to obtain the first marking point after movement, which is recorded as the second marking point;
[0098] Specifically, the forward mechanical platform is moved a second time in a preset direction and a preset distance to obtain the first marker point after movement, which is recorded as the second marker point. After moving the preset distance in the preset direction, the second marker point must be found in the image captured by the forward camera, i.e., there must be corresponding coordinates in the forward camera coordinate system.
[0099] After moving, record the coordinates of the second marker point in the pixel coordinate system of the forward camera, which is (X2 Pccd , Y2 Pccd ), the coordinates of the first mark point in the coordinate system of the positive mechanical platform are (X2 Pmachine , Y2 Pmachine ).
[0100] Step A300: Based on the forward camera coordinates corresponding to the first marking point and the second marking point, and the forward mechanical platform coordinates corresponding to the first marking point and the second marking point, determine the angle between the forward camera and the forward mechanical platform, which is recorded as the first angle.
[0101] Specifically, based on the above steps A100 and A200 obtained (X2 Pccd , Y2 Pccd ) and (X2 Pmachine , Y2 Pmachine ), combined with the angle formula of trigonometric function, calculate the angle between the forward camera and the forward mechanical platform, that is, the first angle θ P , the specific calculation formula is:
[0102]
[0103] For example, if tan45°=1, then the inverse function tan1=45°. Based on the coordinates before and after the secondary movement, calculate the angles between the forward camera and the forward mechanical platform. Then subtract the angle corresponding to the forward mechanical platform from the angle corresponding to the forward camera to obtain the first angle θ. P .
[0104] This embodiment adopts the above scheme, specifically by setting a marking point on the workpiece, recorded as the first marking point, moving the forward mechanical platform and the reverse mechanical platform respectively along the first preset direction by a first preset distance, obtaining the first marking point after movement, recorded as the second marking point, based on the forward camera coordinates corresponding to the first marking point and the second marking point, and the forward mechanical platform coordinates corresponding to the first marking point and the second marking point, determining the angle between the forward camera and the forward mechanical platform, recorded as the first angle, based on the movement of a single feature point, that is, a single marking point, thereby determining the mapping relationship between the camera coordinates and the mechanical coordinates, if the first angle is 0, the camera coordinates are equal to the mechanical coordinates, and the movement vector of the camera coordinates is equal to the movement vector of the mechanical coordinates.
[0105] In step S1001, the step of obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as the second angle, includes:
[0106] Step B100: Determine the angle between the reverse camera and the reverse mechanical platform based on the reverse camera coordinates corresponding to the first marking point and the second marking point, and record it as the second angle.
[0107] Specifically, the calculation method of the second angle is the same as the calculation method of the first angle. After the first movement, the coordinates of the first feature point in the reverse camera coordinate system (X1 Nccd , Y1 Nccd ), and its coordinates in the coordinate system formed by the reverse mechanical platform are (X1 Nmachine , Y1 Nmachine ), after moving, the coordinates of the second marker point in the pixel coordinate system of the forward camera are obtained as (X2 Nccd , Y2 Nccd ), and its coordinates in the coordinate system formed by the forward mechanical platform are (X2 Nmachine , Y2 Nmachine ), then based on the above coordinates, the angle between the reverse camera and the reverse mechanical platform is calculated, that is, the second angle θ N , the specific calculation formula is:
[0108]
[0109] This embodiment adopts the above scheme, specifically by determining the angle between the reverse camera and the reverse mechanical platform based on the reverse camera coordinates corresponding to the first marking point and the second marking point, and the reverse mechanical platform coordinates corresponding to the first marking point and the second marking point, which is recorded as the second angle. Based on the movement of a single feature point, that is, a single marking point, the mapping relationship between the camera coordinates and the mechanical coordinates is determined. If the second angle is 0, the camera coordinates are equal to the mechanical coordinates, and the movement vector of the camera coordinates is equal to the movement vector of the mechanical coordinates.
[0110] Reference Figure 5 , Figure 5 This is a flowchart of another exemplary embodiment of the method corresponding to the present application.
[0111] In step S1001, after the steps of obtaining the angle between the forward camera and the forward mechanical platform, recorded as a first angle, and obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, the method further includes:
[0112] Step C100: determining a forward pixel equivalent of the forward camera based on the forward camera coordinates and the forward mechanical platform coordinates of the first marking point, and the forward camera coordinates and the forward mechanical platform coordinates corresponding to the second marking point;
[0113] Specifically, the pixel equivalent in the pixel image of the forward camera is calculated, where the pixel equivalent refers to the actual physical size represented by one pixel in the image, such as one pixel represents 1 mm. The pixel equivalent is obtained by dividing the actual secondary movement distance of the forward mechanical platform by the pixel distance of the secondary movement in the forward camera coordinate system. P , the specific calculation formula is:
[0114]
[0115] Among them, Mx represents the corresponding movement distance of the X axis in the forward mechanical platform coordinate system before and after the secondary movement of the marker point, and My represents the corresponding movement distance of the Y axis in the forward mechanical platform coordinate system before and after the secondary movement of the marker point. Square Mx and My respectively, add them together, and then take the square root to get the actual secondary movement distance of the forward mechanical platform. Similarly, the area below the division sign represents the pixel distance of the secondary movement in the forward camera coordinate system. For example, the forward mechanical platform moves 20mm. In the forward camera coordinate system, the movement distance occupies 10 pixels, then each pixel represents 2mm, that is, the pixel equivalent is 2mm. By subtracting the forward camera coordinate of the second marker point after the secondary movement (X2 Pccd , Y2 Pccd), respectively, minus the forward camera coordinates of the second marker point before the second move (X1 Pccd , Y1 Pccd ), get the pixel distance of the second movement in the forward camera coordinate system, and then divide the actual distance by the pixel distance to get the pixel equivalent.
[0116] Step C200 : determining a reverse pixel equivalent of the reverse camera based on the reverse mechanical platform coordinates and reverse camera coordinates of the first marking point, and the reverse mechanical platform coordinates and reverse camera coordinates corresponding to the second marking point.
[0117] Since the distance between the forward mechanical platform and the marker may be different, the pixel equivalents of the forward and reverse camera coordinate systems may also be different. Therefore, it is necessary to calculate the reverse pixel equivalent. The calculation method of the reverse pixel equivalent is the same as step C100, which will not be repeated here. The specific calculation formula is:
[0118]
[0119] This embodiment adopts the above scheme, specifically by determining the forward pixel equivalent of the forward camera based on the forward camera coordinates and the forward mechanical platform coordinates of the first marking point, and the forward camera coordinates and the forward mechanical platform coordinates corresponding to the second marking point, and determining the reverse pixel equivalent of the reverse camera based on the reverse mechanical platform coordinates and the reverse camera coordinates of the first marking point, and the reverse mechanical platform coordinates and the reverse camera coordinates corresponding to the second marking point, and based on the movement of a single feature point, determining the distance mapping relationship between the camera coordinates and the mechanical coordinates, so as to subsequently obtain the mechanical coordinates when the camera center and the marking point coincide, as a reference value for alignment.
[0120] Reference Figure 6 , Figure 6 This is a flowchart of another exemplary embodiment of the method corresponding to the present application.
[0121] In step S1001, the step of obtaining the zero point coordinates corresponding to the forward mechanical platform and the zero point coordinates corresponding to the reverse mechanical platform includes:
[0122] Step D100 : determining the zero point coordinates corresponding to the forward mechanical platform based on the forward mechanical coordinates, the forward camera coordinates, the forward pixel equivalent, and the first angle of the first marking point.
[0123] Specifically, according to the forward mechanical coordinates, forward camera coordinates, forward pixel equivalent and the first angle of the first mark point, the coordinates of the forward mechanical platform when the centers of the forward and reverse cameras and the mark point are on the same straight line can be obtained. This coordinate is used as the reference value coordinate for the forward camera alignment (X1 P0 , Y1P0 ), where (X1 P0 , Y1 P0 ) is calculated as follows:
[0124] X1 P0 =(X1 Pccd *sin(θ P )-Y1 Pccd *cos(θ P ))*Pixel P +X1 Pmachine ;
[0125] Y1 P0 =(Y1 Pccd *sin(θ P )+Y1 Pccd *cos(θ P ))*Pixel P +Y1 Pmachine ;
[0126] Among them, X1 Pccd and Y1 Pccd Indicates the XY coordinates of the forward camera of the marker point when the forward camera can clearly capture the marker point, θ P Indicates the angle between the forward camera and the forward mechanical platform, that is, the first angle, X1 Pmachine Indicates the X coordinate of the positive mechanical platform of the marker point when the positive camera can clearly capture the marker point, Pixel P Indicates the pixel equivalent of the pixel image formed by the forward camera, that is, the actual physical size represented by a pixel in the image.
[0127] Step D200 : determining the zero point coordinates corresponding to the reverse mechanical platform based on the reverse mechanical coordinates, reverse camera coordinates, reverse pixel equivalents, and the second angle of the first marking point.
[0128] Similarly, the zero point coordinate (X1 N0 , Y1 N0 ) is calculated in the same manner as in step D100, and the specific calculation formula is:
[0129] X1 N0 =(X1 Nccd *sin(θ N )-Y1 Nccd *cos(θ N ))*Pixel N +X1 Pmachine
[0130] Y1 N0 =(Y1 Nccd *sin(θN )+Y1 Nccd *cos(θ N ))*Pixel N +Y1 Pmachine
[0131] Among them, X1 Nccd and Y1 Nccd Indicates the reverse camera XY coordinates of the marker point when the reverse camera can clearly capture the marker point, θ N Indicates the angle between the reverse camera and the reverse mechanical platform, that is, the first angle, X1 Nmachine Indicates the X coordinate of the reverse mechanical platform of the marker point when the reverse camera can clearly capture the marker point, Pixel N Indicates the pixel equivalent of the pixel image formed by the reverse camera, that is, the actual physical size represented by a pixel in the image.
[0132] This embodiment adopts the above scheme, specifically by determining the zero-point coordinates corresponding to the forward mechanical platform based on the forward mechanical coordinates, forward camera coordinates, forward pixel equivalent and first angle of the first marking point, and determining the zero-point coordinates corresponding to the reverse mechanical platform based on the reverse mechanical coordinates, reverse camera coordinates, reverse pixel equivalent and second angle of the first marking point. That is, based on the angle formed by the camera coordinate system plane and the mechanical platform plane, and the movement distance on each plane, combined with trigonometric functions, the coordinates of the forward and reverse mechanical platforms when the centers of the forward and reverse cameras and the marking point are on the same straight line are obtained, and the coordinates are used as the reference value coordinates when the forward camera is aligned, and as the parameter value of the forward and reverse coordinate conversion formula to convert the coordinates to be converted.
[0133] Reference Figure 7 , Figure 7 This is a flowchart of another exemplary embodiment of the dual-camera calibration method of the present application.
[0134] In step S1002, the step of obtaining the third angle includes:
[0135] Step E100, moving the processing platform along a second preset direction by a second preset distance, obtaining the second marking point after the movement in the forward camera and the reverse camera, and recording it as a third marking point;
[0136] Specifically, after the second movement, the second marking point is obtained. At this time, the third movement is performed, that is, the forward and reverse mechanical platforms remain stationary, and the processing platform is moved a certain distance. The moving direction is not limited, and the moving distance range is. The marking point after movement remains within the field of view of the forward and reverse cameras, and then the coordinates of the marking point at this time are obtained and recorded as the third marking point.
[0137] Step E200, obtaining a forward camera movement distance and a reverse camera movement distance of the third marking point;
[0138] Specifically, the third movement is obtained before and after the third movement. The third movement is to keep the forward and reverse mechanical platforms unchanged, move the processing platform, and ensure that the third marker point after the movement can be captured by the forward and reverse cameras. The distance information before and after the third movement in the forward camera coordinate system, i.e., the forward camera movement distance, and the distance information in the reverse camera coordinate system, i.e., the reverse camera movement distance, are obtained.
[0139] Step E300: Determine the third angle based on the forward camera movement distance and the reverse camera movement distance of the third marking point.
[0140] Specifically, if the third angle is 0, that is, when the forward camera coordinate system plane is parallel to the reverse camera coordinate system plane, the third marker's third movement distance in the forward camera coordinates is equal to its third movement distance in the reverse camera coordinates. If the two distances are not equal, it indicates an angle between the two planes, which may be caused by miscalibration during installation. By comparing the two movement distances of the third marker in the forward and reverse camera coordinates, the angle mapping relationship between the forward and reverse cameras can be obtained. Combined with the inverse angle function in trigonometric functions, the third angle can be obtained.
[0141] Furthermore, the forward and reverse movement distances can be obtained by calculating the forward movement vector (X P , Y P ) and the reverse movement vector (X N , Y N ), as the distance information in the forward camera coordinate system and the distance information in the reverse camera coordinate system, that is, the forward camera coordinate of the third marker point (X3 Pccd , Y3 Pccd ), the forward camera coordinate before moving (X2 Pccd , Y2 Pccd ), reverse camera platform coordinates (X3 Nccd , Y3 Nccd ), the reverse camera coordinate before moving (X2 Nccd , Y2 Nccd ), the specific calculation formula is:
[0142] (X P , Y P )=(X3 Pccd -X2 Pccd , Y3 Pccd -Y2 Pccd )
[0143] (X N , Y N)=(X3 Nccd -X2 Nccd , Y3 Nccd -Y2 Nccd )
[0144] Based on the forward moving vector (X P , Y P ) and the reverse movement vector (X N , Y N ), the installation angle between the forward and reverse cameras is obtained, that is, the third angle α. The specific calculation formula is:
[0145]
[0146] This embodiment adopts the above scheme, specifically by moving the processing platform along the second preset direction by a second preset distance, obtaining the second mark point after movement in the forward camera and the reverse camera, and recording it as the third mark point, obtaining the forward camera movement distance of the third mark point and the reverse camera movement distance, and determining the third angle, that is, the angle between the forward camera and the reverse camera based on the forward camera movement distance of the third mark point and the reverse camera movement distance, so as to finally determine the angle between the forward mechanical platform and the reverse mechanical platform, that is, the fourth angle, based on the third angle. From the mapping relationship of the fourth angle, a calculation formula for converting the spatial positioning information of the front camera into the spatial positioning information of the reverse camera is obtained, thereby achieving the purpose of sharing the forward and reverse spatial positioning information data.
[0147] Reference Figure 8 , Figure 8 This is a flowchart of another exemplary embodiment of the dual-camera calibration method of the present application.
[0148] Specifically, both front and back cameras are mounted on a high-precision mobile platform, and the workpiece is mounted on the processing platform. Front and back operations involve selecting a feature point on the workpiece that can be captured by both front and back cameras and is in the same position, such as a positioning hole on the product.
[0149] Then move the forward and reverse cameras for the first time so that the forward and reverse cameras can clearly capture the feature point coordinate data after the first movement, and then move the forward and reverse mechanical platform for the second time to calculate the angles between the forward and reverse cameras and the forward and reverse mechanical platform, that is, the first angle and the second angle, based on the forward and reverse camera coordinates of the feature points before and after the second movement and the forward and reverse mechanical platform. The specific calculation method can refer to the above embodiment. At this point, the mapping relationship between the forward camera coordinates and the forward mechanical platform coordinates is obtained, and the dual-camera alignment is completed. According to the first angle and the second angle, the zero point coordinates corresponding to the forward mechanical platform and the zero point coordinates corresponding to the reverse mechanical platform can be obtained.
[0150] Then the forward and reverse mechanical platforms remain stationary, and the processing platform is moved for the third time. Based on the forward camera coordinates and reverse camera coordinates of the second marking point before and after the third movement, the angle between the forward and reverse cameras, i.e., the third angle, can be calculated. The calculation method of the third angle refers to the above embodiment. At this point, the mapping relationship between the forward camera coordinates and the reverse camera coordinates is obtained, and the angle calibration between cameras is completed.
[0151] The first angle represents the angle between the forward camera and the forward mechanical platform, the second angle represents the angle between the reverse camera and the reverse mechanical platform, and the third angle represents the angle between the forward camera and the reverse camera. By adding the first angle, the second angle, and the third angle, we can obtain the angle between the forward mechanical platform and the reverse mechanical platform, that is, the fourth angle, and thus obtain the mapping relationship between the forward mechanical platform coordinates and the reverse mechanical platform coordinates.
[0152] According to the fourth angle, the zero point coordinate corresponding to the forward mechanical platform, and the zero point coordinate corresponding to the reverse mechanical platform, a calculation formula for converting the spatial positioning information of the front camera into the spatial positioning information of the reverse camera is obtained, that is, the conversion formula:
[0153]
[0154] Among them, (X * ,Y * ) is the mechanical coordinate when the front platform grabs any feature, (x pn ,y pn ) is the reverse platform mechanical coordinate corresponding to the feature point. The front and reverse sides are not limited. If one of the two processed sides is defined as the front side, the remaining side is the reverse side.
[0155] Through the above scheme, the embodiment of the present application only needs to use one feature point as a reference point. By moving the feature point three times, the mapping relationship between the forward camera coordinates and the reverse camera coordinates, that is, the conversion formula, can be obtained. Through this conversion formula, the mechanical coordinates when the front platform captures any feature can be converted into the corresponding reverse platform mechanical coordinates, thereby realizing the use of a single feature point to complete the alignment and calibration of the front and reverse cameras, simplifying the alignment and calibration workflow, greatly saving the time of processing workpieces, and thus improving the processing positioning efficiency.
[0156] In addition, an embodiment of the present application further provides a dual-camera calibration device, the dual-camera calibration device comprising:
[0157] an acquisition module, configured to acquire spatial positioning information of the workpiece in the forward camera, acquire an angle between the forward camera and the forward mechanical platform (recorded as a first angle), acquire an angle between the reverse camera and the reverse mechanical platform (recorded as a second angle), acquire an angle between the forward camera and the reverse camera (recorded as a third angle), a zero-point coordinate corresponding to the forward mechanical platform, and a zero-point coordinate corresponding to the reverse mechanical platform;
[0158] a determining module, configured to determine an angle between the forward mechanical platform and the reverse mechanical platform based on the first angle, the second angle, and the third angle, recorded as a fourth angle;
[0159] A conversion module is used to convert the spatial positioning information of the processed workpiece in the forward camera into the corresponding spatial positioning information in the reverse camera based on the fourth angle, the zero point coordinate corresponding to the forward mechanical platform, and the zero point coordinate corresponding to the reverse mechanical platform.
[0160] For the principle and implementation process of data flow detection in this embodiment, please refer to the above embodiments and will not be repeated here.
[0161] In addition, an embodiment of the present application also proposes a terminal device, which includes a memory, a processor, and a dual-camera calibration program stored in the memory and runnable on the processor. When the dual-camera calibration program is executed by the processor, the steps of the dual-camera calibration method described above are implemented.
[0162] Since this dual-camera calibration program adopts all the technical solutions of all the aforementioned embodiments when executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0163] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a dual-camera calibration program is stored. When the dual-camera calibration program is executed by a processor, the steps of the dual-camera calibration method described above are implemented.
[0164] Since this dual-camera calibration program adopts all the technical solutions of all the aforementioned embodiments when executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0165] Compared with the existing technology, the current double-sided processing calibration and positioning requires repeated calibration and positioning on the front and back sides respectively, that is, calibration twice in total, and the operation process of the two calibrations is similar, and the calibration work takes a long time. Based on the above problems, the dual-camera calibration method, device, terminal equipment and storage medium proposed in the embodiment of the present application obtain the spatial positioning information of the workpiece in the forward camera, obtain the angle between the forward camera and the forward mechanical platform, recorded as the first angle, obtain the angle between the reverse camera and the reverse mechanical platform, recorded as the second angle, obtain the angle between the forward camera and the reverse camera, recorded as the third angle, the zero-point coordinates corresponding to the forward mechanical platform and the zero-point coordinates corresponding to the reverse mechanical platform, and determine the forward mechanical platform based on the first angle, the second angle and the third angle. The angle between the platform and the reverse mechanical platform is recorded as the fourth angle. Based on the fourth angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, the spatial positioning information of the processed workpiece in the forward camera is converted into the corresponding spatial positioning information in the reverse camera. It only needs to use a marked point on the processed workpiece as a reference, such as a positioning through hole. By moving the positioning through hole and obtaining the corresponding numerical value, the corresponding coordinate data in the reverse direction can be obtained through the conversion formula. No calibration is required in the subsequent processing links, which saves the positioning time of the subsequent processing, thereby improving the efficiency of double-sided processing.
[0166] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0167] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0168] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as mentioned above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present application.
[0169] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A dual-camera calibration method, characterized in that: Applied to a device including a forward mechanical platform, a reverse mechanical platform, and a processing platform, the forward mechanical platform including a forward camera, the reverse mechanical platform including a reverse camera, and a workpiece on the processing platform including a first marking point, the dual-camera calibration method comprising: Obtaining spatial positioning information of the workpiece in the forward camera, obtaining an angle between the forward camera and the forward mechanical platform, recorded as a first angle, obtaining an angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, obtaining the zero point coordinates corresponding to the forward mechanical platform and the zero point coordinates corresponding to the reverse mechanical platform, and obtaining an angle between the forward camera and the reverse camera, recorded as a third angle; Determine an angle between the forward mechanical platform and the reverse mechanical platform based on the first angle, the second angle, and the third angle, and record the angle as a fourth angle; Based on the fourth angle, the zero-point coordinate corresponding to the forward mechanical platform and the zero-point coordinate corresponding to the reverse mechanical platform, the spatial positioning information of the workpiece in the forward camera is converted into corresponding spatial positioning information in the reverse camera.
2. The dual-camera calibration method according to claim 1, wherein: The step of obtaining the angle between the forward camera and the forward mechanical platform, recorded as a first angle, includes: Setting a marking point on the workpiece, which is recorded as a first marking point; Moving the forward mechanical platform and the reverse mechanical platform along a first preset direction by a first preset distance, respectively, to obtain the first marking point after movement, which is recorded as the second marking point; Based on the forward camera coordinates corresponding to the first marking point and the second marking point, and the forward mechanical platform coordinates corresponding to the first marking point and the second marking point, an angle between the forward camera and the forward mechanical platform is determined and recorded as a first angle.
3. The dual-camera calibration method according to claim 2, wherein: The step of obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as the second angle, includes: Based on the reverse camera coordinates corresponding to the first marking point and the second marking point, and the reverse mechanical platform coordinates corresponding to the first marking point and the second marking point, the angle between the reverse camera and the reverse mechanical platform is determined and recorded as the second angle.
4. The dual-camera calibration method according to claim 2, wherein: After the steps of obtaining the angle between the forward camera and the forward mechanical platform, recorded as a first angle, and obtaining the angle between the reverse camera and the reverse mechanical platform, recorded as a second angle, the method further includes: Determine a forward pixel equivalent of the forward camera based on the forward camera coordinates and the forward mechanical platform coordinates of the first marking point and the forward camera coordinates and the forward mechanical platform coordinates corresponding to the second marking point; The reverse pixel equivalent of the reverse camera is determined based on the reverse mechanical platform coordinates and the reverse camera coordinates of the first marking point and the reverse mechanical platform coordinates and the reverse camera coordinates corresponding to the second marking point.
5. The dual-camera calibration method according to claim 4, wherein: The step of obtaining the zero point coordinate corresponding to the forward mechanical platform and the zero point coordinate corresponding to the reverse mechanical platform includes: Determine the zero point coordinates corresponding to the forward mechanical platform based on the forward mechanical coordinates, the forward camera coordinates, the forward pixel equivalent, and the first angle of the first marking point; The zero point coordinates corresponding to the reverse mechanical platform are determined based on the reverse mechanical coordinates, the reverse camera coordinates, the reverse pixel equivalent and the second angle of the first marking point.
6. The dual-camera calibration method according to claim 4, wherein: The step of obtaining the third angle comprises: Moving the processing platform along a second preset direction and a second preset distance, obtaining the second marking point after the movement in the forward camera and the reverse camera, and recording it as a third marking point; Obtaining a forward camera coordinate movement distance and a reverse camera coordinate movement distance of the third marker point; The third angle is determined based on the forward camera coordinate movement distance and the reverse camera coordinate movement distance of the third marking point.
7. The dual-camera calibration method according to claim 6, wherein: The step of determining the third angle based on the forward camera coordinate movement distance and the reverse camera coordinate movement distance of the third marking point includes: Obtaining the forward camera coordinates of the third marking point and the reverse camera coordinates of the second marking point; Determine a motion vector of the third marker point in the forward camera based on the forward camera coordinates of the third marker point and the reverse camera coordinates of the second marker point, and determine a motion vector of the third marker point in the reverse camera based on the reverse camera coordinates of the third marker point and the reverse camera coordinates of the second marker point; The third angle is determined based on a movement vector of the third marking point in the forward camera and the reverse camera.
8. A dual-camera calibration device, characterized in that: The dual-camera calibration device includes: an acquisition module, configured to acquire spatial positioning information of a workpiece in a forward camera, an angle between the forward camera and the forward mechanical platform (recorded as a first angle), an angle between a reverse camera and the reverse mechanical platform (recorded as a second angle), an angle between the forward camera and the reverse camera (recorded as a third angle), a zero-point coordinate corresponding to the forward mechanical platform, and a zero-point coordinate corresponding to the reverse mechanical platform; a determining module, configured to determine an angle between the forward mechanical platform and the reverse mechanical platform based on the first angle, the second angle, and the third angle, recorded as a fourth angle; A conversion module is used to convert the spatial positioning information of the processed workpiece in the forward camera into the corresponding spatial positioning information in the reverse camera based on the fourth angle, the zero point coordinate corresponding to the forward mechanical platform, and the zero point coordinate corresponding to the reverse mechanical platform.
9. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a dual-camera calibration program stored in the memory and executable on the processor. When the dual-camera calibration program is executed by the processor, the steps of the dual-camera calibration method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a dual-camera calibration program, which, when executed by a processor, implements the steps of the dual-camera calibration method according to any one of claims 1 to 7.
Citation Information
Patent Citations
A point cloud registration method based on camera calibration and an ICP algorithm
CN109816703A
Reel-to-reel double-sided digital laser direct writing exposure machine and exposure alignment method
CN113589656A