An absolute phase image optimization method and related device for adaptive median filtering

The abnormality detection and median filtering of the absolute phase image is solved by adaptive median filtering method, and the problem of abnormal phase value during phase expansion in the structured light phase shift method is improved, and the accuracy and robustness of three-dimensional reconstruction are improved.

CN118429193BActive Publication Date: 2024-11-08GUANGZHOU SMART ROBOVISION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410876516.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-11-08
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

In the structured light phase shift method, there may be a large number of abnormal phase values ​​in the absolute phase image after phase expansion. If not optimized, it will affect the quality of the three-dimensional reconstruction and lead to more noise in the point cloud.

Method used

Adaptive median filtering method is used to perform abnormal detection and median filtering on the absolute phase image after phase expansion. Through the set of median filtering windows, the image is gradually selected and median filtered until the abnormal phase value is eliminated.

Benefits of technology

It improves the accuracy and reliability of phase measurement, eliminates abnormal phase values, enhances the quality of three-dimensional reconstruction, has good robustness, and is suitable for different types of expansion errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429193B_ABST
    Figure CN118429193B_ABST
Patent Text Reader

Abstract

The present invention discloses an absolute phase image optimization method and related device of adaptive median filtering, wherein the method comprises: performing abnormal detection processing on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and obtaining the abnormal phase value detection result of each pixel in the absolute phase image; obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the abnormal phase value detection result of each pixel in the absolute phase image; performing median filtering processing on the absolute phase image, and obtaining the first absolute phase image after median filtering; obtaining the first number of pixels corresponding to the pixels with abnormal phase values ​​in the first absolute phase image, and outputting the absolute phase image after median filtering as an optimized image according to the first number of pixels and a preset rule. In the embodiment of the present invention, the abnormal phase value appearing in the absolute phase image during phase unwrapping is optimized, and the abnormal phase value is eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an absolute phase image optimization method of adaptive median filtering and a related device. Background Art

[0002] When using the structured light phase shift method to reconstruct the three-dimensional target in the image, the image needs to be phase-unwrapped. During the phase-unwrapping process, there may be many abnormal phase values ​​in the absolute phase image formed. If these abnormal phase values ​​are not optimized and removed, the quality of subsequent three-dimensional reconstruction of the target will be affected, resulting in large noise points in the three-dimensional reconstructed point cloud. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides an absolute phase image optimization method and related devices based on adaptive median filtering, which can optimize the abnormal phase values ​​that appear in the absolute phase image during phase expansion, eliminate the abnormal phase values, and improve the accuracy and reliability of phase measurement.

[0004] In order to solve the above technical problems, an embodiment of the present invention provides an absolute phase image optimization method of adaptive median filtering, the method comprising:

[0005] Obtaining an absolute phase image after phase unwrapping, performing abnormality detection processing on a phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and obtaining a phase value abnormality detection result for each pixel in the absolute phase image;

[0006] Obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the phase value abnormality detection result of each pixel in the absolute phase image;

[0007] When the number of pixels is greater than zero, selecting a corresponding median filter window in order from a set of median filter windows to perform median filtering on the absolute phase image to obtain a first absolute phase image after median filtering;

[0008] A first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image is obtained, and based on the first number of pixels, the absolute phase image after median filtering is output as an optimized image according to a preset rule.

[0009] Optionally, performing abnormality detection processing on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal to obtain the phase value abnormality detection result of each pixel in the absolute phase image includes:

[0010] Obtaining a current pixel in the absolute phase image, and performing local image division processing with the current pixel as the center according to a preset size window to obtain a local image area corresponding to the current pixel;

[0011] Classify the pixels other than the current pixel in the local image area to obtain a pixel classification result, wherein the pixel classification result includes related pixels and irrelevant pixels;

[0012] Performing anomaly detection processing on the phase value of the current pixel according to the pixel classification result to obtain an anomaly detection result of the phase value of the current pixel;

[0013] The phase value abnormality detection result of each pixel in the absolute phase image is generated according to the phase value abnormality detection result of the current pixel.

[0014] Optionally, the classifying other pixels in the local image area except the current pixel to obtain a pixel classification result includes:

[0015] Subtracting the phase value corresponding to the current pixel in the local image area from the phase value corresponding to any other pixel to obtain a subtraction result;

[0016] Pixel classification processing is performed based on whether the absolute value of the subtraction result is less than a preset threshold to obtain a pixel classification result; if the absolute value of the subtraction result is less than the preset threshold, the arbitrary pixel is classified as a related pixel; if the absolute value of the subtraction result is greater than or equal to the preset threshold, the arbitrary pixel is classified as an unrelated pixel.

[0017] Optionally, performing anomaly detection processing on the phase value of the current pixel according to the pixel classification result to obtain an anomaly detection result of the phase value of the current pixel includes:

[0018] Obtaining a third number corresponding to related pixels and a fourth number corresponding to irrelevant pixels in the pixel classification result;

