Large workpiece size measurement method and device, equipment and storage medium
Through the binocular camera to identify and calculate the three-dimensional coordinates of the target, the problems of low accuracy and efficiency of traditional measurement methods are solved, and high-precision dimensional measurement of large workpieces is achieved.
Patent Information
- Application Number
- CN202411326477.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-11-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional accuracy measurement methods have problems with low measurement accuracy and efficiency in large workpiece installations, especially relying on the experience level of workers, making it difficult to meet high accuracy requirements.
Use a binocular camera to capture multiple targets on the reference target board. By identifying the line segment relationship between the camera of the binocular camera and the target, the three-dimensional coordinate information of the target is determined, thereby calculating the dimension information of the workpiece to be tested and improving the measurement. Accuracy and efficiency.
Through machine vision recognition and three-dimensional coordinate calculation, high-precision measurement of large workpiece sizes is achieved, measuring efficiency is improved, and human error is reduced.
Smart Images

Figure CN118936317A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of workpiece measurement, and in particular relates to a large workpiece size measurement method and device, equipment, and storage medium. Background Art
[0002] With the development of aerospace, large ships and large bridge construction, large-sized workpieces are becoming more and more common in the market, and the requirements for their installation accuracy are also becoming higher and higher.
[0003] However, traditional precision measurement generally uses theodolite to establish a station for measurement. The measurement process needs to rely on the workers' experience level, and there are problems such as low measurement accuracy and efficiency. Summary of the invention
[0004] The object of the present invention is to provide a large workpiece size measurement method and device, equipment, and storage medium, which can improve the measurement accuracy and efficiency of large workpiece size.
[0005] The first aspect of the present invention discloses a method for measuring the size of a large workpiece, comprising:
[0006] Controlling the binocular camera to shoot multiple target points on a reference target plate to obtain image information of each target point; wherein the reference target plate is set on the workpiece to be measured;
[0007] According to the image information, identifying a first line segment and a second line segment between two cameras of the binocular camera and each target point respectively;
[0008] Determine the positional relationship of each target point relative to the baseline of the binocular camera, and determine the target calculation formula corresponding to each target point according to the positional relationship; wherein the target calculation formula is derived according to the triangular geometric relationship between the baseline between the two cameras of the binocular camera, the first line segment and the second line segment;
[0009] According to the target calculation formula, the three-dimensional coordinate information of each target point is calculated;
[0010] The size information of the workpiece to be measured is determined according to the three-dimensional coordinate information of all target points.
[0011] In some embodiments, the positional relationship includes a vertical positional relationship and a lateral relative positional relationship; determining the positional relationship of each target point relative to the baseline of the binocular camera, and determining the target calculation formula corresponding to each target point according to the positional relationship, including:
[0012] Determine the vertical position relationship of each target point relative to the baseline of the binocular camera, where the vertical position relationship includes above or below;
[0013] Determine the lateral relative position relationship of each target point relative to the baseline of the binocular camera according to the triangular geometric relationship formed by the baseline between the two cameras of the binocular camera, the first line segment and the second line segment, wherein the lateral relative position relationship includes the left side, the right side or the middle;
[0014] According to the vertical position relationship and lateral relative position relationship of each target point relative to the baseline of the binocular camera, the target calculation formula corresponding to each target point is determined.
[0015] In some embodiments, determining the vertical position relationship of each target point relative to the baseline of the binocular camera includes:
[0016] Control the laser instrument to project laser to each target point, and obtain the angle between the line where the laser is projected to each target point and the horizontal plane;
[0017] According to the angle between the laser line and the horizontal plane, the vertical position relationship of each target point relative to the baseline of the binocular camera is determined.
[0018] In some embodiments, determining the vertical position relationship of each target point relative to the baseline of the binocular camera according to the angle between the laser line and the horizontal plane includes:
[0019] If the angle between the laser line and the horizontal plane is positive, the vertical position relationship of the target point relative to the baseline of the binocular camera is determined to be upward;
[0020] If the angle between the laser line and the horizontal plane is negative, the vertical position relationship of the target point relative to the baseline of the binocular camera is determined to be downward.
[0021] In some embodiments, determining the lateral relative position relationship of each target point relative to the baseline of the binocular camera according to the triangular geometric relationship formed by the baseline between the two cameras of the binocular camera, the first line segment and the second line segment includes:
[0022] Determine whether the angles between the first line segment, the second line segment and the baseline of the binocular camera are both acute angles;
[0023] If they are all acute angles, determine that the horizontal relative position relationship of the target point with respect to the baseline of the binocular camera is in the middle;
[0024] If the angle between the first line segment and the baseline of the binocular camera is not an acute angle, and the angle between the second line segment and the baseline of the binocular camera is an acute angle, the lateral relative position relationship of the target point relative to the baseline of the binocular camera is determined to be on the left side;
[0025] If the angle between the first line segment and the baseline of the binocular camera is an acute angle, and the angle between the second line segment and the baseline of the binocular camera is not an acute angle, it is determined that the lateral relative position relationship of the target point with respect to the baseline of the binocular camera is on the right side.
[0026] In some embodiments, the target calculation formula corresponding to each target point is determined according to the vertical position relationship and the lateral relative position relationship of each target point relative to the baseline of the binocular camera, including:
[0027] If the vertical position relationship of the target point relative to the baseline of the binocular camera is upward and the horizontal relative position relationship is on the left, the corresponding target calculation formula is: ∠XA1C1=180-(γ-θ); X3=L0*cos(180-(γ-θ)); Y3=L0*sin(180-(γ-θ)); Z3=Y1+AC*sinα;
[0028] If the vertical position relationship of the target point relative to the baseline of the binocular camera is upward and the horizontal relative position relationship is to the right, the corresponding target calculation formula is: ∠XA1C1=γ-θ;X3=L0*cos(γ-θ);Y3=L0*sin(γ-θ);Z3=Y1+AC*sinα;
[0029] If the vertical position relationship of the target point relative to the baseline of the binocular camera is downward and the horizontal relative position relationship is on the left, the corresponding target calculation formula is: ∠XA1C1=180-(γ-θ); X3=L0*cos(180-(γ+θ)); Y3=L0*sin(180-(γ+θ)); Z3=Y1+AC*sinα;
[0030] If the vertical position relationship of the target point relative to the baseline of the binocular camera is downward and the horizontal relative position relationship is to the right, the corresponding target calculation formula is: ∠XA1C1=γ+θ;X3=L0*cos(γ+θ);Y3=L0*sin(γ+θ);Z3=Y1-AC*sinα;
[0031] If the vertical position relationship of the target point relative to the baseline of the binocular camera is above and the horizontal relative position relationship is in the middle, the corresponding target calculation formula is: ∠XA1C1=γ-θ; X3=L0*cos(γ-θ); Y3=L0*sin(γ-θ); Z3=Y1+AC*sinα;
[0032] If the vertical position relationship of the target point relative to the baseline of the binocular camera is below and the horizontal relative position relationship is in the middle, the corresponding target calculation formula is: ∠XA1C1=γ+θ;X3=L0*cos(γ+θ);Y3=L0*sin(γ+θ);Z3=Y1-AC*sinα;
[0033] Wherein, the first projection line segment A1C1 is obtained by projecting the first line segment onto the horizontal plane, and the baseline projection line segment A1B1 is obtained by projecting the baseline of the binocular camera onto the horizontal plane; ∠XA1C1 represents the angle between the first projection line segment A1C1 and the X-axis, L0 represents the length of the first projection line segment A1C1, and γ represents the angle between the baseline projection line segment A1B1 and the first projection line segment A1C1. θ represents the angle between the baseline projection line segment A1B1 and the X-axis, α represents the angle between the first line segment and the horizontal plane, AB is the baseline of the binocular camera, AC is the first line segment, BC is the second line segment; (X3, Y3, Z3) are the coordinates of the target point, Y1=0.
[0034] A second aspect of the present invention discloses a large workpiece size measuring device, comprising:
[0035] A shooting unit, used for controlling a binocular camera to shoot a plurality of target points on a reference target plate to obtain image information of each target point; wherein the reference target plate is arranged on a workpiece to be measured;
[0036] an identification unit, configured to identify, according to the image information, a first line segment and a second line segment between the two cameras of the binocular camera and each target point respectively;
[0037] A determination unit, used to determine the positional relationship of each target point relative to the baseline of the binocular camera, and determine a target calculation formula corresponding to each target point according to the positional relationship; wherein the target calculation formula is derived according to the triangular geometric relationship between the baseline between two cameras of the binocular camera, the first line segment, and the second line segment;
[0038] A calculation unit, used to calculate the three-dimensional coordinate information of each target point according to the target calculation formula;
[0039] The measuring unit is used to determine the size information of the workpiece to be measured according to the three-dimensional coordinate information of all target points.
[0040] In some embodiments, the position relationship includes a vertical position relationship and a horizontal relative position relationship; and the determining unit includes:
[0041] A first determination subunit is used to determine the vertical position relationship of each target point relative to the baseline of the binocular camera, where the vertical position relationship includes above or below;
[0042] A second determining subunit is used to determine the lateral relative position relationship of each target point relative to the baseline of the binocular camera according to the triangular geometric relationship formed by the baseline between the two cameras of the binocular camera, the first line segment and the second line segment, wherein the lateral relative position relationship includes the left side, the right side or the middle;
[0043] The third determination subunit is used to determine the target calculation formula corresponding to each target point according to the vertical position relationship and the horizontal relative position relationship of each target point relative to the baseline of the binocular camera.
[0044] The third aspect of the present invention discloses an electronic device, comprising a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the large workpiece size measurement method disclosed in the first aspect.
[0045] A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the large workpiece size measuring method disclosed in the first aspect.
[0046] The beneficial effects of the present invention are that, by controlling a binocular camera to shoot a plurality of target points on a reference target plate disposed on a workpiece to be measured, image information of each target point is obtained, and the first line segment and the second line segment between the two cameras of the binocular camera and each target point are identified according to the image information, and the positional relationship of each target point relative to the baseline of the binocular camera is determined, and a target calculation formula corresponding to each target point is determined according to the positional relationship; wherein the target calculation formula is derived according to the triangular geometric relationship between the baseline, the first line segment and the second line segment between the two cameras of the binocular camera; then, according to the target calculation formula, the three-dimensional coordinate information of each target point is calculated; and according to the three-dimensional coordinate information of all the target points, the size information of the workpiece to be measured is determined, so that the image information of the reference target points on the workpiece to be measured can be collected by the binocular camera, and the position information of the reference target points can be identified based on machine vision, so as to calculate the size of the workpiece to be measured, and the measurement accuracy and efficiency of the size of large workpieces can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings herein show specific examples of the technical solutions described in the present invention, and together with the specific implementation methods, constitute a part of the specification, and are used to explain the technical solutions, principles and effects of the present invention.
[0048] Unless otherwise specified or defined, the same reference numerals in different drawings represent the same or similar technical features, and the same or similar technical features may also be represented by different reference numerals.
[0049] Figure 1 It is a flow chart of a large workpiece size measurement method disclosed in an embodiment of the present invention;
[0050] Figure 2 Schematic diagram of the projection of the baseline, the first line segment and the second line segment of the binocular camera disclosed in the embodiment of the present invention Figure 1 ;
[0051] Figure 3 Schematic diagram of the projection of the baseline, the first line segment and the second line segment of the binocular camera disclosed in the embodiment of the present invention Figure 2 ;
[0052] Figure 4 is a schematic diagram showing that the target point disclosed in an embodiment of the present invention is located above and to the left of the baseline of the binocular camera;
[0053] Figure 5 is a schematic diagram showing that the target disclosed in an embodiment of the present invention is located above and to the right of the baseline of the binocular camera;
[0054] Figure 6 is a schematic diagram showing that the target point disclosed in the embodiment of the present invention is located below and to the left of the baseline of the binocular camera;
[0055] Figure 7 is a schematic diagram showing that the target disclosed in an embodiment of the present invention is located above and to the right of the baseline of the binocular camera;
[0056] Figure 8 is a schematic diagram showing that the target point disclosed in the embodiment of the present invention is located in the middle above the baseline of the binocular camera;
[0057] Fig. 9 is a schematic diagram showing that the target point disclosed in the embodiment of the present invention is located in the middle below the baseline of the binocular camera;
[0058] Fig.10 It is a structural schematic diagram of a large workpiece size measuring device disclosed in an embodiment of the present invention;
[0059] Fig.11 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention.
[0060] Description of reference numerals:
[0061] 1001, photographing unit; 1002, identification unit; 1003, determination unit; 1004, calculation unit; 1005, measurement unit; 1101, memory; 1102, processor. DETAILED DESCRIPTION
[0062] Unless otherwise specified or defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art. In the case of combining the technical solution of the present invention with realistic scenarios, all technical and scientific terms used herein may also have meanings corresponding to the purpose of implementing the technical solution of the present invention. The "first, second..." used herein is only used to distinguish the names and does not represent a specific quantity or order. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0063] It should be noted that when a component is considered to be "fixed to" another component, it can be directly fixed to the other component or there can be a central component; when an component is considered to be "connected to" another component, it can be directly connected to the other component or there can be a central component at the same time; when an component is considered to be "installed on" another component, it can be directly installed on the other component or there can be a central component at the same time. When an component is considered to be "set on" another component, it can be directly set on the other component or there can be a central component at the same time.
[0064] Unless otherwise specified or defined, the "said" and "the" used in this document refer to the technical features or technical contents mentioned or described before the corresponding position, and the technical features or technical contents may be the same as or similar to the technical features or technical contents mentioned therein. In addition, the terms "including" and "having" and any variations thereof used in this document are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0065] The embodiment of the present invention discloses a method for measuring the size of a large workpiece, which can be implemented by computer programming. The execution subject of the method can be an electronic device such as a computer, a laptop, a tablet computer or a robot, or a large workpiece size measuring device embedded in an electronic device, and the present invention is not limited to this. In order to facilitate the understanding of the present invention, the specific embodiments of the present invention will be described in more detail below with reference to the drawings of the specification.
[0066] The embodiment of the present invention discloses a large workpiece size measurement system, which includes a dual-arm robot, a binocular camera, an image detector, a central controller and a reference target plate. The binocular camera, the dual-arm robot and the image detector are respectively connected to the central controller for communication. When in use, the reference target plate is installed on the workpiece to be measured. A plurality of target points are engraved on the reference target plate, and the plurality of target points form a regularly distributed reference pattern. The binocular camera and the image detector are both installed on the dual-arm robot, and the image detector is located at the midpoint of the baseline of the binocular camera. The central controller is also installed on the dual-arm robot, and a large workpiece size measurement device is provided in the central controller for executing a large workpiece size measurement method.
[0067] Among them, the binocular camera can select different types of charge coupled device (CCD) cameras for image acquisition according to needs. The image detector includes a gyro angle measuring instrument and a laser instrument integrated into one. The measuring lines of the gyro angle measuring instrument and the laser instrument are located on the same line. The laser instrument is used to project the laser to the target point on the reference target plate of the workpiece to be measured, and the gyro angle measuring instrument is used to measure the angle between the line where the laser projected by the laser instrument is located and the horizontal plane.
[0068] like Figure 1 As shown, the large workpiece size measurement method includes the following steps 110 to 150:
[0069] 110. Control a binocular camera to photograph multiple target points on a reference target plate to obtain image information of each target point; wherein the reference target plate is disposed on a workpiece to be measured.
[0070] In the embodiment of the present invention, the dual-arm robot can be controlled to move to the front of one side of the reference target plate of the workpiece to be measured, and the binocular camera set on the dual-arm robot is started to collect image information of the reference target plate. There are three target points engraved on the reference target plate, and the three target points form a reference pattern distributed in an equilateral triangle.
[0071] 120. According to the image information, identify the first line segment and the second line segment between the two cameras of the binocular camera and each target point respectively.
[0072] Image information refers to the conversion of the optical image collected by the binocular camera into analog / digital image data. In the process of machine recognition based on image information, after the image data is stored in real time, it is further processed with the support of image processing software. Among them, image processing mainly performs geometric edge extraction, grayscale histogram, image feature extraction and image position calculation on the converted image data.
[0073] like Figure 2 As shown, assuming that the baseline of the binocular camera is AB (i.e., the distance between the two cameras, equivalent to the two cameras of the binocular camera being located at points A and B respectively), the two cameras of the binocular camera simultaneously shoot any target point C on the reference target plate, and the first line segment AC and its length, and the second line segment BC and its length between the two cameras and the target point C respectively can be obtained based on machine vision recognition according to the collected image information, wherein the first line segment AC, the second line segment BC and the baseline AB between the two cameras of the binocular camera are distributed in a triangle.
[0074] 130. Determine the positional relationship of each target point relative to the baseline of the binocular camera, and determine the target calculation formula corresponding to each target point based on the positional relationship; wherein the target calculation formula is derived based on the triangular geometric relationship between the baseline, the first line segment, and the second line segment between the two cameras of the binocular camera.
[0075] The position relationship includes a vertical position relationship and a horizontal relative position relationship. Specifically, step 130 includes the following steps 1301 to 1303 (not shown):
[0076] 1301. Determine the vertical position relationship of each target point relative to the baseline of the binocular camera, where the vertical position relationship includes above or below.
[0077] Step 1301 includes the following steps S11 to S12 (not shown):
[0078] S11, controlling the laser instrument to project a laser to each target point, and obtaining an angle between a line where the laser is projected to each target point by the laser instrument and a horizontal plane.
[0079] In an embodiment of the present invention, a gyro angle meter can be used to measure the angle between the line where the laser projected by the laser to each target point is located and the horizontal plane, wherein the gyro angle meter and the laser are integrated into an image detector, the image detector is located at the midpoint of the baseline between the two cameras of the binocular camera, and the measurement lines of the gyro angle meter and the laser are located on the same line.
[0080] S12. Determine the vertical position relationship of each target point relative to the baseline between the two cameras of the binocular camera according to the angle between the laser line and the horizontal plane.
[0081] Specifically, the positive or negative angle between the laser line and the horizontal plane can be measured by the gyro angle measuring instrument. If the angle between the laser line and the horizontal plane is positive, the target point is determined to be above the baseline of the binocular camera, that is, the height of the target point in three-dimensional space is greater than the midpoint height of the baseline of the binocular camera; if the angle between the laser line and the horizontal plane is negative, the target point is determined to be below the baseline of the binocular camera, that is, the height of the target point in three-dimensional space is less than the midpoint height of the baseline of the binocular camera. It should be noted that the baseline of the binocular camera is not necessarily parallel to the horizontal plane, so the midpoint height is used to represent the height of the baseline.
[0082] For example, Figure 2As shown, the laser instrument is located at the midpoint D of the baseline AB, projecting laser light to the target point C. The gyro angle measuring instrument is also located at point D, and can measure the angle Φ1 of DC relative to the baseline AB, and the angle Φ2 of DC relative to the horizontal plane. If Φ2>0, the target point C is above AB, and if Φ2<0, the target point C is below AB. Figure 2 In the example, it can be clearly seen that the Z-axis coordinate of the target point C is higher than the Z-axis coordinate of the midpoint D of the baseline AB. Therefore, Φ2>0, and the target point C is considered to be above the baseline AB.
[0083] 1302. Determine the lateral relative position relationship of each target point relative to the baseline of the binocular camera according to the triangular geometric relationship formed by the baseline between the two cameras of the binocular camera, the first line segment, and the second line segment. The lateral relative position relationship includes left side, right side, or middle.
[0084] Specifically, step 1302 may include the following steps S21 to S24, which are not shown in the figure:
[0085] S21, determine whether the angles between the first line segment, the second line segment and the baseline of the binocular camera are both acute angles. If so, execute step S22; otherwise, execute step S23 or S24.
[0086] S22. If both are acute angles, determine that the horizontal relative position relationship of the target point with respect to the baseline of the binocular camera is in the middle.
[0087] S23. If the angle between the first line segment and the baseline of the binocular camera is not an acute angle, and the angle between the second line segment and the baseline of the binocular camera is an acute angle, determine that the lateral relative position relationship of the target point with respect to the baseline of the binocular camera is on the left side.
[0088] S24. If the angle between the first line segment and the baseline of the binocular camera is an acute angle, and the angle between the second line segment and the baseline of the binocular camera is not an acute angle, determine that the lateral relative position relationship of the target point with respect to the baseline of the binocular camera is on the right side.
[0089] Assuming that the first line segment and the second line segment are distributed left and right in the field of view of the binocular camera facing the target, when the angle between the first line segment and the baseline is not an acute angle, the target is located on the left side of the baseline, and vice versa, when the angle between the second line segment and the baseline is not an acute angle, the target is located on the right side of the baseline. Among them, non-acute angles can be either right angles or obtuse angles.
[0090] For example, Figure 2As shown in the figure, since the three sides of triangle ABC are known, the angle ∠BAC between the first line segment AC and the baseline AB and the angle ∠ABC between the second line segment BC and the baseline AB can be obtained. If ∠BAC<90° and ∠ABC<90°, the target point C is in the middle of AB; if ∠BAC≥90°, the target point C is on the left side of AB; if ∠ABC≥90°, the target point C is on the right side of AB.
[0091] 1303. Determine a target calculation formula corresponding to each target point according to the vertical position relationship and the horizontal relative position relationship of each target point relative to the baseline of the binocular camera.
[0092] When calculating, the baseline AB, the first line segment AC, and the second line segment BC between the two cameras of the binocular camera need to be projected onto the horizontal plane (i.e., the plane where the X and Y axes are located in the geodetic coordinate system), and the baseline projection line segment A1B1, the first projection line segment A1C1, and the second projection line segment B1C1 are obtained respectively. Since point A is set as a point on the Z axis, the coordinates of A are (0, 0, Z1), and the corresponding projection point A1 is the origin of the geodetic coordinate system (0, 0, 0).
[0093] like Figure 3 As shown, A1C1=AC·cosα, B1C1=BC·cosβ, then we can find Wherein, α represents the angle between the first line segment AC and the horizontal plane, β represents the angle between the second line segment BC and the horizontal plane, and ∠B1A1C1 represents the angle between the baseline projection line segment A1B1 and the first projection line segment A1C1.
[0094] It is known that the positions of the two cameras of the binocular camera A (X1, Y1, Z1) and B (X2, Y2, Z2) are known installation positions, and the lengths of the first line segment AC and the second line segment BC can be measured based on the image information. In addition, an electronic protractor capable of measuring angles is installed in the binocular camera, which can measure the offset angle of the binocular camera relative to the horizontal plane, that is, the values of α and β. Since the projection point A1 corresponding to point A is designed as the coordinate origin by default, the angle θ of A1B1 relative to the X-axis can be measured by a gyro angle measuring instrument, or directly preset to a fixed value. Either α or β can be selected for calculation. In the embodiment of the present invention, α is taken as an example for calculation. It should be noted that in some other embodiments, β can also be used instead of α for calculation.
[0095] Taking α as an example, for each target point C, the following six calculation formulas are derived, and the target calculation formula is any one of the six calculation formulas:
[0096] (1) If the vertical position relationship of the target point relative to the baseline of the binocular camera is upward and the horizontal relative position relationship is left, such as Figure 4As shown, the target calculation formula corresponding to the target point C (X3, Y3, Z3) coordinates is:
[0097] ∠XA1C1=180-(γ-θ);
[0098] X3 = L0*cos(180-(γ-θ));
[0099] Y3 = L0*sin(180-(γ-θ));
[0100] Z3=Y1+AC*sinα.
[0101] (2) If the vertical position relationship of the target point relative to the baseline of the binocular camera is upward and the horizontal relative position relationship is to the right, such as Figure 5 As shown, the target calculation formula corresponding to the target point C (X3, Y3, Z3) coordinates is:
[0102] ∠XA1C1=γ-θ;
[0103] X3 = L0*cos(γ-θ);
[0104] Y3 = L0*sin(γ-θ);
[0105] Z3=Y1+AC*sinα.
[0106] (3) If the vertical position relationship of the target point relative to the baseline of the binocular camera is downward and the horizontal relative position relationship is to the left, such as Figure 6 As shown, the target calculation formula corresponding to the target point C (X3, Y3, Z3) coordinates is:
[0107] ∠XA1C1=180-(γ-θ);
[0108] X3 = L0*cos(180-(γ+θ));
[0109] Y3 = L0*sin(180-(γ+θ));
[0110] Z3=Y1+AC*sinα.
[0111] (4) If the vertical position relationship of the target point relative to the baseline of the binocular camera is downward and the horizontal relative position relationship is to the right, such as Figure 7 As shown, the target calculation formula corresponding to the target point C (X3, Y3, Z3) coordinates is:
[0112] ∠XA1C1=γ+θ;
[0113] X3 = L0*cos(γ+θ);
[0114] Y3=L0*sin(γ+θ);
[0115] Z3=Y1-AC*sinα.
[0116] (5) If the vertical position relationship of the target point relative to the baseline of the binocular camera is above and the horizontal relative position relationship is in the middle, such as Figure 8 As shown, the target calculation formula corresponding to the target point C (X3, Y3, Z3) coordinates is:
[0117] ∠XA1C1=γ-θ;
[0118] X3 = L0*cos(γ-θ);
[0119] Y3 = L0*sin(γ-θ);
[0120] Z3=Y1+AC*sinα.
[0121] (6) If the vertical position relationship of the target point relative to the baseline of the binocular camera is below and the horizontal relative position relationship is in the middle, such as Fig. 9 As shown, the target calculation formula corresponding to the target point C (X3, Y3, Z3) coordinates is:
[0122] ∠XA1C1=γ+θ;
[0123] X3 = L0*cos(γ+θ);
[0124] Y3=L0*sin(γ+θ);
[0125] Z3=Y1-AC*sinα.
[0126] Among them, ∠XA1C1 represents the angle between the first projection line segment A1C1 and the X-axis, L0 represents the length of the first projection line segment A1C1, γ represents the angle between the baseline projection line segment A1B1 and the first projection line segment A1C1, and θ represents the angle between the baseline projection line segment A1B1 and the X-axis. Since AB, AC, BC, α, θ, and Y1=0 are known, γ can be obtained according to AB, AC, and BC, and L0 can be obtained according to AC and α, so the coordinates of the target point C (X3, Y3, Z3) can be calculated, where the X and Y axis coordinates of point C are the same as the X and Y axis coordinates of its projection point C1, that is, the coordinates of the projection point C1 are (X3, Y3, 0).
[0127] 140. According to the target calculation formula, calculate the three-dimensional coordinate information of each target point.
[0128] 150. Determine the size information of the workpiece to be measured based on the three-dimensional coordinate information of all target points.
[0129] like Fig.10As shown, the embodiment of the present invention discloses a large workpiece size measuring device, including a shooting unit 1001, a recognition unit 1002, a determination unit 1003, a calculation unit 1004, and a measurement unit 1005, wherein:
[0130] The shooting unit 1001 is used to control the binocular camera to shoot multiple target points on the reference target plate to obtain image information of each target point; wherein the reference target plate is set on the workpiece to be measured;
[0131] An identification unit 1002 is used to identify a first line segment and a second line segment between two cameras of the binocular camera and each target point according to the image information;
[0132] The determination unit 1003 is used to determine the positional relationship of each target point relative to the baseline of the binocular camera, and determine the target calculation formula corresponding to each target point according to the positional relationship; wherein the target calculation formula is derived according to the triangular geometric relationship between the baseline, the first line segment and the second line segment between the two cameras of the binocular camera;
[0133] The calculation unit 1004 is used to calculate the three-dimensional coordinate information of each target point according to the target calculation formula;
[0134] The measuring unit 1005 is used to determine the size information of the workpiece to be measured according to the three-dimensional coordinate information of all target points.
[0135] As an optional implementation manner, the position relationship includes a vertical position relationship and a horizontal relative position relationship; the determining unit 1003 includes:
[0136] A first determination subunit is used to determine the vertical position relationship of each target point relative to the baseline of the binocular camera, where the vertical position relationship includes above or below;
[0137] A second determining subunit is used to determine the lateral relative position relationship of each target point relative to the baseline of the binocular camera according to the triangular geometric relationship formed by the baseline between the two cameras of the binocular camera, the first line segment and the second line segment, wherein the lateral relative position relationship includes the left side, the right side or the middle;
[0138] The third determination subunit is used to determine the target calculation formula corresponding to each target point according to the vertical position relationship and the horizontal relative position relationship of each target point relative to the baseline of the binocular camera.
[0139] As an optional implementation manner, the first determination subunit specifically includes the following modules not shown in the figure:
[0140] The transmitting module is used to control the laser instrument to project laser to each target point;
[0141] An angle measurement module is used to obtain the angle between the line where the laser is projected to each target point and the horizontal plane;
[0142] The determination module is used to determine the vertical position relationship of each target point relative to the baseline of the binocular camera according to the angle between the laser line and the horizontal plane.
[0143] Among them, the determination module is specifically used to determine that if the angle between the laser line and the horizontal plane is positive, the vertical position relationship of the target point relative to the baseline of the binocular camera is upward; if the angle between the laser line and the horizontal plane is negative, the vertical position relationship of the target point relative to the baseline of the binocular camera is downward.
[0144] As an optional implementation, the second determination subunit is specifically used to determine whether the angles between the first line segment and the second line segment and the baseline of the binocular camera are both acute angles; if they are both acute angles, the lateral relative position relationship of the target point relative to the baseline of the binocular camera is determined to be in the middle; if the angle between the first line segment and the baseline of the binocular camera is not an acute angle, and the angle between the second line segment and the baseline of the binocular camera is an acute angle, the lateral relative position relationship of the target point relative to the baseline of the binocular camera is determined to be on the left side; if the angle between the first line segment and the baseline of the binocular camera is an acute angle, and the angle between the second line segment and the baseline of the binocular camera is not an acute angle, the lateral relative position relationship of the target point relative to the baseline of the binocular camera is determined to be on the right side.
[0145] As an optional implementation manner, the third determining subunit is specifically configured to:
[0146] If the vertical position relationship of the target point relative to the baseline of the binocular camera is upward and the horizontal relative position relationship is on the left, the corresponding target calculation formula is: ∠XA1C1=180-(γ-θ); X3=L0*cos(180-(γ-θ)); Y3=L0*sin(180-(γ-θ)); Z3=Y1+AC*sinα;
[0147] If the vertical position relationship of the target point relative to the baseline of the binocular camera is upward and the horizontal relative position relationship is to the right, the corresponding target calculation formula is: ∠XA1C1=γ-θ;X3=L0*cos(γ-θ);Y3=L0*sin(γ-θ);Z3=Y1+AC*sinα;
[0148] If the vertical position relationship of the target point relative to the baseline of the binocular camera is downward and the horizontal relative position relationship is on the left, the corresponding target calculation formula is: ∠XA1C1=180-(γ-θ); X3=L0*cos(180-(γ+θ)); Y3=L0*sin(180-(γ+θ)); Z3=Y1+AC*sinα;
[0149] If the vertical position relationship of the target point relative to the baseline of the binocular camera is downward and the horizontal relative position relationship is to the right, the corresponding target calculation formula is: ∠XA1C1=γ+θ;X3=L0*cos(γ+θ);Y3=L0*sin(γ+θ);Z3=Y1-AC*sinα;
[0150] If the vertical position relationship of the target point relative to the baseline of the binocular camera is above and the horizontal relative position relationship is in the middle, the corresponding target calculation formula is: ∠XA1C1=γ-θ; X3=L0*cos(γ-θ); Y3=L0*sin(γ-θ); Z3=Y1+AC*sinα;
[0151] If the vertical position relationship of the target point relative to the baseline of the binocular camera is below and the horizontal relative position relationship is in the middle, the corresponding target calculation formula is: ∠XA1C1=γ+θ;X3=L0*cos(γ+θ);Y3=L0*sin(γ+θ);Z3=Y1-AC*sinα;
[0152] Wherein, the first projection line segment A1C1 is obtained by projecting the first line segment onto the horizontal plane, and the baseline projection line segment A1B1 is obtained by projecting the baseline of the binocular camera onto the horizontal plane; ∠XA1C1 represents the angle between the first projection line segment A1C1 and the X-axis, L0 represents the length of the first projection line segment A1C1, and γ represents the angle between the baseline projection line segment A1B1 and the first projection line segment A1C1. θ represents the angle between the baseline projection line segment A1B1 and the X-axis, α represents the angle between the first line segment and the horizontal plane, AB is the baseline of the binocular camera, AC is the first line segment, BC is the second line segment; (X3, Y3, Z3) are the coordinates of the target point, Y1=0.
[0153] like Fig.11 As shown, an embodiment of the present invention discloses an electronic device, including a memory 1101 storing executable program codes and a processor 1102 coupled to the memory 1101;
[0154] The processor 1102 calls the executable program code stored in the memory 1101 to execute the large workpiece size measurement method described in the above embodiments.
[0155] An embodiment of the present invention further discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the large workpiece size measuring method described in the above embodiments.
[0156] The purpose of the above embodiments is to exemplarily reproduce and deduce the technical solution of the present invention, and to fully describe the technical solution, purpose and effect of the present invention. Its purpose is to make the public understand the disclosed content of the present invention more thoroughly and comprehensively, and it does not limit the scope of protection of the present invention.
[0157] The above embodiments are not exhaustive enumerations of the present invention, and there may be multiple other implementations not listed. Any replacement and improvement made without violating the concept of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for measuring the size of a large workpiece, characterized in that: include: Controlling the binocular camera to shoot multiple target points on a reference target plate to obtain image information of each target point; wherein the reference target plate is arranged on a workpiece to be measured; According to the image information, identifying a first line segment and a second line segment between two cameras of the binocular camera and each target point respectively; Determine the positional relationship of each target point relative to the baseline of the binocular camera, and determine the target calculation formula corresponding to each target point according to the positional relationship; wherein the target calculation formula is derived according to the triangular geometric relationship between the baseline between the two cameras of the binocular camera, the first line segment and the second line segment; According to the target calculation formula, the three-dimensional coordinate information of each target point is calculated; The size information of the workpiece to be measured is determined according to the three-dimensional coordinate information of all target points.
2. The large workpiece size measuring method according to claim 1, characterized in that: The positional relationship includes a vertical positional relationship and a lateral relative positional relationship; Determine the positional relationship of each target point relative to the baseline of the binocular camera, and determine the target calculation formula corresponding to each target point according to the positional relationship, including: Determine the vertical position relationship of each target point relative to the baseline of the binocular camera, where the vertical position relationship includes above or below; Determine the lateral relative position relationship of each target point relative to the baseline of the binocular camera according to the triangular geometric relationship formed by the baseline between the two cameras of the binocular camera, the first line segment and the second line segment, wherein the lateral relative position relationship includes the left side, the right side or the middle; According to the vertical position relationship and lateral relative position relationship of each target point relative to the baseline of the binocular camera, the target calculation formula corresponding to each target point is determined.
3. The large workpiece size measuring method according to claim 2, characterized in that: Determine the vertical position relationship of each target point relative to the baseline of the binocular camera, including: Control the laser instrument to project laser to each target point, and obtain the angle between the line where the laser is projected to each target point and the horizontal plane; According to the angle between the laser line and the horizontal plane, the vertical position relationship of each target point relative to the baseline of the binocular camera is determined.
4. The large workpiece size measuring method according to claim 3, characterized in that: According to the angle between the laser line and the horizontal plane, the vertical position relationship of each target point relative to the baseline of the binocular camera is determined, including: If the angle between the laser line and the horizontal plane is positive, the vertical position relationship of the target point relative to the baseline of the binocular camera is determined to be upward; If the angle between the laser line and the horizontal plane is negative, the vertical position relationship of the target point relative to the baseline of the binocular camera is determined to be downward.
5. The large workpiece size measuring method according to claim 2, characterized in that: According to the triangular geometric relationship formed by the baseline between the two cameras of the binocular camera, the first line segment and the second line segment, the lateral relative position relationship of each target point relative to the baseline of the binocular camera is determined, including: Determine whether the angles between the first line segment, the second line segment and the baseline of the binocular camera are both acute angles; If they are all acute angles, determine that the horizontal relative position relationship of the target point with respect to the baseline of the binocular camera is in the middle; If the angle between the first line segment and the baseline of the binocular camera is not an acute angle, and the angle between the second line segment and the baseline of the binocular camera is an acute angle, the lateral relative position relationship of the target point relative to the baseline of the binocular camera is determined to be on the left side; If the angle between the first line segment and the baseline of the binocular camera is an acute angle, and the angle between the second line segment and the baseline of the binocular camera is not an acute angle, it is determined that the lateral relative position relationship of the target point with respect to the baseline of the binocular camera is on the right side.
6. The large workpiece size measuring method according to any one of claims 2 to 5, characterized in that: According to the vertical position relationship and lateral relative position relationship of each target point relative to the baseline of the binocular camera, the target calculation formula corresponding to each target point is determined, including: If the vertical position relationship of the target point relative to the baseline of the binocular camera is upward and the horizontal relative position relationship is on the left, the corresponding target calculation formula is: ∠XA1C1=180-(γ-θ); X3=L0*cos(180-(γ-θ)); Y3=L0*sin(180-(γ-θ)); Z3=Y1+AC*sinα; If the vertical position relationship of the target point relative to the baseline of the binocular camera is upward and the horizontal relative position relationship is to the right, the corresponding target calculation formula is: ∠XA1C1=γ-θ;X3=L0*cos(γ-θ);Y3=L0*sin(γ-θ);Z3=Y1+AC*sinα; If the vertical position relationship of the target point relative to the baseline of the binocular camera is downward and the horizontal relative position relationship is on the left, the corresponding target calculation formula is: ∠XA1C1=180-(γ-θ); X3=L0*cos(180-(γ+θ)); Y3=L0*sin(180-(γ+θ)); Z3=Y1+AC*sinα; If the vertical position relationship of the target point relative to the baseline of the binocular camera is downward and the horizontal relative position relationship is to the right, the corresponding target calculation formula is: ∠XA1C1=γ+θ;X3=L0*cos(γ+θ);Y3=L0*sin(γ+θ);Z3=Y1-AC*sinα; If the vertical position relationship of the target point relative to the baseline of the binocular camera is above and the horizontal relative position relationship is in the middle, the corresponding target calculation formula is: ∠XA1C1=γ-θ; X3=L0*cos(γ-θ); Y3=L0*sin(γ-θ); Z3=Y1+AC*sinα; If the vertical position relationship of the target point relative to the baseline of the binocular camera is below and the horizontal relative position relationship is in the middle, the corresponding target calculation formula is: ∠XA1C1=γ+θ;X3=L0*cos(γ+θ);Y3=L0*sin(γ+θ);Z3=Y1-AC*sinα; Wherein, the first projection line segment A1C1 is obtained by projecting the first line segment onto the horizontal plane, and the baseline projection line segment A1B1 is obtained by projecting the baseline of the binocular camera onto the horizontal plane; ∠XA1C1 represents the angle between the first projection line segment A1C1 and the X-axis, L0 represents the length of the first projection line segment A1C1, and γ represents the angle between the baseline projection line segment A1B1 and the first projection line segment A1C1. θ represents the angle between the baseline projection line segment A1B1 and the X-axis, α represents the angle between the first line segment and the horizontal plane, AB is the baseline of the binocular camera, AC is the first line segment, BC is the second line segment; (X3, Y3, Z3) are the coordinates of the target point, Y1=0.
7. A large workpiece size measuring device, characterized in that: include: A shooting unit, used for controlling a binocular camera to shoot a plurality of target points on a reference target plate to obtain image information of each target point; wherein the reference target plate is arranged on a workpiece to be measured; an identification unit, configured to identify, according to the image information, a first line segment and a second line segment between the two cameras of the binocular camera and each target point respectively; A determination unit, used to determine the positional relationship of each target point relative to the baseline of the binocular camera, and determine a target calculation formula corresponding to each target point according to the positional relationship; wherein the target calculation formula is derived according to the triangular geometric relationship between the baseline between two cameras of the binocular camera, the first line segment, and the second line segment; A calculation unit, used to calculate the three-dimensional coordinate information of each target point according to the target calculation formula; The measuring unit is used to determine the size information of the workpiece to be measured according to the three-dimensional coordinate information of all target points.
8. The large workpiece size measuring device according to claim 7, characterized in that: The position relationship includes a vertical position relationship and a horizontal relative position relationship; the determining unit includes: A first determination subunit is used to determine the vertical position relationship of each target point relative to the baseline of the binocular camera, where the vertical position relationship includes above or below; A second determining subunit is used to determine the lateral relative position relationship of each target point relative to the baseline of the binocular camera according to the triangular geometric relationship formed by the baseline between the two cameras of the binocular camera, the first line segment and the second line segment, wherein the lateral relative position relationship includes the left side, the right side or the middle; The third determination subunit is used to determine the target calculation formula corresponding to each target point according to the vertical position relationship and the horizontal relative position relationship of each target point relative to the baseline of the binocular camera.
9. An electronic device, characterized in that: It comprises a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the large workpiece size measuring method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the large workpiece size measuring method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for measuring three-dimensional geometrical outline of large-size appearance object based on binocular vision
CN102012217A
Multi-functional precise intelligent measuring apparatus and method for geometric quantities
CN107421515A
Three-dimensional alignment precision automatic measurement device and method based on machine vision
CN111504255A
Laser radar and camera synchronous exposure control method and device
CN117310649A
Three-dimensional information restoration device, three-dimensional information restoration system, and three-dimensional information restoration method
WO2016103621A1
