CN114186191A - Method, device and equipment for calculating coordinate transformation matrix and readable storage medium - Google Patents

Method, device and equipment for calculating coordinate transformation matrix and readable storage medium Download PDF

Info

Publication number
CN114186191A
CN114186191A CN202111399325.8A CN202111399325A CN114186191A CN 114186191 A CN114186191 A CN 114186191A CN 202111399325 A CN202111399325 A CN 202111399325A CN 114186191 A CN114186191 A CN 114186191A
Authority
CN
China
Prior art keywords
iteration
parameter
local minimum
value
optimized
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111399325.8A
Other languages
Chinese (zh)
Inventor
袁康
张学钢
高爽笑
赵兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Lianbao Information Technology Co Ltd
Original Assignee
Hefei Lianbao Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Lianbao Information Technology Co Ltd filed Critical Hefei Lianbao Information Technology Co Ltd
Priority to CN202111399325.8A priority Critical patent/CN114186191A/en
Publication of CN114186191A publication Critical patent/CN114186191A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/11Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Algebra (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Operations Research (AREA)
  • Computing Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method, a device and equipment for calculating a coordinate transformation matrix and a readable storage medium, wherein the method comprises the following steps: acquiring first coordinate data of a characteristic point of a target object in a reference coordinate system and second coordinate data of the characteristic point in a coordinate system to be calibrated; establishing an objective function taking the minimum calibration error as an optimization target; the target function comprises a coordinate conversion matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix comprises parameters to be optimized; performing iterative computation on the objective function according to 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 an iteration termination condition is met and the iterative computation does not fall into the local minimum condition, so as to obtain a second updated value of the parameter to be optimized; and further determines a coordinate transformation matrix. The local minimum value judgment condition and the local minimum value punishment weight are added into the iterative algorithm, so that the algorithm can jump out of the local minimum value.

Description

Method, device and equipment for calculating coordinate transformation matrix and readable storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for calculating a coordinate transformation matrix.
Background
The mechanical arm is guided to carry out automatic operation through the guide sensors such as vision, repeated, heavy, high-strength and high-risk operations can be effectively replaced by manual operation, and the mechanical operation has higher and more consistent quality control, so that the mechanical arm has great application potential in intelligent manufacturing industries such as 3C electronics and automobiles. One of the preconditions of the robot arm for performing automated operations according to a preset program is the need to determine the relative pose of the robot arm, the (vision, etc.) guidance sensor, the operation position and the operation object. In practical application, when the aforementioned condition is implemented, coordinate transformation matrices (rotation matrices and translation vectors) of the guide sensor, the work position and the work object are respectively calculated by measuring (vision and the like) feature points of the guide sensor, the work position and the work object by using a calibration algorithm. The calculation algorithms of the coordinate transformation matrix are classified into linear algorithms and nonlinear algorithms. The nonlinear algorithm is to synchronously calculate a rotation matrix and a translation vector through an iterative algorithm. However, the existing iterative algorithm is sensitive to an iteration initial value, the selection of the initial value directly affects the iteration times and the solving precision of the iterative algorithm, and an improper initial value even causes the iterative algorithm to fall into a local minimum value point, so that the calculation of a coordinate transformation matrix is wrong.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a readable storage medium for calculating a coordinate transformation matrix, so as to solve the problem that in a non-linear algorithm of an existing coordinate transformation matrix, due to inappropriate selection of an iteration initial value, the iteration algorithm falls into a local minimum value point, which results in an erroneous calculation of the coordinate transformation matrix.
In order to solve the above problem, in a first aspect, an embodiment of the present invention provides a method for calculating a coordinate transformation matrix, including: acquiring first coordinate data of a characteristic point of a target object in a reference coordinate system and second coordinate data of the characteristic point in a coordinate system to be calibrated; establishing an objective function taking the minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the target function comprises a coordinate conversion matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix comprises parameters to be optimized; performing iterative computation on the objective function according to 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 an iteration termination condition is met to obtain a first updated value of the parameter to be optimized, a first iteration increment when the iteration is terminated and a first calculated value of the optimization target; under the condition that the iterative computation is judged to be trapped into the local minimum value according to the first iterative increment and the first calculated value of the optimization target, updating the initial value of the local minimum value according to the first updated value of the parameter to be optimized when the iteration is terminated, resetting the initial value of the parameter to be optimized, returning to the step of performing iterative computation on the target function according to the initial value of the parameter to be optimized, the initial value of the iterative parameter, the preset penalty weight of the local minimum value and the initial value of the local minimum value until the iterative computation is judged not to be trapped into the local minimum value, and obtaining a second updated value of the parameter to be optimized; and determining a coordinate transformation matrix according to the second updated value of the parameter to be optimized.
Optionally, before establishing the objective function with the minimum calibration error as the optimization objective according to the first coordinate data and the second coordinate data, the method for calculating the coordinate transformation matrix further includes: and normalizing the first coordinate data and the second coordinate data.
Optionally, performing iterative computation on the objective function according to 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 an iteration termination condition is met, including: calculating a partial derivative of the objective function according to the initial value of the parameter to be optimized; calculating a second iteration increment according to the partial derivative and the initial value of the iteration parameter; calculating an iteration effect index according to the second iteration increment; and 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 weight and the initial value of the local minimum, and returning to perform partial derivative calculation on the target function according to the updated parameters to be optimized until the iteration termination condition is met.
Optionally, 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, includes: and under the condition that the iteration effect index meets the preset condition, updating the parameters to be optimized according to the second iteration increment, the preset local minimum punishment weight and the initial value of the local minimum, and updating the iteration parameters according to the iteration effect index.
Optionally, the method for calculating the coordinate transformation matrix further includes: and under the condition that the iteration effect index does not meet the preset condition, keeping the value of the parameter to be optimized unchanged, and updating the iteration parameter.
Optionally, the step of determining the iterative computation trapping local minimum according to the first iterative increment and the first calculated value of the optimization objective comprises: and under the condition that the first iteration increment and the first calculated value of the optimization target meet the preset condition, judging that the iteration calculation falls into a local minimum value.
In a second aspect, an embodiment of the present invention provides an apparatus for calculating a coordinate transformation matrix, including: the device comprises an acquisition unit, a calibration unit and a calibration unit, wherein the acquisition unit is used for acquiring first coordinate data of a characteristic point of a target object in a reference coordinate system and second coordinate data of the characteristic point in a coordinate system to be calibrated; the establishing unit is used for establishing an objective function taking the minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the target function comprises a coordinate conversion matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix comprises parameters to be optimized; the iteration unit is used for carrying out iterative computation on 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, so as to obtain a first updated value of the parameter to be optimized, a first iteration increment when the iteration is terminated and a first computed value of the optimization target; the updating unit is used for updating the initial value of the local minimum value according to the first updating value of the parameter to be optimized when the iteration is terminated under the condition that the iterative computation is judged to be trapped into the local minimum value according to the first iteration increment and the first calculated value of the optimization target, resetting the initial value of the parameter to be optimized, returning to the step of performing iterative computation on the target function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset penalty weight of the local minimum value and the initial value of the local minimum value until the iterative computation is judged not to be trapped into the local minimum value, and obtaining a second updating value of the parameter to be optimized; and the determining unit is used for determining the coordinate transformation matrix according to the second updated value of the parameter to be optimized.
Optionally, before the establishing unit, the computing device of the coordinate transformation matrix further includes: and the processing unit is used for carrying out normalization processing on the first coordinate data and the second coordinate data.
In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to cause the at least one processor to perform the method of computing the coordinate transformation matrix as in the first aspect or any of the embodiments of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to cause a computer to execute a method for calculating a coordinate transformation matrix as in the first aspect or any implementation manner of the first aspect.
According to the method, the device and the equipment for calculating the coordinate transformation matrix and the readable storage medium provided by the embodiment of the invention, the local minimum value judgment condition is added into the iterative calculation algorithm, so that after the iterative calculation algorithm falls into a local minimum value point, the iterative variables are reinitialized by updating the local minimum value list and are supervised on the reinitialized iterative variables based on the local minimum value punishment weight, so that the algorithm can jump out of the local minimum value, the solution output of the iterative calculation algorithm falling into the local minimum value is avoided, the iterative variables can obtain a proper value, the coordinate transformation matrix is calculated, and the accuracy of the algorithm is enhanced; in addition, by adding a local minimum value detection mechanism and a local minimum value punishment mechanism into the iterative algorithm, the iterative algorithm is not sensitive to the initial value of the iteration, and the initial value of the iteration variable can be randomly selected, so that the problem of initial value selection of the iterative algorithm is solved, and the practicability of the algorithm is enhanced.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
FIG. 1 is a schematic flow chart illustrating a method for calculating a coordinate transformation matrix according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus for computing a coordinate transformation matrix according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a method for calculating a coordinate transformation matrix, which can be applied to the calculation of the relative poses of a middle mechanical arm, a visual guide sensor, a working position, a working object and the like of automatic operation of a mechanical arm, and the method is shown in fig. 1 and comprises the following steps:
s101, acquiring first coordinate data of the feature point of the target object in a reference coordinate system and second coordinate data of the feature point in a coordinate system to be calibrated.
In this embodiment, the target object may be a robot arm, visionAny one of a guide sensor, a work position, and a work target. Coordinate data of the characteristic point of the target object in a reference coordinate system (hereinafter abbreviated as FR) and a coordinate system to be calibrated (hereinafter abbreviated as FC) are
Figure BDA0003364914590000061
Wherein N is the number of the characteristic points,
Figure BDA0003364914590000062
is the coordinate vector of the characteristic point i in the FR coordinate system,
Figure BDA0003364914590000063
is the coordinate vector of the feature point i in the FC coordinate system.
S102, establishing an objective function taking the minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the target function comprises a coordinate conversion matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix includes parameters to be optimized.
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 an optimization target, and the calibration problem can be converted into the following optimization problem:
Figure BDA0003364914590000064
wherein the content of the first and second substances,
Figure BDA0003364914590000065
is the second coordinate data of the characteristic point in the FC coordinate system,
Figure BDA0003364914590000066
the method is characterized in that the target object characteristic point is a nominal coordinate under FC coordinates, the nominal coordinate is obtained by calculating a coordinate conversion matrix (a rotation matrix R and a translation matrix t) to be calibrated and first coordinate data of the characteristic point under FR coordinates, and an optimized target S represents the coordinate to be calibratedThe transformation matrix (R and t) introduces an euclidean distance error between the nominal feature point and the second coordinate data.
The coordinate transformation matrix (R and t) is parameterized and expressed as a parameter to be optimized, namely alpha (alpha)0 α1 α2 α3 α4 α5)T(rotation angle α)012And a translation vector alpha345) R (α) and t (α):
Figure BDA0003364914590000067
t=(α3 α4 α5)T
s103, carrying out iterative computation on the objective function according to 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 an iteration termination condition is met, obtaining a first updated value of the parameter to be optimized, a first iteration increment when iteration is terminated and a first computed value of the optimization target.
In particular, the optimization problem may be solved by an iterative algorithm. During iteration, an initial value of a parameter alpha to be optimized and an initial value of an iteration parameter mu need to be set, and since a local minimum value is unknown during first optimization, the initial value of the local minimum value can be set to be null, and a penalty weight of the local minimum value can be set in order to enable an iteration algorithm to jump out of the local minimum value. In the iteration process, the penalty weight of the local minimum value is set, parameters to be optimized and iteration parameters can be supervised, and therefore the initial value of the iteration algorithm can be randomly selected. During iteration, the iteration increment, the iteration effect index and the calculated value of the optimization target of each iteration need to be calculated. After each iteration, the parameters to be optimized and the iteration parameters need to be updated for the next iteration.
The iteration termination condition includes: 1) the iteration times are out of limit;
2)S<S0,S0is the optimization index threshold;
3)Δα<Δα0,Δα0is an iteration step threshold; Δ α is the iteration increment, i.e., the iteration step size.
The iteration terminates as long as either condition is met. When the iteration is terminated, a first updated value of the parameter to be optimized can be obtained, and a first iteration increment and a first calculated value of the optimization target can also be obtained.
S104, under the condition that the trapping local minimum value of the iterative computation is judged according to the first iterative increment and the first calculated value of the optimization target, updating the initial value of the local minimum value according to the first updated value of the parameter to be optimized when the iteration is terminated, resetting the initial value of the parameter to be optimized, returning to the step of performing the iterative computation on the target function according to 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 value until the trapping local minimum value is judged not to be subjected to the iterative computation, and obtaining a second updated value of the parameter to be optimized.
In one implementation, the step of determining the iteratively calculated trapped local minimum based on the first iteratively incremented and the first calculated value of the optimization objective comprises: and under the condition that the first iteration increment and the first calculated value of the optimization target meet the preset condition, judging that the iteration calculation falls into a local minimum value.
Specifically, the first iteration increment satisfies Δ α<Δα0And a first calculated value S of the optimization target>S0And judging that the iterative computation falls into a local minimum value. Updating the initial value of the local minimum value according to the first updated value of the parameter to be optimized, randomly selecting one initial value of the parameter to be optimized, and repeating the iteration. After this iteration is terminated, if the first iteration increment satisfies Δ α<Δα0And a first calculated value S of the optimization target>S0And if so, indicating that the iterative computation still falls into the local minimum value, re-initializing the local minimum value and the parameter to be optimized, and iterating again. If the first iteration increment does not satisfy Δ α<Δα0And/or the first calculated value of the optimization objective does not satisfy S>S0When the iteration calculation is not trapped in the local minimum value, the iteration is terminatedThe second updated value of the parameter to be optimized is the required parameter to be optimized.
And S105, determining a coordinate transformation matrix according to the second updated value of the parameter to be optimized.
In this embodiment, the calculated second update value of the parameter to be optimized is substituted into the R (α) and t (α) calculation formulas, so as to obtain the coordinate transformation matrix.
According to the method for calculating the coordinate transformation matrix, provided by the embodiment of the invention, the local minimum value judgment condition is added into the iterative calculation algorithm, so that after the iterative calculation algorithm falls into a local minimum value point, the iterative variables are reinitialized by updating the local minimum value list and are supervised based on the local minimum value punishment weight, so that the algorithm can jump out of the local minimum value, the solution output of the iterative calculation algorithm falling into the local minimum value is avoided, the iterative variables can obtain a proper value, the coordinate transformation matrix is calculated, and the accuracy of the algorithm is enhanced; in addition, by adding a local minimum value detection mechanism and a local minimum value punishment mechanism into the iterative algorithm, the iterative algorithm is not sensitive to the initial value of the iteration, and the initial value of the iteration variable can be randomly selected, so that the problem of initial value selection of the iterative algorithm is solved, and the practicability of the algorithm is enhanced.
In an optional embodiment, before the establishing the objective function with the minimum calibration error as the optimization objective according to the first coordinate data and the second coordinate data, the method for calculating the coordinate transformation matrix further includes: and normalizing the first coordinate data and the second coordinate data.
Specifically, the first coordinate data and the second coordinate data may be normalized by the following formula:
Figure BDA0003364914590000091
Figure BDA0003364914590000092
wherein max is the maximum value processing, scalar is the maximum value in the first coordinate data and the second coordinate data,
Figure BDA0003364914590000093
is composed of
Figure BDA0003364914590000094
The corresponding normalized data is then used to normalize the data,
Figure BDA0003364914590000095
is composed of
Figure BDA0003364914590000096
Corresponding normalized data.
In the embodiment, the first coordinate data and the second coordinate data are subjected to normalization processing, so that the problem of algorithm parameter diversity caused by inconsistent sizes of target objects is solved, the algorithm using method is simplified, and the applicability of the algorithm is widened.
In an optional embodiment, step S103, performing iterative computation on the objective function according to an initial value of a parameter to be optimized, an initial value of an iterative parameter, a preset local minimum penalty weight, and an initial value of a local minimum until an iteration termination condition is met, includes: calculating a partial derivative of the objective function according to the initial value of the parameter to be optimized; calculating a second iteration increment according to the partial derivative and the initial value of the iteration parameter; calculating an iteration effect index according to the second iteration increment; and 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 weight and the initial value of the local minimum, and returning to perform partial derivative calculation on the target function according to the updated parameters to be optimized until the iteration termination condition is met.
Specifically, when the optimization problem is solved through an iterative algorithm, the first step is as follows: the initial value of the parameter alpha to be optimized can be set as alphakThe initial value of the iteration parameter mu is muk(first iteration, k ═ 0,) concatenating a list of minimum values α of the parameter α to be optimizedmIs empty. The local minimum penalty weight λ may be passed multiple timesAnd (5) testing.
The second step is that: the partial derivative (Jacobian matrix J) may be calculated for the optimization problem optimization objective S as follows:
Figure BDA0003364914590000101
wherein, the sub Jacobian matrix J corresponding to each characteristic pointiComprises the following steps:
Figure BDA0003364914590000102
i.e. consisting of a rotating part and a translating part. Let the coordinate vector of the feature point i in the FR coordinate system be
Figure BDA0003364914590000103
Then the calculation result of the rotation part in the sub-Jacobian matrix is:
Figure BDA0003364914590000104
wherein r is1、r2And r3Is the coordinate axis.
Therefore, the sub-Jacobian matrix corresponding to the characteristic point i is obtained as follows:
Figure BDA0003364914590000105
where I is the identity matrix.
The third step: iterative delta Δ α calculation:
Figure BDA0003364914590000107
the fourth step: calculating an iteration effect index rho:
Figure BDA0003364914590000106
the fifth step: iteration increment judgment, updating the initial values of the parameters to be optimized and the iteration parameters according to the result of the iteration increment judgment,
if | ρ | +,<ρ0then, then
Figure BDA0003364914590000111
Figure BDA0003364914590000112
ρ0As an effect index threshold, αk+1Is alphakUpdate value of, muk+1Is mukAn updated value of (d); otherwise alphak+1=αkk+1=2μk
And sixthly, returning to the second step, and continuing the next iteration until the iteration termination condition is met.
The iteration termination condition includes: 1) the iteration times are out of limit;
2)S<S0,S0is the optimization index threshold;
3)Δα<Δα0,Δα0is an iteration step threshold;
the iteration terminates as long as any of the 3 conditions is met.
In this embodiment, the parameter to be optimized and the iteration parameter 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, so that when the parameter to be optimized and the iteration parameter are updated, the local minimum penalty weight and the local minimum are considered, the iteration of the parameter to be optimized tends to be away from the local minimum, the algorithm is prevented from falling into the local minimum, the parameter to be optimized is enabled to be closer to a desired value, and the problem of selecting the initial value by the iteration algorithm can be solved.
In an optional embodiment, 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 includes: under the condition that the iteration effect index meets the preset condition, updating the parameter to be optimized according to the second iteration increment, the preset local minimum punishment weight and the initial value of the local minimum, and updating the iteration parameter according to the iteration effect index; and under the condition that the iteration effect index does not meet the preset condition, keeping the value of the parameter to be optimized unchanged, and updating the iteration parameter.
Specifically, it may be set if | ρ | calc<ρ0Then, then
Figure BDA0003364914590000113
Then, local minimum punishment weight and local minimum are considered when updating the parameters to be optimized. Otherwise alphak+1=αkk+1=2μkIn this embodiment, the iteration parameter is updated by μk+1=2μkFor example, the updating is performed, and in other embodiments or other scenarios, the updating is not limited thereto.
In the embodiment of the invention, under the condition that the iteration effect index meets the preset condition, updating the parameters to be optimized according to the second iteration increment, the preset local minimum punishment weight and the initial value of the local minimum value, and updating the iteration parameters according to the iteration effect index; under the condition that the iteration effect index does not meet the preset condition, keeping the value of the parameter to be optimized unchanged, and updating the iteration parameter; therefore, under different iteration effect indexes, different updating modes of iteration variables are executed, and the algorithm is more accurate.
An embodiment of the present invention further provides a device for calculating a coordinate transformation matrix, as shown in fig. 2, including:
the acquiring unit 21 is configured to acquire first coordinate data of a feature point of a target object in a reference coordinate system and second coordinate data of the feature point in a coordinate system to be calibrated; the detailed description of the specific implementation manner is given in step S101 of the above method embodiment, and is not repeated herein.
The establishing unit 22 is used for establishing an objective function taking the minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the target function comprises a coordinate conversion matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix comprises parameters to be optimized; the detailed description of the specific implementation manner is given in step S102 of the above method embodiment, and is not repeated herein.
The iteration unit 23 is configured to perform iterative computation on 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, to obtain a first updated value of the parameter to be optimized, a first iteration increment when iteration is terminated, and a first calculated value of the optimization target; the detailed description of the specific implementation manner is given in step S103 of the above method embodiment, and is not repeated herein.
The updating unit 24 is configured to update the initial value of the local minimum value according to the first update 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 performing iterative computation on the target 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 value until it is determined that the iterative computation does not fall into the local minimum value, so as to obtain a second update value of the parameter to be optimized; the detailed description of the specific implementation manner is given in step S104 of the above method embodiment, and is not repeated herein.
And the determining unit 25 is configured to determine the coordinate transformation matrix according to the second updated value of the parameter to be optimized. The detailed description of the specific implementation manner is given in step S105 of the above method embodiment, and is not repeated herein.
According to the computing device of the coordinate transformation matrix, provided by the embodiment of the invention, the local minimum value judgment condition is added in the iterative computation algorithm, so that after the iterative computation falls into a local minimum value point, the iterative variables are reinitialized by updating the local minimum value list and are supervised based on the local minimum value punishment weight, so that the algorithm can jump out of the local minimum value, the solution output of the iterative computation falling into the local minimum value is avoided, the iterative variables can obtain a proper value, the coordinate transformation matrix is further computed, and the accuracy of the algorithm is enhanced; in addition, by adding a local minimum value detection mechanism and a local minimum value punishment mechanism into the iterative algorithm, the iterative algorithm is insensitive to the iterative initial value, and the initial value of the iterative variable can be randomly selected, so that the problem of selecting the initial value of the iterative algorithm is solved, and the practicability of the algorithm is enhanced.
In an alternative embodiment, before the establishing unit 22, the computing device of the coordinate transformation matrix further includes: and the processing unit is used for carrying out normalization processing on the first coordinate data and the second coordinate data.
Based on the same inventive concept as the method for calculating a coordinate transformation matrix in the foregoing embodiment, an embodiment of the present invention further provides an electronic device, as shown in fig. 3, including: a processor 31 and a memory 32, wherein the processor 31 and the memory 32 may be connected by a bus or other means, and the connection by the bus is illustrated in fig. 3 as an example.
The processor 31 may be a Central Processing Unit (CPU). The Processor 31 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 32, which is a non-transitory computer readable storage medium, may be used for storing 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, namely, implements the calculation method of the coordinate conversion matrix in the above-described method embodiments, by running the non-transitory software program, instructions, and modules stored in the memory 32.
The memory 32 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 31, and the like. Further, the memory 32 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 32 may optionally include memory located remotely from the processor 31, and these remote memories may be connected to the processor 31 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more of the modules described above are stored in the memory 32 and, when executed by the processor 31, perform the method of calculating the coordinate transformation matrix in the embodiment shown in fig. 1.
The details of the electronic device may be understood with reference to the corresponding related description and effects in the embodiment shown in fig. 1, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable information processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable information processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable information processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable information processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such 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 such modifications and variations.

