Position detection method, device and system
By using the upper and lower cameras with fixed relative positions in the machine vision measurement system, combined with the moving mechanism and coordinate plate technology, the problem of inaccurate point detection caused by camera position error is solved, and high-precision detection of workpiece points is achieved.
Patent Information
- Application Number
- CN202510278305.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-10
AI Technical Summary
In machine vision-based measurement methods, there is an error between the actual position and the theoretical position after the camera moves, resulting in the inability to accurately detect the actual position of each point on the workpiece.
The upper camera and the lower camera are fixed relative positions, and the moving mechanism is moved to the point to be measured. Combined with the coordinates obtained by the upper camera shooting coordinate plate and the coordinate offset in the image captured by the lower camera, the actual coordinates of the point to be measured are calculated.
By offsetting installation errors and movement errors, the actual position of each point on the workpiece is accurately detected.
Smart Images

Figure CN119779152A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine vision technology, and in particular to a position detection method, device and system. Background Art
[0002] In the field of industrial production, multiple points (also known as hole positions) are often set on the same workpiece. The accuracy of the relative positions between the points will affect the performance of the workpiece and the qualified rate of the assembled product. Therefore, for the same workpiece, the accuracy detection of the relative positions between the points is crucial.
[0003] Therefore, in the related art, a machine vision-based measurement method is usually used to determine the relative positions between various points on the workpiece. Specifically, the principle is: move the camera so that the point whose actual position needs to be determined (hereinafter referred to as the point to be determined) is located within the camera's field of view, and then determine the actual position of the point to be determined based on the camera's posture after movement and the position of the point to be determined in the image.
[0004] Among them, the position of the camera after movement depends on the installation method of the camera and the position after movement. Usually, in the measurement method based on machine vision, the position of the camera after movement is determined according to the installation method and movement position in theoretical conditions. However, due to the existence of installation errors and movement errors, there is an error between the actual position of the camera after movement and the position in theoretical conditions. Therefore, in the measurement method based on machine vision, it is not accurate to determine the actual position of the point to be determined by the position of the camera after movement. Therefore, how to accurately detect the actual position of each point on the workpiece has become a problem that needs to be solved urgently. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a position detection method, device and system to accurately detect the actual position of each point on a workpiece. The specific technical solution is as follows:
[0006] In a first aspect, a position detection method is applied to a position detection system, the system comprising an upper camera and a lower camera fixed in relative position, a moving mechanism for moving the upper camera and the lower camera, and a fixed coordinate plate; the upper camera is used to photograph the coordinate plate; the method comprises:
[0007] Obtaining a shooting position corresponding to the point to be measured photographed by the lower camera;
[0008] Using the moving mechanism, the upper camera and the lower camera are moved to the shooting position of the workpiece to be measured;
[0009] Acquire a second lower camera image taken by the lower camera for the test point of the workpiece to be tested, as well as a first lower camera image and a first upper camera image; the first lower camera image is an image taken by the lower camera by moving the upper camera and the lower camera to the shooting position of the standard workpiece using the moving mechanism, and the first upper camera image is an image taken by the upper camera;
[0010] The actual coordinates of the point to be measured on the workpiece to be measured are obtained according to the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image, and the first coordinates obtained according to the first upper camera image.
[0011] In some embodiments, the points to be measured include reference points and positions to be determined; the method further includes:
[0012] The position between the reference point and the point to be determined is determined based on the first actual coordinates of the reference point and the second actual coordinates of the point to be determined.
[0013] In some embodiments, the moving mechanism includes a driving component and a connecting component disposed between the upper camera and the lower camera, and the driving component is used to drive the connecting component to drive the upper camera and the lower camera to move synchronously.
[0014] In some embodiments, the distance between the photographing position and a point on the workpiece corresponding to the photographing position is maintained at a preset distance.
[0015] In some embodiments, the moving mechanism is specifically used to move the upper camera and the lower camera while keeping the lower camera and the upper camera moving synchronously in the vertical direction, wherein the vertical direction is the normal of the horizontal plane, and the horizontal plane is the plane for placing the standard workpiece and the workpiece to be measured; and the upper camera is a zoom camera.
[0016] In some embodiments, the lens of the upper camera is a liquid telecentric lens.
[0017] In some embodiments, a plurality of identification codes are set on the coordinate plate, and each identification code is used to indicate the coordinate at which the identification code is set;
[0018] Obtaining a first coordinate according to the first upper camera image in the following manner, including:
[0019] The coordinates represented by the identification code located at the center of the first upper camera image are identified as the first coordinates.
[0020] In some embodiments, the horizontal plane is disposed in a first direction of the lower camera, wherein the first direction is a direction pointing from the upper camera to the lower camera;
[0021] The coordinate plate is arranged in a second direction of the upper camera, and the second direction is the opposite direction of the first direction;
[0022] The connecting component is disposed in the second direction of the lower camera and in the first direction of the upper camera.
[0023] In a second aspect, a position detection system is provided, the system comprising: an upper camera and a lower camera fixed in relative position, a moving mechanism, a coordinate plate, and a first processor; the upper camera faces the coordinate plate;
[0024] The moving mechanism is used to move the upper camera and the lower camera under the control of the first processor;
[0025] The upper camera is used to photograph the coordinate plate under the control of the first processor to obtain an upper camera image;
[0026] The lower camera is used to photograph the points to be measured on the workpiece under the control of the first processor to obtain a lower camera image;
[0027] The first processor is used to implement any of the above-mentioned position detection methods.
[0028] In a third aspect, an embodiment of the present application further provides a position detection device, which is applied to a position detection system, wherein the system includes an upper camera and a lower camera whose relative positions are fixed, a moving mechanism for moving the upper camera and the lower camera, and a fixed coordinate plate; the upper camera is used to photograph the coordinate plate; the device includes:
[0029] A first acquisition module is used to acquire a shooting position corresponding to the point to be measured photographed by the lower camera;
[0030] A mobile driving module, used to move the upper camera and the lower camera to the shooting position of the workpiece to be measured by using the mobile mechanism;
[0031] A second acquisition module is used to acquire a second lower camera image taken by the lower camera for the test point of the workpiece to be measured, as well as a first lower camera image and a first upper camera image; the first lower camera image is an image taken by the lower camera by moving the upper camera and the lower camera to the shooting position of the standard workpiece using the moving mechanism, and the first upper camera image is an image taken by the upper camera;
[0032] A coordinate determination module is used to obtain the actual coordinates of the point to be measured on the workpiece to be measured according to the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image, and the first coordinate obtained according to the first upper camera image.
[0033] In some embodiments, the points to be measured include reference points and positions to be determined; the device further includes:
[0034] The position determination module is used to determine the position between the reference point and the position point to be determined based on the first actual coordinates of the reference point and the second actual coordinates of the position point to be determined.
[0035] In some embodiments, the moving mechanism includes a driving component and a connecting component disposed between the upper camera and the lower camera, and the driving component is used to drive the connecting component to drive the upper camera and the lower camera to move synchronously.
[0036] In some embodiments, the distance between the photographing position and a point on the workpiece corresponding to the photographing position is maintained at a preset distance.
[0037] In some embodiments, the moving mechanism is specifically used to move the upper camera and the lower camera while keeping the lower camera and the upper camera moving synchronously in the vertical direction, wherein the vertical direction is the normal of the horizontal plane, and the horizontal plane is the plane for placing the standard workpiece and the workpiece to be measured; and the upper camera is a zoom camera.
[0038] In some embodiments, the lens of the upper camera is a liquid telecentric lens.
[0039] In some embodiments, a plurality of identification codes are set on the coordinate plate, and each identification code is used to indicate the coordinate at which the identification code is set;
[0040] Obtaining a first coordinate according to the first upper camera image in the following manner, including:
[0041] The coordinates represented by the identification code located at the center of the first upper camera image are identified as the first coordinates.
[0042] In some embodiments, the horizontal plane is disposed in a first direction of the lower camera, wherein the first direction is a direction pointing from the upper camera to the lower camera;
[0043] The coordinate plate is arranged in a second direction of the upper camera, and the second direction is the opposite direction of the first direction;
[0044] The connecting component is disposed in the second direction of the lower camera and in the first direction of the upper camera.
[0045] In a fourth aspect, an embodiment of the present application further provides an electronic device, including:
[0046] Memory, used to store computer programs;
[0047] The first processor is used to implement any of the above-mentioned position detection methods when executing the program stored in the memory.
[0048] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described position detection methods.
[0049] Beneficial effects of the embodiments of the present application:
[0050] In the technical solution provided by the embodiment of the present application, the relative positions of the upper camera and the lower camera are fixed, and when the mobile mechanism is used to move to the point to be measured, the coordinates obtained by photographing the coordinate plate with the upper camera can be referred to as the relative coordinates of the point to be measured (hereinafter referred to as the coordinate plate coordinates of the point to be measured). Therefore, as long as the size of the coordinate plate is large enough to cover the workpiece, the coordinate plate coordinates of the point to be measured can be obtained regardless of the size of the workpiece. However, since there are installation errors when each workpiece is installed in the position detection system and movement errors during the movement of the mobile mechanism, the coordinate position of the point to be measured cannot be accurately obtained if only the coordinate plate coordinates are used. The present application can combine the coordinate plate coordinates with the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image to obtain the accurate coordinates of the point to be measured, thereby offsetting the installation error and the movement error, and accurately detecting the actual position of each point on the workpiece.
[0051] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0053] Figure 1 A schematic diagram of the structure of a position detection system provided in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of the positional relationship between the upper camera and the lower camera provided in an embodiment of the present application;
[0055] Figure 3Another schematic diagram of the positional relationship between the upper camera and the lower camera provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of a first flow chart of a position detection method provided in an embodiment of the present application;
[0057] Figure 5 A schematic diagram of the first structure of a position detection device provided in an embodiment of the present application;
[0058] Figure 6 A second structural schematic diagram of a position detection device provided in an embodiment of the present application;
[0059] Figure 7 A second flow chart of the position detection method provided in an embodiment of the present application;
[0060] Figure 8 A physical picture of a workpiece to be tested provided as an example of this application;
[0061] Fig. 9 A top view of a workpiece to be tested provided in an embodiment of the present application;
[0062] Fig.10 A third flow chart of the position detection method provided in the embodiment of the present application;
[0063] Fig.11 A schematic diagram of a fifth lower camera image and a sixth lower camera image provided in an embodiment of the present application;
[0064] Fig.12 A fourth flow chart of the position detection method provided in an embodiment of the present application;
[0065] Fig.13 A fifth flow chart of the position detection method provided in the embodiment of the present application;
[0066] Fig.14 A sixth flow chart of the position detection method provided in an embodiment of the present application;
[0067] Fig.15 A third structural schematic diagram of the position detection device provided in an embodiment of the present application;
[0068] Fig.16 A schematic diagram of a practical application of the position detection device provided in an embodiment of the present application;
[0069] Fig.17 Another structural schematic diagram of a position detection system provided in an embodiment of the present application;
[0070] Fig.18A schematic diagram of the structure of a position detection device provided in an embodiment of the present application;
[0071] Fig.19 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0073] In the field of industrial production, multiple points (also known as hole positions) are often set on the same workpiece. The accuracy of the relative positions between the points will affect the performance of the workpiece and the qualified rate of the assembled product. Therefore, for the same workpiece, the accuracy detection of the relative positions between the points is crucial.
[0074] Therefore, in the related art, a machine vision-based measurement method is usually used to determine the relative positions between various points on the workpiece. Specifically, the principle is: move the camera so that the point whose actual position needs to be determined (hereinafter referred to as the point to be determined) is located within the camera's field of view, and then determine the actual position of the point to be determined based on the camera's posture after movement and the position of the point to be determined in the image.
[0075] Among them, the position of the camera after movement depends on the installation method of the camera and the position after movement. Usually, in the measurement method based on machine vision, the position of the camera after movement is determined according to the installation method and movement position in theoretical conditions. However, due to the existence of installation errors and movement errors, there is an error between the actual position of the camera after movement and the position in theoretical conditions. Therefore, in the measurement method based on machine vision, it is not accurate to determine the actual position of the point to be determined by the position of the camera after movement. Therefore, how to accurately detect the actual position of each point on the workpiece has become a problem that needs to be solved urgently.
[0076] In order to accurately detect the actual position of each point on the workpiece, the embodiment of the present application provides a position detection method, which is applied to the position detection system. Figure 1-Figure 3 The position detection system provided in the embodiment of the present application is described, and then Figure 4 The position detection method provided in the embodiment of the present application is described.
[0077] See also Figure 1 , Figure 1A structural schematic diagram of a position detection system provided in an embodiment of the present application, the position detection system includes a position detection device 11 and a first processor 12, the position detection device 11 includes: an upper camera 111 and a lower camera 112 fixed in relative position, a moving mechanism 113 for moving the upper camera 111 and the lower camera 112, and a fixed coordinate plate 114. Among them, the upper camera 111 is used to photograph the coordinate plate 114, specifically, the upper camera 111 is used to realize the shooting of any upper camera image in the position detection method; the lower camera 112 is used to photograph the points to be measured on the workpiece to be measured and the standard workpiece, specifically, the lower camera 112 is used to realize the shooting of any lower camera image in the position detection method; the first processor 12 is used to implement any step in the position detection method.
[0078] In the embodiment of the present application, the relative position of the upper camera 111 and the lower camera 112 is fixed, which means that the relative position between the upper camera 111 and the lower camera 112 is fixed on the horizontal plane, wherein the horizontal plane is a plane parallel to the storage platform. It can be understood that the storage platform is used to place standard workpieces and workpieces to be measured, and the storage platform can be a platform fixed in the position detection device, or a detachable platform that is not fixed in the position detection device; or, after the upper camera 111, the lower camera 112 and the coordinate plate 114 in the position detection device are set, the area in the direction pointed by the lens of the lower camera 112 can be used as the storage platform.
[0079] Specifically, Figure 2 As shown, Figure 2 A schematic diagram of the positional relationship between the upper camera and the lower camera provided in an embodiment of the present application, Figure 2 In the figure, the plane area in the direction pointed by the lens of the lower camera 112 is the storage platform. On the horizontal plane parallel to the storage platform, the distance 23 between the position of the upper camera 111 and the position of the lower camera 112 remains unchanged.
[0080] Or, in other embodiments, Figure 3 As shown, Figure 3 Another schematic diagram of the positional relationship between the upper camera and the lower camera provided in an embodiment of the present application, Figure 3 In the figure, the plane area in the direction of the lens of the lower camera 112 is the storage platform. On the horizontal plane parallel to the storage platform, the upper camera 111 and the lower camera 112 are in the same position, that is, the optical axis of the upper camera 111 is coaxial with the optical axis of the lower camera 112.
[0081] In some embodiments, the moving mechanism includes a driving component and a connecting component arranged between the upper camera and the lower camera. The moving mechanism drives the upper camera and the lower camera to move. In fact, the driving component drives the connecting component to drive the upper camera and the lower camera to move synchronously.
[0082] The position detection method provided in the embodiment of the present application is applied to any electronic device carrying the first processor 12, which electronic device may be a desktop computer, a portable computer, a smart mobile terminal, etc. The position detection method provided in the embodiment of the present application is described in detail below through specific examples.
[0083] See also Figure 4 , Figure 4 The first flow chart of the position detection method provided in the embodiment of the present application includes the following steps:
[0084] Step S41: obtaining a shooting position corresponding to the point to be measured by shooting with the lower camera;
[0085] Step S42: using a moving mechanism to move the upper camera and the lower camera to a shooting position of the workpiece to be measured;
[0086] Step S43: obtaining a second lower camera image taken by the lower camera at the test point of the workpiece to be tested, as well as a first lower camera image and a first upper camera image; the first lower camera image is an image taken by the lower camera by moving the upper camera and the lower camera to the shooting position of the standard workpiece using a moving mechanism, and the first upper camera image is an image taken by the upper camera;
[0087] Step S44: obtaining the actual coordinates of the point to be measured on the workpiece according to the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image, and obtaining the first coordinate according to the first upper camera image.
[0088] In the technical solution provided by the embodiment of the present application, the relative positions of the upper camera and the lower camera are fixed, and when the mobile mechanism is used to move to the point to be measured, the coordinates obtained by photographing the coordinate plate with the upper camera can be referred to as the relative coordinates of the point to be measured (hereinafter referred to as the coordinate plate coordinates of the point to be measured). Therefore, as long as the size of the coordinate plate is large enough to cover the workpiece, the coordinate plate coordinates of the point to be measured can be obtained regardless of the size of the workpiece. However, since there are installation errors when each workpiece is installed in the position detection system and movement errors during the movement of the mobile mechanism, the coordinate position of the point to be measured cannot be accurately obtained if only the coordinate plate coordinates are used. The present application can combine the coordinate plate coordinates with the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image to obtain the accurate coordinates of the point to be measured, thereby offsetting the installation error and the movement error, and accurately detecting the actual position of each point on the workpiece.
[0089] It can be understood that the position detection method provided in the embodiment of the present application can be used for detecting the actual coordinates of each point on a small-sized workpiece, and can also be used for detecting the actual coordinates of each point on a large-sized workpiece. Among them, a large-sized workpiece refers to a workpiece that is difficult to detect all points in the same field of view of the camera, and a small-sized workpiece refers to a workpiece that can detect all points in the same field of view of the camera. When the workpiece is a large-sized workpiece, in order to achieve the acquisition of the coordinates of the coordinate plate, the coordinate plate in the position detection system should be large enough. Specifically, the size of the coordinate plate should satisfy: when the lower camera shoots any point on the workpiece, the coordinate plate is located in the field of view of the upper camera. In a specific embodiment, for example, when the plane on which the standard workpiece and the workpiece to be measured are placed is a horizontal plane, the size of the coordinate plate should satisfy: it can cover the workpiece to be detected in a direction parallel to the horizontal plane.
[0090] In the above step S41, the point to be measured is any point on the workpiece to be measured that needs to detect the actual coordinates. It can be understood that the workpiece to be measured and the standard workpiece are workpieces of the same form, and the difference between the standard workpiece and the workpiece to be measured is only that the standard workpiece can be understood as a workpiece with no error and extremely high precision. Therefore, the points existing on the workpiece to be measured also exist on the standard workpiece, and for the same point, even if there is an error in the workpiece to be measured, the error will not be too large. Thus, when the standard workpiece is placed on the storage platform and the lower camera is in a certain position, if there is a point to be measured of the standard workpiece in the field of view of the lower camera at this position, then when the workpiece to be measured is placed on the storage platform and the lower camera is in this position, there is also a point to be measured of the workpiece to be measured in the field of view of the lower camera. Similarly, when the workpiece to be measured is placed on the storage platform and the lower camera is in a certain position, if there is a point to be measured of the workpiece to be measured in the field of view of the lower camera at this position, then when the standard workpiece is placed on the storage platform and the lower camera is in this position, there is also a point to be measured of the standard workpiece in the field of view of the lower camera. It can be understood that, in the present application, placing the standard workpiece and the workpiece to be measured on the placement platform means placing the workpiece to be measured and the standard workpiece at the same position on the placement platform, and keeping the standard workpiece and the workpiece to be measured in the same orientation.
[0091] Based on this, in an embodiment of the present application, when a workpiece to be measured or a standard workpiece is placed on the storage platform, the mobile mechanism drives the upper camera and the lower camera to move, and when it is determined that there is a point to be measured in the field of view of the lower camera, the shooting position is determined. It can be understood that the purpose of the electronic device obtaining the shooting position is to subsequently drive the mobile mechanism to carry the upper camera and the lower camera to move to the shooting position again, so that the lower camera can shoot the point to be measured. That is, the shooting position corresponding to the point to be measured is that the lower camera can shoot the point to be measured at this shooting position. Therefore, the shooting position here can be the posture recorded by the mobile mechanism when there is a point to be measured in the field of view of the lower camera, and thus, when the mobile mechanism drives the upper camera and the lower camera to move to this posture again, the lower camera can still shoot the point to be measured.
[0092] Among them, regarding the step of obtaining the shooting position, specifically, taking the workpiece placed on the storage platform as the workpiece to be tested as an example, the electronic device can control the moving mechanism to drive the upper camera and the lower camera to move synchronously, and during the movement, the lower camera continuously captures images, and uploads the captured images to the electronic device in real time, and the electronic device recognizes them. When the electronic device recognizes that there is a point to be tested of the standard workpiece in the image, the position of the moving mechanism when the image is captured is used as the shooting position, thereby achieving the acquisition of the shooting position. Alternatively, the operator can also control the upper camera and the lower camera to move synchronously. When it is determined that there is a point to be tested of the standard workpiece in the field of view of the lower camera, the position of the moving mechanism at this time is used as the shooting position, and the shooting position is recorded for subsequent reading by the electronic device.
[0093] In addition, in some embodiments, each point on the workpiece to be measured can be used as a point to be measured, and then, the shooting position corresponding to each point on the workpiece to be measured can be predetermined, and the shooting position and each point can be stored in correspondence. In this way, when the subsequent electronic device needs to detect the actual coordinates of a point, it only needs to read the shooting position corresponding to the point, and there is no need to perform the step of determining the shooting position after each switch of the point to be measured.
[0094] Specifically, for example, if the points on the workpiece to be measured are point 1 and point 2, the shooting position corresponding to point 1 (such as shooting position 1) and the shooting position corresponding to point 2 (such as shooting position 2) are determined in advance, and point 1 and shooting position 1, point 2 and shooting position 2 are stored in correspondence. If the electronic device needs to detect the actual coordinates of point 1 on the workpiece to be measured later, the shooting position corresponding to the stored point 1, that is, shooting position 1, can be directly obtained, and then the actual coordinates of point 1 can be detected based on subsequent steps S42-S44. If the electronic device needs to determine the actual coordinates of point 2 on the workpiece to be measured later, the shooting position corresponding to the stored point 2, that is, shooting position 2, can be directly obtained, and then the actual coordinates of point 2 can be detected based on subsequent steps S42-S44.
[0095] Alternatively, in some embodiments, the step of determining the shooting position may be performed each time the point to be measured is switched. For example, the points on the workpiece to be measured are point 1 and point 2. If the electronic device needs to detect the actual coordinates of point 1 on the workpiece to be measured, the upper camera and the lower camera are driven to move by the moving mechanism until point 1 exists in the field of view of the lower camera. At this time, the position and posture of the moving mechanism are recorded as the shooting position corresponding to point 1 (i.e., shooting position 1). Then, the electronic device obtains the shooting position 1 corresponding to point 1, and then detects the actual coordinates of point 1 based on shooting position 1 and steps S42-S43. Afterwards, if the electronic device needs to determine the actual coordinates of point 2 on the workpiece to be measured, the upper camera and the lower camera are driven to move by the moving mechanism until point 2 exists in the field of view of the lower camera. At this time, the position and posture of the moving mechanism are recorded as the shooting position corresponding to point 2 (i.e., shooting position 2). Then, the electronic device obtains the shooting position 2 corresponding to point 2, and then detects the actual coordinates of point 2 based on shooting position 2 and steps S42-S43.
[0096] In the above step S42, after the electronic device obtains the shooting position, when the workpiece to be measured is placed on the storage platform, the upper camera and the lower camera are moved to the obtained shooting position by the moving mechanism. At this time, there are points to be measured on the workpiece to be measured in the field of view of the lower camera.
[0097] In the above step S43, the second lower camera image is an image of the workpiece to be measured obtained by the lower camera when the moving mechanism drives the upper camera and the lower camera to move to the shooting position. It can be understood that the second lower camera image contains the test points of the workpiece to be measured.
[0098] The first lower camera image is an image obtained by the lower camera shooting the standard workpiece when the moving mechanism drives the upper camera and the lower camera to move to the shooting position. It can be understood that there are points to be measured of the standard workpiece in the first lower camera image. The first upper camera image is an image obtained by the upper camera shooting the coordinate plate when the moving mechanism drives the upper camera and the lower camera to move to the shooting position.
[0099] In this step, the electronic device only obtains the first upper camera image, the first lower camera image, and the second lower camera image, and does not limit the shooting time of the first upper camera image, the first lower camera image, and the second lower camera. It can be understood that in some embodiments, the first upper camera image, the first lower camera image, and the second lower camera image can all be taken before step S43. For example, after the electronic device obtains the shooting position corresponding to the point to be measured through step S41, it executes step S42, uses the moving mechanism to move the upper camera and the lower camera to the shooting position of the workpiece to be measured, and uses the lower camera to shoot the workpiece to be measured at the shooting position to obtain the second lower camera image; then, the upper camera and the lower camera are moved to the shooting position of the standard workpiece by the moving mechanism, and the standard workpiece is photographed at the shooting position using the lower camera to obtain the first lower camera image, and at the same time, the coordinate plate is photographed using the upper camera to obtain the first upper camera image. As a result, the electronic device can obtain the first upper camera image, the first lower camera image, and the second lower camera image in step S43.
[0100] For another example, after the electronic device obtains the shooting position corresponding to the point to be measured through step S41, it uses the moving mechanism to move the upper camera and the lower camera to the shooting position of the standard workpiece, and uses the lower camera to shoot the standard workpiece at the shooting position to obtain the first lower camera image. At the same time, the coordinate plate is photographed using the upper camera to obtain the first upper camera image. After that, step S42 is executed, that is, the upper camera and the lower camera are moved to the shooting position of the workpiece to be measured using the moving mechanism, and the workpiece to be measured is photographed at the shooting position using the lower camera to obtain the second lower camera image. As a result, in step S43, the electronic device can obtain the first upper camera image, the first lower camera image, and the second lower camera image.
[0101] Alternatively, in some other embodiments, the first upper camera image, the first lower camera image, and the second lower camera image may also be obtained by taking pictures when executing step S43. For example, after the electronic device obtains the shooting position corresponding to the point to be measured through step S41, step S42 is executed, and the upper camera and the lower camera are driven to move to the shooting position of the workpiece to be measured by the moving mechanism; thereafter, step S43 is executed, specifically, the lower camera is controlled to shoot the workpiece to be measured to obtain the second lower camera image, and at the same time, the upper camera and the lower camera are driven to move to the shooting position of the standard workpiece by the moving mechanism, and the lower camera is controlled to shoot the standard workpiece at the shooting position to obtain the first lower camera image, and the upper camera is controlled to shoot the coordinate plate to obtain the first upper camera image, and then the first upper camera image, the first lower camera image, and the second lower camera image are sent to the electronic device, thereby realizing the acquisition of the first upper camera image, the first lower camera image, and the second lower camera image by the electronic device.
[0102] Alternatively, in some embodiments, the electronic device may place the standard workpiece on the storage platform before executing step S41, and use a moving mechanism to drive the upper camera and the lower camera to move synchronously, determine the shooting position corresponding to each point, and control the upper camera to shoot the coordinate plate at the shooting position, and control the lower camera to shoot the standard workpiece, thereby obtaining the first lower camera image and the first upper camera image corresponding to each point, and correspondingly store the point to be measured, the first upper camera image and the first lower camera image corresponding to the point to be measured, and the shooting position corresponding to the point to be measured. For example, if the points on the standard workpiece are point 1 and point 2, the electronic device can place the workpiece to be measured on the storage platform before executing step S41, and use the moving mechanism to drive the upper camera and the lower camera to move synchronously. When point 1 exists in the field of view of the lower camera, the lower camera shoots the standard workpiece to obtain the first lower camera image corresponding to point 1, and the upper camera shoots the coordinate plate to obtain the first upper camera image corresponding to point 1, and determines the current position of the moving mechanism as the shooting position 1 corresponding to point 1; when point 2 exists in the field of view of the lower camera, the lower camera shoots the standard workpiece to obtain the first lower camera image corresponding to point 2, and the upper camera shoots the coordinate plate to obtain the first upper camera image corresponding to point 2, and determines the current position of the moving mechanism as the shooting position 2 corresponding to point 2. Then, the shooting position 1, the first upper camera image, and the first lower camera image corresponding to point 1, and the shooting position 2, the first upper camera image, and the first lower camera image corresponding to point 2 are stored accordingly; thus, when executing step S41, the electronic device can directly read the shooting position corresponding to the point to be measured. When executing step S43, the electronic device directly obtains the first upper camera image and the first lower camera image corresponding to the point to be measured.
[0103] It can be understood that no matter how many workpieces to be measured there are, by applying the method provided in this embodiment, it is only necessary to collect the first upper camera image and the first lower camera image once for each point to be measured on the standard workpiece, so as to determine the actual coordinates of each point to be measured on the workpiece to be measured. There is no need to collect the first upper camera image and the first lower camera image once for each point to be measured on the standard workpiece every time a workpiece to be measured is changed.
[0104] In addition, it can be understood that in order to realize the upper camera shooting of the coordinate plate, and the lower camera shooting of the workpiece placed on the storage platform, the positional relationship between the storage platform, the coordinate plate and the upper camera and the lower camera in the position detection device must be satisfied, and the storage platform is located in the direction of the lens of the lower camera, and the coordinate plate is located in the direction of the lens of the upper camera. For example, taking the example that there is a storage platform in the position detection device, and the optical axis of the upper camera is coaxial with the optical axis of the lower camera, the positional relationship between the upper camera, the lower camera, the coordinate plate, and the storage platform can be as follows: Figure 5As shown, the coordinate plate 114 is located above the upper camera 111 , and the lens of the upper camera 111 faces the coordinate plate 114 ; the storage platform 115 is located below the lower camera 112 , and the lens of the lower camera 112 faces the storage platform 115 .
[0105] Alternatively, the positional relationship between the upper camera, the lower camera, the coordinate plate, and the storage platform can also be as follows: Figure 6 As shown, the coordinate plate 114 is located between the upper camera 111 and the lower camera 112, and the lens of the upper camera 111 faces the coordinate plate 114; the storage platform 115 is located below the lower camera 112, and the lens of the lower camera 112 faces the storage platform 115; the upper camera 111 and the lower camera 112 are connected based on the first horizontal rod 116, the second horizontal rod 117, and the third horizontal rod 118 to achieve synchronous movement on the horizontal plane. However, based on the above Figure 6 It can be seen that when the coordinate plate 114 is located between the upper camera 111 and the lower camera 112, in order to leave enough space for the upper camera 111 and the lower camera 112 to move in the horizontal plane, the first horizontal rod 116 and the second horizontal rod 117 need to be set longer, and a certain distance needs to be maintained between the third horizontal rod 118 and the coordinate plate 114. In this way, when the size of the standard workpiece and the workpiece to be measured is large, the upper camera 111 and the lower camera 112 have a larger space to move in the horizontal plane and will not be blocked by the coordinate plate 114. Among them, the first horizontal rod 116, the second horizontal rod 117 and the third horizontal rod 118 can be regarded as the above-mentioned Figure 1 The moving mechanism in the position detection system is shown.
[0106] In some embodiments, in order to save the space occupied by the position detection device and facilitate the synchronous movement of the upper camera and the lower camera in the position detection device in the horizontal plane, the storage platform can be set in the first direction of the lower camera, and the coordinate plate can be set in the second direction of the upper camera, wherein the first direction is the direction in which the upper camera points to the lower camera, and the second direction is the opposite direction of the first direction; the connecting component is set in the second direction of the lower camera and in the first direction of the upper camera. That is, the positional relationship between the upper camera, the lower camera, the coordinate plate and the storage platform is set to be similar to Figure 5 The form shown.
[0107] In the above step S44, the second lower camera image is an image obtained by the lower camera photographing the workpiece to be measured when the moving mechanism drives the upper camera and the lower camera to move to the acquired shooting position. Specifically, the second lower camera image contains the test point of the workpiece to be measured. The first lower camera image is an image obtained by the lower camera photographing the standard workpiece when the moving mechanism drives the upper camera and the lower camera to move to the acquired shooting position. Specifically, the first lower camera image contains the test point of the standard workpiece.
[0108] The first upper camera image is an image obtained by the upper camera photographing the coordinate plate when the upper camera and the lower camera are moved to the shooting position of the standard workpiece by using a moving mechanism, that is, when a standard workpiece is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move to the acquired shooting position and the upper camera photographs the coordinate plate. Specifically, in some embodiments, when a standard workpiece is placed on the storage platform, after the electronic device controls the moving mechanism to drive the upper camera and the lower camera to move to the acquired shooting position, the upper camera can be controlled to shoot the first upper camera image while the lower camera is controlled to shoot the first lower camera image; or, in some embodiments, when a standard workpiece is placed on the storage platform, after the electronic device controls the moving mechanism to drive the upper camera and the lower camera to move to the acquired shooting position, the lower camera can be controlled to shoot the first lower camera image first, and then the upper camera can be controlled to shoot the first upper camera image; or, in some embodiments, the electronic device can simultaneously acquire the shooting positions corresponding to multiple points to be measured, and then control the moving mechanism to drive the upper camera and the lower camera to move to each of the acquired shooting positions in turn, and control the lower camera to shoot the first lower camera image at each shooting position; thereafter, the moving mechanism is controlled to drive the upper camera and the lower camera to move to each of the acquired shooting positions in turn, and the upper camera is controlled to shoot the first upper camera image at each shooting position.
[0109] In the embodiment of the present application, the electronic device determines the actual coordinates of the point to be measured on the workpiece to be measured according to the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image, and the first coordinate obtained according to the first upper camera image. It can be understood that the positions of the upper camera and the lower camera are relatively fixed, and the electronic device can determine the position of the upper camera when shooting the first upper camera image according to the first upper camera image, and then, according to the relative distance between the upper camera and the lower camera on the horizontal plane, the position of the lower camera when shooting the first lower camera image can be determined, thereby, according to the first coordinate, the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image, and the relative distance between the upper camera and the lower camera on the horizontal plane, the actual coordinates of the point to be measured on the lower workpiece to be measured can be determined. It can be understood that when the optical axis of the upper camera is coaxial with the optical axis of the lower camera, the actual coordinates of the point to be measured on the workpiece to be measured can be detected directly according to the first coordinate and the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image.
[0110] It can be understood that, regarding obtaining the first coordinate according to the first upper camera image, in some embodiments, a plurality of identification codes are set on the coordinate plate, each identification code is used to indicate the position where the identification code is set, and there is a pre-set identification code in the first upper camera image taken by the upper camera, and the electronic device can identify the position indicated by the identification code in the upper camera image as the first coordinate. Among them, the identification code can be an identification that is easy to be identified and can store location information, such as a QR code, an electronic tag, etc. Among them, if there are multiple identifications in the upper camera image at the same time, the electronic device can use the position indicated by one of the identifications as the standard. For example, it is pre-set that when there are multiple identifications in the upper camera image, the identification located in the center of the multiple identifications is used as the standard. Then, when there are multiple identifications in the upper camera image, the electronic device uses the position indicated by the identification located in the center of the upper camera image as the standard.
[0111] Alternatively, in some embodiments, different special characters or colors may be set at different positions of the coordinate plate, so that the electronic device can determine the position of the upper camera when taking the upper camera image through the special characters or colors in the upper camera image. Alternatively, in some specific embodiments, the coordinate plate may be a calibration plate.
[0112] In the following, taking the optical axis of the upper camera and the optical axis of the lower camera in the position detection device as an example, Figure 7 The example shown once again illustrates the position detection method provided in the embodiment of the present application.
[0113] like Figure 7 As shown, Figure 7 A second flow chart of the position detection method provided in the embodiment of the present application may include the following steps:
[0114] Step S71: acquiring a third lower camera image obtained by photographing the standard workpiece by the lower camera when the lower camera is located at the first position, and a second upper camera image obtained by photographing the coordinate plate by the upper camera; wherein, when the lower camera is located at the first position, the to-be-measured point of the standard workpiece is located within the field of view of the lower camera;
[0115] Step S72: determining, according to the second upper camera image, a second position of the upper camera when the second upper camera image is captured;
[0116] Step S73: acquiring a fourth lower camera image of the workpiece to be measured obtained by the lower camera photographing the workpiece when the upper camera is located at the second position;
[0117] Step S74: determining a third position of the point to be measured in the third lower camera image, determining a fourth position of the point to be measured in the fourth lower camera image, and calculating a first relative position between the third position and the fourth position;
[0118] Step S75: Calculate the actual coordinates of the point to be measured on the workpiece according to the first relative position and the second position.
[0119] In the technical solution provided in the embodiment of the present application, a first position is obtained that enables the point to be measured of the standard workpiece to be located in the field of view of the lower camera. At the first position, the upper camera photographs the coordinate plate to obtain a second upper camera image (i.e., the first upper camera image), and the lower camera photographs the standard workpiece to obtain a third lower camera image (i.e., the first lower camera image). Afterwards, the second position (i.e., the first coordinate) is determined based on the first upper camera image, and a fourth lower camera image (i.e., the second lower camera image) of the workpiece to be measured photographed by the lower camera when the upper camera is located at the second position is obtained. Thus, based on the first relative position (i.e., the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image) and the second position, the actual coordinates of the point to be measured on the workpiece to be measured can be determined.
[0120] In the above step S71, when a standard workpiece is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move synchronously. When there is a point to be measured of the standard workpiece in the field of view of the lower camera, the position of the upper camera and the lower camera is the first position.
[0121] The third lower camera image is an image obtained by the lower camera photographing the standard workpiece when the upper camera and the lower camera are located at the first position (it can be understood that the upper camera and the lower camera are coaxial in this example, so on the horizontal plane, the upper camera and the lower camera are always in the same position), and the standard workpiece is placed on the storage platform. Since the test point of the standard workpiece is located within the field of view of the lower camera when the lower camera is located at the first position, the test point of the standard workpiece exists in the third lower camera image; the second upper camera image is an image obtained by the upper camera photographing the coordinate plate when the upper camera and the lower camera are located at the first position and the standard workpiece is placed on the storage platform. Here, the third lower camera image is the first lower camera image in the above step S43, and the second upper camera image is the first upper camera image in the above step S43.
[0122] It can be understood that when the lower camera is located at the first position, although the upper camera is also located at the first position, the first position is determined based on whether there is a point to be measured in the field of view of the lower camera, that is, where the point to be measured of the standard workpiece is detected in the field of view of the lower camera, then that is the first position. Therefore, the electronic device does not know the specific coordinates of the first position. Therefore, it is necessary to determine the specific positions of the upper and lower cameras when the lower camera photographs the point to be measured of the standard workpiece based on the image of the coordinate plate taken by the upper camera at the first position (that is, the second upper camera image).
[0123] In the embodiment of the present application, after the lower camera captures the third lower camera image and the upper camera captures the second upper camera image, the acquired third lower camera image and the second upper camera image can be sent to the electronic device in real time; or the electronic device can actively acquire the second upper camera image and the third lower camera image from the upper camera and the lower camera at a regular time, so as to realize the acquisition of the third lower camera image and the second upper camera image by the electronic device. In the present application, there is no specific limitation on how the electronic device acquires images from the upper camera and the lower camera.
[0124] In the above step S72, the electronic device can determine the second position of the upper camera when the second upper camera image is captured based on the second upper camera image. Here, the second position can be understood as the first coordinate in the above step S44.
[0125] It can be understood that, referring to the content shown in the above step S71, the third upper camera image and the second lower camera image are taken when the upper camera and the lower camera are located at the first position. Therefore, in theory, the position of the upper camera when taking the second upper camera image is the first position. Therefore, the second position determined by the electronic device through the mark in the second upper camera image can actually be understood as the first position (that is, the first position can be understood as the shooting position in the above step S41). Therefore, in theory, when a standard workpiece is placed on the storage platform, when the upper camera and the lower camera are controlled to move synchronously to the second position, the point to be measured of the standard workpiece will exist in the field of view of the lower camera.
[0126] In the above step S73, when the workpiece to be measured is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move to the second position. At this time, the lower camera shoots the workpiece to be measured to obtain the fourth lower camera image. It can be understood that when a standard workpiece is placed on the storage platform, when the upper camera and the lower camera are in the second position, the point to be measured of the standard workpiece will exist in the field of view of the lower camera. The workpiece to be measured is a workpiece that is consistent with the form of the standard workpiece. Although there may be an error between the workpiece to be measured and the standard workpiece, the error will not be too large. Therefore, when the workpiece to be measured is placed on the storage platform, after controlling the upper camera and the lower camera to move synchronously to the second position, the point to be measured of the workpiece to be measured will exist in the field of view of the lower camera, that is, the fourth lower camera image captured by the lower camera contains the point to be measured of the workpiece to be measured. Here, the fourth lower camera image can be understood as the second lower camera image in the above step S43.
[0127] In the above step S74, the third position is the position of the point to be measured of the standard workpiece determined by the electronic device based on the third camera image. It can be understood that based on the above step S71, there are points to be measured of the standard workpiece in the third camera image. Therefore, based on the third camera image, the electronic device can determine the third position.
[0128] The fourth position is the position of the point to be measured in the workpiece to be measured determined by the electronic device based on the fourth camera image; based on the above step S73, it can be known that there is a point to be measured of the workpiece to be measured in the fourth camera image, so based on the fourth camera image, the electronic device can determine the fourth position. Furthermore, the electronic device can obtain the relative position between the third position and the fourth position by difference calculation as the first relative position. Among them, the first relative position can be understood as the coordinate offset of the point to be measured in the above step S44 in the first camera image and the second camera image.
[0129] It can be understood that the third position and the fourth position in this embodiment are both positions of the point to be measured in the camera coordinate system. The second position in the above step S72 is actually a position obtained based on the information of the coordinate plate in the upper camera image, such as the position obtained by identifying the QR code on the coordinate plate in the upper camera image. The position of the coordinate plate does not change, so the third position and the fourth position and other positions determined by the upper camera image are positions in the physical coordinate system. Among them, the camera coordinate system can be understood as a coordinate system established for the camera, which will change with the movement of the camera; the physical coordinate system can be understood as a coordinate system established for the coordinate plate, and the position of the coordinate plate does not change, that is, the physical coordinate system is fixed.
[0130] In the above step S75, the electronic device can determine the actual coordinates of the point to be measured on the workpiece to be measured according to the first relative position and the first position. For details, please refer to the content recorded in the above step S44.
[0131] In some embodiments, the point to be measured includes a reference point and a point to be determined. The electronic device can determine the position between the reference point and the point to be determined based on the first actual coordinates of the reference point and the second actual coordinates of the point to be determined.
[0132] It is understandable that there are positions to be determined and reference points on the standard workpiece, and there are positions to be determined and reference points on the workpiece to be measured. Among them, the reference point can be a point set outside the positions to be determined and specially used to assist in detecting the position of each position to be determined, or one or more points can be selected from multiple positions to be determined as reference points. On the same workpiece, there can be one or more reference points, and there can also be one or more positions to be determined.
[0133] For example, Figure 8 As shown, Figure 8 A physical image of a workpiece to be measured provided as an example of this application, wherein the first hole positions 81 are all reference points on the workpiece to be measured, and the second hole positions 82 are all positions to be determined on the workpiece to be measured. It can be understood that Figure 8Only some of the hole positions are marked, not all of them. Fig. 9 As shown, Fig. 9 A top view of a workpiece to be measured provided in an embodiment of the present application, wherein circle 1 with slashes and circle 8 with slashes are reference points on the workpiece to be measured, and black circles 2-7 are position points to be determined on the workpiece to be measured.
[0134] In addition, the position between the reference point and the position to be determined is the difference between the actual coordinates of the reference point and the actual coordinates of the position to be determined. Figure 4 The method shown can calculate the actual coordinates of any point to be measured on the workpiece to be measured. Therefore, the electronic device can be based on the above Figure 4 The actual coordinates of the reference point on the workpiece to be measured (i.e., the first actual coordinates) are determined in the manner shown, and based on the above Figure 4 The method shown determines the actual coordinates (i.e., the second actual coordinates) of the position point to be determined on the workpiece to be measured. Thus, the position between the reference point and the position point to be determined can be obtained by subtracting the first actual coordinates from the second actual coordinates.
[0135] In the following, taking the optical axis of the upper camera and the optical axis of the lower camera in the position detection device as an example, Fig.10 The example shown further illustrates the process of determining the position degree according to the position detection method provided in the embodiment of the present application.
[0136] like Fig.10 As shown, Fig.10 The third flow chart of the position detection method provided in the embodiment of the present application may include the following steps:
[0137] Step S101: acquiring a fifth lower camera image obtained by photographing the standard workpiece by the lower camera when the lower camera is located at the fifth position, and a third upper camera image obtained by the upper camera coordinate plate; wherein the reference point of the standard workpiece is located within the field of view of the lower camera when the lower camera is located at the fifth position;
[0138] Step S102: acquiring a sixth lower camera image obtained by photographing the standard workpiece by the lower camera when the lower camera is located at the sixth position, and a fourth upper camera image obtained by photographing the coordinate plate by the upper camera; wherein, when the lower camera is located at the sixth position, the position point to be determined of the standard workpiece is located within the field of view of the lower camera;
[0139] Step S103: determining, according to the third upper camera image, the seventh position at which the upper camera was located when the third upper camera image was captured; and determining, according to the fourth upper camera image, the eighth position at which the upper camera was located when the fourth upper camera image was captured;
[0140] Step S104: acquiring a seventh lower camera image of the workpiece to be measured obtained by the lower camera when the upper camera is located at the seventh position, and an eighth lower camera image of the workpiece to be measured obtained by the lower camera when the upper camera is located at the eighth position;
[0141] Step S105: determining a ninth position of the reference point in the fifth camera image, determining a tenth position of the reference point in the seventh camera image, and calculating a second relative position between the ninth position and the tenth position;
[0142] Step S106: determining the eleventh position of the position point to be determined in the sixth camera image, determining the twelfth position of the position point to be determined in the eighth camera image, and calculating a third relative position between the eleventh position and the twelfth position;
[0143] Step S107: Calculate the position between the position point to be determined on the workpiece to be measured and the reference point according to the second relative position and the third relative position, and the fourth relative position between the seventh position and the eighth position.
[0144] In the technical solution provided in the embodiment of the present application, when the lower camera is located at the fifth position, the upper camera shoots the coordinate plate to obtain the third upper camera image, and the lower camera shoots the standard workpiece to obtain the fourth lower camera image; when the lower camera is located at the sixth position, the upper camera shoots the coordinate plate to obtain the fourth upper camera image, and the lower camera shoots the standard workpiece to obtain the sixth lower camera image; based on the third upper camera image, the seventh position of the upper camera when the third upper camera image is taken can be determined, and based on the fourth upper camera image, the eighth position of the upper camera when the fourth upper camera image is taken can be determined; since the upper camera is coaxial with the lower camera, when the workpiece to be measured is placed on the storage platform, when the upper camera moves to the seventh position, the lower camera can capture the seventh lower camera image with the reference point of the workpiece to be measured; when the upper camera moves to At the eighth position, the lower camera can capture the eighth lower camera image with the position point to be determined of the workpiece to be measured, thereby determining the ninth position of the reference point in the fifth lower camera image, determining the tenth position of the reference point in the seventh lower camera image, and determining the second relative position based on the ninth position and the tenth position; determining the eleventh position of the position point to be determined in the sixth camera image, and determining the twelfth position of the position point to be determined in the eighth lower camera image, and determining the third relative position based on the eleventh position and the twelfth position; thereafter, calculating the position between the position point to be determined on the workpiece to be measured relative to the reference point according to the second relative position and the third relative position, and the fourth relative position between the seventh position and the eighth position.
[0145] In the above step S101, when a standard workpiece is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move synchronously. When there is a reference point of the standard workpiece in the field of view of the lower camera, the position of the upper camera and the lower camera is the fifth position (which can be understood as the shooting position in the above step S41).
[0146] The fifth lower camera image is an image obtained by the lower camera photographing the standard workpiece when the upper camera and the lower camera are located at the fifth position and the standard workpiece is placed on the storage platform, wherein, since the reference point of the standard workpiece is located within the field of view of the lower camera when the lower camera is located at the fifth position, the reference point of the standard workpiece exists in the fifth lower camera image; the third upper camera image is an image obtained by the upper camera photographing the coordinate plate when the upper camera and the lower camera are located at the fifth position and the standard workpiece is placed on the storage platform. Here, the fifth lower camera image can be understood as the first lower camera image in the above step S43; the third upper camera image can be understood as the first upper camera image in the above step S43. More specifically, the fifth lower camera image and the third upper camera image here are images of the reference points on the standard workpiece.
[0147] It can be understood that when the lower camera is located at the fifth position, the upper camera is also located at the fifth position, but since the fifth position is determined based on whether there is a reference point in the field of view of the lower camera, that is, where the reference point of the standard workpiece is detected in the field of view of the lower camera, then that is the fifth position. Therefore, the electronic device does not know the specific coordinates of the fifth position. Therefore, the specific positions of the upper and lower cameras when the lower camera shoots the reference point of the standard workpiece can be determined based on the image of the coordinate plate taken by the upper camera at the fifth position (that is, the third upper camera image).
[0148] In the above step S102, when a standard workpiece is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move synchronously. When there is a position point of the standard workpiece to be determined in the field of view of the lower camera, the position of the upper camera and the lower camera is the sixth position.
[0149] The sixth lower camera image is an image obtained by the lower camera photographing the standard workpiece when the upper camera and the lower camera are located at the sixth position and the standard workpiece is placed on the storage platform, wherein, since the position point of the standard workpiece to be determined is located within the field of view of the lower camera when the lower camera is located at the sixth position, the position point of the standard workpiece to be determined exists in the sixth lower camera image; the fourth upper camera image is an image obtained by the upper camera photographing the coordinate plate when the upper camera and the lower camera are located at the sixth position and the standard workpiece is placed on the storage platform. Here, the sixth lower camera image can be understood as the first lower camera image in the above step S43; the fourth upper camera image can be understood as the first upper camera image in the above step S43. More specifically, the sixth lower camera image and the fourth upper camera image here are images of the position points to be determined on the standard workpiece.
[0150] by Fig.11 Take the example shown as an example, Fig.11 A schematic diagram of a fifth camera image and a sixth camera image provided in an embodiment of the present application, wherein: Fig.11 The left side in the middle is a schematic diagram of a fifth lower camera image, that is, an image obtained by the lower camera photographing the reference point of the standard workpiece; Fig.11 The right side in the middle is a schematic diagram of the sixth lower camera image, that is, the image obtained by the lower camera photographing the position point to be determined of the standard workpiece.
[0151] In the above step S103, the electronic device can determine the seventh position of the upper camera when the third upper camera image is captured based on the third upper camera image; and determine the eighth position of the upper camera when the fourth upper camera image is captured based on the fourth upper camera image. Here, the seventh position and the eighth position can both be understood as the first coordinates in the above step S44, and the method for determining the seventh position and the eighth position can be specifically referred to the description of the first coordinates in the above step S44. Moreover, the seventh position and the eighth position here can also be understood as the shooting positions in the above step S41. Specifically, the seventh position is the shooting position for the reference point of the standard workpiece, and the eighth position is the shooting position for the position point to be determined of the standard workpiece.
[0152] It can be understood that, referring to the content shown in the above step S101, the third upper camera image and the fifth lower camera image are taken when the upper camera and the lower camera are located at the fifth position. Therefore, in theory, the position of the upper camera when taking the third upper camera image is the fifth position. Therefore, the seventh position determined by the electronic device through the mark in the third upper camera image can actually be understood as the fifth position. Therefore, in theory, when a workpiece to be measured is placed on the storage platform, when the upper camera and the lower camera are synchronously moved to the seventh position, the reference point of the workpiece to be measured will exist in the field of view of the lower camera.
[0153] Similarly, referring to the content shown in the above step S102, it can be known that the fourth upper camera image and the sixth lower camera image are taken when the upper camera and the lower camera are located at the sixth position. Therefore, theoretically, the position of the upper camera when taking the fourth upper camera image is the sixth position. Therefore, the eighth position determined by the electronic device through the mark in the fourth upper camera image can actually be understood as the sixth position. Therefore, theoretically, when the workpiece to be measured is placed on the storage platform, when the upper camera and the lower camera move synchronously to the eighth position, the position point to be determined of the workpiece to be measured will be located in the field of view of the lower camera.
[0154] In the above step S104, when the workpiece to be measured is placed on the storage platform and the moving mechanism drives the upper camera and the lower camera to move to the seventh position, the lower camera shoots the workpiece to be measured to obtain the seventh lower camera image. At this time, the seventh lower camera image contains the reference point of the workpiece to be measured. It can be understood that the optical axis of the upper camera and the optical axis of the lower camera in the position detection device are coaxial. Therefore, when the upper camera is located at the seventh position, the lower camera is also located at the seventh position. Here, the seventh lower camera image can be understood as the second lower camera image in the above step S43. Specifically, the seventh lower camera image is an image of the reference point of the workpiece to be measured.
[0155] In addition, in an embodiment of the present application, when a workpiece to be measured is placed on the storage platform and the moving mechanism drives the upper camera and the lower camera to move to the eighth position, the lower camera photographs the workpiece to be measured to obtain an eighth lower camera image. At this time, there are positions of the workpiece to be measured in the eighth lower camera image. Among them, it can be understood that the optical axis of the upper camera and the optical axis of the lower camera in the position detection device are coaxial, so when the upper camera is at the eighth position, the lower camera is also at the eighth position. Here, the eighth lower camera image can also be understood as the second lower camera image in the above step S43. Specifically, the eighth lower camera image is an image of the position points to be determined for the workpiece to be measured.
[0156] In the above step S105, the ninth position is the position of the reference point of the standard workpiece determined by the electronic device based on the fifth camera image. It can be understood that based on the above step S101, there are reference points of the standard workpiece in the fifth camera image. Therefore, based on the fifth camera image, the electronic device can determine the ninth position.
[0157] The tenth position is the position of the reference point in the workpiece to be measured determined by the electronic device based on the seventh camera image; based on the above step S104, it can be known that the reference point of the workpiece to be measured exists in the seventh camera image, so based on the seventh camera image, the electronic device can determine the tenth position. The electronic device can obtain the relative position between the ninth position and the tenth position by difference calculation as the second relative position. Here, the second relative position is the coordinate offset in the above step S44, and more specifically, the second relative position is the coordinate offset for the reference point.
[0158] In the above step S106, the eleventh position is the position of the position point to be determined of the standard workpiece determined by the electronic device according to the sixth camera image; the twelfth position is the position of the position point to be determined in the workpiece to be measured determined by the electronic device according to the eighth camera image; the electronic device can obtain the relative position between the eleventh position and the twelfth position by difference calculation as the third relative position. Here, the third relative position is the coordinate offset in the above step S44, and more specifically, the third relative position is the coordinate offset for the position point to be determined.
[0159] In the above step S107, the electronic device can determine the position of the point to be determined on the workpiece to be measured relative to the reference point according to the second relative position and the third relative position, and the fourth relative position between the seventh position and the eighth position.
[0160] It can be understood that the position between the point to be measured on the workpiece to be measured and the reference point can be understood as the difference between the position of the point to be measured and the position of the reference point. Among them, the actual position of the reference point in the workpiece to be measured (i.e., the first actual coordinate) can be regarded as the sum of the seventh position and the second relative position; and the actual position of the point to be determined in the workpiece to be measured (i.e., the second actual coordinate) can be regarded as the sum of the eighth position and the third relative position. Based on this, the position between the point to be measured on the workpiece to be measured and the reference point should be: the difference between the sum of the eighth position and the third relative position and the sum of the seventh position and the second relative position, that is, (eighth position + third relative position) - (seventh position + second relative position), that is: (eighth position - seventh position) + third relative position - second relative position. It can be seen that the position between the point to be determined on the workpiece to be measured and the reference point can be determined based on the second relative position, the third relative position, and the fourth relative position between the seventh position and the eighth position.
[0161] Let's take a specific example to illustrate. For example, there is a reference point and a position point to be determined on the workpiece to be measured. There is also a reference point and a position point to be determined on the workpiece to be measured. The electronic device obtains the fifth lower camera image and the third upper camera image by the method shown in the above step S101; and the electronic device obtains the sixth lower camera image and the fourth upper camera image by the method shown in the above step S102. After that, the electronic device obtains the seventh position, such as (X0, Y0), according to the third upper camera image by the method shown in step S103, and obtains the eighth position, such as (X1, Y1), according to the fourth upper camera image. After that, based on the above step S104, the seventh lower camera image is obtained when the lower camera is at the seventh position, and the eighth lower camera image is obtained when the lower camera is at the eighth position; further, according to the above step S105, the electronic device determines the position of the reference point in the fifth lower camera image, that is, the ninth position, such as (x1, Y1). 0(0) ,y 0(0) ), which can also be understood as the position of the reference point in the standard workpiece; and the position of the reference point in the seventh camera, that is, the tenth position, such as (x 1(0) ,y 1(0) ), and determine the second relative position, namely (x 1(0) -x 0(0) ,y 1(0) -y 0(0) ), which can also be abbreviated as (△x0, △y0); According to the above step S106, the electronic device determines the position of the point to be determined in the sixth camera image, that is, the eleventh position, such as (x 0(1) ,y 0(1) ), which position can also be understood as the position of the position point to be determined in the standard workpiece; and the position of the position point to be determined in the eighth camera, that is, the twelfth position, such as (x 1(1) ,y 1(1) ), which can also be understood as the position of the position point to be determined in the workpiece to be measured; and the third relative position is determined, that is, (x 1(1) -x 0(1) ,y 1(1) -y 0(1)), which can also be abbreviated as (△x1, △y1); thus, the actual position of the reference point in the workpiece to be measured (i.e., the first actual coordinate) can be expressed as (X0+△x0, Y0+△y0), and the actual position of the point to be determined in the workpiece to be measured (i.e., the second actual coordinate) can be expressed as (X1+△x1, Y1+△y1), and further, the position of the point to be determined in the workpiece to be measured relative to the reference point can be expressed as [(X1+△x1)-(X0+△x0), (Y1+△y1)-(Y0+△y0)], that is, [(X1-X0)+△x1-△x0, (Y1-Y0)+△y1-△y0], wherein (X1-X0, Y1-Y0) is the fourth relative position, (△x0, △y0) is the second relative position, and (△x0, △y0) is the third relative position.
[0162] Among them, the form is (x m(n) ,y m(n) ), when m = 0, it represents the standard workpiece, when m = 1, it represents the workpiece to be measured; when n = 0, it represents the reference point, when n = 1, it represents the position point to be determined; therefore, (x 1(0) ,y 1(0) ) represents the position of the reference point in the workpiece to be measured. The meaning of such formulas in the above examples is similar.
[0163] In addition, since the position obtained by the above calculation is only a numerical value, it is impossible to specifically explain whether the position of the point to be determined in the workpiece to be measured is accurate. Therefore, in some examples, it is also possible to directly determine whether the position of the point to be determined in the workpiece to be measured is accurate based on the second relative position, the third relative position and the fourth relative position.
[0164] It can be understood that the basis for determining whether the position of the position point to be determined in the workpiece to be measured is accurate is whether the position of the position point to be determined in the workpiece to be measured relative to the reference point is equal to the position of the position point to be determined in the reference workpiece relative to the reference point. When the position of the position point to be determined in the workpiece to be measured relative to the reference point is equal to the position of the position point to be determined in the reference workpiece relative to the reference point, the position of the position point to be determined in the workpiece to be measured is accurate. Therefore, in some embodiments, it is possible to determine whether the position of the position point to be determined in the workpiece to be measured is accurate by directly comparing whether the position of the position point to be determined in the workpiece to be measured relative to the reference point and the position of the position point to be determined in the standard workpiece relative to the reference point are equal. Alternatively, in some embodiments, whether the position of the to-be-determined position point on the workpiece to be measured is accurate can be determined by calculating the difference between the second relative position and the third relative position. Specifically, when the difference between the third relative position and the second relative position is 0, it can be indicated that the position of the to-be-determined position point in the workpiece to be measured relative to the reference point is the same as the position of the to-be-determined position point in the standard workpiece relative to the reference point, that is, the position of the to-be-determined position point in the workpiece to be measured is accurate.
[0165] Next, the principle of determining whether the position of the position point to be determined on the workpiece to be measured is accurate according to the difference between the second relative position and the third relative position in the example of the present application is explained through a specific example.
[0166] For example, the position of the reference point in the standard workpiece is position 1 (i.e., the ninth position), the position of the position point to be determined in the standard workpiece is position 2 (i.e., the eleventh position), the position of the reference point in the workpiece to be measured is position 3 (i.e., the tenth position), and the position of the position point to be determined in the workpiece to be measured is position 4 (i.e., the twelfth position). It can be understood that whether the accuracy of the position point to be determined in the workpiece to be measured is accurate depends on whether the position between the position point to be determined and the reference point in the workpiece to be measured is consistent with the position between the position point to be determined and the reference point in the standard workpiece, that is, if the accuracy of the position point to be determined on the workpiece to be measured is accurate, then the position between the position point to be determined and the reference point in the workpiece to be measured is consistent with the position between the position point to be determined and the reference point in the standard workpiece, that is, position 2-position 1=position 4-position 3. However, since the workpiece to be measured is a large-sized workpiece, the measured point and the reference point cannot exist in the same camera field of view at the same time. Therefore, the ninth position (i.e., position 1) and the eleventh position (i.e., position 2) are not positions in the same coordinate system, and the tenth position (i.e., position 3) and the twelfth position (i.e., position 4) are not coordinates in the same coordinate system. Therefore, it is impossible to directly compare the difference between the ninth position and the eleventh position, and the difference between the tenth position and the twelfth position.
[0167] And "position 4 - position 3 = (position 4 - position 2 + position 2) - (position 3 - position 1 + position 1)", we can further get "position 4 - position 3 = (position 4 - position 2) + (position 2 - position 1) - (position 3 - position 1)", and then, since the fifth lower camera image and the seventh lower camera image are both images determined by the reference points taken by the lower camera, and through the control of the position by the upper camera, the fifth lower camera image and the seventh lower camera image can be approximately regarded as images under the same field of view. Therefore, the ninth position determined according to the fifth lower camera image (i.e., position 1) and the tenth position determined according to the seventh lower camera image (i.e., position 3) can be subtracted; similarly, the eleventh position determined according to the sixth lower camera image (i.e., position 2) and the eleventh position determined according to the eighth lower camera image can be subtracted. The eighty-second position determined by the machine image (i.e., position 4) can be directly subtracted, thereby determining the value of (position 4-position 2) and the value of (position 3-position 1); although the eleventh position and the ninth position cannot be directly subtracted, that is, the value of (position 2-position 1) cannot be obtained, but whether the position of the position point to be determined on the workpiece to be measured is accurate depends on "position 4-position 3=position 2-position 1", that is, "(position 4-position 2)+(position 2-position 1)-(position 3-position 1)=position 2-position 1", therefore, (position 2-position 1) can be eliminated, and it is only necessary to determine whether the value of "(position 4-position 2)-(position 3-position 1)" is 0 to determine whether the position of the position point to be determined on the workpiece to be measured is accurate.
[0168] Understandably, the above Fig.10 The example shown is for explanation based on the existence of only one position point to be determined and one reference point on the workpiece. In the actual detection process, there may be multiple reference points or multiple position points to be determined on the workpiece. In this case, the present application can be used. Fig.10 The method shown calculates the position of each to-be-determined position point on the workpiece to be measured relative to the reference point one by one. Alternatively, the upper camera image and the lower camera image corresponding to each reference point and each to-be-determined position point on the standard workpiece can be determined in advance according to the method shown in the above step S101 and the above step S102, and then, referring to the content shown in the above step S103, the positions of the upper camera and the lower camera when shooting each reference point and each to-be-determined position point in each workpiece to be measured are determined according to each upper camera image, and then according to the method shown in the above step S104, the images of each reference point and the to-be-determined position point on the workpiece to be measured are shot by the lower camera, and then the position of each to-be-determined position point relative to each reference point is determined based on steps S105-S107.
[0169] In some embodiments, the distance between the shooting position and the point on the workpiece corresponding to the shooting position is maintained at a preset distance. That is, the distance between the point on the workpiece corresponding to the shooting position and the shooting position is always maintained at a preset distance. For example, the point corresponding to shooting position 1 is point 1. When shooting point 1 of the workpiece to be measured, when the moving mechanism drives the upper camera and the lower camera to move to shooting position 1, the distance between shooting position 1 and point 1 on the workpiece to be measured is the preset distance; and when shooting point 1 of the standard workpiece, when the moving mechanism drives the upper camera and the lower camera to move to shooting position 1, the distance between shooting position 1 and point 1 on the standard workpiece is also maintained at the preset distance.
[0170] Specifically, the distance between the shooting position in the embodiment of the present application and the point on the workpiece corresponding to the shooting position is maintained at a preset distance, which can be understood as that, at the shooting position, the lower edge of the lens of the lower camera and the upper surface (or highest point) of the point corresponding to the shooting position are maintained at a preset distance in the vertical direction, wherein the vertical direction is the normal direction of the horizontal plane, and the horizontal plane is a plane parallel to the storage platform. The preset distance can be set by the user according to the actual scene.
[0171] In the embodiment of the present application, in the process of shooting the lower camera image, the distance between the lower camera and each point is maintained at a preset distance. Therefore, when the workpiece is a workpiece with a large depth of field, that is, when the height difference between each position point to be determined and each reference point is large, the lower camera keeps the distance between the lower edge of the lower camera lens and the position point to be determined or the reference point at the preset distance each time the lower camera shoots the lower camera image. In this way, for the same point on the standard workpiece and the workpiece to be measured, the image coordinate system of the corresponding lower camera image is the same, thereby realizing the calculation of the relative position of the same point on the standard workpiece and the workpiece to be measured, and then realizing the calculation of the position between the position point to be determined on the workpiece to be measured relative to the reference point.
[0172] In some embodiments, the moving mechanism in the position detection device can be used to keep the upper camera and the lower camera moving synchronously in the horizontal plane, and can also be used to keep the upper camera and the lower camera moving synchronously in the vertical direction. Fig.10Taking the example shown as an example, at the fifth position and the sixth position, the distance between the lower camera and the reference point on the standard workpiece and the position point to be determined must be kept at a preset distance. Therefore, when the height of the reference point of the standard workpiece is inconsistent with the height of the position point to be determined, the height of the lower camera will also change, and then the height of the upper camera will also change. Based on this, in order to facilitate the upper camera to capture a clear image of the coordinate plate regardless of any change in the distance between the upper camera and the coordinate plate, the upper camera in this application can use a zoom camera, and specifically, the lens of the upper camera can use a liquid telecentric lens. It can be understood that since the lower camera lens always maintains a preset distance with the point to be measured, the lower camera almost does not have the problem of being unable to shoot clearly due to the change in distance between the lower camera and the point to be measured, so the lens of the lower camera can be unrestricted. Of course, in some examples, in order to avoid distortion of the image obtained by shooting, the lenses of the upper camera and the lower camera can use telecentric lenses. Among them, the liquid telecentric lens can be kept at different heights, and the field of view and height change linearly; the telecentric lens can keep the field of view without distortion.
[0173] Below, taking the example of the upper camera's optical axis being coaxial with the lower camera's optical axis, Fig.12 The example shown further illustrates the process of determining the position degree according to the position detection method provided in the embodiment of the present application.
[0174] See also Fig.12 , Fig.12 The fourth flow chart of the position detection method provided in the embodiment of the present application may include the following steps:
[0175] Step S121: acquiring a fifth lower camera image of the standard workpiece obtained by the lower camera photographing the standard workpiece when the lower camera is located at the fifth position and the distance between the lower camera and the standard workpiece is a preset distance, and a third upper camera image obtained by the upper camera photographing the coordinate plate; wherein, when the lower camera is located at the fifth position, the reference point of the standard workpiece is located within the field of view of the lower camera;
[0176] Step S122: acquiring a sixth lower camera image of the standard workpiece obtained by the lower camera photographing the standard workpiece when the lower camera is located at a sixth position and the distance between the lower camera and the standard workpiece is a preset distance, and a fourth upper camera image obtained by the upper camera photographing the coordinate plate; wherein, when the lower camera is located at the sixth position, the to-be-measured point of the standard workpiece is located within the field of view of the lower camera;
[0177] Step S123: determining the seventh position of the upper camera when the third upper camera image is captured based on the third upper camera image; determining the eighth position of the upper camera when the fourth upper camera image is captured based on the fourth upper camera image; the same as the above step S103;
[0178] Step S124: acquiring a seventh lower camera image of the workpiece to be measured obtained by the lower camera when the upper camera is located at the seventh position and the distance between the lower camera and the workpiece to be measured is a preset distance, and acquiring an eighth lower camera image of the workpiece to be measured obtained by the lower camera when the upper camera is located at the eighth position and the distance between the lower camera and the workpiece to be measured is the preset distance;
[0179] Step S125: determining the ninth position of the reference point in the fifth camera image, determining the tenth position of the reference point in the seventh camera image, and calculating a second relative position between the ninth position and the tenth position; the same as the above step S105;
[0180] Step S126: determining the eleventh position of the position point to be determined in the sixth camera image, determining the twelfth position of the position point to be determined in the eighth camera image, and calculating a third relative position between the eleventh position and the twelfth position; the same as the above step S106;
[0181] Step S127: Based on the second relative position and the third relative position, and the fourth relative position between the seventh position and the eighth position, the position between the position point to be determined on the workpiece to be measured and the reference point is calculated. This is the same as the above step S107.
[0182] In the technical solution provided in the embodiment of the present application, in the process of shooting the fifth lower camera image, the sixth lower camera image, the seventh lower camera image, and the eighth lower camera image, the distance between the lower camera and the standard workpiece and the distance between the lower camera and the workpiece to be measured are both maintained at a preset distance. Thus, when the workpiece is a workpiece with a large depth of field, that is, when the height difference between each position point to be determined and each reference point is large, the lower camera keeps the distance between the lower edge of the lower camera lens and the position point to be determined or the reference point at the preset distance each time the lower camera shoots a lower camera image. In this way, for the same point on the standard workpiece and the workpiece to be measured, the image coordinate system of the corresponding lower camera image is the same, thereby realizing the calculation of the relative position of the same point on the standard workpiece and the workpiece to be measured, and thereby realizing the calculation of the position between the position point to be determined on the workpiece to be measured relative to the reference point.
[0183] The above steps S123, S125, S126 and S127 are respectively Fig.10 Step S103, step S105, step S106, and step S107 are the same and will not be repeated here.
[0184] In the above step S121, when a standard workpiece is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move until the reference point of the standard workpiece is present in the field of view of the lower camera, and the distance between the lower camera and the standard workpiece is controlled to be a preset distance. At this time, the position of the lower camera can be regarded as the fifth position. When located at the fifth position, the distance between the lower camera and the standard workpiece can actually be understood as the distance from the lower edge of the lower camera lens to the upper surface of the reference point of the standard workpiece.
[0185] The fifth lower camera image is an image obtained by the lower camera shooting the storage platform when the lower camera is located at the fifth position, a standard workpiece is placed on the storage platform, and the distance between the lower camera and the standard workpiece is a preset distance. Specifically, since the reference point of the standard workpiece is located within the field of view of the lower camera when the lower camera is located at the fifth position, the reference point of the standard workpiece exists in the fifth lower camera image; the third upper camera image is an image obtained by the upper camera shooting the coordinate plate when the lower camera is located at the fifth position and a standard workpiece is placed on the storage platform. For other contents in the above step S121, please refer to the description in the above step S101.
[0186] In the above step S122, when a standard workpiece is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move until there is a position point of the standard workpiece to be determined in the field of view of the lower camera, and the distance between the lower camera and the standard workpiece is controlled to be a preset distance. At this time, the position of the lower camera can be regarded as the sixth position. Among them, when it is in the sixth position, the distance between the lower camera and the standard workpiece can actually be understood as the distance from the lower edge of the lower camera lens to the upper surface of the position point of the standard workpiece to be determined. It can be understood that, in combination with the above steps S121 and S122, when the lower camera shoots the lower camera image, the distance between the lower camera and the upper surface of the reference point in the standard workpiece needs to be kept at a preset distance, and the distance between the lower camera and the upper surface of the position point to be determined in the standard workpiece needs to be kept at a preset distance.
[0187] The sixth lower camera image is an image obtained by the lower camera photographing the standard workpiece when the lower camera is located at the sixth position, a standard workpiece is placed on the storage platform, and the distance between the lower camera and the standard workpiece is a preset distance. Specifically, since the reference point of the standard workpiece is located within the field of view of the lower camera when the lower camera is located at the sixth position, the reference point of the standard workpiece exists in the sixth lower camera image; the fourth upper camera image is an image obtained by the upper camera photographing the coordinate plate when the lower camera is located at the sixth position and a standard workpiece is placed on the storage platform. For other contents in the above step S122, please refer to the description in the above step S102.
[0188] In the above step S114, when the workpiece to be measured is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move to the seventh position, and when the distance between the lower camera and the workpiece to be measured is the preset distance, the lower camera photographs the workpiece to be measured to obtain the seventh lower camera image. Similarly, when the workpiece to be measured is placed on the storage platform, the moving mechanism drives the upper camera and the lower camera to move to the eighth position, and when the distance between the lower camera and the workpiece to be measured is the preset distance, the lower camera photographs the workpiece to be measured to obtain the eighth lower camera image. For other contents in the above step S124, please refer to the description in the above step S104.
[0189] To facilitate the understanding of the position detection method provided by the present application, the position detection method provided by the embodiment of the present application is further explained below through a specific example. In this example, the coordinate system of the upper camera and the lower camera are consistent (that is, the optical axis of the upper camera is coaxial with the optical axis of the lower camera), and the working distance of the lower camera is fixed (that is, the distance between the lower camera and the workpiece to be measured and the standard workpiece is a preset distance), so as to meet the different depths of field and scales of each point on the workpiece, see Fig.13 , Fig.13 A fifth flow chart of the position detection method provided in the embodiment of the present application may include the following steps:
[0190] Step S131: Determine the standard workpiece;
[0191] Step S132: Shooting point teaching: the moving mechanism moves the camera to each point to be photographed on the standard workpiece; the moving mechanism records its own coordinates and subsequently moves according to the trajectory;
[0192] It can be understood that in the embodiment of the present application, the shooting point teaching can be understood as determining the position corresponding to each point to be measured on the standard workpiece, and the point to be shot can be understood as the above Figure 4 The points to be measured shown in , that is, the reference points on the workpiece and the positions to be determined; the cameras can be understood as the upper camera and the lower camera; the moving mechanism recording its own coordinates can be understood as the moving mechanism driving the upper camera and the lower camera to move until there is a point to be photographed of the standard workpiece in the field of view of the lower camera. At this time, the position of the moving mechanism is recorded, that is, the shooting position shown in the above step S41 is recorded; moving according to the trajectory can be understood as photographing the points to be photographed on the standard workpiece in a preset order, such as taking the standard workpiece as Fig. 9 Taking the standard workpiece shown in the figure as an example, if it is preset to obtain the lower camera images corresponding to points 1-8 in sequence, the movement is performed according to the trajectory, that is, the upper camera and the lower camera are moved synchronously in sequence, so that points 1-8 appear in the field of view of the lower camera in sequence.
[0193] Specifically, the moving mechanism can move the camera, lens, and light source as a whole up, down, left, and right, and the coordinate plate does not move during this process, so that the moving mechanism drives the upper camera and the lower camera to move to the shooting point. It should be noted that the moving mechanism needs to keep the working distance of the lower camera fixed in the process of driving the camera to move, that is, keep the distance between the lower edge of the lens of the lower camera and the upper surface of each point to be shot fixed, so as to determine the position of the points to be shot at different depths of field and positions; wherein, the visual device can be understood as an upper camera and a lower camera, and the coordinate systems of the upper camera and the lower camera are consistent, that is, when installing the upper camera and the lower camera, pay attention to vertical installation, and try to ensure that the upper camera and the lower camera are coaxial.
[0194] When a standard workpiece is placed on the storage platform, for each shooting position, the lower camera is used to shoot an image of the point to be shot, and the coordinates of the point to be shot in the standard workpiece are determined based on the lower camera image. That is, the lower camera is calibrated to convert the pixel coordinates (fx, fy) into physical coordinates (x, y). Here, the pixel coordinates (fx, fy) can be understood as the coordinates of the point to be shot in the image shot by the lower camera, and (x, y) can be understood as the physical coordinates of the point to be shot. At the same time, for each shooting position, the upper camera is calibrated, that is, when the lower camera shoots each point to be shot, the upper camera shoots the image of the coordinate plate, and then the pixel coordinates (Fx, Fy) in the image shot by the upper camera can be converted into coordinate plate coordinates (X, Y). For details, please refer to the description in the above step S44.
[0195] Understandably, Fig.13 In the above, step S1321 to step S1323 are a detailed description of the above step S132. Below, based on steps S1321 to step S1323, the content of step S132 is explained again.
[0196] Step S1321: for the standard workpiece, when there is a point to be photographed of the standard workpiece in the field of view of the lower camera, the lower camera photographs the point to be photographed; based on the photographed image, the coordinates (x0, y0) of the photographed point in the standard workpiece are determined;
[0197] Step S1322: the upper camera uses a liquid telecentric lens to automatically adjust the focal length, and takes a coordinate plate image when the lower camera takes pictures of each point to be photographed, and records the coordinate plate coordinates (X0, Y0) corresponding to each point to be photographed;
[0198] Step S1323: Determine whether all the points to be photographed in the standard workpiece have been traversed; if so, execute the following step S133; if not, return to execute the above step S1321.
[0199] Based on the above steps S1321-S1323, it can be known that the moving mechanism will drive the upper camera and the lower camera to move to each point to be photographed on the standard workpiece. For each point to be photographed, the lower camera photographs the point to be photographed to obtain the lower camera image, while the upper camera photographs the coordinate plate to obtain the coordinate plate image (i.e., the upper camera image). Based on each lower camera image, the physical coordinates of each point to be photographed in the standard workpiece can be determined. These coordinates can be regarded as (x0, y0). For example, the standard workpiece has only one position point to be determined and one reference point. Both points are points to be photographed. The coordinates of the reference point in the standard workpiece determined by the lower camera image obtained by photographing the reference point are (x0 (0) ,y0 (0) The coordinates of the position point to be determined in the standard workpiece determined by the lower camera image obtained by shooting the position point to be determined are (x0 (1) ,y0 (1) ), then (x0 (0) ,y0 (0) ) and (x0 (1) ,y0 (1) ) can be regarded as (x0, y0). At the same time, based on each upper camera image, the coordinates of the upper camera and the lower camera when the lower camera takes each lower camera image can be determined, that is, the coordinates of the coordinate plate, and these coordinates can be called (X0, Y0).
[0200] Step S133: for the workpiece to be measured, when the upper camera moves to the determined coordinates of the coordinate plate, the lower camera photographs the points to be photographed in the workpiece to be measured; based on the photographed images, the coordinates (x1, y1) of each point to be photographed in the workpiece to be measured are determined;
[0201] Step S134: Determine whether all coordinate plate coordinates have been traversed, if so, execute the following step S135, if not, return to execute the above step S133;
[0202] Based on the above steps S133-S134, it can be known that after the coordinates of each coordinate plate are determined based on the above step S1322, the upper camera and the lower camera can be controlled to move to the coordinates of each coordinate plate. For each coordinate plate coordinate, the lower camera shoots the workpiece to be measured to obtain a lower camera image. Based on each lower camera image, the coordinates (x1, y1) of each point to be photographed in the workpiece to be measured can be determined.
[0203] For example, the standard workpiece has only one position point to be determined and one reference point. The position of the reference point on the standard workpiece determined in step S1322 is position 1, and the position of the position point to be determined on the standard workpiece is position 2. When the upper camera and the lower camera move to position 1, the lower camera captures the lower camera image corresponding to position 1; when the upper camera and the lower camera move to position 2, the lower camera captures the lower camera image corresponding to position 2. Afterwards, the electronic device can determine the position of the reference point in the workpiece to be measured based on the lower camera image corresponding to position 1 as (x1 (0) ,y1 (0) ); Based on the lower camera image corresponding to position 2, the position of the point to be measured in the workpiece to be measured can be determined as (x1 (1) ,y1 (1) ), then (x1 (0) ,y1 (0) ) and (x1 (1) ,y1 (1) ) can be regarded as (x1, y1). For details, please refer to the description in the above step S104.
[0204] Step S135: Calculate the offset value of the lower camera, the offset value △x=(x1-x0), △y=(y1-y0);
[0205] Based on the above step S1321, the coordinates of each point to be photographed in the standard workpiece can be determined, and based on the above step S133, the coordinates of each point to be photographed in the workpiece to be measured can be determined. In the embodiment of the present application, the offset value can be understood as the coordinate difference of the same point to be photographed in the standard workpiece and the workpiece to be measured.
[0206] For example, there is only one reference point and one position point to be determined in the standard workpiece. The coordinates of the reference point in the standard workpiece determined based on the above step S1321 are (x0 (0), y0 (0)), and the coordinates of the position point to be determined are (x0 (1), y0 (1)); the coordinates of the reference point in the workpiece to be measured determined based on the above step S133 are (x1 (0), y1 (0)), and the coordinates of the position point to be determined are (x1 (1), y1 (1)); based on this, two deviation values can be determined, one deviation value is (x1 (0) -x0 (0) , y1 (0) -y0 (0) ), and the other deviation value is (x1 (1) -x0 (1) , y1 (1) -y0 (1) ). Among them, when x1 (0) -x0 (0) When y1 is △x, (0) -y0 (0) is △y; when x1(1) -x0 (1) When y1 is △x, (1) -y0 (1) is △y.
[0207] Step S136: upper camera coordinates + lower camera offset, i.e. (X0 + △x), (Y0 + △y); for details, please refer to the description in the above step S107;
[0208] Step S137: Calculate the position of each position to be determined on the workpiece relative to the reference point according to the coordinates and offset data of each shooting point calculated in the above steps. For details, please refer to the description in the above step S107.
[0209] In the position detection method provided in the embodiment of the present application, based on the position device provided in the embodiment of the present application, a single point is photographed, detected and calculated. Through calibration transformation, the upper camera photographs the coordinate plate with position information to calculate different coordinates, and the lower camera calculates the offset, thereby calculating the coordinates and offset of different points, and finally obtaining the position degrees of different positions. The position detection method provided in the embodiment of the present application can achieve high-precision measurement without relying on mechanical accuracy.
[0210] Next, a specific example is used to illustrate the position detection method provided in the embodiment of the present application. Fig.14 , Fig.14 A sixth flow chart of the position detection method provided in the embodiment of the present application, for example, the above Fig. 9 The position of the position point to be determined shown by the black circle 3 in the workpiece to be measured may include the following steps:
[0211] Step S141: Determine Fig. 9 The standard workpiece corresponding to the workpiece to be tested is shown;
[0212] Step S142: Place the standard workpiece determined in the above step S141 under the shooting station (i.e., on the storage platform), use the lower camera to shoot points 1, 8, and 3 to obtain the lower camera images corresponding to points 1, 8, and 3, and use the upper camera to record the coordinate values of the coordinate plate when the lower camera shoots points 1, 8, and 3. Specifically, the coordinates of point 1 on the standard workpiece in the camera coordinate system are determined to be (x1, y1) through the lower camera image corresponding to point 1; the coordinates of point 8 on the standard workpiece in the camera coordinate system are determined to be (x8, y8) through the lower camera image corresponding to point 8, and the coordinates of point 3 on the standard workpiece in the camera coordinate system are determined to be (x3, y3) through the lower camera image corresponding to point 3; the corresponding position when the lower camera shoots point 1 recorded by the upper camera is (X1, Y1), the corresponding position when the lower camera shoots point 8 recorded by the upper camera is (X8, Y8), and the corresponding position when the lower camera shoots point 3 recorded by the upper camera is (X3, Y3); please refer to the description in the above steps S101 and S102 for details.
[0213] Step S143: Fig. 9 The workpiece to be measured is placed under the shooting station. When the upper camera and the lower camera are located at (X1, Y1), the lower camera captures the image of the workpiece to be measured, and the coordinates (x'1, y'1) of point 1 on the workpiece to be measured in the camera coordinate system are obtained; when the upper camera and the lower camera are located at (X8, Y8), the lower camera captures the image of the workpiece to be measured, and the coordinates (x'8, y'8) of point 8 on the workpiece to be measured in the camera coordinate system are obtained; when the upper camera and the lower camera are located at (X3, Y3), the lower camera captures the image of the workpiece to be measured, and the coordinates (x'3, y'3) of point 3 on the workpiece to be measured in the camera coordinate system are obtained; for details, please refer to the description in the above steps S103-S104.
[0214] Step S144: Calculate the coordinate offset (△x1, △y1) corresponding to the reference point 1, the coordinate offset (△x8, △y8) corresponding to the reference point 8, and the coordinate offset (△x3, △y3) corresponding to the position point 3 to be determined in the lower camera;
[0215] Step S145: Calculate the actual coordinates of reference point 1 (X1+△x1, Y1+△y1), the actual coordinates of reference point 8 (X8+△x8, Y8+△y8), and the actual coordinates of point 3 to be measured (X3+△x3, Y3+△y3);
[0216] Step S146: Calculate the position of point 3 relative to 1 and 8 through the actual coordinates of 1, 8, and 3. The specific position of point 3 is (X3+△x3)-(X1+△x1), (Y3+△y3)-(Y1+△y1); (X3+△x3)-(X8+△x8), (Y3+△y3)-(Y8+△y8).
[0217] The above steps S144 to S146 may refer to the descriptions of the above steps S105 to S107.
[0218] The position detection method provided in the embodiment of the present application has the following beneficial effects:
[0219] (a) The position detection method provided in the embodiment of the present application does not need to rely on mechanical accuracy, but is only related to the accuracy of the coordinate plate. That is, when the accuracy of the coordinate plate is high, the accuracy of the positions of each point on the workpiece to be measured taken by the upper camera and the lower camera is also high, and thus the accuracy of the position detection is high;
[0220] (b) The accuracy of the position detection method provided in the embodiment of the present application depends on the accuracy of the coordinate plate, and the accuracy of the coordinate plate can generally be very high. Therefore, the accuracy of the position detection method provided in the embodiment of the present application is relatively high;
[0221] (c) The cost of achieving high precision with a coordinate plate is lower than the cost of achieving high precision with a mechanical structure. Therefore, the position detection method provided in the embodiment of the present application has a low cost;
[0222] (d) The position detection method provided in the embodiment of the present application can realize the position detection of large-sized workpieces (see the above Figure 2 ), and position detection of workpieces with large depth of field (see the above description of Fig.12 description).
[0223] For the position detection device involved in the embodiments of the present application, in some embodiments, a connecting component is arranged between an upper camera and a lower camera, and is used to keep the upper camera and the lower camera moving synchronously in a horizontal plane, and the horizontal plane is a plane parallel to the storage platform; the optical axis of the upper camera is coaxial with the optical axis of the lower camera, and the upper camera faces the coordinate plate, and the lower camera faces the storage platform; the upper camera is used to capture any of the upper camera images described above, and the lower camera is used to capture any of the lower camera images described above.
[0224] In the present application embodiment, it can be understood that the following Fig.15 Taking the position detection device shown as an example, a telescopic component can be set on the third horizontal rod 118 to control the telescopic movement of the third horizontal rod 118 in the horizontal plane, thereby driving the first horizontal rod 116 and the second horizontal rod 117 to telescopic movement in the horizontal plane, thereby realizing the synchronous movement of the upper camera 111 and the lower camera 112 in the horizontal plane, such as synchronous movement along the X-axis and the Y-axis in the horizontal plane.
[0225] Or, with the following Fig.15Taking the position detection device shown as an example, a vertical telescopic assembly can be set at the connection between the third horizontal rod 118 and the vertical rod 119 to control the movement of the second horizontal rod 117 in the vertical direction, thereby driving the upper camera 111 and the lower camera 112 to maintain synchronous movement in the vertical direction, such as maintaining synchronous movement along the Z-axis direction.
[0226] Next, through Fig.15 and Fig.16 The example shown is used to exemplarily illustrate the structure of the position detection device involved in the embodiment of the present application, wherein: Fig.15 A third structural schematic diagram of the position detection device provided in an embodiment of the present application; Fig.16 A schematic diagram of the practical application of the position detection device provided in an embodiment of the present application.
[0227] like Fig.15 As shown, Fig.15 In the figure, the vertical rod 119 is connected to the storage platform 115; the third horizontal rod 118 is connected to the vertical rod 119; the second horizontal rod 117 is connected to the third horizontal rod 118, and the first horizontal rod 116 is also connected to the third horizontal rod 118 through a vertical rod. The ends of the first horizontal rod 116 and the second horizontal rod 117 are at the same distance from the end of the third horizontal rod 118. The upper camera 111 is located at the end of the first horizontal rod 116, and the lower camera 112 is located at the end of the second horizontal rod 117. In this way, by adjusting the length of the third horizontal rod 118, the upper camera 111 and the lower camera 112 can be moved synchronously on the horizontal plane. In addition, the coordinate plate is set in the second direction of the upper camera 111, that is, in the opposite direction of the direction from the upper camera 111 to the lower camera 112. Specifically, Fig.15 In the embodiment, the coordinate plate 114 is located above the upper camera 111, and the lens of the upper camera 111 faces the coordinate plate 114; the storage platform 115 is arranged in the first direction of the lower camera 112, that is, in the direction from the upper camera 111 to the lower camera 112. Specifically, Fig.15 In the embodiment, the storage platform 115 is located below the lower camera 112, and the lens of the lower camera 112 faces the storage platform 115. The connecting component is arranged in the second direction of the lower camera 112. Specifically, Fig.15 In the embodiment, the assembly formed by the third horizontal rod 118, the second horizontal rod 117, and the first horizontal rod 116 can be regarded as a connecting assembly. The storage platform 115 can also be referred to as a multi-axis moving mechanism.
[0228] like Fig.16 As shown, Fig.16The upper middle camera 111 is composed of a 25-megapixel black-and-white camera and a liquid telecentric lens, and can automatically zoom at different heights; the upper camera 111 is used to photograph the coordinate plate 114 and record the coordinates. The lower camera 112 is composed of a 25-megapixel black-and-white camera and a telecentric lens, and is used to photograph the reference points on the standard workpiece or the workpiece to be measured or the points whose position is to be determined, and obtain the first lower camera image, the second lower camera image and other lower camera images.
[0229] In actual use, Fig.16 As shown, a light source device may also be provided on the position detection device, such as Fig.16 A first annular light source 161 is arranged between the upper camera 111 and the coordinate plate 114, so that the upper camera 111 can capture a clear upper camera image; a second annular light source 162 is arranged between the lower camera 112 and the object to be measured, and a plane light source 163 is arranged under the placement platform for placing the object to be measured, so that the lower camera 112 can capture a clear lower camera image. Fig.16 In the position detection device shown, the annular light source (such as the first annular light source 161 and the second annular light source 162 ) can move up and down, the camera lens can move up and down as a whole, and the camera lens can move left and right as a whole.
[0230] exist Fig.16 In the scene shown, the first object to be measured 164, the second object to be measured 165 and the third object to be measured 166 can be regarded as reference points and / or position points to be determined on the standard workpiece or the workpiece to be measured. The size of the second object to be measured 165 is 52mm×52mm; the distance between the second annular light source 162 and the third object to be measured 166 is 180 millimeters (mm); the distance between the edge of the lens of the lower camera 112 and the placement platform is 200mm; the distance between the plane light source 163 and the placement platform is 30mm.
[0231] like Fig.17 As shown, Fig.17 In the position detection system shown, the upper camera 111 and the lower camera 112 are both composed of a camera and a lens. The industrial computer 171 can control the upper camera 111 and the lower camera 112 to shoot and obtain the upper camera image and the lower camera image, and then the industrial computer 171 can obtain image data from the upper camera 111 and the lower camera 112, and display it on the display screen 172. In order to make the image quality obtained by shooting higher, a light source 173 can also be used to assist in shooting. The industrial computer 171 can control the data interaction device 174 to process the obtained image data. When the data interaction device 174 detects an abnormality, it can alarm through the alarm device 175. The alarm device 175 can be configured with an alarm light 176 to prompt the user that an abnormality has occurred. In addition, the moving mechanism 113 in the position detection system is used to drive the upper camera and the lower camera to move.
[0232] For the above Figure 1 The position detection system shown, specifically, the moving mechanism 113 is used to move the upper camera 111 and the lower camera 112 under the control of the first processor 12; the upper camera 111 is used to photograph the coordinate plate 114 under the control of the first processor 12 to obtain an upper camera image; the lower camera 112 is used to photograph the points to be measured on the workpiece under the control of the first processor 12 to obtain a lower camera image; the first processor 12 is used to implement any of the above-mentioned position detection methods.
[0233] Corresponding to the above-mentioned position detection method, the embodiment of the present application further provides a position detection device, which is applied to a position detection system, wherein the system comprises an upper camera and a lower camera fixed in relative position, a moving mechanism for moving the upper camera and the lower camera, and a fixed coordinate plate; the upper camera is used to photograph the coordinate plate; Fig.18 As shown, the device comprises:
[0234] The first acquisition module 181 is used to acquire the shooting position corresponding to the point to be measured photographed by the lower camera;
[0235] A moving driving module 182, used to move the upper camera and the lower camera to the shooting position of the workpiece to be measured by using the moving mechanism;
[0236] The second acquisition module 183 is used to acquire a second lower camera image taken by the lower camera for the test point of the workpiece to be tested, as well as a first lower camera image and a first upper camera image; the first lower camera image is an image taken by the lower camera by moving the upper camera and the lower camera to the shooting position of the standard workpiece using the moving mechanism, and the first upper camera image is an image taken by the upper camera;
[0237] The coordinate determination module 184 is used to obtain the actual coordinates of the point to be measured on the workpiece according to the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image, and the first coordinate obtained according to the first upper camera image.
[0238] In the technical solution provided by the embodiment of the present application, the relative positions of the upper camera and the lower camera are fixed, and when the mobile mechanism is used to move to the point to be measured, the coordinates obtained by photographing the coordinate plate with the upper camera can be referred to as the relative coordinates of the point to be measured (hereinafter referred to as the coordinate plate coordinates of the point to be measured). Therefore, as long as the size of the coordinate plate is large enough to cover the workpiece, the coordinate plate coordinates of the point to be measured can be obtained regardless of the size of the workpiece. However, since there are installation errors when each workpiece is installed in the position detection system and movement errors during the movement of the mobile mechanism, the coordinate position of the point to be measured cannot be accurately obtained if only the coordinate plate coordinates are used. The present application can combine the coordinate plate coordinates with the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image to obtain the accurate coordinates of the point to be measured, thereby offsetting the installation error and the movement error, and accurately detecting the actual position of each point on the workpiece.
[0239] In some embodiments, the points to be measured include reference points and positions to be determined; the device further includes:
[0240] The position determination module is used to determine the position between the reference point and the position point to be determined based on the first actual coordinates of the reference point and the second actual coordinates of the position point to be determined.
[0241] In some embodiments, the moving mechanism includes a driving component and a connecting component disposed between the upper camera and the lower camera, and the driving component is used to drive the connecting component to drive the upper camera and the lower camera to move synchronously.
[0242] In some embodiments, the distance between the photographing position and a point on the workpiece corresponding to the photographing position is maintained at a preset distance.
[0243] In some embodiments, the moving mechanism is specifically used to move the upper camera and the lower camera while keeping the lower camera and the upper camera moving synchronously in the vertical direction, wherein the vertical direction is the normal of the horizontal plane, and the horizontal plane is the plane for placing the standard workpiece and the workpiece to be measured; and the upper camera is a zoom camera.
[0244] In some embodiments, the lens of the upper camera is a liquid telecentric lens.
[0245] In some embodiments, a plurality of identification codes are set on the coordinate plate, and each identification code is used to indicate the coordinate at which the identification code is set;
[0246] Obtaining a first coordinate according to the first upper camera image in the following manner, including:
[0247] The coordinates represented by the identification code located at the center of the first upper camera image are identified as the first coordinates.
[0248] In some embodiments, the horizontal plane is disposed in a first direction of the lower camera, wherein the first direction is a direction pointing from the upper camera to the lower camera;
[0249] The coordinate plate is arranged in a second direction of the upper camera, and the second direction is the opposite direction of the first direction;
[0250] The connecting component is disposed in the second direction of the lower camera and in the first direction of the upper camera.
[0251] The present application also provides an electronic device, such as Fig.19 As shown, including:
[0252] A memory 191, for storing computer programs;
[0253] The second processor 192 is used to implement any of the above-mentioned position detection methods when executing the program stored in the memory 191.
[0254] In addition, the electronic device may further include a communication bus and / or a communication interface, and the second processor 192, the communication interface, and the memory 191 communicate with each other via the communication bus.
[0255] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0256] The communication interface is used for communication between the above electronic device and other devices.
[0257] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned second processor.
[0258] The above-mentioned second processor can be a general-purpose second processor, including a central second processor (CPU), a network second processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0259] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a first processor, the steps of any of the above-mentioned position detection methods are implemented.
[0260] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the position detection methods in the above embodiments.
[0261] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0262] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0263] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for methods, devices, electronic devices, systems, storage media, and computer program products, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0264] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A position detection method, characterized in that: Applied to a position detection system, the system comprises an upper camera and a lower camera fixed in relative position, a moving mechanism for moving the upper camera and the lower camera, and a fixed coordinate plate; the upper camera is used to photograph the coordinate plate; the method comprises: Obtaining a shooting position corresponding to the point to be measured photographed by the lower camera; Using the moving mechanism, the upper camera and the lower camera are moved to the shooting position of the workpiece to be measured; Acquire a second lower camera image taken by the lower camera for the test point of the workpiece to be tested, as well as a first lower camera image and a first upper camera image; the first lower camera image is an image taken by the lower camera by moving the upper camera and the lower camera to the shooting position of the standard workpiece using the moving mechanism, and the first upper camera image is an image taken by the upper camera; The actual coordinates of the point to be measured on the workpiece to be measured are obtained according to the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image, and the first coordinates obtained according to the first upper camera image.
2. The method according to claim 1, characterized in that The points to be measured include reference points and positions to be determined; the method further includes: The position between the reference point and the point to be determined is determined based on the first actual coordinates of the reference point and the second actual coordinates of the point to be determined.
3. The method according to claim 1, characterized in that The moving mechanism includes a driving component and a connecting component arranged between the upper camera and the lower camera, and the driving component is used to drive the connecting component to drive the upper camera and the lower camera to move synchronously.
4. The method according to claim 3, characterized in that The distance between the shooting position and the point on the workpiece corresponding to the shooting position is maintained at a preset distance.
5. The method according to claim 4, characterized in that The moving mechanism is specifically used to move the upper camera and the lower camera while keeping the lower camera and the upper camera moving synchronously in the vertical direction, wherein the vertical direction is the normal to the horizontal plane, and the horizontal plane is the plane for placing the standard workpiece and the workpiece to be measured; and the upper camera is a zoom camera.
6. The method according to claim 5, characterized in that The lens of the upper camera is a liquid telecentric lens.
7. The method according to claim 1, characterized in that The coordinate plate is provided with a plurality of identification codes, each identification code being used to indicate the coordinate at which the identification code is provided; Obtaining a first coordinate according to the first upper camera image in the following manner, including: The coordinates represented by the identification code located at the center of the first upper camera image are identified as the first coordinates.
8. The method according to claim 5, characterized in that The horizontal plane is arranged in a first direction of the lower camera, wherein the first direction is a direction pointing from the upper camera to the lower camera; The coordinate plate is arranged in a second direction of the upper camera, and the second direction is the opposite direction of the first direction; The connecting component is disposed in the second direction of the lower camera and in the first direction of the upper camera.
9. A position detection system, characterized in that: The system comprises: an upper camera and a lower camera fixed in relative position, a moving mechanism, a coordinate plate and a first processor; the upper camera faces the coordinate plate; The moving mechanism is used to move the upper camera and the lower camera under the control of the first processor; The upper camera is used to photograph the coordinate plate under the control of the first processor to obtain an upper camera image; The lower camera is used to photograph the points to be measured on the workpiece under the control of the first processor to obtain a lower camera image; The first processor is used to implement the position detection method described in any one of claims 1-8.
10. A position detection device, characterized in that: Applied to a position detection system, the system comprises an upper camera and a lower camera fixed in relative position, a moving mechanism for moving the upper camera and the lower camera, and a fixed coordinate plate; the upper camera is used to photograph the coordinate plate; the device comprises: A first acquisition module is used to acquire a shooting position corresponding to the point to be measured photographed by the lower camera; A mobile driving module, used to move the upper camera and the lower camera to the shooting position of the workpiece to be measured by using the mobile mechanism; A second acquisition module is used to acquire a second lower camera image taken by the lower camera for the test point of the workpiece to be measured, as well as a first lower camera image and a first upper camera image; the first lower camera image is an image taken by the lower camera by moving the upper camera and the lower camera to the shooting position of the standard workpiece using the moving mechanism, and the first upper camera image is an image taken by the upper camera; A coordinate determination module is used to obtain the actual coordinates of the point to be measured on the workpiece to be measured according to the coordinate offset of the point to be measured in the first lower camera image and the second lower camera image, and the first coordinate obtained according to the first upper camera image.
Citation Information
Patent Citations
Calibration device and method and depth camera
CN113034612A
Hand-eye calibration error correction method based on ICP algorithm
CN114519738A
Size detection system and size detection method for fabrication hole
CN119245516A
Mounting position correction method of position measuring camera in double-sided board inspection device
JP2002221550A
Calibration method and device for robot
WO2022061673A1