Abnormal pixel filtering method and device
By using two ToF cameras to obtain depth maps and point cloud maps, calculate pixel matching indicators and filter out noise, the problem of flying point noise in ToF cameras is solved, and the efficiency of noise removal and simplicity of calculation are improved.
Patent Information
- Application Number
- CN202110596678.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-31
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-05-31
AI Technical Summary
In the existing technology, when processing the depth map measured by a ToF camera, there are a large number of erroneous depth measurement values at the edge of the object, resulting in flying point noise, which affects the wide application of ToF cameras. Moreover, the existing filtering method is inefficient and requires a large amount of calculation. It is difficult to effectively remove noise.
By using two ToF cameras to obtain the depth map and point cloud map, calculate the matching index of the pixels, and determine whether to filter out the pixels based on the threshold, simplifying the calculation steps and improving efficiency.
It achieves rapid and effective removal of abnormal pixel noise, reduces computational complexity, improves filtering efficiency, simplifies the calculation process, and is suitable for depth map processing of ToF cameras.
Smart Images

Figure CN113379812B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for filtering abnormal pixels. Background Art
[0002] In the depth map measured by the ToF camera (Time of Fight Camera), there are often a large number of erroneous depth measurement values at the edge of the object. After the 3D point cloud is generated, it appears visually as invalid points flying in the air, which is called flying point noise. Flying point noise makes it impossible for the ToF camera to effectively obtain 3D information of the edge of the object. If the flying point noise cannot be solved, it will affect the widespread promotion and application of ToF cameras.
[0003] Currently, 3D cameras can only solve the flying spot and other noise phenomena through pure algorithmic methods, which requires a large amount of calculation and is not efficient in removing the flying spot noise.
[0004] The invention patent with the publication number CN 104240188 B discloses a method and device for filtering out noise in pixels, which is used to solve the problem that when the pixels in the image contain impulse noise and Gaussian noise, the existing filtering methods need to filter the impulse noise and Gaussian noise once respectively, which leads to the problem that these filtering methods are inefficient in filtering out noise in the image. The method includes: for a comparison pixel, determining the similarity of at least one comparison pixel with a corresponding pixel in the local neighborhood of the comparison pixel; determining the weight of the local neighborhood of the comparison pixel relative to the local neighborhood of the pixel to be processed according to the determined similarities; determining the filtered pixel value of the pixel to be processed according to the weight of the local neighborhood of at least one comparison pixel in the sliding window relative to the local neighborhood of the pixel to be processed. However, the invention needs to filter the pixels and calculate the similarity and weight of the pixels, that is, to solve the noise in the pixels with a pure algorithm, which has many calculation steps and is complicated, and requires high computing power of the hardware.
[0005] Therefore, it is necessary to provide a method and device for filtering abnormal pixels to solve the above-mentioned problems in the prior art. Summary of the invention
[0006] The purpose of the present invention is to provide a method and device for filtering abnormal pixels to solve the problems of slow efficiency, many calculation steps and complicated calculation when using pure algorithm to calculate and filter pixel noise.
[0007] To achieve the above object, the abnormal pixel filtering method of the present invention comprises the steps of:
[0008] S1: Acquire a first depth image through a first camera, and acquire a second depth image through a second camera;
[0009] S2: Process the first depth image to obtain a first point cloud image, and process the second depth image to obtain a second point cloud image;
[0010] S3: Indexing pixels in the first point cloud image to obtain an index result;
[0011] S4: Calculating a pixel matching index according to the index result;
[0012] S5: Setting a filtering threshold, and filtering out the pixel when it is determined that the matching index of the pixel is greater than or equal to the filtering threshold.
[0013] The beneficial effects of the abnormal pixel filtering method of the present invention are:
[0014] The index result is obtained by comparing and indexing the depth map and point cloud map of the two cameras, and the matching index of the pixel is calculated according to the index result, and it is judged whether the matching index of the pixel is greater than the filtering threshold to decide whether to filter out the pixel. The calculation steps are few and the calculation complexity is low. The matching degree of the pixel is calculated by the depth map and point cloud map of the two cameras. The calculation principle is simple, which can greatly improve the efficiency of judging abnormal pixels, thereby further improving the speed of filtering out pixel noise.
[0015] Preferably, in step S1, the first camera is a TOF camera, and the second camera is also a TOF camera. Its beneficial effect is that the TOF camera mainly includes a transmitting end and a receiving end. The ToF sensor sends a light source driver chip modulation signal to the laser to control the laser to emit high-frequency modulated near-infrared light. After the near-infrared light encounters diffuse reflection from an object, the receiving end calculates the depth information through the phase difference or time difference between the emitted light and the received light. The ToF sensor adopts back-illuminated CMOS process technology, which greatly increases the photosensitive area, improves the photon collection rate and the speed of ranging, and the response time can reach ns level, and the high precision of the depth map can be guaranteed even at long distances. The first depth image and the second depth image are directly obtained by two TOF cameras, thereby improving the efficiency of the abnormal pixel filtering method of the present invention.
[0016] Preferably, the first camera and the second camera are placed in parallel on the same horizontal plane, and the first camera and the second camera are used to photograph the same target to acquire the first depth image and the second depth image.
[0017] Preferably, in step S2, processing the first depth image to obtain a first point cloud image and processing the second depth image to obtain a second point cloud image include the steps of:
[0018] S20: Calibrate camera parameters, where the camera parameters include first camera intrinsic parameters and second camera intrinsic parameters;
[0019] S21: Calculate the first point cloud image according to the first depth image and the first camera intrinsic parameter, and calculate the intermediate point cloud image according to the second depth image and the second camera intrinsic parameter.
[0020] Further preferably, step S22 is also included, wherein the camera parameters also include the external parameters of the second camera, and the step S22 includes, according to the external parameters of the second camera, and taking the center of the first point cloud image as the center of the coordinate system, translating and rotating the intermediate point cloud image to obtain the second point cloud image. The beneficial effect of steps S20 to S22 is that the first point cloud image and the second point cloud image are calculated based on the camera parameters and the depth image, which facilitates the distinction of each pixel in the image, facilitates the subsequent calculation of the pixel matching index, simplifies the difficulty of calculating abnormal pixels, and improves the efficiency of filtering out abnormal pixels.
[0021] Preferably, in step S3, indexing the pixels in the first point cloud image includes calculating pixel position column differences, and searching for corresponding pixels in the second point cloud image for the pixels in the first point cloud image based on the pixel position column differences.
[0022] Preferably, the step of calculating the pixel position column difference comprises:
[0023] S30: Calculate the baseline length and pixel depth value;
[0024] S31: multiply the baseline length and the camera focal length, and divide the resultant result by the pixel depth value to obtain the pixel position column difference.
[0025] Further preferably, the baseline length is a center distance between a lens of the first camera and a center distance between a lens of the second camera.
[0026] Further preferably, the pixel depth value is the pixel depth of the first point cloud image, and the pixel depth of the first point cloud image is consistent with the pixel depth of the second point cloud image.
[0027] Preferably, in step S4, calculating the pixel matching index based on the pixel position column difference includes:
[0028] S40: defining a first window in the first point cloud image, and defining a second window corresponding to the first window in the second point cloud image;
[0029] S41: calculating the point cloud values of all pixels in the first window and the point cloud values of all pixels in the second window respectively;
[0030] S42: subtracting the point cloud value of the pixel in the second window corresponding to the pixel in the first window from the point cloud value of the pixel in the first window to obtain a point cloud difference, and calculating the absolute value of the point cloud difference;
[0031] S43: Sum the absolute values of the point cloud differences to obtain the matching index of the pixels. The beneficial effects of steps S40 to S43 are: first define a first window in the first point cloud, then define a corresponding second window in the second point cloud, calculate the point cloud value of each pixel in the first window and the point cloud value of each pixel in the second window in turn, then subtract the point cloud value of the corresponding pixel in the second window from the point cloud value of the pixel in the first window to obtain the point cloud difference, calculate the absolute value of the point cloud difference, and then sum the absolute values of the point cloud differences of all pixels to obtain the matching index of the pixel. The calculation logic is clear, the calculation steps are simple and clear, and the matching index of the pixels of the first window and the second window can be calculated more quickly, thereby improving the speed of finding abnormal pixels.
[0032] Preferably, in step S5, when it is determined that the matching index of the pixel is less than the filtering threshold, the pixel is retained.
[0033] Preferably, the method further comprises step S6: repeating steps S3 to S5 until all pixels in the first point cloud image are indexed.
[0034] The present invention also provides a device, comprising a first camera, a second camera, an image processing unit, an index unit, a calculation unit, a judgment unit and a filtering execution unit; the first camera is used to provide a first depth image, and the second camera is used to provide a second depth image;
[0035] The image processing unit is connected to the first camera and the second camera, and the image processing unit processes the first depth image to obtain a first point cloud image, and processes the second depth image to obtain a second point cloud image;
[0036] The calculation unit is connected to the image processing unit, and is used to calculate the pixel position column difference and the pixel matching index;
[0037] The indexing unit is connected to the image processing unit and the computing unit, and the indexing unit indexes pixels in the first point cloud image according to the pixel position column difference;
[0038] The judging unit is connected to the calculating unit, and the judging unit judges whether the pixel meets the filtering condition according to the matching index of the pixel and the filtering threshold;
[0039] The filtering execution unit is connected to the judging unit and the image processing unit. When the judging unit judges that the pixel meets the filtering condition, the filtering execution unit filters out the pixel.
[0040] The beneficial effects of the device of the present invention are: the first camera and the second camera provide the first depth map and the second depth map, the image processing unit processes the first depth map and the second depth map to obtain the first point cloud map and the second point cloud map, the calculation unit calculates the pixel position column difference and the pixel matching index in the point cloud map, the index unit indexes the pixels in the point cloud map, the judgment unit is used to judge whether the pixel meets the filtering condition, and the filtering execution unit filters the pixels that meet the filtering condition. The various units of the device are closely connected, and through the cooperation and calculation between the camera and multiple units, the abnormal pixels in the image can be quickly calculated and judged, thereby improving the efficiency of filtering out abnormal pixels.
[0041] Preferably, it further comprises a preset unit, which is connected to the calculation unit and the judgment unit, and is used to preset the filtering threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flow chart of the abnormal pixel filtering method of the present invention;
[0043] Figure 2 A flowchart of processing a first depth image according to the present invention;
[0044] Figure 3 A flowchart of calculating pixel position column difference of the present invention;
[0045] Figure 4 A flowchart of calculating a pixel matching index according to the present invention;
[0046] Figure 5 It is a schematic diagram of the device structure of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than 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. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0048] In view of the problems existing in the prior art, an embodiment of the present invention provides a method and device for filtering abnormal pixels.
[0049] Figure 1 is a flowchart of the abnormal pixel filtering method of the present invention, referring to Figure 2 The abnormal pixel filtering method of the present invention comprises the steps of:
[0050] S1: Acquire a first depth image through a first camera, and acquire a second depth image through a second camera;
[0051] S2: Process the first depth image to obtain a first point cloud image, and process the second depth image to obtain a second point cloud image;
[0052] S3: Index the pixels in the first point cloud image to obtain an index result;
[0053] S4: Calculate the pixel matching index based on the index result;
[0054] S5: Setting a filtering threshold, when it is determined that the matching index of a pixel is greater than or equal to the filtering threshold, filtering out the pixel;
[0055] When the matching index of the judgment pixel is less than the filtering threshold, the pixel is retained.
[0056] S6: Repeat steps S3 to S5 until all pixels in the first point cloud image are indexed.
[0057] The advantages of the abnormal pixel filtering method of the present invention are:
[0058] The indexing result is obtained by comparing and indexing the depth map and point cloud map of the two cameras, and the matching index of the pixel is calculated based on the indexing result to determine whether the matching index of the pixel is greater than the filtering threshold to decide whether to filter out the pixel. The calculation steps are few and the calculation complexity is low. The matching degree of the pixel is calculated by the depth map and point cloud map of the two cameras. The calculation principle is simple, which can greatly improve the efficiency of judging abnormal pixels, thereby improving the speed of filtering out pixel noise.
[0059] As a preferred embodiment of the present invention, in step S1, the first camera is a TOF camera, and the second camera is also a TOF camera. Its advantages are: the TOF camera mainly includes a transmitting end and a receiving end, and the ToF sensor sends a light source driver chip modulation signal to the laser to control the laser to emit high-frequency modulated near-infrared light. After the near-infrared light encounters diffuse reflection of an object, the receiving end calculates the depth information through the phase difference or time difference between the emitted light and the received light. The ToF sensor generally adopts back-illuminated CMOS process technology, which greatly increases the photosensitive area, improves the photon collection rate and the speed of ranging, and the response time can reach ns level, and the high precision of the depth map can be guaranteed at a long distance. The first depth image and the second depth image are directly obtained by two TOF cameras, which improves the efficiency of the abnormal pixel filtering method of the present invention.
[0060] As a preferred implementation manner of the present invention, the first camera and the second camera are placed in parallel on the same horizontal plane, and the first camera and the second camera are used to shoot the same target to obtain the first depth image and the second depth image.
[0061] As a preferred embodiment of the present invention, in step S2, Figure 2 This is a flowchart of processing the first depth image of the present invention. Figure 2 , processing the first depth image to obtain a first point cloud image, and processing the second depth image to obtain a second point cloud image comprises the steps of:
[0062] S20: Calibrate camera parameters, where the camera parameters include first camera intrinsic parameters and second camera intrinsic parameters;
[0063] S21: Calculate a first point cloud image according to the first depth image and the first camera intrinsic parameter, and calculate an intermediate point cloud image according to the second depth image and the second camera intrinsic parameter.
[0064] As a preferred embodiment of the present invention, refer to Figure 2 , further comprising step S22, the camera parameters further comprising the external parameters of the second camera, step S22 comprising, based on the external parameters of the second camera, and taking the center of the first point cloud image as the center of the coordinate system, translating and rotating the intermediate point cloud image to obtain the second point cloud image. The advantages of steps S20 to S22 are: based on the camera parameters and the depth image, the first point cloud image and the second point cloud image are calculated, which facilitates the distinction of each pixel in the image, facilitates the subsequent calculation of the pixel matching index, simplifies the difficulty of calculating abnormal pixels, and improves the efficiency of filtering out abnormal pixels.
[0065] As a preferred implementation of the present invention, in step S3, indexing the pixels in the first point cloud image includes calculating pixel position column differences, and searching for corresponding pixels in the second point cloud image for the pixels in the first point cloud image based on the pixel position column differences.
[0066] As a preferred embodiment of the present invention, Figure 3 The flowchart of calculating pixel position column difference of the present invention is shown in FIG. Figure 3 , the steps of calculating the pixel position column difference include:
[0067] S30: Calculate the baseline length and pixel depth value;
[0068] S31: Multiply the baseline length and the camera focal length, and divide the result by the pixel depth value to obtain the pixel position column difference.
[0069] As a specific implementation of the present invention, a calculation formula for pixel position column difference is provided, and the calculation formula for pixel position column difference is as follows:
[0070]
[0071] Among them, d is the pixel position column difference; B is the baseline length; f is the camera focal length, and Z is the pixel depth value.
[0072] As a preferred implementation of the present invention, the baseline length is the center distance between the lens of the first camera and the lens of the second camera.
[0073] As a preferred implementation manner of the present invention, the pixel depth value is the pixel depth of the first point cloud image, and the pixel depth of the first point cloud image is consistent with the pixel depth of the second point cloud image.
[0074] As a preferred embodiment of the present invention, in step S4, Figure 4 This is a flowchart of calculating the pixel matching index of the present invention. Figure 4 , calculating the pixel matching index based on the pixel position column difference includes the following steps:
[0075] S40: defining a first window in the first point cloud image, and defining a second window corresponding to the first window in the second point cloud image; specifically, searching for the second window corresponding to the first window in the second point cloud image through the indexing process of step S3 above.
[0076] S41: Calculate the point cloud values of all pixels in the first window and the point cloud values of all pixels in the second window respectively;
[0077] S42: subtracting the point cloud value of the pixel in the first window from the point cloud value of the pixel in the second window corresponding to the pixel in the first window to obtain a point cloud difference, and calculating the absolute value of the point cloud difference;
[0078] S43: Sum the absolute values of the point cloud differences to obtain the pixel matching index. The advantages of steps S40 to S43 are: first define the first window in the first point cloud, then define the corresponding second window in the second point cloud, calculate the point cloud value of each pixel in the first window and the point cloud value of each pixel in the second window in turn, then subtract the point cloud value of the corresponding pixel in the second window from the point cloud value of the pixel in the first window to obtain the point cloud difference, calculate the absolute value of the point cloud difference, and then sum the absolute values of the point cloud differences of all pixels to obtain the pixel matching index. The calculation logic is clear, the calculation steps are simple and clear, and the matching index of the pixels of the first window and the second window can be calculated more quickly, thereby improving the speed of finding abnormal pixels.
[0079] As a specific implementation of the present invention, a calculation formula for the pixel matching index is also provided. The calculation formula for the pixel matching index is as follows:
[0080]
[0081] Among them, f(x, y, d) is the pixel matching index, M is the size of the first window or the second window, x is the horizontal coordinate of the pixel, y is the vertical coordinate of the pixel, d is the pixel position column difference, PCL1(x+dx, y+dy) is the point cloud value of the pixel in the first window, and PCL2'(x+dx-d, y+dy) is the point cloud value of the pixel in the second window.
[0082] It can be explained that the size M of the first window can be adjusted, and the size M of the first window can be 2, which means that there are 3×3 pixels, a total of 9 pixels, in the first window. The second window corresponds to the first window, so the size of the second window is consistent with the size of the first window.
[0083] The present invention also provides a device, Figure 5 This is a schematic diagram of the device structure of the present invention. Figure 5 The device of the present invention includes a first camera 1, a second camera 2, an image processing unit 3, an indexing unit 4, a calculating unit 5, a judging unit 6 and a filtering execution unit 7; the first camera 1 is used to provide a first depth image, and the second camera 2 is used to provide a second depth image;
[0084] The image processing unit 3 is connected to the first camera 1 and the second camera 2, and processes the first depth image to obtain a first point cloud image, and processes the second depth image to obtain a second point cloud image;
[0085] The calculation unit 5 is connected to the image processing unit 3, and the calculation unit 5 is used to calculate the pixel position column difference and the pixel matching index;
[0086] As a specific implementation of the present invention, the calculation unit 5 calculates the pixel position column difference by a pixel position column difference formula, and the pixel position column difference formula is:
[0087]
[0088] Among them, d is the pixel position column difference; B is the baseline length; f is the camera focal length, and Z is the pixel depth value.
[0089] As a specific implementation of the present invention, specifically, the calculation unit 5 calculates the pixel matching index through the pixel matching index formula, and the pixel matching index formula is:
[0090]
[0091] Among them, f(x, y, d) is the pixel matching index, M is the size of the first window and the second window, x is the horizontal coordinate of the pixel, y is the vertical coordinate of the pixel, d is the pixel position column difference, PCL1(x+dx, y+dy) is the point cloud value of the pixel in the first window, and PCL2'(x+dx-d, y+dy) is the point cloud value of the pixel in the second window.
[0092] The indexing unit 4 is connected to the image processing unit 3 and the calculation unit 5, and the indexing unit 4 indexes the pixels in the first point cloud image according to the pixel position column difference;
[0093] When calculating the pixel matching index, the index unit 4 is also used to index the second window corresponding to the first window in the second point cloud image.
[0094] The judgment unit 6 is connected to the calculation unit 5. The judgment unit judges whether the pixel meets the filtering condition according to the matching index and the filtering threshold of the pixel. The pixel whose matching index is greater than the filtering threshold is an abnormal pixel.
[0095] Specifically, when the judgment unit 6 judges that the matching index of the pixel is greater than or equal to the filtering threshold, it is judged that the pixel meets the filtering condition;
[0096] When the judgment unit 6 judges that the matching index of the pixel is less than the filtering threshold, it is judged that the pixel does not meet the filtering condition. At this time, the pixel is a normal pixel and does not need to be filtered out, and the normal pixel is retained.
[0097] The filtering execution unit 7 is connected to the judging unit 6 and the image processing unit 3. When the judging unit 6 judges that the pixel meets the filtering condition, the filtering execution unit 7 filters out the pixel, that is, filters out the abnormal pixel.
[0098] The advantages of the device of the present invention are: the first depth map and the second depth map are provided by the first camera 1 and the second camera 2, the first depth map and the second depth map are processed by the image processing unit 3 to obtain the first point cloud map and the second point cloud map, the calculation unit 5 calculates the pixel position column difference and the pixel matching index in the point cloud map, the index unit 4 indexes the pixels in the point cloud map, the judgment unit 6 is used to judge whether the pixel meets the filtering condition, and the filtering execution unit 7 filters the pixels that meet the filtering condition. The various units of the device are closely connected, and through the cooperation and calculation between the camera and multiple units, the abnormal pixels in the image can be quickly calculated and judged, thereby improving the efficiency of filtering abnormal pixels.
[0099] As a preferred embodiment of the present invention, refer to Figure 5 , and also includes a preset unit 8, which is connected to the calculation unit 5 and the judgment unit 6, and the preset unit 8 is used to preset a filtering threshold.
[0100] The preset unit 8 is also used to calibrate the camera parameters, which include the first camera intrinsic parameters, the second camera intrinsic parameters, and the second camera extrinsic parameters. After the preset unit 8 transmits the above camera parameters to the calculation unit 5, the calculation unit 5 calculates the first point cloud image based on the first depth image and the first camera intrinsic parameters, and calculates the intermediate point cloud image based on the second depth image and the second camera intrinsic parameters. Then, the calculation unit 5 translates and rotates the intermediate point cloud image based on the extrinsic parameters of the second camera and takes the center of the first point cloud image as the center of the coordinate system to obtain the second point cloud image.
[0101] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.
Claims
1. A method for filtering abnormal pixels, characterized in that: Includes steps: S1: Acquire a first depth image through a first camera, and acquire a second depth image through a second camera; S2: Process the first depth image to obtain a first point cloud image, and process the second depth image to obtain a second point cloud image; S3: Indexing pixels in the first point cloud image to obtain an index result; S4: Calculating a pixel matching index according to the index result; S5: Setting a filtering threshold, and filtering out the pixel when it is determined that the matching index of the pixel is greater than or equal to the filtering threshold; In the step S1, the first camera is a TOF camera, and the second camera is a TOF camera; In the step S3, indexing the pixels in the first point cloud image includes calculating pixel position column differences, and searching for corresponding pixels in the second point cloud image for the pixels in the first point cloud image according to the pixel position column differences; The calculation formula of pixel position column difference is as follows: Where d is the pixel position column difference; B is the baseline length; f is the camera focal length; Z is the pixel depth value; In the step S4, calculating the pixel matching index according to the pixel position column difference includes: S40: defining a first window in the first point cloud image, and defining a second window corresponding to the first window in the second point cloud image; S41: calculating the point cloud values of all pixels in the first window and the point cloud values of all pixels in the second window respectively; S42: subtracting the point cloud value of the pixel in the second window corresponding to the pixel in the first window from the point cloud value of the pixel in the first window to obtain a point cloud difference, and calculating an absolute value of the point cloud difference; S43: summing the absolute values of the point cloud differences to obtain a matching index of the pixels; The calculation formula of the pixel matching index is as follows: Wherein, f(x, y, d) is the pixel matching index, M is the size of the first window or the second window, x is the horizontal coordinate of the pixel, y is the vertical coordinate of the pixel, PCL1(x+dx, y+dy) is the point cloud value of the pixel in the first window, PCL2'(x+dx-d, y+dy) is the point cloud value of the pixel in the second window; the size M of the first window is adjustable, and the size of the second window is the same as that of the first window; In step S2, the processing of the first depth image to obtain a first point cloud image and the processing of the second depth image to obtain a second point cloud image include the following steps: S20: Calibrate camera parameters, where the camera parameters include first camera intrinsic parameters and second camera intrinsic parameters; S21: Calculate the first point cloud image according to the first depth image and the first camera intrinsic parameters, and calculate the intermediate point cloud image according to the second depth image and the second camera intrinsic parameters; The method further includes step S22, wherein the camera parameters also include external parameters of a second camera. Step S22 includes translating and rotating the intermediate point cloud image based on the external parameters of the second camera and taking the center of the first point cloud image as the center of the coordinate system to obtain the second point cloud image.
2. The method for filtering abnormal pixels according to claim 1, characterized in that: The first camera and the second camera are placed in parallel on the same horizontal plane, and the first camera and the second camera are used to shoot the same target to obtain the first depth image and the second depth image.
3. The method for filtering abnormal pixels according to claim 1, characterized in that: The step of calculating the pixel position column difference comprises: S30: Calculate the baseline length and pixel depth value; S31: multiply the baseline length and the camera focal length, and divide the resultant result by the pixel depth value to obtain the pixel position column difference.
4. The method for filtering abnormal pixels according to claim 3, characterized in that: The baseline length is the center distance between the lens of the first camera and the lens of the second camera.
5. The method for filtering abnormal pixels according to claim 3, characterized in that: The pixel depth value is the pixel depth of the first point cloud image, and the pixel depth of the first point cloud image is consistent with the pixel depth of the second point cloud image.
6. The method for filtering abnormal pixels according to claim 1, wherein: In the step S5, when it is determined that the matching index of the pixel is less than the filtering threshold, the pixel is retained.
7. The method for filtering abnormal pixels according to claim 1, wherein: The method further includes step S6: repeating steps S3 to S5 until all pixels in the first point cloud image are indexed.
8. A device, characterized in that It includes a first camera, a second camera, an image processing unit, an index unit, a calculation unit, a judgment unit and a filtering execution unit; the first camera is used to provide a first depth image, and the second camera is used to provide a second depth image; The image processing unit is connected to the first camera and the second camera, and the image processing unit processes the first depth image to obtain a first point cloud image, and processes the second depth image to obtain a second point cloud image; The calculation unit is connected to the image processing unit, and is used to calculate the pixel position column difference and the pixel matching index; The indexing unit is connected to the image processing unit and the computing unit, and the indexing unit indexes pixels in the first point cloud image according to the pixel position column difference; The judging unit is connected to the calculating unit, and the judging unit judges whether the pixel meets the filtering condition according to the matching index of the pixel and the filtering threshold; The filtering execution unit is connected to the judging unit and the image processing unit. When the judging unit judges that the pixel meets the filtering condition, the filtering execution unit filters out the pixel.
9. The device as claimed in claim 8, characterized in that It also includes a preset unit, which is connected to the calculation unit and the judgment unit, and is used to preset the filtering threshold.