Claims (10)

1. A method for calculating a coordinate transformation matrix, comprising:
acquiring first coordinate data of a characteristic point of a target object in a reference coordinate system and second coordinate data of the characteristic point in a coordinate system to be calibrated;
establishing an objective function taking the minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the target function comprises a coordinate conversion matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix comprises parameters to be optimized;
performing iterative computation on the objective function according to the initial value of the parameter to be optimized, the initial value of the iterative parameter, a preset local minimum penalty weight and the initial value of the local minimum until an iteration termination condition is met to obtain a first updated value of the parameter to be optimized, a first iteration increment when iteration is terminated and a first computed value of the optimization target;
under the condition that the trapping local minimum value of iterative computation is judged according to the first iterative increment and the first calculated value of the optimization target, updating the initial value of the local minimum value according to the first updated value of the parameter to be optimized when iteration is terminated, resetting the initial value of the parameter to be optimized, returning to the step of performing iterative computation on the target function according to 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 value until the trapping local minimum value of the iterative computation is judged, and obtaining a second updated value of the parameter to be optimized;
and determining the coordinate transformation matrix according to the second updated value of the parameter to be optimized.
2. The method of calculating a coordinate transformation matrix according to claim 1, further comprising, before establishing an objective function with a minimum calibration error as an optimization objective based on the first coordinate data and the second coordinate data:
and normalizing the first coordinate data and the second coordinate data.
3. The method for calculating the coordinate transformation matrix according to claim 1, wherein the iteratively calculating the objective function according to the initial value of the parameter to be optimized, the initial value of the iterative parameter, the predetermined local minimum penalty weight, and the initial value of the local minimum until an iteration termination condition is satisfied includes:
calculating a partial derivative of the objective function according to the initial value of the parameter to be optimized;
calculating a second iteration increment according to the partial derivative and the initial value of the iteration parameter;
calculating an iteration effect index according to the second iteration increment;
and updating the parameter to be optimized and the iteration parameter according to the iteration effect index, the second iteration increment, a preset local minimum penalty weight and an initial value of a local minimum, and performing partial derivative calculation on the objective function according to the updated parameter to be optimized until an iteration termination condition is met.
4. The method according to claim 3, wherein the updating 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 a local minimum comprises:
and under the condition that the iteration effect index meets the preset condition, updating the parameter to be optimized according to the second iteration increment, the preset local minimum punishment weight and the initial value of the local minimum value, and updating the iteration parameter according to the iteration effect index.
5. The method of calculating a coordinate conversion matrix according to claim 4, further comprising:
and under the condition that the iteration effect index does not meet the preset condition, keeping the value of the parameter to be optimized unchanged, and updating the iteration parameter.
6. The method of computing a coordinate transformation matrix of claim 1, wherein determining the iterative computation trapping local minimum based on the first iterative increment and the first computed value of the optimization objective comprises:
and under the condition that the first iteration increment and the first calculated value of the optimization target meet the preset condition, judging that the iteration calculation falls into a local minimum value.
7. An apparatus for calculating a coordinate transformation matrix, comprising:
the device comprises an acquisition unit, a calibration unit and a calibration unit, wherein the acquisition unit is used for acquiring first coordinate data of a characteristic point of a target object in a reference coordinate system and second coordinate data of the characteristic point in a coordinate system to be calibrated;
the establishing unit is used for establishing an objective function taking the minimum calibration error as an optimization target according to the first coordinate data and the second coordinate data; the target function comprises a coordinate conversion matrix between a reference coordinate system and a coordinate system to be calibrated; the coordinate transformation matrix comprises parameters to be optimized;
the iteration unit is used for performing iterative computation on the objective function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, a preset local minimum penalty weight and the initial value of the local minimum until an iteration termination condition is met, so as to obtain a first updated value of the parameter to be optimized, a first iteration increment when iteration is terminated and a first computed value of the optimization target;
the updating unit is used for updating the initial value of the local minimum value according to the first updating value of the parameter to be optimized when iteration is terminated under the condition that the iterative computation is judged to be trapped into the local minimum value according to the first iteration increment and the first calculated value of the optimization target, resetting the initial value of the parameter to be optimized, and returning to the step of performing iterative computation on the target function according to the initial value of the parameter to be optimized, the initial value of the iteration parameter, the preset penalty weight of the local minimum value and the initial value of the local minimum value until the iterative computation is judged not to be trapped into the local minimum value, so that a second updating value of the parameter to be optimized is obtained;
and the determining unit is used for determining the coordinate transformation matrix according to the second updated value of the parameter to be optimized.
8. The apparatus for calculating a coordinate conversion matrix according to claim 7, further comprising, before the establishing unit:
and the processing unit is used for carrying out normalization processing on the first coordinate data and the second coordinate data.
9. An electronic device, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of computing the coordinate transformation matrix of any of claims 1-6.
10. A computer-readable storage medium storing computer instructions for causing a computer to execute a method of calculating a coordinate conversion matrix according to any one of claims 1 to 6.
CN202111399325.8A 2021-11-19 2021-11-19 Method, device and equipment for calculating coordinate transformation matrix and readable storage medium Pending CN114186191A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111399325.8A CN114186191A (en) 2021-11-19 2021-11-19 Method, device and equipment for calculating coordinate transformation matrix and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111399325.8A CN114186191A (en) 2021-11-19 2021-11-19 Method, device and equipment for calculating coordinate transformation matrix and readable storage medium

