Coordinate transformation matrix calculation method, device, equipment and readable storage medium
By adding local minimum value detection and punishment mechanisms to the iterative algorithm, the problem of the iterative algorithm falling into local minimum value when calculating the coordinate transformation matrix is solved, and the accuracy and practicality of the algorithm are improved.
Patent Information
- Application Number
- CN202111399325.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-11-19
AI Technical Summary
Existing iterative algorithms are sensitive to the initial value when calculating the coordinate conversion matrix, and are prone to falling into local minimum value points, resulting in calculation errors.
By adding local minimum value judgment conditions to the iterative calculation, updating the local minimum value list, reinitializing the iterative variable, and using local minimum value penalties to supervise iterative variables to avoid falling into local minimum value.
It improves the accuracy and practicality of the algorithm, enables iterative variables to obtain appropriate values, solves the problem of initial value selection, and enhances the stability of the algorithm.
Smart Images

Figure CN114186191B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment and readable storage medium for calculating a coordinate transformation matrix. Background Art
[0002] Guiding the robot arm to perform automated operations through guidance sensors such as vision can effectively replace manual repetitive, heavy, high-intensity, and high-risk operations, and mechanical operations have higher and more consistent quality control, so it has great application potential in smart manufacturing industries such as 3C electronics and automobiles. One of the prerequisites for the robot arm to perform automated operations according to the preset program is to determine the relative posture between the robot arm, (vision, etc.) guidance sensors, the operation position, and the operation object. In practical applications, this prerequisite is to measure the feature points of the (vision, etc.) guidance sensors, the operation position, and the operation object, and use the calibration algorithm to calculate the coordinate transformation matrix (rotation matrix and translation vector) of the guidance sensor, the operation position, and the operation object. The calculation algorithm of the coordinate transformation matrix is divided into two categories: linear algorithm and nonlinear algorithm. The nonlinear algorithm is to synchronously calculate the rotation matrix and the translation vector through an iterative algorithm. However, the existing iterative algorithm is sensitive to the initial value of the iteration. The selection of the initial value directly affects the number of iterations and the solution accuracy of the iterative algorithm. Inappropriate initial values may even cause the iterative algorithm to fall into a local minimum point, resulting in errors in the calculation of the coordinate transformation matrix. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a method, device, equipment and readable storage medium for calculating a coordinate transformation matrix, so as to solve the problem that the iterative algorithm falls into a local minimum point due to inappropriate selection of the iterative initial value, resulting in errors in the calculation of the coordinate transformation matrix in the existing nonlinear algorithm of the coordinate transformation matrix.
[0004] In order to solve the above problems, in the first aspect, an embodiment of the present invention provides a method for calculating a coordinate transformation matrix, including: obtaining first coordinate data of a feature point of a target object in a reference coordinate system and second coordinate data in a coordinate system to be calibrated; establishing an objective function with a minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the objective function includes a coordinate transformation matrix between the reference coordinate system and the coordinate system to be calibrated; the coordinate transformation matrix includes parameters to be optimized; iteratively calculating the objective function according to initial values of the parameters to be optimized, initial values of the iteration parameters, preset local minimum penalty weights and initial values of the local minimum until an iteration termination condition is met to obtain the parameters to be optimized. the first updated value of the parameter to be optimized, the first iterative increment when the iteration terminates, and the first calculated value of the optimization target; in the case where it is determined that the iterative calculation falls into a local minimum according to the first iterative increment and the first calculated value of the optimization target, the initial value of the local minimum is updated according to the first updated value of the parameter to be optimized when the iteration terminates, the initial value of the parameter to be optimized is reset, and the step of iteratively calculating the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum is returned until it is determined that the iterative calculation does not fall into the local minimum, and a second updated value of the parameter to be optimized is obtained; the coordinate transformation matrix is determined according to the second updated value of the parameter to be optimized.
[0005] Optionally, before establishing an objective function with a minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data, the method for calculating the coordinate transformation matrix further includes: normalizing the first coordinate data and the second coordinate data.
[0006] Optionally, the objective function is iteratively calculated according to the initial values of the parameters to be optimized, the initial values of the iteration parameters, the preset local minimum penalty weights and the initial values of the local minimum until the iteration termination conditions are met, including: calculating the partial derivatives of the objective function according to the initial values of the parameters to be optimized; calculating the second iteration increment according to the partial derivatives and the initial values of the iteration parameters; calculating the iteration effect index according to the second iteration increment; updating the parameters to be optimized and the iteration parameters according to the iteration effect index, the second iteration increment, the preset local minimum penalty weights and the initial values of the local minimum, and returning the partial derivative calculation of the objective function according to the updated parameters to be optimized until the iteration termination conditions are met.
[0007] Optionally, the optimization parameters and iteration parameters are updated according to the iteration effect index, the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum, including: when it is determined that the iteration effect index meets the preset conditions, the optimization parameters are updated according to the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum value, and the iteration parameters are updated according to the iteration effect index.
[0008] Optionally, the coordinate transformation matrix calculation method further includes: when it is determined that the iteration effect index does not meet a preset condition, keeping the value of the parameter to be optimized unchanged and updating the iteration parameter.
[0009] Optionally, the step of determining whether the iterative calculation falls into a local minimum according to the first iterative increment and the first calculated value of the optimization target includes: determining whether the iterative calculation falls into a local minimum when it is determined that the first iterative increment and the first calculated value of the optimization target meet preset conditions.
[0010] In a second aspect, an embodiment of the present invention provides a coordinate transformation matrix calculation device, comprising: an acquisition unit, used to acquire first coordinate data of a feature point of a target object in a reference coordinate system and second coordinate data in a coordinate system to be calibrated; an establishment unit, used to establish an objective function with a minimum calibration error as an optimization target based on the first coordinate data and the second coordinate data; the objective function includes a coordinate transformation matrix between the reference coordinate system and the coordinate system to be calibrated; the coordinate transformation matrix includes parameters to be optimized; an iteration unit, used to iteratively calculate the objective function based on initial values of the parameters to be optimized, initial values of the iteration parameters, preset local minimum penalty weights and initial values of the local minimum until an iteration termination condition is met to obtain the parameters to be optimized. A first update value, a first iteration increment when the iteration terminates, and a first calculated value of the optimization target; an update unit, used to update the initial value of the local minimum according to the first update value of the parameter to be optimized when the iteration terminates, reset the initial value of the parameter to be optimized, and return to the step of iteratively calculating the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum, when it is determined that the iterative calculation has fallen into a local minimum according to the first iteration increment and the first calculated value of the optimization target, until it is determined that the iterative calculation has not fallen into a local minimum, and a second update value of the parameter to be optimized is obtained; a determination unit, used to determine the coordinate transformation matrix according to the second update value of the parameter to be optimized.
[0011] Optionally, before the establishment unit, the coordinate conversion matrix calculation device further includes: a processing unit, configured to perform normalization processing on the first coordinate data and the second coordinate data.
[0012] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes a method for calculating a coordinate transformation matrix as in the first aspect or any embodiment of the first aspect.
[0013] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute a method for calculating a coordinate transformation matrix as in the first aspect or any embodiment of the first aspect.
[0014] The coordinate transformation matrix calculation method, device, equipment and readable storage medium provided by the embodiments of the present invention add local minimum judgment conditions to the iterative calculation algorithm, so that after the iterative algorithm falls into the local minimum point, the iterative variables are reinitialized by updating the local minimum list, and the reinitialized iterative variables are supervised based on the local minimum penalty weight, so that the algorithm can jump out of the local minimum, avoid the solution output of the iterative algorithm falling into the local minimum, and enable the iterative variable to obtain a suitable value, and then calculate the coordinate transformation matrix, thereby enhancing the accuracy of the algorithm; and, by adding local minimum detection and local minimum penalty mechanisms to the iterative algorithm, the iterative algorithm is insensitive to the initial value of the iteration, and the initial value of the iterative variable can be randomly selected, which solves the problem of initial value selection of the iterative algorithm and enhances the practicality of the algorithm.
[0015] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a flow chart of a method for calculating a coordinate transformation matrix in an embodiment of the present invention;
[0017] Figure 2 Schematic diagram of the structure of a coordinate conversion matrix calculation device in an embodiment of the present invention;
[0018] Figure 3 The figure is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0020] The embodiment of the present invention provides a method for calculating a coordinate transformation matrix, which can be applied to the calculation of the relative posture of a robot arm, a visual guidance sensor, a work position, a work object, etc. in a robot arm automated operation. Figure 1 As shown, including:
[0021] S101. Obtain first coordinate data of a feature point of a target object in a reference coordinate system and second coordinate data in a coordinate system to be calibrated.
[0022] In this embodiment, the target object can be any one of a robot arm, a visual guidance sensor, a work position, and a work object. The coordinate data of the feature points of the target object in the reference coordinate system (hereinafter referred to as FR) and the coordinate system to be calibrated (hereinafter referred to as FC) are: Among them, N is the number of feature points, is the coordinate vector of feature point i in the FR coordinate system, is the coordinate vector of feature point i in the FC coordinate system.
[0023] S102. Establish an objective function with minimum calibration error as optimization target according to the first coordinate data and the second coordinate data; the objective function includes a coordinate transformation matrix between the reference coordinate system and the coordinate system to be calibrated; the coordinate transformation matrix includes parameters to be optimized.
[0024] In this embodiment, the first coordinate data and the second coordinate data need to be calibrated to obtain a coordinate transformation matrix between the reference coordinate system and the coordinate system to be calibrated. During calibration, the calibration error can be minimized as the optimization goal, and the calibration problem can be transformed into the following optimization problem:
[0025]
[0026] in, It is the second coordinate data of the feature point in the FC coordinate system. It is the nominal coordinate of the feature point of the target object in the FC coordinate, which is calculated by the coordinate transformation matrix to be calibrated (rotation matrix R and translation matrix t) and the first coordinate data of the feature point in the FR coordinate. The optimization target S represents the Euclidean distance error between the nominal feature point and the second coordinate data introduced by the coordinate transformation matrix to be calibrated (R and t).
[0027] The coordinate transformation matrix (R and t) is parameterized and expressed as the parameter to be optimized α = (α0 α1 α2 α3 α4 α5) T Mapping R(α) and t(α) of (rotation angles α0, α1, α2 and translation vectors α3, α4, α5):
[0028]
[0029] t = (α3 α4 α5) T 。
[0030] S103. Iteratively calculate the objective function based on the initial value of the parameter to be optimized, the initial value of the iterative parameter, the preset local minimum penalty weight, and the initial value of the local minimum until the iterative termination condition is satisfied, obtaining the first updated value of the parameter to be optimized, the first iterative increment at the end of iteration, and the first calculated value of the optimization objective.
[0031] Specifically, an iterative algorithm can be used to solve the optimization problem. During iteration, it is necessary to set the initial value of the parameter α to be optimized and the initial value of the iterative parameter μ. Since the local minimum is unknown during the first optimization, the initial value of the local minimum can be set to be empty. To enable the iterative algorithm to jump out of the local minimum, the penalty weight of the local minimum can be set. And during the iterative process, by setting the penalty weight of the local minimum, the parameter to be optimized and the iterative parameter can be supervised, so that the initial value of the iterative algorithm can be randomly selected. During iteration, it is necessary to calculate the iterative increment, the iterative effect index, and the calculated value of the optimization objective for each iteration. After each iteration, the parameter to be optimized and the iterative parameter need to be updated for the next iteration.
[0032] The iterative termination conditions include: 1) The number of iterations exceeds the limit;
[0033] 2) S < S0, where S0 is the optimization index threshold;
[0034] 3) Δα < Δα0, where Δα0 is the iterative step threshold; Δα is the iterative increment, that is, the iterative step.
[0035] As long as any of the conditions is satisfied, the iteration terminates. When the iteration terminates, the first updated value of the parameter to be optimized can be obtained, and the first iterative increment and the first calculated value of the optimization objective can also be obtained.
[0036] S104. In the case where it is determined that the iterative calculation has fallen into a local minimum according to the first iterative increment and the first calculated value of the optimization objective, update the initial value of the local minimum according to the first updated value of the parameter to be optimized at the end of iteration, reset the initial value of the parameter to be optimized, and return to the step of iteratively calculating the objective function based on the initial value of the parameter to be optimized, the initial value of the iterative parameter, the preset local minimum penalty weight, and the initial value of the local minimum until it is determined that the iterative calculation has not fallen into a local minimum, obtaining the second updated value of the parameter to be optimized.
[0037] In one implementation, the step of determining that the iterative calculation has fallen into a local minimum according to the first iterative increment and the first calculated value of the optimization objective includes: determining that the iterative calculation has fallen into a local minimum in the case where it is determined that the first iterative increment and the first calculated value of the optimization objective satisfy the preset conditions.
[0038] Specifically, when the first iterative increment satisfies Δα<Δα0 and the first calculated value of the optimization target S>S0, it is determined that the iterative calculation falls into a local minimum. Then the initial value of the local minimum is updated according to the first updated value of the parameter to be optimized, and an initial value of the parameter to be optimized is randomly selected and iterated again. After the termination of this iteration, if the first iterative increment satisfies Δα<Δα0 and the first calculated value of the optimization target S>S0, it means that the iterative calculation is still trapped in the local minimum, and it is necessary to reinitialize the local minimum and the parameter to be optimized, and iterate again. If the first iterative increment does not satisfy Δα<Δα0, and / or the first calculated value of the optimization target does not satisfy S>S0, it means that the iterative calculation has not fallen into a local minimum, and the second updated value of the parameter to be optimized at the termination of the iteration is the required parameter to be optimized.
[0039] S105. Determine a coordinate transformation matrix according to the second updated value of the parameter to be optimized.
[0040] In this embodiment, the calculated second updated value of the parameter to be optimized is substituted into the calculation formula of R(α) and t(α) to obtain the coordinate transformation matrix.
[0041] The coordinate transformation matrix calculation method provided by the embodiment of the present invention adds a local minimum judgment condition to the iterative calculation algorithm, so that after the iterative algorithm falls into a local minimum point, the iterative variables are reinitialized by updating the local minimum list, and the reinitialized iterative variables are supervised based on the local minimum penalty weight, so that the algorithm can jump out of the local minimum, avoid the solution output of the iterative algorithm falling into the local minimum, and enable the iterative variable to obtain a suitable value, and then calculate the coordinate transformation matrix, thereby enhancing the accuracy of the algorithm; and, by adding local minimum detection and local minimum penalty mechanisms to the iterative algorithm, the iterative algorithm is insensitive to the initial value of the iteration, and the initial value of the iterative variable can be randomly selected, which solves the problem of initial value selection of the iterative algorithm and enhances the practicality of the algorithm.
[0042] In an optional embodiment, before establishing an objective function with minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data, the method for calculating the coordinate transformation matrix further includes: normalizing the first coordinate data and the second coordinate data.
[0043] Specifically, the first coordinate data and the second coordinate data can be normalized by the following formula:
[0044]
[0045]
[0046] Among them, max is the maximum value processing, scalar is the maximum value of the first coordinate data and the second coordinate data, for The corresponding normalized data is for The corresponding normalized data.
[0047] In this embodiment, the first coordinate data and the second coordinate data are normalized, thereby eliminating the problem of algorithm parameter heterogeneity caused by inconsistent target object sizes, simplifying the algorithm usage method, and broadening the applicability of the algorithm.
[0048] In an optional embodiment, step S103, iteratively calculates the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum until the iteration termination condition is met, including: calculating the partial derivative of the objective function according to the initial value of the parameter to be optimized; calculating the second iteration increment according to the partial derivative and the initial value of the iteration parameter; calculating the iteration effect index according to the second iteration increment; updating the parameter to be optimized and the iteration parameter according to the iteration effect index, the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum, and returning to calculate the partial derivative of the objective function according to the updated parameter to be optimized until the iteration termination condition is met.
[0049] Specifically, when solving the optimization problem through an iterative algorithm, the first step is to set the initial value of the parameter to be optimized to α k , the initial value of the iteration parameter μ is μ k (First iteration, k = 0,) and set the minimum value list α of the parameter to be optimized m The local minimum penalty weight λ can be obtained through multiple tests.
[0050] Step 2: The partial derivative (Jacobi matrix J) can be calculated for the optimization target S of the optimization problem. The calculation process is as follows:
[0051]
[0052] Among them, the sub-Jacobi matrix J corresponding to each feature point i for:
[0053]
[0054] That is, it consists of a rotation part and a translation part. The coordinate vector of feature point i in the FR coordinate system is Then the calculation result of the rotation part in the sub-Jacobi matrix is:
[0055]
[0056] Among them, r1, r2, and r3 are coordinate axes.
[0057] Therefore, the sub-Jacobian matrix corresponding to the feature point i is obtained as follows:
[0058]
[0059] Among them, I is the identity matrix.
[0060] Step 3: Calculation of the iterative increment Δα:
[0061]
[0062] Step 4: Calculation of the iterative effect index ρ:
[0063]
[0064] Step 5: Determination of the iterative increment. Update the parameter to be optimized and the initial value of the iterative parameter according to the result of the iterative increment determination.
[0065] If |ρ| < ρ0, then ρ0 is the effect index threshold, α k+1 is the updated value of α k , μ k+1 is the updated value of μ k ; otherwise α k+1 = α k , μ k+1 = 2μ k .
[0066] Step 6: Return to Step 2 and continue the next iteration until the iteration termination condition is met.
[0067] The iteration termination conditions include: 1) The number of iterations exceeds the limit;
[0068] 2) S < S0, where S0 is the optimization index threshold;
[0069] 3) Δα < Δα0, where Δα0 is the iteration step size threshold;
[0070] As long as any one of the three conditions is met, the iteration terminates.
[0071] In this embodiment, the parameter to be optimized and the iterative parameter are updated according to the iterative effect index, the second iterative increment, the preset local minimum penalty weight, and the initial value of the local minimum. Therefore, when updating the parameter to be optimized and the iterative parameter, the penalty weight of the local minimum and the local minimum are considered, which can make the iteration of the parameter to be optimized tend to be far from the local minimum, avoid the algorithm falling into the local minimum, and can make the parameter to be optimized closer and closer to the desired value, and can solve the problem of the initial value selection of the iterative algorithm.
[0072] In an optional embodiment, the optimization parameters and iteration parameters are updated according to the iteration effect index, the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum, including: when it is determined that the iteration effect index meets the preset conditions, the optimization parameters are updated according to the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum value, and the iteration parameters are updated according to the iteration effect index; when it is determined that the iteration effect index does not meet the preset conditions, the value of the parameter to be optimized is kept unchanged and the iteration parameters are updated.
[0073] Specifically, we can assume that if |ρ|<ρ0, then When updating the optimization parameters, the local minimum penalty weight and the local minimum are considered. Otherwise, α k+1 =α k ,μ k+1 =2μ k In this embodiment, when the iterative parameter is updated, μ k+1 =2μ k The update is performed as an example, and is not limited to this in other embodiments or other scenarios.
[0074] In an embodiment of the present invention, when it is determined that the iteration effect index meets the preset conditions, the parameters to be optimized are updated according to the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum value, and the iteration parameters are updated according to the iteration effect index; when it is determined that the iteration effect index does not meet the preset conditions, the value of the parameter to be optimized is kept unchanged and the iteration parameters are updated; thereby, different updating methods of iteration variables are executed under different iteration effect indicators, making the algorithm more accurate.
[0075] The embodiment of the present invention also provides a coordinate transformation matrix calculation device, such as Figure 2 As shown, including:
[0076] The acquisition unit 21 is used to acquire the first coordinate data of the feature point of the target object in the reference coordinate system and the second coordinate data in the coordinate system to be calibrated; the specific implementation method is detailed in the description of step S101 of the above method embodiment, which will not be repeated here.
[0077] Establishing unit 22, used to establish an objective function with minimum calibration error as optimization target according to the first coordinate data and the second coordinate data; the objective function includes a coordinate transformation matrix between the reference coordinate system and the coordinate system to be calibrated; the coordinate transformation matrix includes parameters to be optimized; the specific implementation method is detailed in the description of step S102 of the above method embodiment, which will not be repeated here.
[0078] The iteration unit 23 is used to iteratively calculate the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum until the iteration termination condition is met, thereby obtaining the first updated value of the parameter to be optimized, the first iteration increment when the iteration terminates and the first calculated value of the optimization target; the specific implementation method is detailed in the description of step S103 of the above method embodiment, which will not be repeated here.
[0079] The updating unit 24 is used to update the initial value of the local minimum according to the first updated value of the parameter to be optimized when the iteration is terminated, reset the initial value of the parameter to be optimized, and return to the step of iteratively calculating the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum, when it is determined that the iterative calculation has fallen into a local minimum according to the first iterative increment and the first calculated value of the optimization target, until it is determined that the iterative calculation has not fallen into a local minimum, and a second updated value of the parameter to be optimized is obtained; the specific implementation method is detailed in the description of step S104 of the above method embodiment, which will not be repeated here.
[0080] The determination unit 25 is used to determine the coordinate transformation matrix according to the second updated value of the parameter to be optimized. The specific implementation method is described in the description of step S105 of the above method embodiment, which will not be repeated here.
[0081] The coordinate transformation matrix calculation device provided by the embodiment of the present invention adds a local minimum judgment condition to the iterative calculation algorithm, so that after the iterative algorithm falls into a local minimum point, the iterative variable is reinitialized by updating the local minimum list, and the reinitialized iterative variable is supervised based on the local minimum penalty weight, so that the algorithm can jump out of the local minimum, avoid the solution output of the iterative algorithm falling into the local minimum, and enable the iterative variable to obtain a suitable value, and then calculate the coordinate transformation matrix, thereby enhancing the accuracy of the algorithm; and, by adding local minimum detection and local minimum penalty mechanisms to the iterative algorithm, the iterative algorithm is insensitive to the initial value of the iteration, and the initial value of the iterative variable can be randomly selected, which solves the problem of initial value selection of the iterative algorithm and enhances the practicality of the algorithm.
[0082] In an optional embodiment, before establishing unit 22, the coordinate transformation matrix calculation device further includes: a processing unit, configured to perform normalization processing on the first coordinate data and the second coordinate data.
[0083] Based on the same inventive concept as the method for calculating a coordinate transformation matrix in the aforementioned embodiment, an embodiment of the present invention further provides an electronic device, such as Figure 3As shown, it includes: a processor 31 and a memory 32, wherein the processor 31 and the memory 32 can be connected via a bus or other means. Figure 3 The bus connection is used as an example for explanation.
[0084] The processor 31 may be a central processing unit (CPU). The processor 31 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0085] The memory 32 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method for calculating the coordinate transformation matrix in the embodiment of the present invention. The processor 31 executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory 32, that is, implements the method for calculating the coordinate transformation matrix in the above method embodiment.
[0086] The memory 32 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created by the processor 31, etc. In addition, the memory 32 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 32 may optionally include a memory remotely arranged relative to the processor 31, and these remote memories may be connected to the processor 31 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0087] The above one or more modules are stored in the memory 32, and when executed by the processor 31, the following is performed: Figure 1 The calculation method of the coordinate transformation matrix in the illustrated embodiment.
[0088] For details of the above electronic equipment, please refer to Figure 1 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.
[0089] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0090] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0091] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable information processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable information processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable information processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0093] These computer program instructions can also be loaded onto a computer or other programmable information processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0094] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for calculating a coordinate transformation matrix, the method being applied to the relative posture calculation of a robot arm automated operation, characterized in that: include: Acquire first coordinate data of a feature point of a target object in a reference coordinate system and second coordinate data of a feature point of a target object in a coordinate system to be calibrated, wherein the target object includes any one of a robotic arm, a visual guidance sensor, an operation position, and an operation object; Establishing an objective function with minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the objective function includes a coordinate transformation matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix includes parameters to be optimized; Iteratively calculating the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum until the iteration termination condition is met, thereby obtaining a first updated value of the parameter to be optimized, a first iteration increment when the iteration terminates and a first calculated value of the optimization objective; In the case where it is determined that the iterative calculation falls into a local minimum according to the first iterative increment and the first calculated value of the optimization target, the initial value of the local minimum is updated according to the first updated value of the parameter to be optimized when the iteration is terminated, the initial value of the parameter to be optimized is reset, and the step of iteratively calculating the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum is returned until it is determined that the iterative calculation does not fall into a local minimum, and a second updated value of the parameter to be optimized is obtained; Determine the coordinate transformation matrix according to the second updated value of the parameter to be optimized; Determine the relative positions and postures among the robot arm, the vision guidance sensor, the working position, and the working object according to the coordinate transformation matrix; The iterative calculation of the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum until the iteration termination condition is met includes: Calculating partial derivatives of the objective function according to the initial values of the parameters to be optimized; Calculating a second iteration increment according to the partial derivative and an initial value of an iteration parameter; Calculating an iteration effect indicator according to the second iteration increment; The parameters to be optimized and the iteration parameters are updated according to the iteration effect index, the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum, and the partial derivative calculation of the objective function is returned according to the updated parameters to be optimized until the iteration termination condition is met.
2. The method for calculating the coordinate transformation matrix according to claim 1, characterized in that: Before establishing an objective function with the minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data, the method further includes: The first coordinate data and the second coordinate data are normalized.
3. The method for calculating the coordinate transformation matrix according to claim 1, characterized in that: The updating of the parameter to be optimized and the iteration parameter according to the iteration effect indicator, the second iteration increment, a preset local minimum penalty weight and an initial value of the local minimum includes: When it is determined that the iteration effect indicator meets the preset conditions, the parameter to be optimized is updated according to the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum value, and the iteration parameter is updated according to the iteration effect indicator.
4. The method for calculating the coordinate transformation matrix according to claim 3, characterized in that: Also includes: When it is determined that the iteration effect indicator does not meet the preset condition, the value of the parameter to be optimized is kept unchanged, and the iteration parameter is updated.
5. The method for calculating the coordinate transformation matrix according to claim 1, characterized in that: The step of determining that the iterative calculation falls into a local minimum according to the first iterative increment and the first calculated value of the optimization target comprises: When it is determined that the first iterative increment and the first calculated value of the optimization target satisfy a preset condition, it is determined that the iterative calculation falls into a local minimum.
6. A coordinate transformation matrix calculation device, the method is applied to the relative posture calculation of the robot arm automation operation, characterized in that: include: An acquisition unit, used to acquire first coordinate data of a feature point of a target object in a reference coordinate system and second coordinate data in a coordinate system to be calibrated, wherein the target object includes any one of a robotic arm, a visual guidance sensor, a work position, and a work object; An establishing unit, configured to establish an objective function with a minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the objective function includes a coordinate transformation matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix includes parameters to be optimized; An iteration unit, configured to iteratively calculate the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum until an iteration termination condition is met, thereby obtaining a first updated value of the parameter to be optimized, a first iteration increment when the iteration terminates and a first calculated value of the optimization objective; an updating unit, for, when it is determined that the iterative calculation falls into a local minimum according to the first iterative increment and the first calculated value of the optimization target, updating the initial value of the local minimum according to the first updated value of the parameter to be optimized at the time of iteration termination, resetting the initial value of the parameter to be optimized, and returning to the step of iteratively calculating the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum, until it is determined that the iterative calculation does not fall into a local minimum, thereby obtaining a second updated value of the parameter to be optimized; A determination unit, configured to determine the coordinate transformation matrix according to the second updated value of the parameter to be optimized, and determine the relative posture among the robot arm, the vision guidance sensor, the working position, and the working object according to the coordinate transformation matrix; The iterative calculation of the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset local minimum penalty weight and the initial value of the local minimum until the iteration termination condition is met includes: Calculating partial derivatives of the objective function according to the initial values of the parameters to be optimized; Calculating a second iteration increment according to the partial derivative and an initial value of an iteration parameter; Calculating an iteration effect indicator according to the second iteration increment; The parameters to be optimized and the iteration parameters are updated according to the iteration effect index, the second iteration increment, the preset local minimum penalty weight and the initial value of the local minimum, and the partial derivative calculation of the objective function is returned according to the updated parameters to be optimized until the iteration termination condition is met.
7. The coordinate transformation matrix calculation device according to claim 6, characterized in that: Before building the unit, also include: A processing unit is used to normalize the first coordinate data and the second coordinate data.
8. An electronic device, characterized in that: include: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the method for calculating the coordinate transformation matrix as described in any one of claims 1-5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the coordinate transformation matrix calculation method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Measuring head pose calibration technology of non-contact measurement system
CN112781496A
Image clustering method and device, electronic equipment and storage medium
CN113505838A
Attitude determination apparatus and method, movement direction determination apparatus, position determination apparatus, and computer program
JP2009276094A
