Block matching method, device, electronic device and storage medium based on stereoscopic view
By introducing mapping matrix and preset cost algorithms into traditional image block matching methods, it is transformed into random image block calculation matching cost, and the problem of inaccurate image block matching accuracy in traditional methods is solved, achieving higher matching accuracy.
Patent Information
- Application Number
- CN202111593232.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2041-12-23
AI Technical Summary
Traditional image block matching methods are prone to matching errors in complex scenarios, resulting in inaccurate image block matching accuracy.
The base image block and the reference image block are converted into random image blocks through the mapping matrix, and then the matching cost is calculated using the preset cost algorithm to determine the target matching image block.
Improve the accuracy of image block matching, weaken the impact of base image blocks and reference image blocks on matching, and ensure the accuracy of target matching image blocks.
Smart Images

Figure CN114463369B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a block matching method, device, electronic device and storage medium based on stereoscopic viewing. Background Art
[0002] With the advancement of computer vision technology, autonomous driving is attracting increasing attention from researchers. Autonomous driving encompasses four key technologies: environmental perception, precise positioning, decision-making and planning, and control and execution. Scene depth is essential for both environmental perception and precise positioning. In autonomous driving, LiDAR (LiDAR) can be used to directly detect scene depth. However, given its high cost, industrial cameras can be used to capture binocular images and estimate scene depth information in practical applications.
[0003] Traditional image block matching methods can achieve real-time depth acquisition of scenes. These methods sequentially traverse pixels in a base image (in blocks) and search for corresponding matching blocks in a reference image based on epipolar constraints. When calculating match confidence, the matching cost is calculated using an absolute error sum algorithm, with a lower matching cost indicating higher confidence. However, due to the complexity of real-world scenes, traditional image block matching is prone to matching errors, resulting in inaccurate image block matching accuracy. Summary of the Invention
[0004] The present application provides a block matching method, device, electronic device and storage medium based on stereoscopic viewing, aiming to improve the accuracy of image block matching.
[0005] In a first aspect, the present application provides a block matching method based on a stereoscopic view, comprising:
[0006] Obtaining a base image block according to each image pixel in the base image, and traversing a reference image block in the reference image according to an epipolar constraint;
[0007] Calculating a mapping matrix of the stereoscopic view using a preset random algorithm, and generating a random image block according to the mapping matrix, the base image block, and the reference image block;
[0008] The matching cost of the random image block is calculated according to a preset cost algorithm, and the target matching image block is determined according to the matching cost.
[0009] In one embodiment, the step of generating a random image block according to the mapping matrix, the base image block and the reference image block comprises:
[0010] Processing the base image block through the mapping matrix to obtain a first target image block, and processing the reference image block through the mapping matrix to obtain a second target image block;
[0011] The first target image block and the second target image block are used as an image block pair to generate the random image block.
[0012] The steps of processing the base image block by using the mapping matrix to obtain a first target image block, and processing the reference image block by using the mapping matrix to obtain a second target image block include:
[0013] Performing a matrix multiplication operation on the mapping matrix and the base image block to obtain the first target image block;
[0014] Perform a matrix multiplication operation on the mapping matrix and the reference image block to obtain the second target image block.
[0015] The step of determining the target matching image block according to the matching cost includes:
[0016] Determining the matching cost with the smallest value among the matching costs;
[0017] The image block corresponding to the matching cost with the smallest value is determined as the target matching image block.
[0018] The step of obtaining a base image block according to each image pixel in the base image and traversing a reference image block in the reference image according to epipolar constraints comprises:
[0019] Traversing each image pixel in the base image, and obtaining the base image block with each image pixel as the center;
[0020] A constraint condition of the epipolar constraint is determined, and a reference image block that meets the constraint condition is traversed in the reference image according to the epipolar constraint.
[0021] In a second aspect, the present application further provides a block matching device based on a stereoscopic view, comprising:
[0022] a determination module, configured to obtain a base image block according to each image pixel in the base image, and traverse a reference image block in the reference image according to an epipolar constraint;
[0023] a generating module, configured to calculate a mapping matrix of the stereoscopic view using a preset random algorithm, and generate a random image block according to the mapping matrix, the base image block, and the reference image block;
[0024] The matching module is configured to calculate a matching cost of the random image block according to a preset cost algorithm, and determine a target matching image block according to the matching cost.
[0025] Furthermore, the generating module is further configured to:
[0026] Processing the base image block through the mapping matrix to obtain a first target image block, and processing the reference image block through the mapping matrix to obtain a second target image block;
[0027] The first target image block and the second target image block are used as an image block pair to generate the random image block.
[0028] Furthermore, the generation module further includes a calculation unit, which is further configured to:
[0029] Performing a matrix multiplication operation on the mapping matrix and the base image block to obtain the first target image block;
[0030] Perform matrix multiplication on the mapping matrix and the reference image block to obtain the second target image block
[0031] In a third aspect, the present application also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the block matching method based on stereoscopic view described in the first aspect are implemented.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a computer program, and when the computer program is executed by the processor, the steps of the stereoscopic view-based block matching method described in the first aspect are implemented.
[0033] In a fifth aspect, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions, which, when executed by a computer, implement the steps of the stereoscopic view-based block matching method described in the first aspect.
[0034] The stereoscopic view-based block matching method, device, electronic device and storage medium provided in the present application do not directly calculate the matching costs of the base image blocks and the reference image blocks during the stereoscopic view-based block matching process. Instead, the base image blocks and the reference image blocks are first converted into random image blocks through a mapping matrix, and then the target matching image blocks are obtained through a preset cost algorithm and the random image blocks, thereby improving the accuracy of image block matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0036] Figure 1 This is a flowchart of a block matching method based on a stereoscopic view provided by this application;
[0037] Figure 2 Schematic diagram of the structure of the block matching device based on stereoscopic view provided by this application;
[0038] Figure 3 It is a structural diagram of the electronic device provided in this application. DETAILED DESCRIPTION
[0039] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0040] The following combination Figures 1 to 3 The present application describes a stereoscopic view-based block matching method, device, electronic device, and storage medium.
[0041] This application provides a block matching method based on stereoscopic view, referring to Figures 1 to 3 , Figure 1 This is a flowchart of a block matching method based on a stereoscopic view provided by this application; Figure 2 Schematic diagram of the structure of the block matching device based on stereoscopic view provided by this application; Figure 3 It is a structural diagram of the electronic device provided in this application.
[0042] The embodiments of the present application provide an embodiment of a block matching method based on a stereoscopic view. It should be noted that although a logical order is shown in the flowchart, under certain data, the steps shown or described may be completed in an order different from that here.
[0043] Glossary:
[0044] Stereoscopic vision Figure 1 Generally, it includes a left view image and a right view image. If the disparity map of the left view image is estimated, the left view image is the base image and the right view image is the reference image. Conversely, if the disparity map of the right view image is estimated, the right view image is the base image and the left view image is the reference image.
[0045] The disparity map is an image in which any one of the image pairs (left view image and right view image) is used as a reference image and the pixel values are disparity values.
[0046] Depth map: The depth map and disparity map are inversely proportional, and the scale factor is the baseline multiplied by the camera focal length.
[0047] The epipolar constraint is the constraint formed by the image point and the camera optical center under the projection model when the same 3D point is projected onto two images with different perspectives.
[0048] The embodiments of the present application take an electronic device as an example of an execution subject. The embodiments of the present application take an image processing system as one of the forms of the electronic device, but do not limit the electronic device.
[0049] Specifically, refer to Figure 1 , Figure 1 This is one of the flowcharts of the block matching method based on stereoscopic views provided in this application.
[0050] The block matching method based on stereoscopic views provided in the embodiment of the present application includes:
[0051] Step S10 , obtaining a base image block according to each image pixel in the base image, and traversing to obtain a reference image block in the reference image according to epipolar constraints.
[0052] It should be noted that before performing image block matching, the image processing system first needs to determine the disparity map of the point image to be estimated in the stereoscopic view. In order to further illustrate the embodiments of the present application, taking the estimation of the disparity map of the left view image as an example, the left view image in the stereoscopic view is determined as the base image, and the right view image in the stereoscopic view is determined as the reference image.
[0053] Therefore, the image processing system determines each image pixel in the base image, wherein the image pixel includes an image horizontal coordinate pixel and an image vertical coordinate pixel, and the image horizontal coordinate pixel is represented by pixel i. Next, the image processing system constructs an image block of a preset length and a preset width with each image horizontal coordinate pixel i in the base image as the center, wherein the preset length and the preset width are both set according to actual conditions, and the preset length can be equal to the preset width, or the preset length can be different from the preset width. For ease of understanding, in this embodiment, the preset length is equal to the preset width, so the preset length and the preset width can be represented as n, and the base image block of the base image is obtained. Therefore, the base image block can be represented as At the same time, the image processing system traverses the reference image block in the reference image according to the epipolar constraint. The reference image block can be expressed as Where |j|≤D max , D max Indicates the maximum disparity value, specifically as in step S101 to step S102.
[0054] Step S20 : calculating a mapping matrix of the stereoscopic viewing image by using a preset random algorithm, and generating a random image block according to the mapping matrix, the base image block, and the reference image block.
[0055] It should be noted that the random algorithms in the embodiments of the present application include but are not limited to the Monte Carlo random algorithm and the Las Vegas random algorithm.
[0056] Therefore, the image processing system determines the view length and view width of the stereoscopic view, and calculates the random block of the stereoscopic view by combining the view length and view width through a preset random algorithm. The essence of the random block is a matrix, so the random block is the mapping matrix of the stereoscopic view. The view length can be represented by m, and the view width can be represented by n, wherein the view length m can be equal to the view width n, and the view length can also be different from the view width n. In actual application scenarios, generally, the view length is greater than or equal to the view width. Therefore, the mapping matrix can be expressed as R n*m , where m≥n. Then, the image processing system maps the matrix R n*m Base image block Perform image block processing, that is, mapping matrix R n*m With the base image block Perform image operations to obtain the processed base image blocks. At the same time, the image processing system uses the mapping matrix R n*m For the reference image block Perform image block processing, that is, mapping matrix R n*m With the reference image block Perform image operations to obtain a processed reference image block. Finally, the image processing system constructs an image block pair using the processed base image block and the processed reference image block to generate a random image block, as described in steps S201 to S202.
[0057] Step S30 , calculating the matching cost of the random image block according to a preset cost algorithm, and determining a target matching image block according to the matching cost.
[0058] It should be noted that the preset cost algorithm in the embodiment of the present application is the Sum of Absolute Differences (SAD) algorithm.
[0059] Therefore, the image processing system calculates the matching cost of a random image block using an absolute error sum algorithm. The term "matching cost" can be understood as a general term, not just a specific matching cost. A smaller matching cost indicates a higher confidence level, while a larger matching cost indicates a lower confidence level. The image processing system then determines the minimum and maximum matching costs among the matching costs. Based on these minimum and maximum matching costs, the system determines the target matching image block, as detailed in steps S301 and S302.
[0060] This embodiment provides a stereoscopic block matching method. During the stereoscopic block matching process, rather than directly calculating the matching cost between the base image block and the reference image block, the base image block and the reference image block are first converted into random image blocks using a mapping matrix. The target matching image block is then obtained by applying a preset cost algorithm to the random image blocks. This embodiment demonstrates that the stereoscopic block matching method improves the accuracy of image block matching without compromising the speed of image block matching by first converting the base image block and the reference image block into random image blocks using a mapping matrix.
[0061] Furthermore, the description of step S101 to step S102 is as follows:
[0062] Step S101, traversing each image pixel in a base image, and obtaining the base image block with each image pixel as the center;
[0063] Step S102 : determining the constraint conditions of the epipolar constraint, and traversing the reference image blocks that meet the constraint conditions in the reference image according to the epipolar constraint.
[0064] Specifically, the image processing system determines each image pixel in the base image, wherein the image pixel includes an image horizontal coordinate pixel and an image vertical coordinate pixel, and the image horizontal coordinate pixel is represented by pixel i. Then, the image processing system constructs an image block of preset length and preset width with each image horizontal coordinate pixel i in the base image as the center, wherein the preset length and preset width are set according to actual conditions, and the preset length can be equal to the preset width, or the preset length can be different from the preset width. For ease of understanding, in this embodiment, the preset length is equal to the preset width, so the preset length and preset width can be represented as n, and the base image block of the base image is obtained. The base image block can be represented as At the same time, the image processing system determines the constraint conditions of the epipolar constraint, traverses the reference image according to the epipolar constraint, and traverses the reference image blocks that meet the constraint conditions in the reference image. The reference image blocks can be expressed as Where |j|≤D max , D max Indicates the maximum disparity value.
[0065] The embodiment of the present application obtains a base image block by traversing each image pixel in the base image, and traverses a reference image block according to the constraint conditions, thereby ensuring the accuracy of the traversed base image block and the reference image block, and further improving the accuracy of image block matching.
[0066] Furthermore, the description of step S201 to step S202 is as follows:
[0067] Step S201, processing the base image block by the mapping matrix to obtain a first target image block, and processing the reference image block by the mapping matrix to obtain a second target image block;
[0068] Step S202 : generating the random image block by using the first target image block and the second target image block as an image block pair.
[0069] Specifically, the image processing system maps the matrix R n*m Base image block Perform image block processing, that is, mapping matrix R n*m With the base image block Perform image operation to obtain the first target image block, which can be expressed as At the same time, the image processing system uses the mapping matrix R n*m For the reference image block Perform image block processing, that is, mapping matrix R n*m With the reference image block Perform image operation to obtain the second target image block, which can be expressed as Specifically, as in step S2011 to step S2012. Next, the image processing system constructs an image block pair from the first target image block and the second target image block in the form of an image block pair to generate a random image block. The random image block can be expressed as (first target image block, second target image block), that is, the random image block is
[0070] In the embodiment of the present application, after processing the base image block and the reference image block through a mapping matrix, a first target image block and a second target image block are obtained, and the first target image block and the second target image block are used to generate a pair of random image blocks, thereby greatly reducing the influence of the base image block and the reference image block on image block matching and further improving the accuracy of image block matching.
[0071] Step S202: Generate the random image block by combining the first target image block and the second target image block in the form of an image block pair.
[0072] Furthermore, the description of steps S2011 to S2012 is as follows:
[0073] Step S2011, performing a matrix multiplication operation on the mapping matrix and the base image block to obtain the first target image block;
[0074] Step S2012: performing a matrix multiplication operation on the mapping matrix and the reference image block to obtain the second target image block.
[0075] Specifically, the image processing system maps the matrix Rn*m With the base image block Perform matrix multiplication, that is, map the matrix R n*m With the base image block Multiply to get the first target image block Therefore, the first target image block can be expressed as At the same time, the image processing system maps the matrix R n*m With the reference image block Perform matrix multiplication, that is, map the matrix R n*m With the reference image block Multiply to get the second target image block Therefore, the second target image block can be expressed as
[0076] In the embodiment of the present application, a matrix multiplication operation is performed on the base image block and the reference image block through a mapping matrix to obtain a first target image block and a second target image block. By processing the base image block and the reference image block through the mapping matrix, the influence of the base image block and the reference image block on the image block matching is greatly reduced, thereby further improving the accuracy of the image block matching.
[0077] Furthermore, the description of step S301 to step S302 is as follows:
[0078] Step S301, determining the matching cost with the smallest value among the matching costs;
[0079] Step S302: Determine the image block corresponding to the matching cost with the minimum value as the target matching image block.
[0080] Specifically, since a smaller matching cost indicates a higher confidence level, and a larger matching cost indicates a lower confidence level, the image processing system needs to compare the numerical values of all matching costs and determine the matching cost with the smallest numerical value among the matching costs. Next, the image processing system determines the image block corresponding to the matching cost with the smallest numerical value, and determines the image block corresponding to the matching cost with the smallest numerical value as the target matching image block to be matched in the end. Furthermore, since the target matching image block to be matched in the end is the reference image block in the stereoscopic view, it can be understood that the image processing system determines the reference image block B corresponding to the matching cost with the smallest numerical value. i+j And the reference image block B corresponding to the minimum matching cost i+j , determined as the target matching image block to be matched in the end.
[0081] The embodiment of the present application determines the matching cost with the minimum value by comparing the numerical values, and determines the reference image block corresponding to the matching cost with the minimum value as the target matching image block to be matched, thereby ensuring the accuracy of the target matching image block and further improving the accuracy of image block matching.
[0082] Furthermore, the block matching device based on stereoscopic viewing provided by the present application is described below. The block matching device based on stereoscopic viewing described below and the block matching method based on stereoscopic viewing described above can refer to each other.
[0083] like Figure 2 As shown, Figure 2 : is a schematic structural diagram of a block matching device based on a stereoscopic view provided by the present application. The block matching device based on a stereoscopic view includes:
[0084] A determination module 201 is configured to obtain a base image block according to each image pixel in the base image, and traverse a reference image block in the reference image according to epipolar constraints;
[0085] A generating module 202 is configured to calculate a mapping matrix of the stereoscopic view using a preset random algorithm, and generate a random image block according to the mapping matrix, the base image block, and the reference image block;
[0086] The matching module 203 is configured to calculate a matching cost of the random image block according to a preset cost algorithm, and determine a target matching image block according to the matching cost.
[0087] Furthermore, the generating module 202 is further configured to:
[0088] Processing the base image block through the mapping matrix to obtain a first target image block, and processing the reference image block through the mapping matrix to obtain a second target image block;
[0089] The first target image block and the second target image block are used as an image block pair to generate the random image block.
[0090] Furthermore, the generating module 202 further includes a calculating unit configured to:
[0091] Performing a matrix multiplication operation on the mapping matrix and the base image block to obtain the first target image block;
[0092] Perform a matrix multiplication operation on the mapping matrix and the reference image block to obtain the second target image block.
[0093] Furthermore, the matching module 203 is further configured to:
[0094] Determining the matching cost with the smallest value among the matching costs;
[0095] The image block corresponding to the matching cost with the smallest value is determined as the target matching image block.
[0096] Furthermore, the determining module 201 is further configured to:
[0097] Traversing each image pixel in the base image, and obtaining the base image block with each image pixel as the center;
[0098] A constraint condition of the epipolar constraint is determined, and a reference image block that meets the constraint condition is traversed in the reference image according to the epipolar constraint.
[0099] The specific embodiments of the block matching device based on stereoscopic viewing provided in this application are basically the same as the above-mentioned embodiments of the block matching method based on stereoscopic viewing, and are not described in detail here.
[0100] Figure 3 An example of a physical structure diagram of an electronic device is shown below. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 may call logic instructions in the memory 330 to execute a block matching method based on a stereoscopic view, the method including:
[0101] Obtaining a base image block according to each image pixel in the base image, and traversing a reference image block in the reference image according to an epipolar constraint;
[0102] Calculating a mapping matrix of the stereoscopic view using a preset random algorithm, and generating a random image block according to the mapping matrix, the base image block, and the reference image block;
[0103] The matching cost of the random image block is calculated according to a preset cost algorithm, and the target matching image block is determined according to the matching cost.
[0104] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0105] On the other hand, the present application further provides a computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions. When the program instructions are executed by a computer, the computer is capable of performing the stereoscopic view-based block matching method provided by the above methods, wherein the method comprises:
[0106] Obtaining a base image block according to each image pixel in the base image, and traversing a reference image block in the reference image according to an epipolar constraint;
[0107] Calculating a mapping matrix of the stereoscopic view using a preset random algorithm, and generating a random image block according to the mapping matrix, the base image block, and the reference image block;
[0108] The matching cost of the random image block is calculated according to a preset cost algorithm, and the target matching image block is determined according to the matching cost.
[0109] In another aspect, the present application further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program is implemented to perform the above-mentioned block matching method based on stereoscopic views, the method comprising:
[0110] Obtaining a base image block according to each image pixel in the base image, and traversing a reference image block in the reference image according to an epipolar constraint;
[0111] Calculating a mapping matrix of the stereoscopic view using a preset random algorithm, and generating a random image block according to the mapping matrix, the base image block, and the reference image block;
[0112] The matching cost of the random image block is calculated according to a preset cost algorithm, and the target matching image block is determined according to the matching cost.
[0113] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0114] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A block matching method based on stereoscopic view, characterized in that: The stereoscopic view includes a base image and a reference image, and the steps of the block matching method based on the stereoscopic view include: Obtaining a base image block according to each image pixel in the base image, and traversing a reference image block in the reference image according to an epipolar constraint; Calculating a mapping matrix of the stereoscopic view using a preset random algorithm, and generating a random image block according to the mapping matrix, the base image block, and the reference image block; Calculating a matching cost of the random image block according to a preset cost algorithm, and determining a target matching image block according to the matching cost; The step of generating a random image block according to the mapping matrix, the base image block and the reference image block comprises: Processing the base image block through the mapping matrix to obtain a first target image block, and processing the reference image block through the mapping matrix to obtain a second target image block; Generate the random image block by using the first target image block and the second target image block in the form of an image block pair; The steps of processing the base image block by using the mapping matrix to obtain a first target image block, and processing the reference image block by using the mapping matrix to obtain a second target image block include: Performing a matrix multiplication operation on the mapping matrix and the base image block to obtain the first target image block; Perform a matrix multiplication operation on the mapping matrix and the reference image block to obtain the second target image block.
2. The block matching method based on stereoscopic view according to claim 1, characterized in that: The step of determining the target matching image block according to the matching cost includes: Determining the matching cost with the smallest value among the matching costs; The image block corresponding to the matching cost with the smallest value is determined as the target matching image block.
3. The block matching method based on stereoscopic view according to claim 1, characterized in that: The step of obtaining a base image block according to each image pixel in the base image and traversing a reference image block in the reference image according to epipolar constraints comprises: Traversing each image pixel in the base image, and obtaining the base image block with each image pixel as the center; A constraint condition of the epipolar constraint is determined, and a reference image block that meets the constraint condition is traversed in the reference image according to the epipolar constraint.
4. A block matching device based on a stereoscopic view, characterized in that: The stereoscopic view includes a base image and a reference image. The block matching device based on the stereoscopic view includes: a determination module, configured to obtain a base image block according to each image pixel in the base image, and traverse a reference image block in the reference image according to an epipolar constraint; a generating module, configured to calculate a mapping matrix of the stereoscopic view using a preset random algorithm, and generate a random image block according to the mapping matrix, the base image block, and the reference image block; a matching module, configured to calculate a matching cost of the random image block according to a preset cost algorithm, and determine a target matching image block according to the matching cost; The generation module is further configured to: Processing the base image block through the mapping matrix to obtain a first target image block, and processing the reference image block through the mapping matrix to obtain a second target image block; Generate the random image block by using the first target image block and the second target image block in the form of an image block pair; The generating module further includes a calculating unit, which is further configured to: Performing a matrix multiplication operation on the mapping matrix and the base image block to obtain the first target image block; Perform a matrix multiplication operation on the mapping matrix and the reference image block to obtain the second target image block.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the block matching method based on stereoscopic viewing images according to any one of claims 1 to 3 are implemented.
6. A non-transitory computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed by a processor, the steps of the block matching method based on stereoscopic viewing according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Matching cost calculation method and device
CN108074250A