Publications (1)

Publication Number Publication Date
CN114186191A true CN114186191A (en) 2022-03-15

Family

ID=80541352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111399325.8A Pending CN114186191A (en) 2021-11-19 2021-11-19 Method, device and equipment for calculating coordinate transformation matrix and readable storage medium

Country Status (1)

Country Link
CN (1) CN114186191A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114648611A (en) * 2022-04-12 2022-06-21 清华大学 Three-dimensional reconstruction method and device of local orbit function

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114648611A (en) * 2022-04-12 2022-06-21 清华大学 Three-dimensional reconstruction method and device of local orbit function
CN114648611B (en) * 2022-04-12 2023-07-18 清华大学 Three-dimensional reconstruction method and device for local orbit function

Similar Documents

Publication Publication Date Title
JP2020535562A (en) Devices and methods to control the system
EP3716160A1 (en) Learning parameters of a probabilistic model comprising gaussian processes
CN111060125B (en) Collision detection method and device, computer equipment and storage medium
CN112936301B (en) Robot hand-eye calibration method and device, readable storage medium and robot
CN111578928B (en) Positioning method and device based on multi-source fusion positioning system
CN111637877B (en) Robot positioning method and device, electronic equipment and nonvolatile storage medium
CN114186189A (en) Method, device and equipment for calculating coordinate transformation matrix and readable storage medium
CN114186191A (en) Method, device and equipment for calculating coordinate transformation matrix and readable storage medium
CN115457510A (en) Self-adaptive cooperative target tracking method based on variational Bayes
CN113569432B (en) Simulation detection method and system for liquid-air-tight element
CN114186190A (en) Method, device and equipment for calculating coordinate transformation matrix and readable storage medium
CN112380073B (en) Fault position detection method and device and readable storage medium
CN115876356A (en) Temperature sensor calibration method and device, electronic equipment and storage medium
CN112615604A (en) Filtering method and device of intelligent driving perception system and electronic equipment
CN112720450B (en) Robot joint angle inspection method, device, equipment and medium
CN116662733A (en) Variational filter maneuvering target tracking method based on Gaussian process regression
CN113702931B (en) External parameter calibration method and device for vehicle-mounted radar and storage medium
CN115979288A (en) Course angle determining method, electronic equipment and storage medium
CN111108738A (en) Data processing device, data analysis device, data processing system, and method for processing data
JP5152156B2 (en) Model parameter calculation accuracy judgment program and storage medium storing the program
CN112560974B (en) Information fusion and vehicle information acquisition method and device
US20230214660A1 (en) Hybrid training method for self-learining algorithms
CN110866638A (en) Traffic volume prediction model construction method and device, computer equipment and storage medium
CN110879530A (en) Method for the secure training of dynamic models
CN111007553B (en) Navigation method and device of measured object, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination