Data processing method and related device
By processing the image feature matrix and error calculation in parallel, the target matrix is selected to determine the target features, which solves the problem of time-consuming and excessive hardware resource consumption of the traditional RANSAC algorithm, and achieves efficient image matching and video processing.
Patent Information
- Application Number
- CN202310479249.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- Publication Date
- 2024-10-29
AI Technical Summary
In the field of computer vision, the traditional RANSAC algorithm takes a long time due to the large number of iterations and cannot be applied in real time. The hardware implementation consumes too many FPGA on-chip resources and has low processing efficiency, making it difficult to meet the needs of real-time image matching and video processing.
By obtaining image feature pairs, calculating parallel processing matrices and errors, selecting a target matrix to determine target features, and combining the digital signal processing module and error processing module to achieve parallel matrix calculation and error processing, improving data processing efficiency and accuracy.
While ensuring data processing accuracy, it greatly improves data processing efficiency, reduces hardware resource consumption, and is suitable for real-time computer vision applications.
Smart Images

Figure CN118864896A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to a data processing method and related devices. Background Art
[0002] In the field of computer vision, the application of Random Sample Consensus (RANSAC) algorithm is very common. For example, due to the limitation of the lens, it often takes multiple photos to capture a huge landscape. When synthesizing multiple photos, some key features will be extracted from the pictures to be synthesized. Objects from different perspectives can often be obtained through the transformation of a perspective matrix, that is, the features with matching relationships in different pictures can be regarded as the same object from different perspectives. RANSAC is used to determine the exact features with matching relationships, so that the same object in different photos can be identified.
[0003] At present, the traditional RANSAC algorithm is mainly implemented through pure software, and then the optimal mode is obtained through iteration. However, a large number of iterations will consume a lot of time and cannot be applied in real time, while a small number of iterations cannot guarantee accuracy. If hardware is used for implementation, the current hardware implementation will consume too many Field Programmable Gate Array (FGPA) on-chip resources and the processing efficiency is not high. Summary of the invention
[0004] In view of this, the present application provides a data processing method and related devices, which can greatly improve data processing efficiency while ensuring data processing accuracy.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:
[0006] Acquire feature pairs of the first image and the second image, each set of feature pairs including a first feature of the first image and a second feature of the second image;
[0007] Determine a first matrix and a second matrix corresponding to each set of feature pairs;
[0008] determining a first error for each first matrix and a second error for each second matrix;
[0009] Determine a first candidate matrix according to the first error of each of the first matrices, and determine a second candidate matrix according to the second error of each of the second matrices;
[0010] According to a preset strategy, one of the first candidate matrix and the second candidate matrix is selected as a target matrix to determine a target feature, wherein the target matrix includes the target feature, and the target feature is used to indicate a first feature and a second feature that have a matching relationship.
[0011] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:
[0012] An acquisition unit, configured to acquire feature pairs of the first image and the second image, each set of feature pairs including a first feature of the first image and a second feature of the second image;
[0013] A first matrix unit, used to determine a first matrix and a second matrix corresponding to each set of feature pairs;
[0014] an error determination unit, configured to determine a first error of each first matrix and a second error of each second matrix;
[0015] A second matrix unit, configured to determine a first candidate matrix according to a first error of each of the first matrixes, and to determine a second candidate matrix according to a second error of each of the second matrixes;
[0016] A feature determination unit is used to select one of the first candidate matrix and the second candidate matrix as a target matrix according to a preset strategy to determine a target feature, wherein the target matrix includes the target feature, and the target feature is used to indicate the first feature and the second feature that have a matching relationship.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method in the first aspect of the embodiment of the present application.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.
[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiment of the present application. The computer program product may be a software installation package.
[0020] It can be seen that through the above data processing method and related devices, first, the feature pairs of the first image and the second image are obtained, and each set of feature pairs includes the first feature of the first image and the second feature of the second image; then, the first matrix and the second matrix corresponding to each set of feature pairs are determined; then, the first error of each first matrix and the second error of each second matrix are determined; then, the first candidate matrix is determined according to the first error of each first matrix, and the second candidate matrix is determined according to the second error of each second matrix; finally, one of the first candidate matrix and the second candidate matrix is selected as the target matrix according to the preset strategy to determine the target feature, and the target matrix includes the target feature, and the target feature is used to indicate the first feature and the second feature that have a matching relationship. Two matrices and corresponding errors can be calculated at the same time, and finally a suitable one is selected as the target matrix, which greatly improves the data processing efficiency while ensuring the data processing accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0022] Figure 1 A system architecture diagram of a data processing method provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of a sampling process workflow provided in an embodiment of the present application;
[0024] Figure 3 A flowchart of a data processing method provided in an embodiment of the present application;
[0025] Figure 4 A flowchart of another data processing method provided in an embodiment of the present application;
[0026] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0027] Figure 6 A block diagram of the functional units of a data processing device provided in an embodiment of the present application;
[0028] Figure 7 A block diagram of the functional units of another data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0031] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article indicates that the associated objects before and after are in an "or" relationship. The "plurality" appearing in the embodiments of the present application refers to two or more.
[0032] In the embodiments of the present application, "at least one item" or similar expressions refer to any combination of these items, including any combination of single items or plural items, and refer to one or more, and multiple refers to two or more. For example, at least one item of a, b, or c can represent the following seven situations: a, b, c, a and b, a and c, b and c, a, b, and c. Among them, each of a, b, and c can be an element or a set containing one or more elements.
[0033] The "connection" that appears in the embodiments of the present application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not impose any limitations on this.
[0034] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0035] The following is an explanation of the relevant contents, concepts, meanings, technical issues, technical solutions, beneficial effects, etc. involved in the embodiments of the present application.
[0036] 1. Related terms
[0037] 1. RANSAC algorithm: Its basic assumption is that the sample contains correct data (inliers, data that can be described by the model) and abnormal data (outliers, data that deviates far from the normal range and cannot fit the mathematical model), that is, the data set contains noise. These abnormal data may be caused by wrong measurements, wrong assumptions, wrong calculations, etc. At the same time, RANSAC also assumes that, given a set of correct data, there is a method to calculate the model parameters that conform to these data.
[0038] 2. Application scenarios and electronic devices
[0039] 1. Application scenarios
[0040] The embodiments of the present application can be applied to the following application scenarios, including but not limited to: a processing system deployed on an electronic device, for computer vision applications (such as image matching, synthesis, and video processing, etc.). The embodiments of the present application can be adjusted and improved according to the specific application environment, and are not specifically limited here.
[0041] 2. Electronic equipment
[0042] The electronic device in the embodiment of the present application may be a portable electronic device that also includes other functions such as a personal digital assistant and / or a music player function, such as a mobile phone, a tablet computer, a wearable electronic device with a wireless communication function (such as a smart watch), etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with an IOS system, an Android system, a Microsoft system, or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer (Laptop), etc. It should also be understood that in some other embodiments, the above-mentioned electronic device may not be a portable electronic device, but a desktop computer, a server, etc.
[0043] 3. Example
[0044] See also Figure 1 , Figure 1 This is a system architecture diagram of a data processing method provided in an embodiment of the present application. Figure 1As shown, the system architecture 100 includes a digital signal processing module 110 and an error processing module 120, wherein the digital signal processing module 110 may be a digital signal processing (DSP) chip, and the error processing module 120 may be an application specific integrated circuit (ASIC) chip.
[0045] Among them, the system architecture 100 can obtain the features of image A and the features of image B, and determine the rough matching feature pairs. Since the rough matching feature pairs are not accurate at this time and there are a large number of noise features, the idea of RANSAC is adopted to randomly select rough matching feature pairs using the digital signal processing module 110, and perform projection matrix conversion processing on each group of rough matching feature pairs. Then, the error processing module 120 is used to solve and compare the errors of the matrices corresponding to each group of rough matching feature pairs to determine the optimal candidate matrix. Finally, the digital signal processing module 110 is used to determine the target matrix according to the preset strategy to obtain the target features. It can be understood that all features contained in the rough matching feature pairs are filtered out, and the features obtained after filtering out all noise features are the target features.
[0046] It should be noted that the system architecture 100 can be deployed on electronic devices and can be applied in real time in computer vision processing tasks without consuming too many hardware resources. The digital signal processing module 110 has a data parallel processing function, thereby realizing parallel processing of random sampling and matrix calculation, and the error processing module 120 can perform hardware acceleration, which greatly improves data processing efficiency while ensuring data processing accuracy.
[0047] 3. A Data Processing Method
[0048] The existing traditional RANSAC algorithm is mainly implemented by pure software, and then the optimal mode is obtained through iteration. However, this implementation method has several problems: First, the running time is long. Generally, the running time of 500 iterations is about 200-300ms, which is basically unable to achieve real-time application. Especially in the mobile phone camera mode, the frame rate is generally required to be above 30fps. If it is implemented by traditional software, it can only reduce the number of RANSAC iterations, or do it once every few frames, which will greatly reduce the accuracy of matching point pairs and cannot meet application requirements.
[0049] The large number of iterative operations included in the RANSAC algorithm poses a great challenge to hardware implementation. Especially in the application field of image feature point matching and screening, there are very few existing RANSAC hardware acceleration solutions. At the same time, a common problem in these research results is that they consume too much FPGA on-chip resources.
[0050] To solve the above problems, the embodiments of the present application provide a data processing method and related devices, which can determine the first matrix and the second matrix of each set of feature pairs from the first image and the second image. At the same time, error processing is performed on each first matrix and the second matrix, and finally the target matrix is determined to determine the target features, which can greatly improve the accuracy and efficiency of data processing.
[0051] The technical solutions, beneficial effects, concepts, etc. involved in the embodiments of the present application are described in detail below.
[0052] 1. Source of feature pairs
[0053] In order to explain the present solution more clearly, it is necessary to first explain the data processed by the data processing method. The feature pairs in the embodiments of the present application are derived from preset feature pair data, and the preset feature pair data may include feature coordinates from different images, roughly matched feature pairs, matching scores of each roughly matched feature pair, and identification of each roughly matched feature pair. It can be understood that in the field of computer vision, processing steps such as feature extraction and feature matching are already relatively mature, so the present application can use a feature module to process at least two images to determine the above-mentioned preset feature pair data.
[0054] Among them, the features in the embodiments of the present application may be point features and / or line features, and the feature pairs may include feature point pairs and / or feature line pairs, which are not specifically limited here.
[0055] Among them, taking image matching as an example, the first image and the second image can be images of the same scene at different perspectives. When determining the position of the same object in the scene in the first image and the second image, feature matching is required. The electronic device can calculate the feature points of the first image and the second image through the feature module, and obtain coarse matching feature point pairs, the matching score of each coarse matching feature pair, and the identification of each coarse matching feature pair. At this time, there are a large number of noise feature points in the determined coarse matching feature point pairs, and each noise feature point can be regarded as an "outlier" in the RANSAC algorithm, so it is necessary to use the RANSAC algorithm to further screen and determine the "inliers", that is, to screen out the target features.
[0056] Specifically, the feature module can be used to calculate the first feature point of the first image, the second feature point of the second image, the roughly matched feature point pairs, the matching score of each feature point pair, the identifier corresponding to each feature point pair, etc., and the above data can be uniformly saved as preset feature pair data in a storage module. The storage module can be a double data rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random Access Memory, DDR SDRAM), etc., which is not specifically limited here.
[0057] 2. Sampling and processing
[0058] After clarifying the data processed by the data processing method in the embodiment of the present application, in order to improve the efficiency and accuracy of data processing, the embodiment of the present application first performs sampling processing on the feature pairs. The sampling processing includes extracting feature pairs from preset feature pair data in the storage module and subsequent matrix calculation processing steps, as shown below.
[0059] First, the digital signal processing module can read the preset feature pair data stored in the storage module, and store each feature according to the rough matching relationship based on the identification of each rough matching feature pair, and perform normalization processing. Then, by utilizing the parallel processing capability of the digital signal processing module, the feature pairs are randomly sampled and the matrix calculations for each feature pair are performed in parallel, thereby greatly improving the data processing speed.
[0060] Among them, the digital signal processing module can randomly sample the stored preset feature pair data a preset number of times, and obtain a group of feature pairs each time sampling. Each group of feature pairs can actually include multiple coarsely matched feature point pairs and / or feature line pairs, and the number of coarsely matched feature point pairs and / or coarsely matched feature line pairs in each group of feature pairs can be determined according to the matrix calculation algorithm. For example, if the eight-point method is used, each group of feature pairs can include four coarsely matched feature point pairs and / or coarsely matched feature line pairs, which is not specifically limited here.
[0061] Among them, the digital signal processing module can synchronously perform matrix calculations on each group of feature pairs, and solve the first matrix and the second matrix corresponding to each group of feature pairs, wherein the first matrix can be a homography matrix (Homography matrix), and the second matrix can be a fundamental matrix (Fundamental matrix). It can be understood that the homography matrix can reflect the transformation from a point in a plane image to a corresponding point in another plane image, and the fundamental matrix can represent the relationship between a point in space and the corresponding points in the image coordinate system under different viewing angles. The solution method for the homography matrix and the fundamental matrix can adopt methods such as the eight-point method, which are not specifically limited here.
[0062] For example, taking the eight-point method as an example, when solving the homography matrix, you can randomly sample the matching point pairs of the feature points of image A and image B, and extract a total of four pairs of matching feature points. Because there are eight unknown quantities when solving the homography matrix H, the matrix equation group composed of the number of elements of the four pairs of feature points can just solve the unknown quantities of the homography matrix H. Then use the coordinate elements of the four feature points in image A to form matrix a, and the coordinate elements of the four matching points in image B to form matrix b. Use matrix a and matrix b to list the matrix equation:
[0063] b=H*a
[0064] The equation can be expanded as:
[0065]
[0066] Expand the matrix into a system of equations and solve the system of equations to obtain the homography matrix H:
[0067]
[0068] Similarly, taking the eight-point method as an example, when solving the basic matrix, the outer polar constraint can be written in the form of a linear system:
[0069]
[0070] The above solution method can refer to the existing matrix calculation method. If there are line features, line matching constraints are added to perform matrix calculation, which will not be described in detail here.
[0071] Specifically, the digital signal processing module can use a parallel processing mechanism to perform random sampling and matrix calculation on the preset feature data. During the calculation process, the data in the storage module can be moved to the two tightly coupled memories (TCM) inside the digital signal processing module in a ping-pong mode through the direct memory access (DMA) module inside the digital signal processing module. Specifically, after being moved to the first TCM, 32 channels of block information processing are immediately performed, and at the same time, DMA moves the next block of data to another TCM, so that data processing and data transfer can be carried out simultaneously, reducing the processing time. After the calculation is completed, the obtained homography matrix and basic matrix can be moved to DDR through DMA. It is convenient for subsequent error processing modules to call.
[0072] For ease of understanding, the following Figure 2 The sampling process in the embodiment of the present application is described. Figure 2A flow chart of a sampling process provided for an embodiment of the present application shows that the preset feature pair data stored in the DDR module are arranged in sequence according to the identifiers, and random sampling can be performed from the preset feature pair data. If there are obvious external points in the sampling points, the random sampling is invalidated and random sampling is performed again. If there are no obvious external points in the sampling points, matrix calculation is performed to obtain the homography matrix and basic matrix corresponding to each set of feature point pairs.
[0073] It can be seen that parallel processing through the digital signal processing module can greatly improve the speed of matrix calculation. At the same time, two types of matrices can be solved, which is convenient for the subsequent determination of a better target matrix that meets the current scenario and can improve the accuracy of data processing.
[0074] 3. Error handling
[0075] After determining the first matrix and the second matrix corresponding to each set of feature pairs, in order to select the optimal matrix, the embodiment of the present application introduces error processing, calculates the first error of each first matrix and the second error of each second matrix, and determines the first candidate matrix according to the first error of each first matrix, and determines the second candidate matrix according to the second error of each second matrix.
[0076] Among them, error processing can be performed through an error processing module, and the error processing module can be an ASIC module. The error processing module can calculate the corresponding reprojection error for each homography matrix, and calculate the corresponding epipolar error for each basic matrix. The calculation method of the reprojection error and the epipolar error can refer to the existing related algorithms, which will not be repeated here.
[0077] Next, the error processing module can select a first matrix whose error meets a preset threshold as a first candidate matrix, and select a second matrix whose error meets a preset threshold as a second candidate matrix, so that a matrix that can more accurately express the internal point can be selected to improve the accuracy of data processing.
[0078] In a possible embodiment, the error processing module can count the sum of the errors of the first candidate matrix, and after counting the errors of the second candidate matrix, determine the homography matrix error according to each first error, and determine the basic matrix error according to each second error, to provide data support for the subsequent determination of the target matrix.
[0079] Specifically, the error processing module can read the first matrix and the second matrix on the DDR, and then calculate the reprojection error for each homography matrix, and calculate the epipolar error for each basic matrix, and then select and determine a better homography matrix and a better basic matrix.
[0080] It can be seen that error processing is used to eliminate some inaccurate matrices and improve the accuracy of data processing.
[0081] 4. Determination of the target matrix
[0082] After determining the first candidate matrix and the second candidate matrix, in order to determine the target matrix that best suits the current scene, the embodiment of the present application introduces a preset strategy to perform the final determination step, and the features included in the target matrix are the target features.
[0083] In a possible embodiment, based on the sizes of the above-mentioned homography matrix error and the basic matrix error, if the homography matrix error is greater than the basic matrix error and the difference between the homography matrix and the basic matrix error is greater than a preset difference threshold, the first candidate matrix is selected as the target matrix; if the homography matrix error is less than the basic matrix error and the difference between the homography matrix and the basic matrix error is greater than the preset difference threshold, the second candidate matrix is selected as the target matrix.
[0084] In a possible embodiment, since the homography matrix mainly reflects planar features and the basic matrix mainly reflects spatial features, the picture types of the first image and the second image can be determined. If the picture type is a two-dimensional type, the first candidate matrix is selected as the target matrix. If the picture type is a three-dimensional type, the second candidate matrix is selected as the target matrix.
[0085] It can be seen that through the above data processing method, the first matrix and the second matrix of each set of feature pairs from the first image and the second image can be determined. At the same time, error processing is performed on each first matrix and the second matrix, and finally the target matrix is determined to determine the target features, which can greatly improve the accuracy and efficiency of data processing.
[0086] 5. An exemplary description of a data processing method
[0087] In combination with the above content, an example of a data processing method in an embodiment of the present application is introduced below.
[0088] like Figure 3 FIG. 1 is a flow chart of a data processing method according to an embodiment of the present application, which specifically includes the following steps:
[0089] Step 301: Acquire a feature pair of a first image and a second image.
[0090] Each set of feature pairs includes a first feature of a first image and a second feature of a second image. It can be understood that each set of feature pairs may include a plurality of roughly matched feature pairs.
[0091] The stored preset feature pair data may be randomly sampled by a digital signal processing module to obtain each group of feature pairs.
[0092] In this way, reference data can be provided for subsequent data processing.
[0093] Step 302: determine the first matrix and the second matrix corresponding to each set of feature pairs.
[0094] Among them, each group of feature pairs can be solved synchronously by the digital signal processing module to obtain the homography matrix corresponding to each group of feature pairs, and each group of feature pairs can be solved synchronously by the digital signal processing module to obtain the basic matrix corresponding to each group of feature pairs.
[0095] In this way, the data processing efficiency can be improved through the parallel processing capability of the digital signal processing module. At the same time, solving the two matrices can provide more choices when determining the target matrix later, thereby improving the accuracy of data processing.
[0096] Step 303: determine a first error of each first matrix and a second error of each second matrix.
[0097] The reprojection error of each homography matrix can be determined by an error processing module, and the epipolar error of each basic matrix can be determined by the error processing module. The error processing module can be an ASIC module with hardware acceleration capability.
[0098] Step 304: determining a first candidate matrix according to the first error of each first matrix, and determining a second candidate matrix according to the second error of each second matrix.
[0099] Among them, the error processing module can determine the first matrix corresponding to the first error whose value meets the preset threshold value as the first candidate matrix, and the error processing module can determine the second matrix corresponding to the second error whose value meets the preset threshold value as the second candidate matrix.
[0100] In this way, a more accurate candidate matrix can be determined, thereby improving the accuracy of the target matrix determined subsequently.
[0101] Step 305: Select one of the first candidate matrix and the second candidate matrix as a target matrix according to a preset strategy to determine a target feature.
[0102] The target matrix includes the target feature, and the target feature is used to indicate a first feature and a second feature that have a matching relationship.
[0103] In a possible embodiment, a homography matrix error can be determined according to each first error, and a basic matrix error can be determined according to each second error. The homography matrix error can reflect the cumulative error of all the basic matrices. If the homography matrix error is greater than the basic matrix error and the difference between the homography matrix and the basic matrix error is greater than a preset difference threshold, the first candidate matrix is selected as the target matrix; if the homography matrix error is less than the basic matrix error and the difference between the homography matrix and the basic matrix error is greater than the preset difference threshold, the second candidate matrix is selected as the target matrix. In this way, a matrix corresponding to a matrix type with a smaller error can be selected as the target matrix, thereby improving the accuracy of the determined target matrix.
[0104] In a possible embodiment, the screen types of the first image and the second image may be determined; if the screen type is a two-dimensional type, the first candidate matrix is selected as the target matrix; if the screen type is a three-dimensional type, the second candidate matrix is selected as the target matrix. In this way, a matrix of a matrix type that is more suitable for the current scene may be selected as the target matrix, thereby improving the accuracy of the determined target matrix.
[0105] Through the above data processing method, the first matrix and the second matrix of each set of feature pairs from the first image and the second image can be determined. At the same time, error processing is performed on each first matrix and the second matrix, and finally the target matrix is determined to determine the target feature, which can greatly improve the accuracy and efficiency of data processing.
[0106] For the steps not described in detail above, please refer to the description of 1-4 above, which will not be repeated here.
[0107] 6. Another exemplary method for data processing
[0108] For ease of understanding, the following Figure 4 Another data processing method in the embodiment of the present application is exemplarily described. Figure 4A flow chart of another data processing method provided for an embodiment of the present application. It can be seen that when the data processing method starts, the digital signal processing DSP module is used to implement the steps of performing homography matrix calculation and basic matrix calculation on the acquired feature points respectively, and the error processing ASIC module is used to perform reprojection error calculation, and determine the better homography matrix and homography matrix error through error comparison. In parallel, the error processing module is used to perform polar line error calculation, and determine the better basic matrix and basic matrix error through error comparison. Finally, the digital signal processing module determines the evaluation score RH, which is equal to the homography matrix error SH divided by the sum of the homography matrix error SH and the basic matrix error SF. If the evaluation score is greater than the preset score threshold of RH, the target feature corresponding to the homography matrix is output; if the evaluation score is less than or equal to the preset score threshold, the target feature corresponding to the basic matrix is output. No further details are given here.
[0109] For the steps not described in detail above, please refer to the description of 1-5 above, which will not be repeated here.
[0110] IV. Exemplary description of an electronic device
[0111] Combine the following Figure 5 An electronic device in an embodiment of the present application is described. Figure 5 Schematic diagram of the structure of an electronic device according to an embodiment of the present application, wherein the electronic device 500 includes a processor 501 , a memory 502 , and a communication bus 503 for connecting the processor 501 and the memory 502 .
[0112] In some possible implementations, the memory 502 includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or portable read-only memory (CD-ROM), and the memory 502 is used to store the program code executed by the electronic device 500 and the transmitted data.
[0113] In some possible implementations, the electronic device 500 further includes a communication interface for receiving and sending data.
[0114] In some possible implementations, the processor 501 may be one or more central processing units (CPUs). When the processor 501 is a central processing unit (CPU), the central processing unit (CPU) may be a single-core central processing unit (CPU) or a multi-core central processing unit (CPU).
[0115] In some possible implementations, the processor 501 may be a baseband chip, a chip, a central processing unit (CPU), a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof.
[0116] In a specific implementation, the processor 501 in the electronic device 500 is used to execute the program instructions 521 stored in the memory 502 to perform the following operations:
[0117] Acquire feature pairs of the first image and the second image, each set of feature pairs including a first feature of the first image and a second feature of the second image;
[0118] Determine a first matrix and a second matrix corresponding to each set of feature pairs;
[0119] determining a first error for each first matrix and a second error for each second matrix;
[0120] Determine a first candidate matrix according to the first error of each of the first matrices, and determine a second candidate matrix according to the second error of each of the second matrices;
[0121] According to a preset strategy, one of the first candidate matrix and the second candidate matrix is selected as a target matrix to determine a target feature, wherein the target matrix includes the target feature, and the target feature is used to indicate a first feature and a second feature that have a matching relationship.
[0122] It can be seen that through the above data processing method and related devices, first, the feature pairs of the first image and the second image are obtained, and each set of feature pairs includes the first feature of the first image and the second feature of the second image; then, the first matrix and the second matrix corresponding to each set of feature pairs are determined; then, the first error of each first matrix and the second error of each second matrix are determined; then, the first candidate matrix is determined according to the first error of each first matrix, and the second candidate matrix is determined according to the second error of each second matrix; finally, one of the first candidate matrix and the second candidate matrix is selected as the target matrix according to the preset strategy to determine the target feature, and the target matrix includes the target feature, and the target feature is used to indicate the first feature and the second feature that have a matching relationship. Two matrices and corresponding errors can be calculated at the same time, and finally a suitable one is selected as the target matrix, which greatly improves the data processing efficiency while ensuring the data processing accuracy.
[0123] It should be noted that the specific implementation of each operation can adopt the corresponding description of the method embodiment shown above, and the electronic device 500 can be used to execute the above method embodiment of the present application, which will not be described in detail.
[0124] 5. Exemplary Description of a Data Processing Device
[0125] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0126] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0127] In the case of dividing each functional module into corresponding functional modules, Figure 6 This is a block diagram of the functional units of a data processing device provided in an embodiment of the present application. The data processing device 600 includes:
[0128] An acquisition unit 610 is used to acquire feature pairs of the first image and the second image, each set of feature pairs includes a first feature of the first image and a second feature of the second image;
[0129] A first matrix unit 620, used to determine a first matrix and a second matrix corresponding to each set of feature pairs;
[0130] an error determination unit 630, configured to determine a first error of each first matrix and a second error of each second matrix;
[0131] A second matrix unit 640, configured to determine a first candidate matrix according to a first error of each first matrix, and to determine a second candidate matrix according to a second error of each second matrix;
[0132] The feature determination unit 650 is used to select one of the first candidate matrix and the second candidate matrix as a target matrix according to a preset strategy to determine a target feature, wherein the target matrix includes the target feature, and the target feature is used to indicate the first feature and the second feature that have a matching relationship.
[0133] It can be seen that through the above data processing method and related devices, first, the feature pairs of the first image and the second image are obtained, and each set of feature pairs includes the first feature of the first image and the second feature of the second image; then, the first matrix and the second matrix corresponding to each set of feature pairs are determined; then, the first error of each first matrix and the second error of each second matrix are determined; then, the first candidate matrix is determined according to the first error of each first matrix, and the second candidate matrix is determined according to the second error of each second matrix; finally, one of the first candidate matrix and the second candidate matrix is selected as the target matrix according to the preset strategy to determine the target feature, and the target matrix includes the target feature, and the target feature is used to indicate the first feature and the second feature that have a matching relationship. Two matrices and corresponding errors can be calculated at the same time, and finally a suitable one is selected as the target matrix, which greatly improves the data processing efficiency while ensuring the data processing accuracy.
[0134] It should be noted that the specific implementation of each operation can adopt the corresponding description of the method embodiment shown above, and the data processing device 600 can be used to execute the above method embodiment of the present application, which will not be described in detail.
[0135] VI. Exemplary Description of Another Data Processing Device
[0136] In the case of an integrated unit, the following combination Figure 7 Another data processing device 700 in an embodiment of the present application is described in detail, and the data processing device 700 includes a processing unit 701 and a communication unit 702, wherein the processing unit 701 is used to execute any step in the above method embodiment, and when performing data transmission such as sending, the communication unit 702 can be selectively called to complete the corresponding operation.
[0137] The data processing device 700 may further include a storage unit 703 for storing program codes and data. The processing unit 701 may be a processor, the communication unit 702 may be a wireless communication module, and the storage unit 703 may be a memory.
[0138] The processing unit 701 is specifically used for:
[0139] Acquire feature pairs of the first image and the second image, each set of feature pairs including a first feature of the first image and a second feature of the second image;
[0140] Determine a first matrix and a second matrix corresponding to each set of feature pairs;
[0141] determining a first error for each first matrix and a second error for each second matrix;
[0142] Determine a first candidate matrix according to the first error of each of the first matrices, and determine a second candidate matrix according to the second error of each of the second matrices;
[0143] According to a preset strategy, one of the first candidate matrix and the second candidate matrix is selected as a target matrix to determine a target feature, wherein the target matrix includes the target feature, and the target feature is used to indicate a first feature and a second feature that have a matching relationship.
[0144] It can be seen that through the above data processing method and related devices, first, the feature pairs of the first image and the second image are obtained, and each set of feature pairs includes the first feature of the first image and the second feature of the second image; then, the first matrix and the second matrix corresponding to each set of feature pairs are determined; then, the first error of each first matrix and the second error of each second matrix are determined; then, the first candidate matrix is determined according to the first error of each first matrix, and the second candidate matrix is determined according to the second error of each second matrix; finally, one of the first candidate matrix and the second candidate matrix is selected as the target matrix according to the preset strategy to determine the target feature, and the target matrix includes the target feature, and the target feature is used to indicate the first feature and the second feature that have a matching relationship. Two matrices and corresponding errors can be calculated at the same time, and finally a suitable one is selected as the target matrix, which greatly improves the data processing efficiency while ensuring the data processing accuracy.
[0145] It should be noted that the specific implementation of each operation can adopt the corresponding description of the method embodiment shown above, and the data processing device 700 can be used to execute the above method embodiment of the present application, which will not be described in detail.
[0146] 7. Other examples
[0147] An embodiment of the present application also provides a chip, including a processor, a memory, and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps described in the above method embodiment.
[0148] An embodiment of the present application also provides a chip module, including a transceiver component and a chip, the chip including a processor, a memory and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps described in the above method embodiment.
[0149] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method recorded in the above method embodiment, and the above computer includes an electronic device.
[0150] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.
[0151] It should be noted that, for the above-mentioned various embodiments, for the sake of simple description, they are all expressed as a series of action combinations. Those skilled in the art should be aware that the present application is not limited by the described order of actions, because some steps in the embodiments of the present application can be performed in other orders or simultaneously. In addition, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions, steps, modules or units involved are not necessarily required by the embodiments of the present application.
[0152] In the above embodiments, the embodiments of the present application have different focuses on the description of each embodiment. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0153] The steps of the method or algorithm described in the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disks, mobile hard disks, read-only compact disks (CD-ROMs) or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device or a management device. Of course, the processor and the storage medium can also be present in a terminal device or a management device as discrete components.
[0154] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0155] The modules / units included in the devices and products described in the above embodiments may be software modules / units or hardware modules / units, or may be partially software modules / units and partially hardware modules / units. For example, for the devices and products applied to or integrated in the chip, the modules / units included therein may all be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for the devices and products applied to or integrated in the chip module, the modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or in different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. The software programs run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits. It is implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal equipment, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in hardware such as circuits.
[0156] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific implementation method of the embodiments of the present application and is not intended to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Acquire feature pairs of the first image and the second image, each set of feature pairs including a first feature of the first image and a second feature of the second image; Determine a first matrix and a second matrix corresponding to each set of feature pairs; determining a first error for each first matrix and a second error for each second matrix; Determine a first candidate matrix according to the first error of each of the first matrices, and determine a second candidate matrix according to the second error of each of the second matrices; According to a preset strategy, one of the first candidate matrix and the second candidate matrix is selected as a target matrix to determine a target feature, wherein the target matrix includes the target feature, and the target feature is used to indicate a first feature and a second feature that have a matching relationship.
2. The method according to claim 1, characterized in that The step of acquiring a feature pair of the first image and the second image comprises: The stored preset feature pair data is randomly sampled through a digital signal processing module to obtain each group of feature pairs.
3. The method according to claim 2, characterized in that The determining the first matrix and the second matrix corresponding to each set of feature pairs comprises: Each set of feature pairs is solved synchronously by the digital signal processing module to obtain a homography matrix corresponding to each set of feature pairs, and each set of feature pairs is solved synchronously by the digital signal processing module to obtain a basic matrix corresponding to each set of feature pairs.
4. The method according to claim 3, characterized in that The determining of the first error of each first matrix and the second error of each second matrix comprises: The reprojection error of each homography matrix is determined by an error processing module, and the epipolar error of each base matrix is determined by the error processing module.
5. The method according to claim 4, characterized in that The determining of the first candidate matrix according to the first error of each of the first matrixes, and the determining of the second candidate matrix according to the second error of each of the second matrixes, comprises: The error processing module determines a first matrix corresponding to a first error whose value meets a preset threshold as the first candidate matrix, and the error processing module determines a second matrix corresponding to a second error whose value meets the preset threshold as the second candidate matrix.
6. The method according to claim 1, characterized in that The selecting one of the first candidate matrix and the second candidate matrix as a target matrix according to a preset strategy to determine a target feature includes: determining a homography matrix error based on each first error, and determining a fundamental matrix error based on each second error; If the homography matrix error is greater than the basic matrix error and the difference between the homography matrix and the basic matrix error is greater than a preset difference threshold, selecting the first candidate matrix as the target matrix; If the homography matrix error is smaller than the basic matrix error and the difference between the homography matrix error and the basic matrix error is greater than the preset difference threshold, the second candidate matrix is selected as the target matrix.
7. The method according to claim 1, characterized in that The selecting one of the first candidate matrix and the second candidate matrix as a target matrix according to a preset strategy to determine a target feature includes: determining the picture types of the first image and the second image; If the picture type is a two-dimensional type, selecting the first candidate matrix as the target matrix; If the picture type is a 3D type, the second candidate matrix is selected as the target matrix.
8. A data processing device, characterized in that: The device comprises: An acquisition unit, configured to acquire feature pairs of the first image and the second image, each set of feature pairs including a first feature of the first image and a second feature of the second image; A first matrix unit, used to determine a first matrix and a second matrix corresponding to each set of feature pairs; an error determination unit, configured to determine a first error of each first matrix and a second error of each second matrix; A second matrix unit, configured to determine a first candidate matrix according to a first error of each of the first matrixes, and to determine a second candidate matrix according to a second error of each of the second matrixes; A feature determination unit is used to select one of the first candidate matrix and the second candidate matrix as a target matrix according to a preset strategy to determine a target feature, wherein the target matrix includes the target feature, and the target feature is used to indicate the first feature and the second feature that have a matching relationship.
9. An electronic device, characterized in that: include: A processor, a memory, and one or more programs; the one or more programs are stored in the memory and are configured to be executed by the processor, the programs comprising instructions for executing the steps in the method according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.
