Target positioning model training and positioning method, related equipment and storage medium

By training the target positioning model through feature extraction and dimensionality reduction, the problem of misjudgment of visual algorithm positioning in industrial application scenarios is solved, efficient and accurate target positioning is achieved, and overall efficiency is improved.

CN120599205APending Publication Date: 2025-09-05LCFC HEFEI ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510457730.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

In industrial application scenarios, existing technologies often misjudge product positioning due to inconsistencies in materials, production environments, and light sources, resulting in low overall efficiency.

Method used

By acquiring sample images, performing feature extraction and dimensionality reduction processing, training the target positioning model, optimizing the classifier using cyclic shift sampling and ridge regression algorithms, and combining the Gaussian kernel function to achieve target positioning.

Benefits of technology

The calculation speed and robustness of target positioning are improved, efficient and accurate target positioning is achieved, and overall work efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120599205A_ABST
    Figure CN120599205A_ABST
Patent Text Reader

Abstract

The invention provides a training and positioning method of a target positioning model, related equipment and a storage medium, and the training method comprises the steps: obtaining a sample image which comprises a target positioning region; performing feature extraction on the target positioning area to obtain a feature matrix for the target positioning area; performing feature dimension reduction on the feature matrix for the target positioning area to obtain a first dimension reduction matrix; based on the first dimension reduction matrix, training a to-be-trained classifier to obtain a target positioning model; the target positioning model is used for performing target positioning on the to-be-positioned image. Compared with the prior art that a product is recognized and positioned through a visual algorithm, the target positioning model obtained through training is high in calculation speed and good in robustness, target positioning can be efficiently and accurately achieved, and then the overall working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training and positioning method for a target positioning model, related equipment, and storage medium. Background Art

[0002] Automated product positioning is a key step in automated industrial applications. However, due to the inability to guarantee consistency across all product materials, production environments, automation equipment, and lighting, product identification and positioning using visual algorithms can result in numerous misjudgments, leading to lower overall factory efficiency. Therefore, efficiently and accurately locating target products has become a pressing technical challenge. Summary of the Invention

[0003] The present application provides a training and positioning method for a target positioning model, related equipment and storage medium to at least solve the above technical problems existing in the prior art.

[0004] According to a first aspect of the present application, a method for training a target positioning model is provided, the method comprising:

[0005] Acquire a sample image, where the sample image includes a target positioning area;

[0006] Extracting features from the target positioning area to obtain a feature matrix for the target positioning area;

[0007] Performing feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix;

[0008] Based on the first dimensionality reduction matrix, the classifier to be trained is trained to obtain a target positioning model; the target positioning model is used to perform target positioning on the image to be positioned.

[0009] In one possible implementation manner, performing feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix includes:

[0010] Based on the target dimensionality reduction algorithm, the feature matrix is ​​subjected to eigendecomposition to obtain N eigenvalues ​​and N eigenvectors of the covariance matrix corresponding to the feature matrix; N is an integer greater than 1;

[0011] Obtaining a transformation matrix based on at least some of the N eigenvalues ​​and at least some of the eigenvectors;

[0012] Based on the transformation matrix and the characteristic matrix, a first dimension reduction matrix is ​​obtained.

[0013] In one possible implementation, the training of the classifier to be trained based on the first dimensionality reduction matrix to obtain the target positioning model includes:

[0014] Based on a cyclic shift sampling algorithm and a first dimensionality reduction matrix, sample expansion is performed on the target positioning area to obtain a sample data set;

[0015] Based on the sample data set, the classifier to be trained is trained to obtain a target positioning model.

[0016] In one possible implementation, the training of the classifier to be trained based on the sample data set to obtain a target positioning model includes:

[0017] Based on the sample data set, construct a classification function of the classifier to be trained;

[0018] Performing a transformation from the time domain to the frequency domain on the classification function to obtain a transformed classification function;

[0019] Based on the transformed classification function and the ridge regression algorithm, a training target expression of the classifier to be trained is obtained;

[0020] The classifier to be trained is trained based on the training target expression and the Gaussian kernel function. When the value of the training target expression of the classifier to be trained is the smallest, the classifier with the smallest value of the training target expression is used as the target positioning model.

[0021] In one embodiment, after obtaining the target positioning model, the method further includes:

[0022] Acquire the image to be positioned;

[0023] Taking the target positioning area as the reference position area in the image to be positioned, performing feature extraction on the reference position area to obtain a feature matrix for the reference position area;

[0024] Performing feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix;

[0025] Based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix, data expansion is performed on the reference location area to obtain a data set to be located;

[0026] Performing a time domain to frequency domain transformation on the dataset to be located to obtain a transformed dataset to be located;

[0027] Performing Gaussian kernel mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned;

[0028] Based on the reference matrix to be positioned and the target positioning model, the target position in the image to be positioned is obtained.

[0029] In one possible implementation manner, obtaining the target position in the image to be positioned based on the reference matrix to be positioned and the target positioning model includes:

[0030] Based on the reference matrix to be positioned and the target positioning model, the target positioning result of the image to be positioned in the frequency domain is obtained;

[0031] Performing a frequency domain to time domain transformation on the target positioning result to obtain a target positioning result of the image to be positioned in the time domain;

[0032] Based on the target positioning result of the image to be positioned in the time domain, the target position in the image to be positioned is determined.

[0033] In one possible implementation manner, determining the target position in the image to be located based on the target location result of the image to be located in the time domain includes:

[0034] Based on the interpolation algorithm, the feature dimension of the target positioning result of the image to be positioned in the time domain is restored to obtain a restored target positioning result;

[0035] Based on the restored target positioning result, the target position in the image to be positioned is determined.

[0036] According to a second aspect of the present application, a target positioning method is provided, the method comprising:

[0037] Acquire the image to be positioned;

[0038] Taking the target positioning area as the reference position area in the image to be positioned, performing feature extraction on the reference position area to obtain a feature matrix for the reference position area;

[0039] Performing feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix;

[0040] Based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix, data expansion is performed on the reference location area to obtain a data set to be located;

[0041] Performing a time domain to frequency domain transformation on the dataset to be located to obtain a transformed dataset to be located;

[0042] Performing Gaussian kernel mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned;

[0043] The target position in the image to be positioned is obtained based on the reference matrix to be positioned and the target positioning model, wherein the target positioning model is obtained by the aforementioned target positioning model training method.

[0044] According to a third aspect of the present application, a training device for a target positioning model is provided, the device comprising:

[0045] A first acquiring unit is configured to acquire a sample image, wherein the sample image includes a target positioning area;

[0046] A second acquisition unit is used to extract features from the target positioning area to obtain a feature matrix for the target positioning area;

[0047] A third acquisition unit is configured to perform feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix;

[0048] The fourth acquisition unit is used to train the classifier to be trained based on the first dimensionality reduction matrix to obtain a target positioning model; the target positioning model is used to perform target positioning on the image to be positioned.

[0049] According to a fourth aspect of the present application, a target positioning device is provided, comprising:

[0050] An image acquisition unit, configured to acquire an image to be positioned;

[0051] a feature extraction unit, configured to use the target positioning area as a reference position area in the image to be positioned, perform feature extraction on the reference position area, and obtain a feature matrix for the reference position area;

[0052] a feature dimensionality reduction unit, configured to perform feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix;

[0053] A data expansion unit, configured to perform data expansion on the reference location area based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix to obtain a data set to be located;

[0054] a transform unit, configured to transform the data set to be located from the time domain to the frequency domain to obtain a transformed data set to be located;

[0055] a mapping unit, configured to perform Gaussian kernel mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned;

[0056] The position acquisition unit is used to obtain the target position in the image to be positioned based on the reference matrix to be positioned and the target positioning model.

[0057] According to a fifth aspect of the present application, an electronic device is provided, including:

[0058] at least one processor; and

[0059] a memory communicatively connected to the at least one processor; wherein,

[0060] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described in this application.

[0061] According to a sixth aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method described in the present application.

[0062] In this application, a sample image is obtained, the sample image including a target positioning area; features are extracted from the target positioning area to obtain a feature matrix for the target positioning area; feature dimensionality reduction is performed on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix; based on the first dimensionality reduction matrix, a classifier to be trained is trained to obtain a target positioning model; the target positioning model is used to perform target positioning on the image to be positioned. Compared to related technologies that use visual algorithms to identify and locate products, the target positioning model obtained through training in this application has fast calculation speed and good robustness, and can efficiently and accurately achieve target positioning, thereby improving overall work efficiency.

[0063] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The above and other objects, features and advantages of the exemplary embodiments of the present application will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present application are shown in an illustrative and non-limiting manner, in which:

[0065] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts.

[0066] Figure 1 A schematic diagram of the implementation process of the training method of the target positioning model according to an embodiment of the present application is shown;

[0067] Figure 2 A flowchart of a method for training a target positioning model according to an embodiment of the present application is shown;

[0068] Figure 3 An example diagram of interpolation of a target position according to an embodiment of the present application is shown;

[0069] Figure 4 An intuitive example diagram of the target location of an embodiment of the present application is shown;

[0070] Figure 5The following is a schematic diagram showing the implementation process of the target positioning method according to an embodiment of the present application;

[0071] Figure 6 A schematic diagram showing the structure of a training device for a target positioning model according to an embodiment of the present application is shown;

[0072] Figure 7 A schematic diagram of the structure of a target positioning device according to an embodiment of the present application is shown;

[0073] Figure 8 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0074] In order to make the purpose, features, and advantages of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.

[0075] It is understandable that related technologies usually use edge detection, template matching and deep learning methods when locating targets. However, there are usually problems such as being affected by noise such as shadows and reflections, complex operations, excessive resource consumption, insufficient accuracy and low efficiency, resulting in poor target positioning effects.