[0019] Based on whether the third number is greater than the fourth number, an abnormality detection process is performed on the phase value corresponding to the current pixel to obtain an abnormality detection result of the phase value of the current pixel; when the third number is greater than the fourth number, it is confirmed that the phase value corresponding to the current pixel is not an abnormal phase value; when the third number is less than or equal to the fourth number, it is confirmed that the phase value corresponding to the current pixel is an abnormal phase value.

[0020] Optionally, obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the phase value abnormality detection result of each pixel in the absolute phase image includes:

[0021] The phase value abnormality detection result of each pixel in the absolute phase image is statistically processed to find pixels with phase abnormality, and the number of pixels with phase value abnormality in the absolute phase image is obtained according to the statistical result.

[0022] Optionally, the step of sequentially selecting a corresponding median filter window from a set of median filter windows to perform median filtering on the absolute phase image to obtain a first absolute phase image after median filtering includes:

[0023] A corresponding median filter window is selected from the median filter window set in a manner from small to large to perform median filtering on the absolute phase image, so as to obtain a first absolute phase image after median filtering.

[0024] Optionally, obtaining a first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and outputting the absolute phase image after median filtering as an optimized image according to a preset rule based on the first number of pixels, includes:

[0025] Performing abnormality detection processing on phase values ​​corresponding to pixels in the first absolute phase image, and obtaining a first number of pixels of pixel pairs with abnormal phase values ​​according to abnormal monitoring results of phase values ​​corresponding to pixels in the first absolute phase image;

[0026] Determining whether the first number of pixels is equal to zero;

[0027] If the first number of pixels is equal to zero, the absolute phase image after median filtering is output as an optimized image;

[0028] If the first number of pixels is not equal to zero, return to performing median filtering processing on the absolute phase image based on sequentially selecting the corresponding preset median filtering window in the median filtering window set, and until the first numbers of pixels with abnormal phase values ​​corresponding to three consecutive median filtering processes are the same or all median filtering windows in the combination of the median filtering windows are executed, the absolute phase image after median filtering is output as an optimized image.

[0029] In addition, an embodiment of the present invention further provides an absolute phase image optimization device for adaptive median filtering, the device comprising:

[0030] Anomaly detection module: used to obtain the absolute phase image after phase unwrapping, perform anomaly detection processing on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and obtain the phase value abnormality detection result of each pixel in the absolute phase image;

[0031] A quantity acquisition module: used for obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the abnormal phase value detection result of each pixel in the absolute phase image when the number of pixels is greater than zero;

[0032] Median filtering module: used for performing median filtering processing on the absolute phase image based on sequentially selecting a corresponding median filtering window from a median filtering window set to obtain a first absolute phase image after median filtering;

[0033] Image output module: used to obtain the first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and output the absolute phase image after median filtering as an optimized image according to a preset rule based on the first number of pixels.

[0034] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the absolute phase image optimization method as described in any one of the above is implemented.

[0035] In addition, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0036] one or more processors;

[0037] Memory;

[0038] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to: execute the absolute phase image optimization method according to any one of the above.

[0039] In an embodiment of the present invention, by obtaining an absolute phase image after phase unwrapping, an abnormal detection process is performed on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and the phase value abnormal detection result of each pixel in the absolute phase image is obtained; the number of pixels with abnormal phase values ​​in the absolute phase image is obtained based on the phase value abnormal detection result of each pixel in the absolute phase image; when the number of pixels is greater than zero, the absolute phase image is subjected to median filtering based on the corresponding median filtering window selected in sequence from the median filtering window set, and the first absolute phase image after median filtering is obtained; the first number of pixels corresponding to the pixels with abnormal phase values ​​in the first absolute phase image is obtained, and the absolute phase image after median filtering is output as an optimized image based on the first number of pixels according to a preset rule. The optimization of the abnormal phase values ​​that appear in the absolute phase image during phase unwrapping is achieved, the abnormal phase values ​​are eliminated, and the accuracy and reliability of phase measurement are improved; and the method has good robustness, can cope with different types of unwrapping errors, and achieves good results. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 is a schematic flow chart of an absolute phase image optimization method of adaptive median filtering in an embodiment of the present invention;

[0042] Figure 2 Schematic diagram of the structure of an absolute phase image optimization device for adaptive median filtering in an embodiment of the present invention;

[0043] Figure 3 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] 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.

[0045] For example, see Figure 1 , Figure 1It is a flow chart of the absolute phase image optimization method of the adaptive median filtering in the embodiment of the present invention.

[0046] like Figure 1 As shown, an absolute phase image optimization method of adaptive median filtering comprises:

[0047] S11: obtaining an absolute phase image after phase unwrapping, performing abnormality detection processing on a phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and obtaining a phase value abnormality detection result for each pixel in the absolute phase image;

[0048] In the specific implementation process of the present invention, the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal is subjected to abnormal detection processing to obtain the phase value abnormality detection result of each pixel in the absolute phase image, including: obtaining the current pixel in the absolute phase image, and performing local image division processing with the current pixel as the center according to a preset size window to obtain the local image area corresponding to the current pixel; classifying the other pixels in the local image area except the current pixel to obtain a pixel classification result, wherein the pixel classification result includes related pixels and irrelevant pixels; performing abnormal detection processing on the phase value of the current pixel according to the pixel classification result to obtain the phase value abnormality detection result of the current pixel; generating the phase value abnormality detection result of each pixel in the absolute phase image according to the phase value abnormality detection result of the current pixel.

[0049] Furthermore, the classification processing of pixels other than the current pixel in the local image area to obtain a pixel classification result includes: subtracting a phase value corresponding to the current pixel in the local image area from a phase value corresponding to any pixel in the other pixels to obtain a subtraction result; performing pixel classification processing based on whether the absolute value of the subtraction result is less than a preset threshold to obtain a pixel classification result; wherein if the absolute value of the subtraction result is less than the preset threshold, the arbitrary pixel is classified as a related pixel; if the absolute value of the subtraction result is greater than or equal to the preset threshold, the arbitrary pixel is classified as an unrelated pixel.

[0050] Furthermore, performing abnormality detection processing on the phase value of the current pixel according to the pixel classification result to obtain an abnormality detection result of the phase value of the current pixel includes: obtaining a third number corresponding to related pixels and a fourth number corresponding to irrelevant pixels in the pixel classification result; performing abnormality detection processing on the phase value corresponding to the current pixel based on whether the third number is greater than the fourth number to obtain an abnormality detection result of the phase value of the current pixel; wherein when the third number is greater than the fourth number, it is confirmed that the phase value corresponding to the current pixel is not an abnormal phase value; when the third number is less than or equal to the fourth number, it is confirmed that the phase value corresponding to the current pixel is an abnormal phase value.

[0051] Specifically, the absolute phase image formed during phase unwrapping needs to be subjected to abnormal detection of the phase value in the absolute phase image during phase unwrapping, that is, abnormal phase values ​​are detected to facilitate subsequent phase optimization processing; in order to perform abnormal phase value detection, it is first necessary to select any pixel in the absolute phase image as the current pixel (select each pixel point in the absolute phase image in turn in this way), and then perform local image division processing with the current pixel as the center according to a preset size window, and obtain the local image area corresponding to the current pixel; then it is necessary to classify the other pixels in the local image area except the current pixel, where the classification is to classify the other pixels as related pixels or unrelated pixels, that is, to obtain pixel classification results, and the pixel classification results include related pixels and unrelated pixels; and according to the pixel classification results, the phase value of the current pixel is subjected to abnormal detection processing to obtain the abnormal phase value detection result of the current pixel, and the phase value abnormality detection result of each pixel in the absolute phase image is generated according to the abnormal phase value detection result of the current pixel.

[0052] When performing classification processing, firstly, the phase value corresponding to the current pixel in the local image area is subtracted from the phase value corresponding to any pixel in other pixels to obtain a subtraction result; and pixel classification processing is performed according to whether the absolute value of the subtraction result is less than a preset threshold, so as to obtain a pixel classification result; if the absolute value of the subtraction result is less than the preset threshold, any pixel is classified as a related pixel; if the absolute value of the subtraction result is greater than or equal to the preset threshold, any pixel is classified as an unrelated pixel.

[0053] When performing anomaly detection, it is necessary to obtain a third number corresponding to related pixels and a fourth number corresponding to irrelevant pixels in the pixel classification result; then determine whether the third number is greater than the fourth number, and perform anomaly detection processing on the phase value corresponding to the current pixel by determining whether the third number is greater than the fourth number to obtain an abnormal phase value detection result of the current pixel; when the third number is greater than the fourth number, it is confirmed that the phase value corresponding to the current pixel is not an abnormal phase value; when the third number is less than or equal to the fourth number, it is confirmed that the phase value corresponding to the current pixel is an abnormal phase value.

[0054] That is, in the absolute phase image, a window of a specified size is selected as its local area by taking the current pixel A as the center; for an erroneous pixel, its unfolding error should be a multiple of 2π; therefore, in a local area, the phase values ​​of an erroneous pixel and a good pixel are completely different, while the phase values ​​of two good pixels are similar; using this property, any pixel B in the window is first classified as a relative pixel or an irrelevant pixel; if the absolute value of the phase value of pixel A minus the phase value of pixel B is less than the threshold, then B is a relative pixel of A, otherwise B is an irrelevant pixel of A; next, in this window, if A has more relative pixels than irrelevant pixels, then A is considered to be a "good" pixel; otherwise, it is erroneous; the threshold is selected as π, which is the Nyquist sampling frequency; if it is considered to be a "good" pixel, its corresponding phase value is also normal; if it is an "erroneous" pixel, its corresponding phase value is abnormal.

[0055] S12: obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the phase value abnormality detection result of each pixel in the absolute phase image;

[0056] In the specific implementation process of the present invention, the method of obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the phase value abnormality detection result of each pixel in the absolute phase image includes: performing statistical processing on pixels with phase abnormalities in the phase value abnormality detection result of each pixel in the absolute phase image, and obtaining the number of pixels with abnormal phase values ​​in the absolute phase image according to the statistical results.

[0057] Specifically, statistical processing is performed on pixels with phase abnormalities in the phase value abnormality detection results of each pixel in the absolute phase image, and the number of pixels with phase value abnormalities in the absolute phase image is obtained according to the statistical results; if the number of pixels is greater than 0, median filtering optimization processing needs to be performed, otherwise median filtering optimization processing does not need to be performed.

[0058] S13: When the number of pixels is greater than zero, select a corresponding median filter window in order from a set of median filter windows to perform median filtering on the absolute phase image to obtain a first absolute phase image after median filtering;

[0059] In a specific implementation of the present invention, the method of performing median filtering on the absolute phase image based on sequentially selecting corresponding median filtering windows from a median filtering window set to obtain a first absolute phase image after median filtering comprises: selecting corresponding median filtering windows from the median filtering window set in a manner from small to large to perform median filtering on the absolute phase image to obtain a first absolute phase image after median filtering.

[0060] Specifically, when the number of pixels is greater than zero, median filtering is required, that is, the corresponding median filtering window is selected from the median filtering window set in an ascending order to perform median filtering on the absolute phase image, so as to obtain the first absolute phase image after median filtering; the median filtering window size in the median filtering window set can be s1 = 1x3, s2 = 1x5, s3 = 3x3, s4 = 5x5, s5 = 7x7, etc.; the advantage of selecting the median filtering window from small to large to perform adaptive median filtering is to give priority to a small filter size and eliminate abnormal phase values ​​to the maximum extent, while preventing the negative impact of the window step height.

[0061] S14: Obtaining a first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and outputting the absolute phase image after median filtering as an optimized image according to a preset rule based on the first number of pixels.

[0062] In a specific implementation of the present invention, the obtaining of the first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and outputting the median filtered absolute phase image as an optimized image based on the first number of pixels according to a preset rule, includes: performing abnormality detection processing on the phase values ​​corresponding to the pixels in the first absolute phase image, and obtaining the first number of pixels of pixel pairs with abnormal phase values ​​according to the abnormal phase value monitoring results corresponding to the pixels in the first absolute phase image; judging whether the first number of pixels is equal to zero; if the first number of pixels is equal to zero, outputting the median filtered absolute phase image as an optimized image; if the first number of pixels is not equal to zero, returning to the median filtering processing of the absolute phase image by selecting the corresponding preset median filtering window in sequence based on the median filtering window set, and until the first numbers of pixels with abnormal phase values ​​after three consecutive median filtering processings are the same or all median filtering windows in the combination of median filtering windows are executed, the median filtered absolute phase image is output as an optimized image.

[0063] Specifically, it is necessary to perform abnormal detection processing on the phase values ​​corresponding to the pixels in the first absolute phase image, and obtain the first pixel number of the pixel pairs with abnormal phase values ​​according to the abnormal phase value monitoring results corresponding to the pixels in the first absolute phase image; then determine whether the first pixel number is equal to zero; if it is equal to zero, it is considered that there is no abnormal phase value after the current filtering operation; the absolute phase image after median filtering can be output as an optimized image; if the first pixel number is not equal to zero, return to the median filtering window set based on the corresponding preset median filtering window selected in sequence to perform median filtering processing on the absolute phase image, and until the first numbers of pixels with abnormal phase values ​​after three consecutive median filtering processes are the same or all median filtering windows in the combination of the median filtering windows are executed, the absolute phase image after median filtering is output as an optimized image.

[0064] The number of abnormal phase values ​​detected before filtering is expressed as N0, and the number of abnormal phase values ​​detected after median filtering is expressed as N i ; The stopping criteria for iterative filtering are as follows: ①N i = 0, there is no abnormal phase value after the current filtering operation; ②N i = N i-1 = N i-2 , indicating that the number of outlier phase values ​​has not decreased after three consecutive filtering operations; if this happens, it is considered that further median filtering will no longer be effective.

[0065] In an embodiment of the present invention, by obtaining an absolute phase image after phase unwrapping, an abnormal detection process is performed on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and the phase value abnormal detection result of each pixel in the absolute phase image is obtained; the number of pixels with abnormal phase values ​​in the absolute phase image is obtained based on the phase value abnormal detection result of each pixel in the absolute phase image; when the number of pixels is greater than zero, the absolute phase image is subjected to median filtering based on the corresponding median filtering window selected in sequence from the median filtering window set, and the first absolute phase image after median filtering is obtained; the first number of pixels corresponding to the pixels with abnormal phase values ​​in the first absolute phase image is obtained, and the absolute phase image after median filtering is output as an optimized image based on the first number of pixels according to a preset rule. The optimization of the abnormal phase values ​​that appear in the absolute phase image during phase unwrapping is achieved, the abnormal phase values ​​are eliminated, and the accuracy and reliability of phase measurement are improved; and the method has good robustness, can cope with different types of unwrapping errors, and achieves good results.

[0066] For example 2, please refer to Figure 2 , Figure 2 It is a schematic diagram of the structural composition of the absolute phase image optimization device of the adaptive median filter in the embodiment of the present invention.

[0067] like Figure 2 As shown, an absolute phase image optimization device for adaptive median filtering, the device comprising:

[0068] Anomaly detection module 21: used to obtain an absolute phase image after phase unwrapping, perform anomaly detection processing on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and obtain an abnormal phase value detection result of each pixel in the absolute phase image;

[0069] In the specific implementation process of the present invention, the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal is subjected to abnormal detection processing to obtain the phase value abnormality detection result of each pixel in the absolute phase image, including: obtaining the current pixel in the absolute phase image, and performing local image division processing with the current pixel as the center according to a preset size window to obtain the local image area corresponding to the current pixel; classifying the other pixels in the local image area except the current pixel to obtain a pixel classification result, wherein the pixel classification result includes related pixels and irrelevant pixels; performing abnormal detection processing on the phase value of the current pixel according to the pixel classification result to obtain the phase value abnormality detection result of the current pixel; generating the phase value abnormality detection result of each pixel in the absolute phase image according to the phase value abnormality detection result of the current pixel.

[0070] Furthermore, the classification processing of pixels other than the current pixel in the local image area to obtain a pixel classification result includes: subtracting a phase value corresponding to the current pixel in the local image area from a phase value corresponding to any pixel in the other pixels to obtain a subtraction result; performing pixel classification processing based on whether the absolute value of the subtraction result is less than a preset threshold to obtain a pixel classification result; wherein if the absolute value of the subtraction result is less than the preset threshold, the arbitrary pixel is classified as a related pixel; if the absolute value of the subtraction result is greater than or equal to the preset threshold, the arbitrary pixel is classified as an unrelated pixel.

[0071] Furthermore, performing abnormality detection processing on the phase value of the current pixel according to the pixel classification result to obtain an abnormality detection result of the phase value of the current pixel includes: obtaining a third number corresponding to related pixels and a fourth number corresponding to irrelevant pixels in the pixel classification result; performing abnormality detection processing on the phase value corresponding to the current pixel based on whether the third number is greater than the fourth number to obtain an abnormality detection result of the phase value of the current pixel; wherein when the third number is greater than the fourth number, it is confirmed that the phase value corresponding to the current pixel is not an abnormal phase value; when the third number is less than or equal to the fourth number, it is confirmed that the phase value corresponding to the current pixel is an abnormal phase value.

[0072] Specifically, the absolute phase image formed during phase unwrapping needs to be subjected to abnormal detection of the phase value in the absolute phase image during phase unwrapping, that is, abnormal phase values ​​are detected to facilitate subsequent phase optimization processing; in order to perform abnormal phase value detection, it is first necessary to select any pixel in the absolute phase image as the current pixel (select each pixel point in the absolute phase image in turn in this way), and then perform local image division processing with the current pixel as the center according to a preset size window, and obtain the local image area corresponding to the current pixel; then it is necessary to classify the other pixels in the local image area except the current pixel, where the classification is to classify the other pixels as related pixels or unrelated pixels, that is, to obtain pixel classification results, and the pixel classification results include related pixels and unrelated pixels; and according to the pixel classification results, the phase value of the current pixel is subjected to abnormal detection processing to obtain the abnormal phase value detection result of the current pixel, and the phase value abnormality detection result of each pixel in the absolute phase image is generated according to the abnormal phase value detection result of the current pixel.

[0073] When performing classification processing, firstly, the phase value corresponding to the current pixel in the local image area is subtracted from the phase value corresponding to any pixel in other pixels to obtain a subtraction result; and pixel classification processing is performed according to whether the absolute value of the subtraction result is less than a preset threshold, so as to obtain a pixel classification result; if the absolute value of the subtraction result is less than the preset threshold, any pixel is classified as a related pixel; if the absolute value of the subtraction result is greater than or equal to the preset threshold, any pixel is classified as an unrelated pixel.

[0074] When performing anomaly detection, it is necessary to obtain a third number corresponding to related pixels and a fourth number corresponding to irrelevant pixels in the pixel classification result; then determine whether the third number is greater than the fourth number, and perform anomaly detection processing on the phase value corresponding to the current pixel by determining whether the third number is greater than the fourth number to obtain an abnormal phase value detection result of the current pixel; when the third number is greater than the fourth number, it is confirmed that the phase value corresponding to the current pixel is not an abnormal phase value; when the third number is less than or equal to the fourth number, it is confirmed that the phase value corresponding to the current pixel is an abnormal phase value.

[0075] That is, in the absolute phase image, a window of a specified size is selected as its local area by taking the current pixel A as the center; for an erroneous pixel, its unfolding error should be a multiple of 2π; therefore, in a local area, the phase values ​​of an erroneous pixel and a good pixel are completely different, while the phase values ​​of two good pixels are similar; using this property, any pixel B in the window is first classified as a relative pixel or an irrelevant pixel; if the absolute value of the phase value of pixel A minus the phase value of pixel B is less than the threshold, then B is a relative pixel of A, otherwise B is an irrelevant pixel of A; next, in this window, if A has more relative pixels than irrelevant pixels, then A is considered to be a "good" pixel; otherwise, it is erroneous; the threshold is selected as π, which is the Nyquist sampling frequency; if it is considered to be a "good" pixel, its corresponding phase value is also normal; if it is an "erroneous" pixel, its corresponding phase value is abnormal.

[0076] A quantity acquisition module 22 is used for obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the abnormal phase value detection result of each pixel in the absolute phase image when the number of pixels is greater than zero;

[0077] In the specific implementation process of the present invention, the method of obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the phase value abnormality detection result of each pixel in the absolute phase image includes: performing statistical processing on pixels with phase abnormalities in the phase value abnormality detection result of each pixel in the absolute phase image, and obtaining the number of pixels with abnormal phase values ​​in the absolute phase image according to the statistical results.

[0078] Specifically, statistical processing is performed on pixels with phase abnormalities in the phase value abnormality detection results of each pixel in the absolute phase image, and the number of pixels with phase value abnormalities in the absolute phase image is obtained according to the statistical results; if the number of pixels is greater than 0, median filtering optimization processing needs to be performed, otherwise median filtering optimization processing does not need to be performed.

[0079] Median filtering module 23: used for performing median filtering processing on the absolute phase image based on sequentially selecting a corresponding median filtering window from a median filtering window set to obtain a first absolute phase image after median filtering;

[0080] In a specific implementation of the present invention, the method of performing median filtering on the absolute phase image based on sequentially selecting corresponding median filtering windows from a median filtering window set to obtain a first absolute phase image after median filtering comprises: selecting corresponding median filtering windows from the median filtering window set in a manner from small to large to perform median filtering on the absolute phase image to obtain a first absolute phase image after median filtering.

[0081] Specifically, when the number of pixels is greater than zero, median filtering is required, that is, the corresponding median filtering window is selected from the median filtering window set in an ascending order to perform median filtering on the absolute phase image, so as to obtain the first absolute phase image after median filtering; the median filtering window size in the median filtering window set can be s1 = 1x3, s2 = 1x5, s3 = 3x3, s4 = 5x5, s5 = 7x7, etc.; the advantage of selecting the median filtering window from small to large to perform adaptive median filtering is to give priority to a small filter size and eliminate abnormal phase values ​​to the maximum extent, while preventing the negative impact of the window step height.

[0082] Image output module 24: used to obtain the first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and output the absolute phase image after median filtering as an optimized image according to a preset rule based on the first number of pixels.

[0083] In a specific implementation of the present invention, the obtaining of the first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and outputting the median filtered absolute phase image as an optimized image based on the first number of pixels according to a preset rule, includes: performing abnormality detection processing on the phase values ​​corresponding to the pixels in the first absolute phase image, and obtaining the first number of pixels of pixel pairs with abnormal phase values ​​according to the abnormal phase value monitoring results corresponding to the pixels in the first absolute phase image; judging whether the first number of pixels is equal to zero; if the first number of pixels is equal to zero, outputting the median filtered absolute phase image as an optimized image; if the first number of pixels is not equal to zero, returning to the median filtering processing of the absolute phase image by selecting the corresponding preset median filtering window in sequence based on the median filtering window set, and until the first numbers of pixels with abnormal phase values ​​after three consecutive median filtering processings are the same or all median filtering windows in the combination of median filtering windows are executed, the median filtered absolute phase image is output as an optimized image.

[0084] Specifically, it is necessary to perform abnormal detection processing on the phase values ​​corresponding to the pixels in the first absolute phase image, and obtain the first pixel number of the pixel pairs with abnormal phase values ​​according to the abnormal phase value monitoring results corresponding to the pixels in the first absolute phase image; then determine whether the first pixel number is equal to zero; if it is equal to zero, it is considered that there is no abnormal phase value after the current filtering operation; the absolute phase image after median filtering can be output as an optimized image; if the first pixel number is not equal to zero, return to the median filtering window set based on the corresponding preset median filtering window selected in sequence to perform median filtering processing on the absolute phase image, and until the first numbers of pixels with abnormal phase values ​​after three consecutive median filtering processes are the same or all median filtering windows in the combination of the median filtering windows are executed, the absolute phase image after median filtering is output as an optimized image.

[0085] The number of abnormal phase values ​​detected before filtering is expressed as N0, and the number of abnormal phase values ​​detected after median filtering is expressed as N i ; The stopping criteria for iterative filtering are as follows: ①N i = 0, there is no abnormal phase value after the current filtering operation; ②N i = N i-1 = N i-2 , indicating that the number of outlier phase values ​​has not decreased after three consecutive filtering operations; if this happens, it is considered that further median filtering will no longer be effective.

[0086] In an embodiment of the present invention, by obtaining an absolute phase image after phase unwrapping, an abnormal detection process is performed on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and the phase value abnormal detection result of each pixel in the absolute phase image is obtained; the number of pixels with abnormal phase values ​​in the absolute phase image is obtained based on the phase value abnormal detection result of each pixel in the absolute phase image; when the number of pixels is greater than zero, the absolute phase image is subjected to median filtering based on the corresponding median filtering window selected in sequence from the median filtering window set, and the first absolute phase image after median filtering is obtained; the first number of pixels corresponding to the pixels with abnormal phase values ​​in the first absolute phase image is obtained, and the absolute phase image after median filtering is output as an optimized image based on the first number of pixels according to a preset rule. The optimization of the abnormal phase values ​​that appear in the absolute phase image during phase unwrapping is achieved, the abnormal phase values ​​are eliminated, and the accuracy and reliability of phase measurement are improved; and the method has good robustness, can cope with different types of unwrapping errors, and achieves good results.

