A method for removing noise from a disparity map, a memory and a shooting device
Through the noise removal method of the disparity map, stereo matching and pixel block grouping technology are used to remove noise in the disparity map, solving the problems of excessive computing resources and poor real-time processing in stereo vision technology, and achieving more efficient images. deal with.
Patent Information
- Application Number
- CN202111494357.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-12-08
AI Technical Summary
Existing stereo vision technology has deficiencies in robustness and real-time performance, causing the processing process to occupy a large amount of computing resources and cannot be effectively applied to low computing power platforms. Moreover, the real-time processing performance is poor and it is difficult to cope with real-time control scenarios.
Using the disparity map noise removal method, the disparity map is generated through stereo matching, and pixel block grouping and preset thresholds are used to remove noise, reduce computing resource usage, and improve processing efficiency.
It effectively shortens the image processing time, improves the real-time performance of disparity map processing, solves the problem of excessive computing resource usage and slow processing speed, and is suitable for low computing power platforms.
Smart Images

Figure CN114419129B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for removing noise from a disparity map, a memory and a shooting device. Background Art
[0002] "Vision" is the most common way for living things to obtain information from nature. There are also data showing that nearly 80% of the total amount of information humans obtain from the outside world comes from vision. Therefore, computer-based visual information processing has naturally gradually become a hot research field, that is, obtaining three-dimensional spatial information such as distance and depth by processing two-dimensional digital image information. Stereoscopic vision, as an important branch of computer vision, refers to a way of shooting the same scene from two or more angles at a certain moment, and finally obtaining three-dimensional information such as distance by matching the corresponding points of the collected image groups. It can be seen that stereoscopic vision is a passive ranging method. The so-called passive means that no active illumination or projection is required. At the same time, from the perspective of bionics, the binocular stereoscopic vision system is the most basic computer stereoscopic vision system: the system only needs a camera and does not need active light emission, which is not only conducive to reducing the overall power consumption and system cost, but also to a certain extent can improve the overall stability of the system. Of course, the development of stereoscopic vision technology is closely linked to the rapid update of sensors and cameras. The two complement each other and enhance each other. With the continuous improvement of imaging quality, stereo vision systems have extremely high research value in industrial production, military survey, aerospace and other fields. In the field of industrial production, Japanese scientists have developed a servo system based on binocular vision system. In addition, the binocular system can be combined with robot control to adjust the overall posture of the robot and realize intelligent navigation. Through this control, more efficient and intelligent large-scale industrial production can be achieved. In the military field, the stereo vision system can be combined with mobile robots, drones and other mobile devices to realize remote terrain survey, target measurement, intelligent control, etc. in the field of wireless data transmission, realizing the real "clairvoyance", which greatly meets the needs of information-based high-tech military development. In the field of aerospace, stereo vision can be combined with mobile platforms such as space vehicles to timely survey the geology and topography of other planets, and propose more accurate solutions for intelligent navigation and tracking. It will have a significant impact on human development in outer space and even planetary migration.
[0003] In the prior art, stereoscopic vision technology has made great progress and achieved certain breakthroughs and developments in multiple theoretical key points. However, the inventors found in the implementation process that the robustness and real-time performance of the stereoscopic vision system have not been completely solved, and people have put forward more stringent requirements on the practical experience and cost of stereoscopic vision technology, which has greatly improved the theoretical algorithm level of stereoscopic vision technology. However, it has been greatly restricted in practical applications, and it is difficult to achieve a good comprehensive breakthrough in robustness and real-time performance. For example, the existing processing methods for binocular vision technology often need to extract the three-dimensional information of the image. This processing process requires a large amount of computing resources, which makes the above processing methods usually not well suited for low-computing power platforms; at the same time, because a large amount of computing resources are required in the processing process, the real-time performance of the image processing process of the existing technology is poor, and it cannot cope with real-time control scenarios well. Summary of the invention
[0004] In view of the above problems existing in the prior art, a method for removing noise from a disparity map, a memory and a shooting device are provided.
[0005] The specific technical solutions are as follows:
[0006] A method for removing noise from a disparity map, comprising:
[0007] Step S1: collecting the disparity map and the disparity value corresponding to the disparity map for the scene to be measured;
[0008] Step S2: generating pixel blocks from the disparity map;
[0009] Step S3: removing noise from the disparity map according to the pixel block and a preset threshold.
[0010] Preferably, the step S1 comprises:
[0011] Step S11: acquiring a first image and a second image of the scene to be measured;
[0012] Step S12: using a stereo matching method to generate the disparity map and the disparity value based on the first image and the second image.
[0013] Preferably, the stereo matching method in step S12 is:
[0014] Step S121: selecting a target pixel from the first image;
[0015] Step S122: acquiring a plurality of comparison pixels in the second image according to the vertical coordinate of the target pixel in the first image;
[0016] Step S123: calculating the similarity between the comparison pixel and the target pixel, and generating a similar pixel with the maximum similarity;
[0017] Step S124: generating a disparity value corresponding to the target pixel according to the similar pixel and the target pixel;
[0018] Step S125: repeating steps S121 to S124 to obtain the disparity values corresponding to all pixels in the first image, and generating the disparity map according to the disparity values.
[0019] Preferably, the similarity calculation method in step S123 is:
[0020]
[0021] Where: corr is the similarity, I r is the second image, I t is the first image, M represents the window radius, (x r ,y r ) is the coordinate of the comparison pixel in the second image, (x t ,y t ) are the coordinates of the target pixel in the first image, is the light intensity mean of the window pixels with the comparison pixel as the center and M as the window radius, is the mean light intensity of the window pixels with the target image as the center and M as the window radius.
[0022] Preferably, the method for calculating the disparity value in step S124 is:
[0023] d(x t ,y t )=x t -x r ;
[0024] Among them, d(x t ,y t ) is the disparity value, (x t ,y t ) is the coordinate of the target pixel, x t is the horizontal coordinate of the target pixel, and xr is the horizontal coordinate of the similar pixel.
[0025] Preferably, the step S2 comprises:
[0026] Step S21: selecting a disparity pixel in the disparity map;
[0027] Step S22: selecting at least one grouping pixel adjacent to the disparity pixel, and generating a difference value according to the disparity value of the disparity pixel and the disparity value of the grouping pixel;
[0028] Step S23: judging whether the grouped pixels and the parallax pixels are pixels of the same group according to a preset difference limit, and generating the pixel block according to the judging result;
[0029] Step S24: repeating the steps S21 to S23 until all pixels in the disparity map are traversed to generate a plurality of pixel blocks.
[0030] Preferably, step S3 comprises:
[0031] Step S31: obtaining the number of pixels of the pixel block;
[0032] Step S32: determining whether the number of pixels is less than a preset counting threshold, and identifying whether the pixel block is a noise point according to the determination result;
[0033] If yes, remove the pixel block and then return to step S31;
[0034] If not, return to step S31 until all the pixel blocks are traversed.
[0035] A memory is provided with computer instructions, and when the computer instructions are run in a computer device, the above-mentioned noise removal method is executed.
[0036] A disparity map shooting device includes a memory, wherein the memory is provided with computer instructions;
[0037] a first image sensor, wherein the first image sensor captures a first image;
[0038] a second image sensor, wherein the second image sensor captures a second image;
[0039] a processor, the processor being connected to the first image sensor and the second image sensor to acquire the first image and the second image;
[0040] The processor is also connected to the memory to execute the computer instructions;
[0041] The processor executes the above-mentioned noise removal method when running the computer instructions, so as to generate a noise-removed disparity map according to the first image and the second image.
[0042] The above technical solution has the following advantages or beneficial effects: by using the stereo matching method to obtain the disparity map and removing noise through pixel blocks, the time required for image processing is effectively shortened while ensuring the image processing effect, solving the problem in the prior art that the processing of the disparity map requires a lot of computing resources and has poor real-time processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The embodiments of the present invention will be described more fully with reference to the attached drawings, which are provided for illustration and description only and are not intended to limit the scope of the present invention.
[0044] Figure 1 It is an overall schematic diagram of an embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of sub-steps of step S1 in an embodiment of the present invention;
[0046] Figure 3 is the disparity map collected in step S1 in the embodiment of the present invention;
[0047] Figure 4 This is a schematic diagram of sub-steps of step S12 in an embodiment of the present invention;
[0048] Figure 5 This is a schematic diagram of sub-steps of step S2 in an embodiment of the present invention;
[0049] Figure 6 This is a schematic diagram of sub-steps of step S3 in an embodiment of the present invention;
[0050] Figure 7 is a disparity map after noise is removed in an embodiment of the present invention;
[0051] Figure 8 4 is a principle block diagram of a shooting device in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0054] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.
[0055] The present invention comprises:
[0056] A method for removing noise from a disparity map, such as Figure 1 As shown, including:
[0057] Step S1: collecting a disparity map and a disparity value corresponding to the disparity map for the scene to be tested;
[0058] Step S2: generating pixel blocks from the disparity map;
[0059] Step S3: removing noise from the disparity map according to the pixel blocks and a preset threshold.
[0060] Specifically, in response to the problem in the prior art that extracting three-dimensional information to process disparity maps requires a lot of computing resources, the present invention provides a method for removing noise from disparity maps, which detects noise with jumpy disparity values by using the difference in disparity values between pixels in the disparity map, thereby achieving automatic noise removal based on the disparity map and reducing the computing resources required during the processing.
[0061] In a preferred embodiment, Figure 2 As shown, step S1 includes:
[0062] Step S11: acquiring a first image and a second image of the scene to be measured;
[0063] Step S12: using a stereo matching method to generate a disparity map and a disparity value based on the first image and the second image.
[0064] Specifically, in view of the technical problems in the prior art that the disparity map is difficult to process and has poor robustness and stability, this embodiment selects a stereo matching method to synthesize the first image and the second image to generate a Figure 3 The disparity map shown in the figure has achieved good universality and can be well adapted to various practical scenarios in actual application. In the implementation process, two independent image sensors or acquisition points can be used to acquire the first image and the second image by setting a specific main axis angle, or a binocular camera or binocular camera system can be used, which is not limited here.
[0065] In a preferred embodiment, Figure 4 As shown, the stereo matching method in step S12 is:
[0066] Step S121: selecting a target pixel from the first image;
[0067] Step S122: acquiring a plurality of comparison pixels in the second image according to the vertical coordinate of the target pixel in the first image;
[0068] Step S123: Calculate the similarity between the comparison pixel and the target pixel, and generate a similar pixel with the maximum similarity;
[0069] Step S124: generating a disparity value corresponding to the target pixel according to the similar pixel and the target pixel;
[0070] Step S125: repeating steps S121 to S124 to obtain disparity values corresponding to all pixels in the first image, and generating a disparity map according to the disparity values.
[0071] Specifically, in view of the problem that the processing process of synthesizing the disparity map by acquiring three-dimensional information in the prior art is slow, this embodiment selects a target matching method based on a regional window to achieve a faster matching speed. In the implementation process of this embodiment, the first image and the second image are located at the same horizontal height when they are collected, so it is assumed that the vertical coordinates of the target pixel and the comparison pixel are highly consistent, and then multiple comparison pixels are obtained in the second image along the horizontal direction, and the comparison pixel closest to the target pixel is obtained by calculating their similarity to shorten the processing time.
[0072] In a preferred embodiment, the similarity calculation method in step S123 is:
[0073]
[0074] Among them: corr is the similarity, I r is the second image, I t is the first image, M represents the window radius, (x r ,y r ) is the coordinate of the comparison pixel in the second image, (x t ,y t ) is the coordinate of the target pixel in the first image, is the mean light intensity of the window pixels centered on the comparison pixel and with M as the window radius, is the mean light intensity of the window pixels centered on the target image and with M as the window radius.
[0075] Specifically, in view of the problem that the process of obtaining disparity values based on three-dimensional information in the prior art is slow, this embodiment uses the regional window method to compare similar pixels, thereby achieving a faster matching speed. Among them, by selecting the target pixel to be compared and the window pixels around the comparison pixel, the average light intensity is calculated, and then the similarity can be effectively obtained, and then multiple similarities are compared to obtain actual similar pixels. Experimental data show that in the implementation process, by increasing the value of the window radius M, a more accurate similarity result can be obtained, thereby improving the accuracy of selecting similar pixels, but the calculation time will be correspondingly prolonged.
[0076] In a preferred embodiment, the calculation method of the disparity value in step S124 is:
[0077] d(x t ,y t )=x t -x r ;
[0078] Among them, d(x t ,y t ) is the parallax value, (x t ,y t ) is the coordinate of the target pixel, x t is the horizontal coordinate of the target pixel, x r is the horizontal coordinate of similar pixels.
[0079] In a preferred embodiment, Figure 5 As shown, step S2 includes:
[0080] Step S21: selecting a disparity pixel in the disparity map;
[0081] Step S22: selecting at least one grouping pixel adjacent to the disparity pixel, and generating a difference value according to the disparity value of the disparity pixel and the disparity value of the grouping pixel;
[0082] Step S23: judging whether the grouped pixels and the parallax pixels are pixels of the same group according to a preset difference limit, and generating a pixel block according to the judgment result;
[0083] Step S24: Repeat steps S21 to S23 until all pixels in the disparity map are traversed to generate a plurality of pixel blocks.
[0084] Specifically, in view of the problem that the image denoising algorithm in the prior art needs to occupy a large amount of computing resources, this embodiment uses a pixel block grouping method to quickly filter out the noise area from the image. Generally speaking, since noise is a tiny digital noise generated in the image due to the lens, sensor setting parameters, lighting conditions, etc. during the image acquisition process, it often has a small area in the image. Therefore, by calculating the difference value of the disparity value between a pixel and its adjacent pixels, the disparity map can be divided into multiple small pixel blocks, and then the noise that needs to be removed can be further filtered out from the pixel blocks.
[0085] As an optional implementation, the difference limit is 5 pixels.
[0086] In a preferred embodiment, Figure 6 As shown, step S3 includes:
[0087] Step S31: obtaining the number of pixels in the pixel block;
[0088] Step S32: determining whether the number of pixels is less than a preset counting threshold, and identifying whether the pixel block is a noise point according to the determination result;
[0089] If yes, remove the pixel block and then return to step S31;
[0090] If not, return to step S31 until all pixel blocks are traversed.
[0091] Specifically, in order to solve the problem that the image denoising algorithm in the prior art needs to occupy a large amount of computing resources, this embodiment uses the pixel block grouping method to quickly filter out the noise area from the image. Since the area of the noise in the overall image is small, the area of the corresponding pixel block generated by the difference value calculation of the noise area is also small. In this regard, this embodiment can determine the area of the part by obtaining the number of pixels in each pixel block, and then remove the noise part with a smaller area, forming a Figure 7 The disparity map after removing noise is shown. It can be seen that Figure 3 The disparity map in reduces the noise.
[0092] As an optional implementation, the counting threshold is 200 pixels.
[0093] As an optional implementation, the Wiener filter method is used to perform image restoration on the portion where the pixel block is removed, so as to achieve a faster processing speed.
[0094] A memory is provided with computer instructions, and when the computer instructions are run in a computer device, the above-mentioned noise removal method is executed.
[0095] A disparity map shooting device, such as Figure 8 As shown, a memory 4 is included, and computer instructions are set in the memory 4;
[0096] A first image sensor 1, the first image sensor 1 captures a first image;
[0097] A second image sensor 2, the second image sensor 2 captures a second image;
[0098] Processor 3, processor 3 is connected to the first image sensor and the second image sensor to obtain the first image and the second image;
[0099] The processor 3 is also connected to the memory 4 to execute computer instructions;
[0100] The processor 3 executes the above-mentioned noise removal method when running the computer instructions, so as to generate a noise-removed disparity map according to the first image and the second image.
[0101] Specifically, when executing computer instructions, the processor 3 can execute the functional actions specified in each step or a combination of steps in the above flowchart in forward, reverse or simultaneous manner.
[0102] It should be understood that the processor 3 can be understood as one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components, which are used to execute the aforementioned computer instructions or implement the aforementioned noise removal method.
[0103] In this embodiment, the memory can be a computer-readable signal medium or a computer-readable storage medium, including but not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or means, or any appropriate combination of the foregoing, such as random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable read-only memory (CD-ROM).
[0104] The above technical solution has the following advantages or beneficial effects: by using the stereo matching method to obtain the disparity map and removing noise through pixel blocks, the time required for image processing is effectively shortened while ensuring the image processing effect, solving the problem in the prior art that the processing of the disparity map requires a lot of computing resources and has poor real-time processing.
[0105] The above are only preferred embodiments of the present invention, and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for removing noise from a disparity map, characterized in that: include: Step S1: collecting the disparity map and the disparity value corresponding to the disparity map for the scene to be measured; Step S2: generating pixel blocks from the disparity map; Step S3: removing noise from the disparity map according to the pixel block and a preset threshold; The step S2 comprises: Step S21: selecting a disparity pixel in the disparity map; Step S22: selecting at least one grouping pixel adjacent to the disparity pixel, and generating a difference value according to the disparity value of the disparity pixel and the disparity value of the grouping pixel; Step S23: judging whether the grouped pixels and the parallax pixels are pixels of the same group according to a preset difference limit, and generating the pixel block according to the judging result; Step S24: repeating the steps S21 to S23 until all pixels in the disparity map are traversed to generate a plurality of pixel blocks; The step S3 comprises: Step S31: obtaining the number of pixels of the pixel block; Step S32: determining whether the number of pixels is less than a preset counting threshold, and identifying whether the pixel block is a noise point according to the determination result; If yes, remove the pixel block and then return to step S31; If not, return to step S31 until all the pixel blocks are traversed.
2. The method for removing noise points according to claim 1, characterized in that: The step S1 comprises: Step S11: acquiring a first image and a second image of the scene to be measured; Step S12: using a stereo matching method to generate the disparity map and the disparity value based on the first image and the second image.
3. The method for removing noise points according to claim 2, characterized in that: The stereo matching method in step S12 is: Step S121: selecting a target pixel from the first image; Step S122: acquiring a plurality of comparison pixels in the second image according to the vertical coordinate of the target pixel in the first image; Step S123: calculating the similarity between the comparison pixel and the target pixel, and generating a similar pixel with the maximum similarity; Step S124: generating a disparity value corresponding to the target pixel according to the similar pixel and the target pixel; Step S125: repeating steps S121 to S124 to obtain the disparity values corresponding to all pixels in the first image, and generating the disparity map according to the disparity values.
4. The method for removing noise points according to claim 3, characterized in that: The similarity calculation method in step S123 is: Where: corr is the similarity, I r is the second image, I t is the first image, M represents the window radius, (x r ,y t ) is the coordinate of the comparison pixel in the second image, (x t ,y t ) are the coordinates of the target pixel in the first image, is the light intensity mean of the window pixels with the comparison pixel as the center and M as the window radius, is the mean light intensity of the window pixels with the target pixel as the center and M as the window radius.
5. The method for removing dust spots according to claim 3, characterized in that: The calculation method of the disparity value in step S124 is: d(x t ,y t )=x t -x r ; Among them, d(x t ,y t ) is the disparity value, (x t ,y t ) is the coordinate of the target pixel, x t is the horizontal coordinate of the target pixel, x r is the horizontal coordinate of the similar pixel. . .
6. A memory, characterized in that: The memory is provided with computer instructions, and when the computer instructions are executed in the computer device, the noise removal method according to any one of claims 1 to 5 is executed.
7. A disparity map shooting device, characterized in that: A memory is included, wherein the memory is provided with computer instructions; a first image sensor, wherein the first image sensor captures a first image; a second image sensor, wherein the second image sensor captures a second image; a processor, the processor being connected to the first image sensor and the second image sensor to acquire the first image and the second image; The processor is also connected to the memory to execute the computer instructions; When the processor runs the computer instructions, the processor performs the noise removal method according to any one of claims 1 to 5, so as to generate a noise-removed disparity map according to the first image and the second image.
Citation Information
Patent Citations
Rapid stereo matching method and disparity map obtaining method both aiming at high-definition image pair
CN103310421A
Image visual processing method, equipment and device
CN108076338A