[0076] The present application provides a method for training a target positioning model, which includes obtaining a sample image, wherein the sample image includes a target positioning area; performing feature extraction on the target positioning area to obtain a feature matrix for the target positioning area; performing feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix; training a classifier to be trained based on the first dimensionality reduction matrix to obtain a target positioning model; the target positioning model is used to perform target positioning on the image to be positioned. Compared to related technologies that use visual algorithms to identify and locate products, the target positioning model obtained through training in the present application has fast calculation speed and good robustness, and can efficiently and accurately achieve target positioning, thereby improving overall work efficiency and enhancing the effect of target positioning.

[0077] The present application embodiment provides a method for training a target positioning model, such as Figure 1 As shown, the method includes:

[0078] S101: Acquire a sample image, where the sample image includes a target positioning area.

[0079] In this step, the sample image is an image captured of a known target, and the sample image includes the known target. The target positioning area is the area where the known target is located. The target positioning area can be preset to be manually framed in the sample image. For example, assume that the known target is a screw hole, that is, the screw hole needs to be located so that the screw can be screwed in accurately. A sample image is captured of the screw hole, and the sample image includes both the screw hole and the background. The area where the screw hole is located in the captured sample image is divided as the target positioning area in the sample image.

[0080] S102: Extract features from the target positioning area to obtain a feature matrix for the target positioning area.

[0081] In this step, refer to Figure 2 , feature extraction is performed on the target positioning area in the sample image. The specific feature extraction methods include but are not limited to one or more superposition methods of grayscale features, color name features, deep learning features, and HOG (Histogram of Oriented Gradients) features.

[0082] S103: Performing feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix.

[0083] In this step, refer to Figure 2 To speed up data calculation, the feature matrix for the target positioning area obtained in step S102 is subjected to feature dimensionality reduction processing (equivalent to compression processing) to obtain a reduced feature matrix, i.e., a first reduced dimensionality matrix. The specific process of feature dimensionality reduction is described in the relevant information and is not repeated here.

[0084] S104: Based on the first dimensionality reduction matrix, the classifier to be trained is trained to obtain a target positioning model; the target positioning model is used to perform target positioning on the image to be positioned.

[0085] In this step, the classifier to be trained is essentially a filter. Training the classifier based on the first dimensionality reduction matrix is ​​essentially a process of abstracting image features into filter parameters. The resulting trained target localization model can be used to locate targets in the target image. The specific training process is described in detail below and is not repeated here.

[0086] In the scheme shown in steps S101 to S104, a sample image is obtained, the sample image including a target positioning area; features are extracted from the target positioning area to obtain a feature matrix for the target positioning area; feature dimensionality reduction is performed on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix; based on the first dimensionality reduction matrix, a classifier to be trained is trained to obtain a target positioning model; the target positioning model is used to perform target positioning in the image to be positioned. Compared to related technologies that use visual algorithms to identify and locate products, the target positioning model obtained through training in this application has fast calculation speed and good robustness, and can efficiently and accurately achieve target positioning, thereby improving overall work efficiency.

[0087] In an optional solution, performing feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix includes:

[0088] Based on the target dimensionality reduction algorithm, the feature matrix is ​​subjected to eigendecomposition to obtain N eigenvalues ​​and N eigenvectors of the covariance matrix corresponding to the feature matrix; N is an integer greater than 1;

[0089] Obtaining a transformation matrix based on at least some of the N eigenvalues ​​and at least some of the eigenvectors;

[0090] Based on the transformation matrix and the characteristic matrix, a first dimension reduction matrix is ​​obtained.

[0091] In this application, the target dimensionality reduction algorithm includes the PCA (Principal Component Analysis) algorithm and the SVD (Singular Value Decomposition) algorithm. Based on the target dimensionality reduction algorithm, the characteristic matrix can be decomposed to obtain multiple eigenvalues ​​and eigenvectors of the covariance matrix corresponding to the characteristic matrix (the eigenvalues ​​and eigenvectors correspond one to one). Arrange the multiple eigenvalues ​​from large to small, select the first M (custom setting) eigenvalues ​​and their corresponding eigenvectors to form a new matrix, that is, the transformation matrix. Alternatively, arrange the multiple eigenvalues ​​from small to large, select the last M (custom setting) eigenvalues ​​and their corresponding eigenvectors to form a new matrix, that is, the transformation matrix. The dimension of the transformation matrix is ​​smaller than the dimension of the characteristic matrix. Assume that the characteristic matrix is ​​expressed as M m*n (dimension is m*n), the transformation matrix is ​​represented as V n*k (dimension is n*k), the transposed matrix of the transformation matrix is ​​expressed as (where T represents transpose), the first dimension reduction matrix is ​​calculated by formula (1):

[0092]

[0093] Among them, M′ m*k It is represented as the first dimensionality reduction matrix with dimension m*k (m and k are both natural numbers).

[0094] Formula (1) can be used to map data into a new low-dimensional space, effectively reducing the dimensionality of the feature matrix, reducing the amount of data calculation, and effectively improving the calculation speed.

[0095] In an optional solution, the training of the classifier to be trained based on the first dimensionality reduction matrix to obtain the target positioning model includes:

[0096] Based on a cyclic shift sampling algorithm and a first dimensionality reduction matrix, sample expansion is performed on the target positioning area to obtain a sample data set;

[0097] Based on the sample data set, the classifier to be trained is trained to obtain a target positioning model.

[0098] In this application, reference Figure 2 , taking the first dimension reduction matrix as a sample, the cyclic shift algorithm and the first dimension reduction matrix are used to expand the sample of the target positioning area to obtain a sample data set. The principle of the cyclic shift algorithm is to shift the target positioning area up and down and left and right in the sample image to obtain images of multiple adjacent areas x1~x n , which is equivalent to obtaining the feature dimension reduction matrix of the adjacent area. Its mathematical form is expressed as the following constant matrix:

[0099]

[0100] Here, C(X) is the sample dataset. Its practical meaning is equivalent to stitching together multiple regional images. To address the significant and uneven edge variations caused by image stitching, a cosine window can be introduced to weight the central target region and mask the sample edges, thereby weakening the edges and highlighting the central region. Using this sample dataset to train the classifier to be trained ensures the accuracy of the final target location model.

[0101] In an optional solution, the training of the classifier to be trained based on the sample data set to obtain the target positioning model includes:

[0102] Based on the sample data set, construct a classification function of the classifier to be trained;

[0103] Performing a transformation from the time domain to the frequency domain on the classification function to obtain a transformed classification function;

[0104] Based on the transformed classification function and the ridge regression algorithm, a training target expression of the classifier to be trained is obtained;

[0105] The classifier to be trained is trained based on the training target expression and the Gaussian kernel function. When the value of the training target expression of the classifier to be trained is the smallest, the classifier with the smallest value of the training target expression is used as the target positioning model.

[0106] In this application, based on the sample data set, reference Figure 2 , the classification function of the classifier to be trained is

[0107] f(x)=ω T x Formula (3)

[0108] Where f(x) is the classification result of the classifier. x is each sample in the sample data set, ω is the classification parameter of the classifier, ω T is the transpose of the classification parameters of the classifier.

[0109] refer to Figure 2 , the classification function shown in formula (3) is transformed from the time domain to the frequency domain, specifically the fast Fourier transform, to obtain the transformed classification function. Let the desired classifier target f(x) be y, and perform the fast Fourier transform on it to obtain its frequency domain form Y. Perform the fast Fourier transform on the sample x to obtain its frequency domain form X. Since the classification parameter ω of the classifier is a constant, it is still a constant after the fast Fourier transform, so the classification parameter of the classifier after the fast Fourier transform is still recorded as ω. Based on the ridge regression algorithm, the training target expression of the classifier to be trained is constructed as follows:

[0110]

[0111] Where λ is the regularization coefficient and i is an integer greater than 0 and less than or equal to the number of samples.

[0112] Based on the mathematical properties of circulant matrices, formula (4) can be equivalent to formula (5) with the same time complexity:

[0113]

[0114] In formula (5), all symbols with ^ are the results of fast Fourier transform. ⊙ represents multiplication. * represents conjugate complex number.

[0115] The present embodiment introduces Gaussian kernel function formula (6) and formula (7):

[0116]

[0117] Where u is any sample in the sample data set, such as x in formula (5). v is the mean of all samples in the sample data set. i and x jare any two samples in the sample data set. is the Gaussian kernel parameter. is the first intermediate value of Gaussian kernelization, k(x i ,x j ) is the second intermediate value of Gaussian kernelization. Combining formulas (5) to (7), we can get the final expression of the classification parameter of the classifier:

[0118]

[0119] in, Equivalent to formula (5) represents the first row element in k obtained by formula (7). This is the classification parameter of the classifier when the value of the training target expression of the classifier to be trained is minimized, indicating that the target positioning model training is complete. Compared to the existing technology, the embodiment of the present application abandons the sliding window operation and abstracts the modeling and matching process as a regression problem instead, which has better robustness. For different types of targets, only the corresponding target positioning area needs to be reselected to automatically model, without the need for extensive adjustment of algorithm parameters, saving a lot of manpower and time.

[0120] In an optional solution, after obtaining the target positioning model, the method further includes:

[0121] Acquire the image to be positioned;

[0122] Taking the target positioning area as the reference position area in the image to be positioned, performing feature extraction on the reference position area to obtain a feature matrix for the reference position area;

[0123] Performing feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix;

[0124] Based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix, data expansion is performed on the reference location area to obtain a data set to be located;

[0125] Performing a time domain to frequency domain transformation on the dataset to be located to obtain a transformed dataset to be located;

[0126] Performing Gaussian kernel mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned;

[0127] Based on the reference matrix to be positioned and the target positioning model, the target position in the image to be positioned is obtained.

[0128] In this application, reference Figure 2After the target positioning model training is completed, when the target is positioned in the image to be positioned, since the position of the target in the image to be positioned is unknown, the target positioning area in the sample image is first used as the reference position area in the image to be positioned, and the reference position area is subjected to feature extraction to obtain a feature matrix for the reference position area. For example, assuming that the type of target to be positioned is a screw hole, the target positioning area where the screw hole is located in the screw hole sample image is used as the reference position area of ​​the screw hole in the image to be positioned (this area is not necessarily the final accurate area of ​​the target in the image to be positioned) to perform feature extraction to obtain a corresponding feature matrix (for the feature extraction method, please refer to the feature extraction method of the aforementioned target positioning area). Similar to the aforementioned processing method for the feature matrix of the target positioning area of ​​the sample image, the feature matrix of the reference position area is subjected to feature dimensionality reduction based on the PCA algorithm and the SVD algorithm, and data expansion is performed on the reference position area based on the obtained second dimensionality reduction matrix and the cyclic shift sampling algorithm to obtain a data set to be positioned. And the data set to be positioned is transformed from time domain to frequency domain (fast Fourier transform) to obtain the transformed data set to be positioned. (For the specific process, please refer to the aforementioned related instructions and will not be repeated here). The Gaussian kernelization mapping of the above formulas (6) and (7) is performed on the transformed data set to be positioned, and the reference matrix to be positioned is recorded as k xy Based on the reference matrix to be positioned and the target positioning model, the target position in the image to be positioned can be accurately and efficiently obtained. For the specific process, please refer to the detailed description of the relevant parts below and will not be repeated here.

[0129] In an optional solution, obtaining the target position in the image to be positioned based on the reference matrix to be positioned and the target positioning model includes:

[0130] Based on the reference matrix to be positioned and the target positioning model, the target positioning result of the image to be positioned in the frequency domain is obtained;

[0131] Performing a frequency domain to time domain transformation on the target positioning result to obtain a target positioning result of the image to be positioned in the time domain;

[0132] Based on the target positioning result of the image to be positioned in the time domain, the target position in the image to be positioned is determined.

[0133] In this application, based on the reference matrix to be positioned and the target positioning model, the target positioning result of the image to be positioned in the frequency domain is calculated by formula (9):

[0134]

[0135] in, Indicates the target positioning result of the image to be positioned in the frequency domain. Represents the reference matrix to be positioned. is the classification parameter of the classifier obtained in formula (8) (i.e., the target positioning model).

[0136] The target localization results are transformed from the frequency domain to the time domain (specifically, an inverse Fourier transform) to obtain the target localization results for the image to be located in the time domain. Based on the target localization results in the time domain of the image to be located, the target position in the image to be located can be determined intuitively and accurately. The specific process of target localization is described in detail below and is not repeated here.

[0137] In an optional solution, determining the target position in the image to be located based on the target location result of the image to be located in the time domain includes:

[0138] Based on the interpolation algorithm, the feature dimension of the target positioning result of the image to be positioned in the time domain is restored to obtain a restored target positioning result;

[0139] Based on the restored target positioning result, the target position in the image to be positioned is determined.

[0140] In this application, since the dimensionality reduction and compression operation is performed in the process of obtaining the target positioning result, after obtaining the target positioning result in the time domain, it is necessary to restore the feature dimension of the target positioning result in the time domain of the image to be positioned by an interpolation algorithm to obtain the restored target positioning result. The restored target positioning result is as follows: Figure 3 As shown, Figure 3 The position corresponding to the point with the highest peak value is the target position in the image to be located. Taking the target as a screw hole as an example, according to Figure 3 The target position in the image can be accurately determined, referring to Figure 4 As shown, Figure 4 The target positioning model in the embodiment of the present application is used to locate the image. Figure 4 Target positioning is performed, and the obtained Figure 4 The content in the box is the target in the image to be located, which facilitates the accurate screwing of the subsequent screws and improves the overall factory work quality.

[0141] The present application embodiment provides a target positioning method, such as Figure 5 As shown, the method includes:

[0142] S501: Acquire the image to be positioned;

[0143] In this step, the image to be positioned is an image that requires target positioning.

[0144] S502: Taking the target positioning area as the reference position area in the image to be positioned, extracting features from the reference position area to obtain a feature matrix for the reference position area;

[0145] In this step, since the position of the target in the image to be located is unknown, the target location area in the sample image is first used as the reference location area in the image to be located, and features are extracted from the reference location area to obtain a feature matrix for the reference location area. For example, assuming that the type of target to be located is a screw hole, the target location area where the screw hole is located in the screw hole sample image is used as the reference location area of ​​the screw hole in the image to be located (this area is not necessarily the final accurate area of ​​the target in the image to be located) to perform feature extraction to obtain the corresponding feature matrix (for the feature extraction method, refer to the feature extraction method of the target location area described above).

[0146] S503: performing feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix;

[0147] In this step, similar to the aforementioned processing method for the feature matrix of the target positioning area of ​​the sample image, feature dimension reduction is performed on the feature matrix of the reference position area based on the PCA algorithm and the SVD algorithm.

[0148] S504: Based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix, data expansion is performed on the reference location area to obtain a data set to be positioned;

[0149] In this step, data expansion is performed on the reference location area based on the obtained second dimensionality reduction matrix and the cyclic shift sampling algorithm to obtain a dataset to be located. The specific process is described in detail in the following relevant parts and will not be repeated here.

[0150] S505: performing a transformation from the time domain to the frequency domain on the dataset to be located to obtain a transformed dataset to be located;

[0151] In this step, the dataset to be located is transformed from the time domain to the frequency domain (Fast Fourier Transform) to obtain the transformed dataset to be located. (For the specific process, please refer to the above description and will not be repeated here.)

[0152] S506: Performing Gaussian kernelization mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned;

[0153] In this step, the transformed data set to be positioned is subjected to Gaussian kernelization mapping of the aforementioned formulas (6) and (7) to obtain a reference matrix to be positioned, which is recorded as k^xy.

[0154] S507: Based on the reference matrix to be positioned and the target positioning model, obtain the target position in the image to be positioned; wherein the target positioning model is obtained by the aforementioned target positioning model training method.

[0155] In this step, based on the reference matrix to be positioned and the target positioning model, the target position in the image to be positioned can be accurately and efficiently obtained. The specific process is described in detail in the following relevant parts and will not be repeated here.

[0156] The solution shown in steps S501 to S507 can be considered an application solution for the target positioning model. The target positioning model obtained through the solution shown in the aforementioned steps S101 to S104 can locate the target in the image to be positioned. Compared to related technologies that use visual algorithms to identify and locate products, the target positioning model obtained through training in this application has fast calculation speed and good robustness, and can efficiently and accurately locate the target, thereby improving overall work efficiency.

[0157] In an optional solution, obtaining the target position in the image to be positioned based on the reference matrix to be positioned and the target positioning model includes:

[0158] Based on the reference matrix to be positioned and the target positioning model, the target positioning result of the image to be positioned in the frequency domain is obtained;

[0159] Performing a frequency domain to time domain transformation on the target positioning result to obtain a target positioning result of the image to be positioned in the time domain;

[0160] Based on the target positioning result of the image to be positioned in the time domain, the target position in the image to be positioned is determined.

[0161] In this application, based on the reference matrix to be located and the target positioning model, the target positioning result of the image to be located in the frequency domain is calculated by the aforementioned formula (9), and the target positioning result is transformed from the frequency domain to the time domain (specifically, an inverse Fourier transform) to obtain the target positioning result of the image to be located in the time domain. Based on the target positioning result of the image to be located in the time domain, the target position in the image to be located can be determined intuitively and accurately. The specific process of the target position is described in detail in the aforementioned relevant parts and will not be repeated here.

[0162] In an optional solution, determining the target position in the image to be located based on the target location result of the image to be located in the time domain includes:

[0163] Based on the interpolation algorithm, the feature dimension of the target positioning result of the image to be positioned in the time domain is restored to obtain a restored target positioning result;

[0164] Based on the restored target positioning result, the target position in the image to be positioned is determined.

[0165] In this application, since the dimensionality reduction and compression operation is performed in the process of obtaining the target positioning result, after obtaining the target positioning result in the time domain, it is necessary to restore the feature dimension of the target positioning result in the time domain of the image to be positioned by an interpolation algorithm to obtain the restored target positioning result. The restored target positioning result is as follows: Figure 3 As shown, Figure 3 The position corresponding to the point with the highest peak value is the target position in the image to be located. Taking the target as a screw hole as an example, according to Figure 3 The target position in the image can be accurately determined, referring to Figure 4 As shown, Figure 4 The target positioning model in the embodiment of the present application is used to locate the image. Figure 4 Target positioning is performed, and the obtained Figure 4 The content in the box is the target in the image to be located, which facilitates the accurate screwing of the subsequent screws and improves the overall factory work quality.

[0166] The present application also provides a training device for a target positioning model. Figure 6 As shown, the device includes:

[0167] A first acquiring unit 601 is configured to acquire a sample image, where the sample image includes a target positioning area;

[0168] A second acquisition unit 602 is configured to extract features from the target positioning area to obtain a feature matrix for the target positioning area;

[0169] A third acquisition unit 603 is configured to perform feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix;

[0170] The fourth acquisition unit 604 is used to train the classifier to be trained based on the first dimensionality reduction matrix to obtain a target positioning model; the target positioning model is used to perform target positioning on the image to be positioned.

[0171] In an optional scheme, the third acquisition unit 603 is used to perform eigendecomposition on the feature matrix based on a target dimensionality reduction algorithm to obtain N eigenvalues ​​and N eigenvectors of the covariance matrix corresponding to the feature matrix; N is an integer greater than 1; based on at least part of the eigenvalues ​​and at least part of the eigenvectors in the N eigenvalues ​​and N eigenvectors, a transformation matrix is ​​obtained; based on the transformation matrix and the feature matrix, a first dimensionality reduction matrix is ​​obtained.

[0172] In an optional solution, the fourth acquisition unit 604 is used to perform sample expansion on the target positioning area based on a cyclic shift sampling algorithm and a first dimensionality reduction matrix to obtain a sample data set; and based on the sample data set, train the classifier to be trained to obtain a target positioning model.

[0173] In an optional scheme, the fourth acquisition unit 604 is used to construct a classification function of the classifier to be trained based on a sample data set; transform the classification function from the time domain to the frequency domain to obtain a transformed classification function; obtain a training target expression of the classifier to be trained based on the transformed classification function and the ridge regression algorithm; train the classifier to be trained based on the training target expression and the Gaussian kernel function, and when the value of the training target expression of the classifier to be trained is the smallest, the classifier with the smallest value of the training target expression is used as the target positioning model.

[0174] In an optional solution, it also includes:

[0175] A positioning unit is used to obtain an image to be positioned; using a target positioning area as a reference position area in the image to be positioned, performing feature extraction on the reference position area to obtain a feature matrix for the reference position area; performing feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix; based on a cyclic shift sampling algorithm and the second dimensionality reduction matrix, performing data expansion on the reference position area to obtain a data set to be positioned; performing a time domain to frequency domain transformation on the data set to be positioned to obtain a transformed data set to be positioned; performing Gaussian kernelization mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned; and obtaining a target position in the image to be positioned based on the reference matrix to be positioned and a target positioning model.

[0176] In an optional scheme, the positioning unit is used to obtain a target positioning result of the image to be positioned in the frequency domain based on the reference matrix to be positioned and the target positioning model; perform a frequency domain to time domain transformation on the target positioning result to obtain a target positioning result of the image to be positioned in the time domain; and determine the target position in the image to be positioned based on the target positioning result of the image to be positioned in the time domain.

[0177] In an optional solution, the positioning unit is used to restore the feature dimensions of the target positioning result of the image to be positioned in the time domain based on an interpolation algorithm to obtain a restored target positioning result; and determine the target position in the image to be positioned based on the restored target positioning result.

[0178] The present application also provides a target positioning device, such as Figure 7 As shown, the device includes:

[0179] An image acquisition unit 701 is used to acquire an image to be positioned;

[0180] A feature extraction unit 702 is configured to use the target positioning area as a reference position area in the image to be positioned, perform feature extraction on the reference position area, and obtain a feature matrix for the reference position area;

[0181] A feature dimension reduction unit 703 is configured to perform feature dimension reduction on the feature matrix for the reference position area to obtain a second dimension reduction matrix;

[0182] A data expansion unit 704 is configured to perform data expansion on the reference location area based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix to obtain a data set to be located;

[0183] The transformation unit 705 is configured to transform the data set to be located from the time domain to the frequency domain to obtain a transformed data set to be located;

[0184] A mapping unit 706 is configured to perform Gaussian kernelization mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned;

[0185] The position acquisition unit 707 is configured to obtain the target position in the image to be positioned based on the reference matrix to be positioned and the target positioning model.

[0186] In an optional solution, the position acquisition unit 707 is used to obtain a target positioning result of the image to be positioned in the frequency domain based on the reference matrix to be positioned and the target positioning model; perform a frequency domain to time domain transformation on the target positioning result to obtain a target positioning result of the image to be positioned in the time domain; and determine the target position in the image to be positioned based on the target positioning result of the image to be positioned in the time domain.

[0187] In an optional solution, the position acquisition unit 707 is used to restore the feature dimension of the target positioning result of the image to be positioned in the time domain based on an interpolation algorithm to obtain a restored target positioning result; and determine the target position in the image to be positioned based on the restored target positioning result.

[0188] It should be noted that the training device of the target positioning model and the target positioning device in the embodiment of the present application, since the principles of solving the problems by the training device of the target positioning model and the target positioning device are similar to the training method and the target positioning method of the aforementioned target positioning model, the implementation process, implementation principles, and beneficial effects of the training device of the target positioning model and the target positioning device can all be referred to the description of the implementation process, implementation principles, and beneficial effects of the aforementioned method, and the repetitive parts will not be repeated.

[0189] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0190] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0191] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0192] Multiple components in the electronic device 800 are connected to the I / O interface 805, including an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0193] The computing unit 801 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the training and positioning of the target positioning model and the positioning method. For example, in some embodiments, the training and positioning of the target positioning model and the positioning method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the training and positioning method of the target positioning model described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the training of the target positioning model and the positioning method in any other appropriate manner (eg, by means of firmware).

[0194] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0195] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow charts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0196] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0197] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0198] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0199] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0200] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this application can be achieved. This is not a limitation herein.

[0201] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the description of this application, "plurality" means two or more, unless otherwise specifically defined.

[0202] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for training a target positioning model, characterized in that: The method comprises: Acquire a sample image, where the sample image includes a target positioning area; Extracting features from the target positioning area to obtain a feature matrix for the target positioning area; Performing feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix; Based on the first dimensionality reduction matrix, the classifier to be trained is trained to obtain a target positioning model; the target positioning model is used to perform target positioning on the image to be positioned.