[0087] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the absolute phase image optimization method of any one of the above embodiments is implemented. The computer-readable storage medium includes, but is not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (EraSable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the storage device includes any medium that can store or transmit information in a readable form by a device (for example, a computer, a mobile phone), which can be a read-only memory, a disk or an optical disk, etc.

[0088] An embodiment of the present invention further provides a computer application program, which runs on a computer and is used to execute the absolute phase image optimization method of any one of the above embodiments.

[0089] also, Figure 3 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention.

[0090] The embodiment of the present invention further provides an electronic device, such as Figure 3The electronic device includes a processor 302, a memory 303, an input unit 304, a display unit 305 and other devices. Those skilled in the art will understand that Figure 3 The electronic device structure device shown does not constitute a limitation on all devices, and may include more or fewer components than shown, or combine certain components. The memory 303 can be used to store the application 301 and various functional modules, and the processor 302 runs the application 301 stored in the memory 303, thereby executing various functional applications and data processing of the device. The memory can be an internal memory or an external memory, or include both internal and external memories. The internal memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), a flash memory, or a random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a U disk, a magnetic tape, etc. The memory disclosed in the present invention includes but is not limited to these types of memories. The memory disclosed in the present invention is only used as an example and not as a limitation.

[0091] The input unit 304 is used to receive the input of signals and keywords input by the user. The input unit 304 may include a touch panel and other input devices. The touch panel can collect the touch operations of the user on or near it, and drive the corresponding connection device according to a pre-set program; other input devices may include but are not limited to one or more of a physical keyboard, function keys (such as playback control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc. The display unit 305 can be used to display the information input by the user or the information provided to the user and various menus of the terminal device. The display unit 305 can be in the form of a liquid crystal display, an organic light emitting diode, etc. The processor 302 is the control center of the terminal device, which uses various interfaces and lines to connect various parts of the entire device, and executes various functions and processes data by running or executing software programs and / or modules stored in the memory 303, and calling data stored in the memory.

[0092] As an embodiment, the electronic device includes: one or more processors 302, a memory 303, and one or more applications 301, wherein the one or more applications 301 are stored in the memory 303 and are configured to be executed by the one or more processors 302, and the one or more applications 301 are configured to execute the absolute phase image optimization method in any one of the above-mentioned embodiments.

[0093] In an embodiment of the present invention, by obtaining an absolute phase image after phase unwrapping, an abnormal detection process is performed on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and the phase value abnormal detection result of each pixel in the absolute phase image is obtained; the number of pixels with abnormal phase values ​​in the absolute phase image is obtained based on the phase value abnormal detection result of each pixel in the absolute phase image; when the number of pixels is greater than zero, the absolute phase image is subjected to median filtering based on the corresponding median filtering window selected in sequence from the median filtering window set, and the first absolute phase image after median filtering is obtained; the first number of pixels corresponding to the pixels with abnormal phase values ​​in the first absolute phase image is obtained, and the absolute phase image after median filtering is output as an optimized image based on the first number of pixels according to a preset rule. The optimization of the abnormal phase values ​​that appear in the absolute phase image during phase unwrapping is achieved, the abnormal phase values ​​are eliminated, and the accuracy and reliability of phase measurement are improved; and the method has good robustness, can cope with different types of unwrapping errors, and achieves good results.

[0094] In addition, the above is a detailed introduction to the absolute phase image optimization method and related devices of an adaptive median filter provided in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An absolute phase image optimization method based on adaptive median filtering, It is characterized in that The method comprises: Obtaining an absolute phase image after phase unwrapping, performing abnormality detection processing on a phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and obtaining a phase value abnormality detection result for each pixel in the absolute phase image; Obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the phase value abnormality detection result of each pixel in the absolute phase image; When the number of pixels is greater than zero, selecting a corresponding median filter window in order from a set of median filter windows to perform median filtering on the absolute phase image to obtain a first absolute phase image after median filtering; Obtaining a first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and outputting the absolute phase image after median filtering as an optimized image according to a preset rule based on the first number of pixels; The obtaining of a first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and outputting the absolute phase image after median filtering as an optimized image according to a preset rule based on the first number of pixels, includes: Performing abnormality detection processing on phase values ​​corresponding to pixels in the first absolute phase image, and obtaining a first number of pixels of pixel pairs with abnormal phase values ​​according to abnormal monitoring results of phase values ​​corresponding to pixels in the first absolute phase image; Determining whether the first number of pixels is equal to zero; If the first number of pixels is equal to zero, the absolute phase image after median filtering is output as an optimized image; If the first number of pixels is not equal to zero, return to performing median filtering processing on the absolute phase image based on sequentially selecting the corresponding preset median filtering window in the median filtering window set, and until the first numbers of pixels with abnormal phase values ​​corresponding to three consecutive median filtering processes are the same or all median filtering windows in the combination of the median filtering windows are executed, the absolute phase image after median filtering is output as an optimized image.

2. The absolute phase image optimization method according to claim 1, It is characterized in that The performing abnormality detection processing on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal to obtain the abnormality detection result of the phase value of each pixel in the absolute phase image includes: Obtaining a current pixel in the absolute phase image, and performing local image division processing with the current pixel as the center according to a preset size window to obtain a local image area corresponding to the current pixel; Classify the pixels other than the current pixel in the local image area to obtain a pixel classification result, wherein the pixel classification result includes related pixels and irrelevant pixels; Performing anomaly detection processing on the phase value of the current pixel according to the pixel classification result to obtain an anomaly detection result of the phase value of the current pixel; The phase value abnormality detection result of each pixel in the absolute phase image is generated according to the phase value abnormality detection result of the current pixel.

3. The absolute phase image optimization method according to claim 2, It is characterized in that The classifying the pixels other than the current pixel in the local image area to obtain the pixel classification result includes: Subtracting the phase value corresponding to the current pixel in the local image area from the phase value corresponding to any other pixel to obtain a subtraction result; Pixel classification processing is performed based on whether the absolute value of the subtraction result is less than a preset threshold to obtain a pixel classification result; if the absolute value of the subtraction result is less than the preset threshold, the arbitrary pixel is classified as a related pixel; if the absolute value of the subtraction result is greater than or equal to the preset threshold, the arbitrary pixel is classified as an unrelated pixel.

4. The absolute phase image optimization method according to claim 2, It is characterized in that The performing abnormality detection processing on the phase value of the current pixel according to the pixel classification result to obtain the abnormality detection result of the phase value of the current pixel includes: Obtaining a third number corresponding to related pixels and a fourth number corresponding to irrelevant pixels in the pixel classification result; Based on whether the third number is greater than the fourth number, an abnormality detection process is performed on the phase value corresponding to the current pixel to obtain an abnormality detection result of the phase value of the current pixel; when the third number is greater than the fourth number, it is confirmed that the phase value corresponding to the current pixel is not an abnormal phase value; when the third number is less than or equal to the fourth number, it is confirmed that the phase value corresponding to the current pixel is an abnormal phase value.

5. The absolute phase image optimization method according to claim 1, It is characterized in that The obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the phase value abnormality detection result of each pixel in the absolute phase image comprises: Statistical processing is performed on pixels with phase abnormalities in the phase value abnormality detection result of each pixel in the absolute phase image, and the number of pixels with phase value abnormalities in the absolute phase image is obtained according to the statistical result.

6. The absolute phase image optimization method according to claim 1, It is characterized in that The step of selecting a corresponding median filter window in sequence from a set of median filter windows to perform median filtering on the absolute phase image to obtain a first absolute phase image after median filtering comprises: A corresponding median filter window is selected from the median filter window set in a manner from small to large to perform median filtering on the absolute phase image, so as to obtain a first absolute phase image after median filtering.

7. An absolute phase image optimization device with adaptive median filtering, It is characterized in that The device comprises: Anomaly detection module: used to obtain the absolute phase image after phase unwrapping, perform anomaly detection processing on the phase value corresponding to each pixel of the absolute phase image when the phase unwrapping is abnormal, and obtain the phase value abnormality detection result of each pixel in the absolute phase image; A quantity acquisition module: used for obtaining the number of pixels with abnormal phase values ​​in the absolute phase image based on the abnormal phase value detection result of each pixel in the absolute phase image when the number of pixels is greater than zero; Median filtering module: used for performing median filtering processing on the absolute phase image based on sequentially selecting a corresponding median filtering window from a median filtering window set to obtain a first absolute phase image after median filtering; An image output module: used for obtaining a first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and outputting the absolute phase image after median filtering as an optimized image according to a preset rule based on the first number of pixels; The obtaining of a first number of pixels corresponding to pixels with abnormal phase values ​​in the first absolute phase image, and outputting the absolute phase image after median filtering as an optimized image according to a preset rule based on the first number of pixels, includes: Performing abnormality detection processing on phase values ​​corresponding to pixels in the first absolute phase image, and obtaining a first number of pixels of pixel pairs with abnormal phase values ​​according to abnormal monitoring results of phase values ​​corresponding to pixels in the first absolute phase image; Determining whether the first number of pixels is equal to zero; If the first number of pixels is equal to zero, the absolute phase image after median filtering is output as an optimized image; If the first number of pixels is not equal to zero, return to performing median filtering processing on the absolute phase image based on sequentially selecting the corresponding preset median filtering window in the median filtering window set, and until the first numbers of pixels with abnormal phase values ​​corresponding to three consecutive median filtering processes are the same or all median filtering windows in the combination of the median filtering windows are executed, the absolute phase image after median filtering is output as an optimized image.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the absolute phase image optimization method as described in any one of claims 1 to 6 is implemented.

9. An electronic device, It is characterized in that The electronic device comprises: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to: execute the absolute phase image optimization method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for filtering image data

    CN112614065A

  • Grating phase diagram processing method and device, electronic equipment and storage medium

    CN112766256A

  • Refractory brick surface defect detection method based on grating projection

    CN114280058A

  • Phase unwrapping method based on light field multi-view constraint and related assembly

    CN114897959A

  • Class determination system, class determination method, and class determination program

    EP4033404A1