2. The method according to claim 1, characterized in that The performing feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix includes: Based on the target dimensionality reduction algorithm, the feature matrix is ​​subjected to eigendecomposition to obtain N eigenvalues ​​and N eigenvectors of the covariance matrix corresponding to the feature matrix; N is an integer greater than 1; Obtaining a transformation matrix based on at least some of the N eigenvalues ​​and at least some of the eigenvectors; Based on the transformation matrix and the characteristic matrix, a first dimension reduction matrix is ​​obtained.

3. The method according to claim 1 or 2, characterized in that The step of training the classifier to be trained based on the first dimensionality reduction matrix to obtain a target positioning model includes: Based on a cyclic shift sampling algorithm and a first dimensionality reduction matrix, sample expansion is performed on the target positioning area to obtain a sample data set; Based on the sample data set, the classifier to be trained is trained to obtain a target positioning model.

4. The method according to claim 3, characterized in that The step of training the classifier to be trained based on the sample data set to obtain a target positioning model includes: Based on the sample data set, construct a classification function of the classifier to be trained; Performing a transformation from the time domain to the frequency domain on the classification function to obtain a transformed classification function; Based on the transformed classification function and the ridge regression algorithm, a training target expression of the classifier to be trained is obtained; The classifier to be trained is trained based on the training target expression and the Gaussian kernel function. When the value of the training target expression of the classifier to be trained is the smallest, the classifier with the smallest value of the training target expression is used as the target positioning model.

5. The method according to claim 1, wherein After obtaining the target positioning model, the method further includes: Acquire the image to be positioned; Taking the target positioning area as the reference position area in the image to be positioned, performing feature extraction on the reference position area to obtain a feature matrix for the reference position area; Performing feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix; Based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix, data expansion is performed on the reference location area to obtain a data set to be located; Performing a time domain to frequency domain transformation on the dataset to be located to obtain a transformed dataset to be located; Performing Gaussian kernel mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned; Based on the reference matrix to be positioned and the target positioning model, the target position in the image to be positioned is obtained.

6. The method according to claim 5, characterized in that The step of obtaining the target position in the image to be positioned based on the reference matrix to be positioned and the target positioning model includes: Based on the reference matrix to be positioned and the target positioning model, the target positioning result of the image to be positioned in the frequency domain is obtained; Performing a frequency domain to time domain transformation on the target positioning result to obtain a target positioning result of the image to be positioned in the time domain; Based on the target positioning result of the image to be positioned in the time domain, the target position in the image to be positioned is determined.

7. The method according to claim 6, characterized in that The determining the target position in the image to be located based on the target location result of the image to be located in the time domain includes: Based on the interpolation algorithm, the feature dimension of the target positioning result of the image to be positioned in the time domain is restored to obtain a restored target positioning result; Based on the restored target positioning result, the target position in the image to be positioned is determined.

8. A target positioning method, characterized in that: The method comprises: Acquire the image to be positioned; Taking the target positioning area as the reference position area in the image to be positioned, performing feature extraction on the reference position area to obtain a feature matrix for the reference position area; Performing feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix; Based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix, data expansion is performed on the reference location area to obtain a data set to be located; Performing a time domain to frequency domain transformation on the dataset to be located to obtain a transformed dataset to be located; Performing Gaussian kernel mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned; Based on the reference matrix to be positioned and the target positioning model, the target position in the image to be positioned is obtained; wherein the target positioning model is obtained by the training method of the target positioning model described in any one of claims 1-7.

9. A training device for a target positioning model, characterized in that: The device comprises: A first acquiring unit is configured to acquire a sample image, wherein the sample image includes a target positioning area; A second acquisition unit is used to extract features from the target positioning area to obtain a feature matrix for the target positioning area; A third acquisition unit is configured to perform feature dimensionality reduction on the feature matrix for the target positioning area to obtain a first dimensionality reduction matrix; The fourth acquisition unit is used to train the classifier to be trained based on the first dimensionality reduction matrix to obtain a target positioning model; the target positioning model is used to perform target positioning on the image to be positioned.

10. A target positioning device, characterized in that: The device comprises: An image acquisition unit, configured to acquire an image to be positioned; a feature extraction unit, configured to use the target positioning area as a reference position area in the image to be positioned, perform feature extraction on the reference position area, and obtain a feature matrix for the reference position area; a feature dimensionality reduction unit, configured to perform feature dimensionality reduction on the feature matrix for the reference position area to obtain a second dimensionality reduction matrix; A data expansion unit, configured to perform data expansion on the reference location area based on a cyclic shift sampling algorithm and a second dimensionality reduction matrix to obtain a data set to be located; a transform unit, configured to transform the data set to be located from the time domain to the frequency domain to obtain a transformed data set to be located; a mapping unit, configured to perform Gaussian kernel mapping on the transformed data set to be positioned to obtain a reference matrix to be positioned; The position acquisition unit is used to obtain the target position in the image to be positioned based on the reference matrix to be positioned and the target positioning model.

11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7 and / or 8.

12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-7 and or 8.