Polarization image region growing specular reflection repair method and device

By calculating the grayscale ratio of polarized images and using region growing methods, the specular reflection region is automatically detected and repaired, solving the processing difficulties in complex scenes in existing technologies, improving image processing efficiency and accuracy, and adapting to the needs of a large number of samples.

CN119521014BActive Publication Date: 2025-12-09WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411396113.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-12-09
Estimated Expiration
2044-10-08

AI Technical Summary

Technical Problem

Existing technologies struggle to adapt to complex or changing scenarios when processing specular reflections in polarized images. They require manual adjustments, which are time-consuming and labor-intensive. Furthermore, the accuracy of specular reflection area recognition is lacking, affecting the overall image analysis results. Additionally, different polarized images may require independent threshold settings, making it difficult to handle the processing needs of a large number of samples.

Method used

By calculating the grayscale ratio of the initial specular reflection region of the target polarization image, the specular reflection threshold is determined, and region growth is performed based on this threshold. The system then checks whether the preset conditions are met and repairs the specular reflection region, thus achieving automatic detection and repair.

Benefits of technology

It enables automatic detection and repair of specular reflection areas in polarized images, reducing manual intervention, improving image processing efficiency and accuracy, reducing computational costs, effectively processing large amounts of polarized image data, and ensuring the accuracy of specular reflection removal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119521014B_ABST
    Figure CN119521014B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image restoration, in particular to a polarized image region growth mirror reflection restoration method and device, wherein the method comprises the following steps: calculating the gray scale proportion of an initial mirror reflection region of a target polarized image to obtain a mirror reflection threshold value of the initial mirror reflection region; determining at least one growth initial point according to the mirror reflection threshold value to grow the initial mirror reflection region and obtain a grown mirror reflection region; in the case that the grown mirror reflection region meets a preset condition, stopping growing the initial mirror reflection region and restoring each image element of the grown mirror reflection region to eliminate the grown mirror reflection region. The application can realize automatic detection and restoration of the mirror reflection region in the polarized image, greatly reduces manual intervention, improves the efficiency and precision of image processing, reduces the computer computing power and computing cost requirements, and can effectively process a large amount of polarized image data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image inpainting, and particularly relates to a polarized image region growing mirror reflection inpainting method and device. BACKGROUND

[0002] In the related art, the traditional method is a fixed threshold method or an edge detection technique. The fixed threshold method can distinguish the mirror reflection region and other regions by setting a fixed pixel value threshold, and then process the mirror reflection region when processing the mirror reflection in the polarized image. The edge detection technique is mainly used to detect the edge information in the image, that is, the position where the brightness or color in the image changes significantly. When processing the mirror reflection in the polarized image, the edge detection technique can help us more accurately identify the boundary between the mirror reflection region and other regions. In the polarized image, the mirror reflection region often has different polarization characteristics from other regions. Therefore, polarization information can be used to enhance the effect of edge detection. For example, a polarization filter can be used to reduce the influence of the mirror reflection component, so as to more accurately detect the edge information.

[0003] However, the method in the related art is only applicable to simple scenes in most cases, and when processing complex or changing scenes, manual adjustment is often required, which is time-consuming and laborious and difficult to meet the large-scale image processing demand. The accuracy of the recognition result of the mirror reflection region is also lacking, thereby affecting the overall image analysis result, and different polarized images may need independent threshold setting, which is difficult to meet the processing demand of the mirror reflection region of the polarized image when the number of samples is large, and needs to be solved urgently. SUMMARY

[0004] The present application provides a polarized image region growing mirror reflection inpainting method and device to solve the problems that the method in the related art is only applicable to simple scenes in most cases, and when processing complex or changing scenes, manual adjustment is often required, which is time-consuming and laborious and difficult to meet the large-scale image processing demand. The accuracy of the recognition result of the mirror reflection region is also lacking, thereby affecting the overall image analysis result, and different polarized images may need independent threshold setting, which is difficult to meet the processing demand of the mirror reflection region of the polarized image when the number of samples is large.

[0005] The first aspect embodiment of the present application provides a polarized image region growing mirror reflection repair method, comprising the following steps: calculating the gray scale proportion of the initial mirror reflection region of the target polarized image to obtain the mirror reflection threshold of the initial mirror reflection region; determining at least one growing initial point according to the mirror reflection threshold, growing the initial mirror reflection region based on the at least one growing initial point to obtain a grown mirror reflection region; detecting whether the grown mirror reflection region meets a preset condition, and in the case that it is detected that the grown mirror reflection region meets the preset condition, stopping growing the initial mirror reflection region and repairing each pixel of the grown mirror reflection region to eliminate the grown mirror reflection region.

[0006] Optionally, in an embodiment of the present application, the calculation of the gray scale proportion of the initial mirror reflection region of the target polarized image comprises: identifying the initial mirror reflection region in the target polarized image; counting the gray scale values of the pixels of the initial mirror reflection region; and calculating the gray scale proportion according to the gray scale values.

[0007] Optionally, in an embodiment of the present application, the determination of the at least one growing initial point according to the mirror reflection threshold, the growing of the initial mirror reflection region based on the at least one growing initial point, and the obtaining of the grown mirror reflection region comprise: calculating the gray scale interpolation of a plurality of adjacent pixels around the at least one growing initial point; and performing region growing on the initial mirror reflection region based on the at least one growing initial point and the gray scale interpolation to obtain the grown mirror reflection region.

[0008] Optionally, in an embodiment of the present application, before stopping growing the initial mirror reflection region, the method further comprises: calculating the adjacent point gray scale interpolation of the edge of the grown mirror reflection region; detecting the gray scale value of the edge of the grown mirror reflection region; and determining whether the grown mirror reflection region meets the preset condition based on the adjacent point gray scale interpolation and the gray scale value.

[0009] Optionally, in an embodiment of the present application, the calculation formula of the gray scale proportion can be expressed as:

[0010]

[0011] wherein r an is the proportion of the gray scale of the point an in the entire two-dimensional polarized image, an is each pixel in the point set {(a1(i+Δi,j+Δj),a2(i+Δi,j+Δj),…an(i+Δi,h+Δj)}, n GrayValue is the number of pixels with the gray scale value GrayValue, n all is the number of pixels of the entire image.

[0012] The second aspect embodiment of the present application provides a polarized image region growing mirror reflection repair device, comprising: a first calculation module, configured to calculate a gray scale proportion of an initial mirror reflection region of a target polarized image to obtain a mirror reflection threshold of the initial mirror reflection region; a region growing module, configured to determine at least one growing initial point according to the mirror reflection threshold, grow the initial mirror reflection region based on the at least one growing initial point to obtain a grown mirror reflection region; and a repair module, configured to detect whether the grown mirror reflection region meets a preset condition, and stop growing the initial mirror reflection region and repair each pixel of the grown mirror reflection region to eliminate the grown mirror reflection region in a case where it is detected that the grown mirror reflection region meets the preset condition.

[0013] Optionally, in an embodiment of the present application, the calculation module comprises: an identification unit, configured to identify an initial mirror reflection region in the target polarized image; a statistical unit, configured to count gray scale values of pixels of the initial mirror reflection region; and a first calculation unit, configured to calculate the gray scale proportion according to the gray scale values.

[0014] Optionally, in an embodiment of the present application, the region growing module comprises: a second calculation unit, configured to calculate gray scale interpolation values of a plurality of adjacent pixels around the at least one growing initial point; and a region growing unit, configured to perform region growing on the initial mirror reflection region based on the at least one growing initial point and the gray scale interpolation values to obtain the grown mirror reflection region.

[0015] Optionally, in an embodiment of the present application, further comprising: a second calculation module, configured to calculate adjacent point gray scale interpolation values of an edge of the grown mirror reflection region before stopping growing the initial mirror reflection region; a detection module, configured to detect gray scale values of the edge of the grown mirror reflection region; and a determination module, configured to determine whether the grown mirror reflection region meets a preset condition based on the adjacent point gray scale interpolation values and the gray scale values.

[0016] Optionally, in an embodiment of the present application, a calculation formula of the gray scale proportion can be expressed as:

[0017]

[0018] wherein, r an is a proportion of the gray scale of the point an in the entire two-dimensional polarized image, an is each pixel in the point set {(a1(i+Δi,j+Δj),a2(i+Δi,j+Δj),…an(i+Δi,j+Δj)}, n GrayValuen is the number of pixels whose gray value is GrayValue, n all n is the number of pixels of the whole image.

[0019] The third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the polarized image region growing mirror reflection repair method as described in the above embodiments.

[0020] The fourth aspect of the present application provides a computer readable storage medium, which stores a computer program, wherein the program is executed by a processor to implement the polarized image region growing mirror reflection repair method as described above.

[0021] The fifth aspect of the present application provides a computer program product, comprising a computer program, wherein the computer program is executed to implement the polarized image region growing mirror reflection repair method as described above.

[0022] The embodiments of the present application can determine the mirror reflection threshold of the initial mirror reflection region and then determine the growing initial point to perform region growing on the initial mirror reflection region, eliminate the grown mirror reflection region, and repair the target polarized image. Thus, the automatic detection and repair of the mirror reflection region in the polarized image are realized, the manual intervention is greatly reduced, the efficiency and accuracy of image processing are improved, the particularity of the polarized image is fully considered, the requirements of computer computing power and computing cost are reduced, a large amount of polarized image data can be effectively processed, and the accuracy of the mirror reflection removal effect in the processed polarized image can be effectively guaranteed. Thus, the problems in the related art are solved, such as the method in the related art is only applicable to simple scenes in most cases, manual adjustment is often required when processing complex or changing scenes, time and effort are wasted, the large-scale image processing demand cannot be met, the accuracy of the recognition result of the mirror reflection region is insufficient, the overall image analysis result is affected, different polarized images may require independent threshold setting, and the processing demand of the mirror reflection region of the polarized image when the number of samples is large cannot be met.

[0023] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS

[0024] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the accompanying drawings, wherein:

[0025] Figure 1 A schematic diagram of the framework of the polarized image region growing mirror reflection repair of an embodiment of the present application;

[0026] Figure 2 A flowchart of a polarized image region growing mirror reflection repair method according to an embodiment of the present application is provided.

[0027] Figure 3 A flowchart of determining a mirror reflection threshold according to an embodiment of the present application is provided.

[0028] Figure 4 A flowchart of mirror reflection region growing and repair according to an embodiment of the present application is provided.

[0029] Figure 5 A flowchart of repair result verification according to an embodiment of the present application is provided.

[0030] Figure 6 A structure diagram of a polarized image region growing mirror reflection repair device according to an embodiment of the present application is provided.

[0031] Figure 7 A structure diagram of an electronic device according to an embodiment of the present application is provided.

[0032] Reference signs:

[0033] 10 - polarized image region growing mirror reflection repair device: 100 - first calculation module, 200 - region growing module, and 300 - repair module; 701 - memory, 702 - processor, and 703 - communication interface. DETAILED DESCRIPTION

[0034] Embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference signs represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as limiting the present application.

[0035] A polarized image region growing mirror reflection repair method and device of an embodiment of the present application are described below with reference to the accompanying drawings. The method in the related art mentioned in the background art is only applicable to simple scenes in most cases, and manual adjustment is often required when processing complex or changing scenes, which is time-consuming and laborious and difficult to meet the large-scale image processing requirements. The accuracy of the recognition result of the mirror reflection region is also lacking, thereby affecting the overall image analysis result. Different polarized images may require independent threshold setting, and it is difficult to cope with the processing requirements of the mirror reflection region of the polarized image when the number of samples is large. The present application provides a polarized image region growing mirror reflection repair method. In the method, the mirror reflection threshold of the initial mirror reflection region can be determined to determine the growing initial point, so as to perform region growing on the initial mirror reflection region, eliminate the grown mirror reflection region, and repair the target polarized image. Thus, automatic detection and repair of the mirror reflection region in the polarized image are realized, manual intervention is greatly reduced, the efficiency and accuracy of image processing are improved, the particularity of the polarized image is fully considered, the requirements of computer power and computing cost are reduced, a large amount of polarized image data can be effectively processed, and the accuracy of the mirror reflection removal effect in the processed polarized image can be effectively guaranteed. Thus, the method in the related art is only applicable to simple scenes in most cases, and manual adjustment is often required when processing complex or changing scenes, which is time-consuming and laborious and difficult to meet the large-scale image processing requirements. The accuracy of the recognition result of the mirror reflection region is also lacking, thereby affecting the overall image analysis result. Different polarized images may require independent threshold setting, and it is difficult to cope with the processing requirements of the mirror reflection region of the polarized image when the number of samples is large.

[0036] Before the polarized image region growing mirror reflection repair method in the embodiment of the present application is explained, the framework of the polarized image region growing mirror reflection repair in the embodiment of the present application is explained.

[0037] In modern medical imaging and related scientific research, polarized images can provide important information about the surface characteristics, material and structure of an object, which is often not easy to observe in non-polarized light images. Using Mueller matrix and its derivative parameters is a relatively complete representation method of polarization information of biological tissues, which is called "fingerprint" of optical properties of biological tissues. However, one of the main challenges of polarization imaging technology is the interference of mirror reflection. Mirror reflection not only distorts the true color in the image, but also hides or changes important details in the image, affecting subsequent image analysis and processing, resulting in misjudgment or omission of results.

[0038] In conventional unpolarized images, specular reflection is typically related to the intensity and angle of the incident light, as well as the surface characteristics of the object. Under the same incident light intensity, the specular reflection area produced in an unpolarized image is the same. However, in polarized images, the processing complexity of specular reflection increases significantly because the reflection of polarized light is not only affected by the surface characteristics of the object but also closely related to its polarization properties. This means that the same object can produce reflections of different intensities and characteristics under different polarization states. Especially when acquiring polarized images of fresh samples, the sample's thickness and other physical properties often lead to significant specular reflections, which cannot accurately reflect the true polarization characteristics of the sample area in the image.

[0039] For the same sample, the acquired polarization images are typically multiple backscattered images captured by rotating the waveplate of the optical device to change the polarization of the incident light. If specular reflection occurs, it usually manifests as a white spot at the same location in multiple images, with the corresponding grayscale values ​​distributed in the high grayscale range. This replaces the original scattering results for incident light with different polarizations; that is, the sample loses information about the intensity of polarized light in that region. Therefore, areas where specular reflection occurs severely affect subsequent calculations of the Mueller matrix and polarization decomposition. This is because the Mueller matrix reflects the polarization characteristics of the object, while specular reflection is unrelated to these characteristics. Furthermore, using the Lu-Chipman method for polarization decomposition can lead to singular values ​​in the parameter matrix, making it irreversible and preventing subsequent calculations. Without proper preprocessing of these polarization images, the results of the Mueller matrix and polarization decomposition may be incomplete, resulting in the loss of important image information.

[0040] Figure 1 This is a schematic diagram illustrating the framework for specular reflection repair of a polarized image region growing method according to an embodiment of this application. Figure 1 As shown, this embodiment of the application, based on a fresh sample polarization image affected by specular reflection, calculates an initial specular reflection threshold for the initial specular reflection region using an adaptive threshold algorithm. Then, based on this initial specular reflection threshold, a region growing algorithm is used to grow the initial specular reflection region, resulting in a polarization image of the specular reflection region after region growing. A verification algorithm is then used to check whether the specular reflection region meets the conditions. If it does not meet the conditions and fails the verification, the region growing and verification processes are repeated. If it passes the verification and meets the conditions, the specular reflection region of the polarization image is repaired, resulting in a processed polarization image.

[0041] Specifically, Figure 2 This is a flowchart of a method for repairing specular reflections in a polarized image region, provided as an embodiment of this application.

[0042] like Figure 2As shown, the polarized image region growing specular reflection repair method comprises the following steps:

[0043] In step S201, the gray scale proportion of the initial specular reflection region of the target polarized image is calculated to obtain the specular reflection threshold of the initial specular reflection region.

[0044] It can be understood that the target polarized image herein can be understood as a polarized image in which the specular reflection region of the image needs to be repaired.

[0045] In some embodiments, specular reflection is prone to occur in some polarized images, especially in the polarized images of some fresh tissue samples, specular reflection is more obvious, and important image information is easily lost. Directly processing the specular reflection region is easy to mistake some diffuse reflection regions as specular reflection or the recognized specular reflection region fails to completely cover the real specular reflection region, therefore, the embodiments of the present application can expand from the specular reflection region when repairing the specular reflection in the polarized image.

[0046] Specifically, the embodiments of the present application can first calculate the gray scale proportion of the initial specular reflection region in the target polarized image, and then obtain the specular reflection threshold of the initial specular reflection region. It should be noted that the initial specular reflection region herein can be understood as the initial specular reflection region directly recognized by related technologies or related computer software technologies.

[0047] Next, the process of calculating the gray scale proportion of the initial specular reflection region of the target polarized image is further described.

[0048] Optionally, in an embodiment of the present application, calculating the gray scale proportion of the initial specular reflection region of the target polarized image comprises: identifying the initial specular reflection region in the target polarized image; counting the gray scale values of the image elements of the initial specular reflection region; and calculating the gray scale proportion according to the gray scale values.

[0049] In actual execution process, when calculating the gray scale proportion of the initial specular reflection region of the target polarized image, the present application needs to first identify the initial specular reflection region of the target polarized image, and then count the gray scale values of all the image elements of the initial specular reflection region, and calculate the gray scale proportion of the initial specular reflection region in the target polarized image according to the gray scale values.

[0050] Taking a fresh mouse tissue sample containing a bone tumor as an example, the surface of this tissue sample is uneven, and specular reflection will occur in certain areas during polarization image acquisition, which will appear as overexposed spots or white spots with abnormally high gray values ​​in the image. For this fresh mouse tissue sample, the information in the image acquired by the optical device is the scattered light intensity information of the sample, which can be mapped as gray values ​​and stored in an 8-bit space. Next, the embodiments of this application can determine the pixel position and gray value of the initial specular reflection area, record their positions in the gray-level histogram, then count the gray values ​​of the pixels in the initial specular reflection area, and mark these values ​​in the gray-level histogram.

[0051] Figure 3 This is a schematic diagram illustrating the process of determining the specular reflection threshold according to one embodiment of this application. Figure 3 As shown, there are 32 polarization images in the sample, denoted as I1, I2, ... I 32 From 32 original polarization images, polarization image number 1 was randomly selected. The Mueller matrix and polarization decomposition were first performed on the selected image number 1. During polarization decomposition, the pixels exhibiting singular matrices were recorded and denoted as {(a1(i1,j1),a2(i2,j2),…an(in,jn)}, where a1,a2,…an are the gray levels of the pixels exhibiting singular matrices in the two-dimensional polarization image, and i1,i2,…in and ji,j2,…jn are the x and y coordinates of these pixels. These pixels were stored in a two-dimensional array A1, and the position of each pixel corresponds to the location of specular reflection in the sampled polarization image numbered m. Subsequently, the gray-level histogram of the current polarization image was calculated. In the histogram, the proportion r1 of the gray-level values ​​of elements in A1 within the gray-level histogram was calculated. The specific calculation formula can be expressed as:

[0052]

[0053] Where n is the number of pixels in the polarization image with a gray value equal to n, n all This represents the total number of pixels in the polarized image.

[0054] Next, the gray values ​​of these pixels are integrated in the histogram to calculate the proportion of the gray values ​​of the initial specular reflection region in the gray values ​​of the polarized image of the fresh mouse tissue sample. This proportion is denoted as r1, r2, ..., rm, where m is the total number of polarized images processed.

[0055] Finally, by calculating the average value of r1, r2, ..., rm, we can obtain the grayscale proportion of the specular reflection region in a polarized image under general conditions. For polarization images acquired by the same optical device, their proportion in the histogram can be used as a metric. high gray value region in the same polarized image as the initial specular reflection region, and the minimum gray value of the high gray value region in the same polarized image is determined as the threshold of specular reflection of the image. Thus, the preliminary specular reflection threshold, i.e., the threshold of the region of complete specular reflection, can be extracted.

[0056] For example, 31 polarized images remaining after the image numbered 1 is removed are read, and the gray values of the pixels stored in the array A1 are updated and stored as A2, A3,..., A32. The average values are independently obtained, respectively, to obtain r2, r3,..., r32. Then, the average values of r1 to r32 are obtained to obtain the initial specular reflection region gray value proportion of the polarized image under the general condition, which is also denoted as Subsequently, for the 32 polarized images, the high gray value region in the histogram with a proportion of The minimum gray value of the high gray value region in the same polarized image is determined as the threshold of specular reflection of the image. The threshold is determined by The specific implementation process of determining the threshold can be represented as follows:

[0057] For the two-dimensional polarized image I1, first, the length and the width are read, and the product of the length and the width is taken as the total number of pixels of the two-dimensional polarized image, denoted as sumPoints, and sumReflection is defined as the total number of pixels in a certain gray interval, and then sumReflection is initialized.

[0058] Next, the number of pixels with the gray value equal to the maximum gray value in the two-dimensional polarized image is counted, and the counting result is accumulated in sumReflectionn. The proportion parameter RateReflection is defined as sumReflection / sumPoints, and then it is determined whether If yes, the number of pixels with the gray value equal to the maximum gray value in the two-dimensional polarized image minus 1 is counted, and the new result is accumulated in sumReflection, and then it is determined whether If yes, it is considered that the counted pixels satisfy the gray threshold condition, and the counting is stopped, and the current gray value is taken as the specular reflection gray threshold of the polarized image. Thus, the adaptive threshold of the specular reflection region in the 32 polarized images based on the criterion of singular matrix can be obtained.

[0059] In step S202, at least one growth initial point is determined according to the specular reflection threshold, and the initial specular reflection region is grown based on the at least one growth initial point to obtain a grown specular reflection region.

[0060] ​​​​Based on the related description of other embodiments, it can be understood that, when the specular reflection region in the polarization image is repaired, the diffuse reflection region is easily mistaken for the specular reflection region, or the initial specular reflection region identified does not completely cover the real specular reflection region.

[0061] Therefore, the embodiment of the present application can first determine at least one growth initial point according to the obtained specular reflection threshold value, and then grow the initial specular reflection region based on the growth initial point to obtain the grown specular reflection region capable of effectively covering the real specular reflection region.

[0062] Next, the process of growing the initial specular reflection region is further explained.

[0063] Optionally, in an embodiment of the present application, the at least one growth initial point is determined according to the specular reflection threshold value, and the initial specular reflection region is grown based on the at least one growth initial point to obtain the grown specular reflection region, including: calculating the gray value interpolation of a plurality of adjacent pixels around the at least one growth initial point; and growing the initial specular reflection region based on the at least one growth initial point and the gray value interpolation to obtain the grown specular reflection region.

[0064] Optionally, in an embodiment of the present application, the calculation formula of the gray value proportion can be expressed as:

[0065]

[0066] wherein, r an is the proportion of the gray value of the point an in the entire two-dimensional polarization image, an is each pixel in the point set {(a1(i+Δi,j+Δj),a2(i+Δi,j+Δj),…an(i+Δi,j+Δj)}, n GrayValue is the number of pixels with the gray value GrayValue, and n all is the number of pixels of the entire image.

[0067] In the actual execution process, when the initial specular reflection region is grown, the present application can first calculate the gray value interpolation of a plurality of adjacent pixels around the at least one growth initial point, and then grow the initial specular reflection region according to the growth initial point and the gray value interpolation.

[0068] It should be noted that, before the initial specular reflection region is grown, the embodiment of the present application needs to detect the mixed region of specular reflection and diffuse reflection which seriously affects the expression of the polarization characteristics of the sample. In order to prevent such extreme conditions as the physical structure of the region where the specular reflection occurs causes a cliff-like drop in a certain direction along the high gray value, the embodiment of the present application can define a constant a diffuse=50% is the conservative grayscale ratio for diffuse reflection, and then a region growth operation is performed.

[0069] Specifically, in this embodiment, the determined specular reflection threshold is first used as the initial growth point, and all pixels that meet the threshold are counted into a point set. The grayscale difference between the eight neighboring pixels of the point is calculated to obtain the region that diffuses outward from the specular reflection region that meets the initial value, and the edge of the specular reflection region is updated. Then, for each pixel of the updated edge, it is checked whether it belongs to the grayscale of diffuse reflection. If its value is less than 0, it is considered that this pixel belongs to the diffuse reflection region, this pixel is deleted from the point set, and the region growth operation in this direction is stopped. If its value is greater than 0, it is considered that it still belongs to the region with a large specular reflection weight.

[0070] As can be understood from the descriptions in the preceding embodiments, this application can detect completely specular reflection regions in 32 polarization images, that is, regions where pixel polarization information is completely lost due to specular reflection. Therefore, it can detect regions that, although not generating singular matrices during polarization decomposition, still severely affect the polarization feature representation of the samples and cause partial loss of polarization information in some affected pixels.

[0071] Figure 4 This is a schematic diagram illustrating the process of increasing and repairing the specular reflection area according to an embodiment of this application. Figure 4 As shown, the constant a is still defined in the embodiments of this application. diffuse =50% is the conservative grayscale percentage for diffuse reflection. Taking the m-th polarized image out of 32 polarized images as an example, the determined threshold is used as the initial point for growth. All pixels that meet the threshold are counted as a point set, and the pixels at its edge can be denoted as {a1(i1, j1), a2(i2, j2), ... an(in, jn)}. Taking a1(i1, j1) as an example, first calculate the grayscale difference between the 8 neighboring pixels of this point, that is:

[0072]

[0073] Where d11, d12, ..., d1n are the gray-level differences between a pixel in the point set and a pixel that is adjacent to it in a certain direction, and d1n i1+Δi,j1+Δj The 1 represents the first time the region is grown, and n represents d1n. i1+Δi,j1+Δjis the gray value difference of the n-th pixel from the point set {(a1(i1, j1), a2(i2, j2),... an(in, jn)} and the 8 pixels adjacent to it, and the values of Δi and Δj can be ±1. Then, the gray value of each pixel in {(a1(i1+Δi, j1+Δj), a2(i2+Δi, j2+Δj),... an(in+Δi, jn+Δj)} is checked to see whether it belongs to the diffuse reflection conservative gray interval, and the specific process can be represented as follows:

[0074] For each pixel in {(a1(i1+Δi, j1+Δj), a2(i2+Δi, j2+Δj),... an(in+Δi, jn+Δj)}, the proportion of its gray value in the entire two-dimensional polarization image is calculated, and the formula can be represented as:

[0075]

[0076] wherein r an is the proportion of the gray value of the point an in the entire two-dimensional polarization image, an is each pixel in the point set {(a1(i+Δi, j+Δj), a2(i+Δi, j+Δj),... an(i+Δi, j+Δj)), n GrayValue is the number of pixels with the gray value of GrayValue, and n all is the number of pixels in the entire image. The value of r an is checked, if r an is less than 0, it is proved that a n is in the diffuse reflection conservative gray interval, but not in the specular reflection interval, and the pixel a n is deleted from the point set {(a1(i+Δi, j+Δj), a2(i+Δi, j+Δj),... an(i+Δi, j+Δj)}; if r an is greater than 0, it is proved that a n is not in the diffuse reflection conservative gray interval, and a n is retained in the point set {(a1(i1+Δi, j1+Δj), a2(i2+Δi, j2+Δj),... an(in+Δi, jn+Δj)}.

[0077] After the proportion r a1 , r a2 ,... r anThen, the pixels that were not deleted are added to the point set {(a1(i1,j1),a2(i2,j2),...an(in,jn)} as the boundary of the mirror reflection region after the first growth, and continue to spread outward with the new edge.

[0078] Optionally, in one embodiment of this application, before stopping the growth of the initial specular reflection region, the method further includes: calculating the grayscale interpolation of the nearest points of the edge of the grown specular reflection region; detecting the grayscale value of the edge of the grown specular reflection region; and determining whether the grown specular reflection region meets the preset conditions based on the nearest point grayscale interpolation and the grayscale value.

[0079] In other embodiments, after growing the initial specular reflection region, it is necessary to determine whether the grown specular reflection region meets the requirements before stopping the growth of the initial specular reflection region. Specifically, after the initial specular reflection region continues to diffuse outward step by step with new edges, the embodiments of this application can calculate the new grayscale difference between neighboring points of the pixels at the edge of the grown specular reflection region. If the new difference is greater than the difference in the previous step, an operation is performed to check whether it belongs to diffuse grayscale: if it still belongs to the specular reflection region, the edge of the specular reflection is updated; if it belongs to the diffuse reflection region, the edge of the previous step is taken as the specular reflection edge, and diffusion in that direction is stopped. If the new difference is less than the difference in the previous step, the edge of the specular reflection is updated.

[0080] For example, like Figure 3 As shown, this application can use the boundary of the specular reflection region after the first growth as the new boundary, and continue to grow outward with the new boundary to obtain the boundary of the specular reflection region after the second growth and the grayscale differences d21, d22, ... d2n between them and the boundary points after the first growth. The sizes of d21, d22, ... d2n are compared with d11, d12, ... d1n respectively, i.e., d21 is compared with d11, d22 with d12, ..., d2n with d1n. If the new difference is greater than the difference in the previous step, a check is performed to see if it belongs to diffuse grayscale: if it still belongs to the specular reflection region, the edge of the specular reflection is updated; if it belongs to the diffuse reflection region, the edge of the previous step is taken as the specular reflection edge, and growth in this direction is stopped. If the new difference is less than the difference in the previous step, the edge of the specular reflection is updated.

[0081] Step S203: Detect whether the grown specular reflection area meets the preset conditions. If the grown specular reflection area meets the preset conditions, stop growing the initial specular reflection area and repair each pixel of the grown specular reflection area to eliminate the grown specular reflection area.

[0082] As a possible implementation, after the initial specular reflection region is regionally grown, it is necessary to check whether the region growth can be stopped all the time until the grown specular reflection region meets preset conditions. The preset conditions can be understood here as that the grown specular reflection region meets repair conditions such as clear edges, covering all the real specular reflection growth regions, and the like, at which time all the to-be-outwardly-grown pixels can be stopped from growing. Then all the diffused edge points are collected together to form a new point set, and an image repair algorithm type tool can be used to repair the pixels in the point set to be able to eliminate the grown specular reflection region.

[0083] It should be noted that the elimination of the specular reflection region is not a single processing process, because multiple polarization images can be involved, so it is necessary to repeatedly detect the specular growth region, perform region growth, judge whether certain repair conditions are met, and finally perform image repair and the like until all the polarization images are processed.

[0084] When the following conditions are met, it can be determined that the grown specular reflection region meets certain conditions, and all the to-be-outwardly-grown pixels can stop growing: first, the gray value difference between all the boundary pixels and the boundary pixels of the previous time step is the maximum difference in the direction; second, the gray value of all the edge pixels does not meet the diffuse reflection conservative gray value interval. After all the to-be-outwardly-grown pixels stop growing, all the grown boundary pixels are continuously updated to finally form a new point set, which can be denoted as {(b1(i1, j1), b2(i2, j2),... bn(in, jn)}. In the bn(i, j), bn represents the gray value of the nth pixel in the point set, and i, j represent the x coordinate and y coordinate of the pixel. At this point, the specular reflection region extraction of the polarization image is completed. Subsequently, an existing image repair algorithm is used to fill the gray value of the pixels in the extracted specular reflection region, and the result is stored in new two-dimensional arrays I'1, I'2,... I'n, which are the repaired images. 32

[0085] Further, in order to guarantee the effectiveness of the method in the embodiments of the present application, the repaired polarization image can also be verified to ensure that the specular reflection region has been accurately removed and the quality of the polarization image has been improved. The verification process can be represented as follows:

[0086] (1) The Mueller matrix M and polarization decomposition are calculated for the polarization image result obtained after processing, and the three components after polarization decomposition are denoted as D, Δ and R, respectively;

[0087] ​(2) Based on the pixels outside the repaired area, continue to spread outward by one pixel as a new temporary boundary. Since the element values ​​of the Δ matrix after polarization decomposition are more sensitive to the light intensity of specular reflection, the method of comparing the value of the Δ matrix in the polarization decomposition of the temporary boundary with the value of the Δ matrix at the singular point in the previous polarization decomposition and finding the difference is adopted to verify.

[0088] (3) If the difference is 0 or greater than 0, it proves that the point has not been repaired correctly, and it is marked as a point to be repaired. Repeat the above repair process. If the difference is less than 0, continue to calculate the difference between the value of the Δ matrix at the temporary boundary and the average value of the Δ matrix in the sample area. If the absolute value of the difference between the value of the Δ matrix at the temporary boundary and the average value of the Δ matrix is ​​less than the value of the Δ matrix at the temporary boundary and the value of the Δ matrix at the previous singular point, it can be considered that the repair is correct.

[0089] Figure 5 This is a schematic diagram illustrating the repair result verification process of one embodiment of this application. Figure 5 As shown, still using 32 polarization images I1, I2, ... I 32 For example, the specific verification process can be represented as follows:

[0090] (1) Polarization images I1, I2, ... I 32 After processing, new images I′1, I′2, ... I′ can be obtained. 32 . For I′1, I′2,...I′ 32 Find the Mueller matrix and perform polarization decomposition, and denote I′1, I′2, ..., I′ as... 32 The calculated Mueller matrix is ​​M, and the three components of the polarization decomposition are D, Δ, and R. For I′1, I′2, ..., I′... 32 There are two possibilities for the result of calculating the Mueller matrix and performing polarization decomposition: ① a singular matrix is ​​generated during polarization decomposition; ② no singular matrix is ​​generated during polarization decomposition. If it meets the condition of ①, it proves that specular reflection regions still exist in the image, and the polarization image specular reflection region processing process should be repeated; if it meets the condition of ②, it proves that there are no longer any specular reflection regions in the image that would affect the expression of the polarization characteristics of the sample, and the next step of processing can be carried out.

[0091] (2) For I′1, I′2,...I′ 32 The boundary pixels of the point set {(b1(i1, j1), b2(i2, j2), ..., bn(in, jn)} in each image are further increased outward by one pixel using the same region growing process, and this is used as a temporary boundary, denoted as {(b edge1 (i1′,j1′), b edge2 (i2′,j2′), ...b edgen(i1', j1') is marked as a point to be repaired, and the steps 3 to 6 are repeated; if the result is less than 0, then the difference between Δ(i1', j1') and the average intensity of the Δ matrix is calculated, and if the absolute value of the difference between Δ(i1', j1') and the average intensity of the Δ matrix is less than the absolute value of Δ(i1', j1') - Δ(i2, j2), then it can be considered that I'1, I'2,..., I'n in the b edge1 direction are correctly repaired. edge1 For example: ③ According to the coordinate position (i1', j1') of b edge1 , find the pixel closest to (i1', j1') in {(a1(i1, j1), a2(i2, j2),..., an(in, jn)}; ④ Assuming that the pixel found in ③ is a2(i2, j2), in the Δ matrix of the polarization decomposition result, the value of Δ(i1', j1') - Δ(i2, j2) is calculated, and a judgment is made: if the result is 0 or greater than 0, it proves that the detection of the polarized image I1 on the mirror reflection region is incomplete, and the pixels affected by the mirror reflection and having polarization characteristics are not correctly repaired, b 32 (i1', j1') is marked as a point to be repaired, and the steps 3 to 6 are repeated; if the result is less than 0, then the difference between Δ(i1', j1') and the average intensity of the Δ matrix is calculated, and if the absolute value of the difference between Δ(i1', j1') and the average intensity of the Δ matrix is less than the absolute value of Δ(i1', j1') - Δ(i2, j2), then it can be considered that I'1, I'2,..., I'n in the b edge1 direction are correctly repaired.

[0092] (3) The above operations are performed on the remaining other pixels of {(b edge1 (i1', j1'), b edge2 (i2', j2'),..., b edgen (in', jn')}. If all the detected pixels pass the detection, it is considered that the polarization characteristics of the samples in the polarized images I'1, I'2,..., I'n have excluded the interference of the mirror reflection. 32

[0093] After the repair is completed, the calculation of the Mueller matrix and the polarization decomposition can make the extracted dichroism parameter, scattering depolarization parameter, phase delay parameter and azimuth angle of the optical axis more accurate, thereby effectively guaranteeing the effectiveness of the verification result.

[0094] ​The polarized image region growth mirror reflection repair method provided in the embodiment of the present application can determine the mirror reflection threshold of the initial mirror reflection region and then determine the growth initial point, so as to perform region growth on the initial mirror reflection region, eliminate the grown mirror reflection region, and repair the target polarized image. In this way, the automatic detection and repair of the mirror reflection region in the polarized image are realized, the manual intervention is greatly reduced, the efficiency and accuracy of image processing are improved, the particularity of the polarized image is fully considered, the requirements of computer computing power and computing cost are reduced, a large amount of polarized image data can be effectively processed, and the accuracy of the mirror reflection removal effect in the processed polarized image can be effectively guaranteed. In this way, the problems in the related art that the method in the related art is only applicable to simple scenes in most cases, manual adjustment is often required when processing complex or changing scenes, time and effort are wasted, the large-scale image processing demand cannot be met, the accuracy of the recognition result of the mirror reflection region is also insufficient, the overall image analysis result is affected, different polarized images may require independent threshold setting, and the mirror reflection region in the polarized image cannot be solved when the number of samples is large are solved.

[0095] Secondly, the polarized image region growth mirror reflection repair device provided in the embodiment of the present application is described with reference to the accompanying drawings.

[0096] Figure 6 FIG. 1 is a structural schematic diagram of the polarized image region growth mirror reflection repair device in the embodiment of the present application.

[0097] As shown in FIG. 1, the polarized image region growth mirror reflection repair device 10 includes a first calculation module 100, a region growth module 200, and a repair module 300. Figure 6

[0098] The first calculation module 100 is configured to calculate the gray scale proportion of the initial mirror reflection region of the target polarized image, so as to obtain the mirror reflection threshold of the initial mirror reflection region.

[0099] The region growth module 200 is configured to determine at least one growth initial point according to the mirror reflection threshold, and grow the initial mirror reflection region based on the at least one growth initial point, so as to obtain the grown mirror reflection region.

[0100] The repair module 300 is configured to detect whether the grown mirror reflection region meets a preset condition, and in the case where it is detected that the grown mirror reflection region meets the preset condition, stop growing the initial mirror reflection region, and repair each pixel of the grown mirror reflection region, so as to eliminate the grown mirror reflection region.

[0101] Optionally, in an embodiment of the present application, the first calculation module 100 includes an identification unit, a statistical unit, and a first calculation unit. ​

[0102] The identification unit is configured to identify an initial specular reflection region in the target polarized image.

[0103] The statistical unit is configured to count the gray value of the pixel in the initial specular reflection region.

[0104] The first calculation unit is configured to calculate a gray proportion according to the gray value.

[0105] Optionally, in an embodiment of the present application, the region growing module comprises a second calculation unit and a region growing unit.

[0106] The second calculation unit is configured to calculate a gray interpolation of a plurality of adjacent pixels around the at least one growing initial point.

[0107] The region growing unit is configured to perform region growing on the initial specular reflection region based on the at least one growing initial point and the gray interpolation, to obtain a grown specular reflection region.

[0108] Optionally, in an embodiment of the present application, the region growing module further comprises a second calculation module, a detection module and a determination module.

[0109] The second calculation module is configured to calculate a neighboring point gray interpolation of an edge of the grown specular reflection region before stopping growing the initial specular reflection region.

[0110] The detection module is configured to detect a gray value of the edge of the grown specular reflection region.

[0111] The determination module is configured to determine whether the grown specular reflection region satisfies a preset condition based on the neighboring point gray interpolation and the gray value.

[0112] Optionally, in an embodiment of the present application, the calculation formula of the gray proportion can be represented as:

[0113]

[0114] wherein, r an is the proportion of the gray value of the point an in the entire two-dimensional polarized image, an is each pixel in the point set {(a1(i+Δi,j+Δj),a2(i+Δi,j+Δj),…an(i+Δi,j+Δj)}, n GrayValue is the number of pixels with the gray value GrayValue, n all is the number of pixels in the entire image.

[0115] It should be noted that the above description of the embodiment of the polarized image region growing specular reflection repair method is also applicable to the polarized image region growing specular reflection repair device of the embodiment, which will not be described here again.

[0116] The polarized image region growth mirror reflection repair device provided by the embodiment of the present application can determine the mirror reflection threshold of the initial mirror reflection region and further determine the growth initial point to perform region growth on the initial mirror reflection region, eliminate the grown mirror reflection region, and repair the target polarized image. In this way, the automatic detection and repair of the mirror reflection region in the polarized image are realized, the manual intervention is greatly reduced, the efficiency and accuracy of image processing are improved, the particularity of the polarized image is fully considered, the requirements of computer computing power and computing cost are reduced, a large amount of polarized image data can be effectively processed, and the accuracy of the mirror reflection removal effect in the processed polarized image can be effectively guaranteed. In this way, the problems in the related art are solved, for example, the method in the related art is only applicable to a simple scene in most cases, manual adjustment is often required when a complex or changing scene is processed, time and effort are wasted, the large-scale image processing demand cannot be met, the accuracy of the recognition result of the mirror reflection region is also insufficient, the overall image analysis result is affected, different polarized images may require independent threshold setting, and the mirror reflection region of the polarized image cannot be solved when the number of samples is large.

[0117] Figure 7 The structure schematic diagram of the electronic device provided by the embodiment of the present application is provided. The electronic device can include:

[0118] The memory 701, the processor 702, and the computer program stored in the memory 701 and executable on the processor 702.

[0119] The processor 702 implements the polarized image region growth mirror reflection repair method provided in the above embodiment when executing the program.

[0120] Further, the electronic device further includes:

[0121] The communication interface 703 is used for communication between the memory 701 and the processor 702.

[0122] The memory 701 is used to store the computer program executable on the processor 702.

[0123] The memory 701 can include a high-speed RAM memory, and can also include a non-volatile memory, for example, at least one disk memory.

[0124] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the communication interface 703, the memory 701 and the processor 702 can be connected with each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 7 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.

[0125] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can complete communication between each other through an internal interface.

[0126] The processor 702 can be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0127] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the polarized image region growing mirror reflection repair method.

[0128] The embodiments of the present application also provide a computer program product, which includes a computer program, and the computer program can run computer instructions, and the computer instructions are executed by a processor to implement the polarized image region growing mirror reflection repair method provided by the embodiments of the present application.

[0129] In the description of the application, reference to "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that a particular feature, structure, material, or characteristic being described is included in at least one embodiment or example of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment or example. Furthermore, the described specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples. In addition, the usage of "N" means at least two, for example, two, three or the like, unless explicitly stated otherwise.

[0130] Furthermore, the terms "first", "second", or the like, are used merely as a designation of certain elements or features, and do not imply or connote relative importance or a specific order of categorization thereof. Accordingly, features described as "first" or "second" can be explicitly or implicitly included in at least one of the features. In the description of the application, the meaning of "N" is at least two, for example, two, three, etc., unless explicitly specified otherwise.

[0131] Any process or method descriptions or blocks in flow charts or otherwise described herein represent embodiments which can be managed as one or more modules, segments, or portions of code which include one or more executable instructions for implementing specific logic functions or steps, and alternate implementations are possible. In some embodiments, the processes and methods described can be executed by one or more apparatuses or devices, either directly or after conversion to another language. Alternate implementations are possible.

[0132] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of executable instructions stored in a computer readable medium, which can be executed by an instruction execution system, apparatus or device, such as a computer-based system, a processor-based system, or other system that can fetch the instructions from the instruction execution system, apparatus or device and execute the instructions, or a combination of the above. For the purposes of this specification, a "computer readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus or device. The computer readable medium can be a computer readable storage medium or a computer readable signal medium. The computer readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a propagation medium. The computer readable signal medium can include, but is not limited to, a computer readable medium that facilitates transfer of the program from one place to another. A specific example of a computer readable medium is a non-transitory computer-readable storage medium. A specific example of a computer readable signal medium is a source or destination of the computer readable medium. Another specific example of a computer readable signal medium is a computer readable signal travelling through space. Thus, a computer readable medium can take many forms of hardware to carry out the program for use by or in connection with the instruction execution system, apparatus or device.

[0133] It should be understood that aspects of the application can be implemented in hardware, software, firmware or a combination thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware and in another embodiment, the hardware can be implemented using any or a combination of the following technologies, which are each well known in the art: a discrete logic circuit(s) having logic gates for implementing logic functions upon an application of data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array(s) (PGA), a field programmable gate array (FPGA), etc.

[0134] Those of skill in the art would understand that the steps of the methods carried out above can be carried out wholly or partly by a program instructing relevant hardware, and the program can be stored in a computer readable storage medium, and when executed, includes one or a combination of the steps of the method embodiments.

[0135] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0136] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. A polarized image region growing specular reflection repair method, characterized by, The method comprises the following steps: calculating a gray scale proportion of an initial specular reflection region of a target polarization image to obtain a specular reflection threshold of the initial specular reflection region; determining at least one growth initial point according to the specular reflection threshold to grow the initial specular reflection region based on the at least one growth initial point to obtain a grown specular reflection region; detecting whether the grown specular reflection region meets a preset condition to stop growing the initial specular reflection region and repairing each pixel of the grown specular reflection region to eliminate the grown specular reflection region if it is detected that the grown specular reflection region meets the preset condition; The method comprises the following steps: based on the at least one growth initial point, counting the pixels satisfying the mirror reflection threshold as a point set, and calculating the gray difference between each pixel in the point set and its adjacent pixels; calculating the gray proportion of each pixel in the target polarization image , and determining that the gray proportion is greater than zero, the pixel does not belong to the diffuse reflection conservative gray interval, so as to retain the pixel not belonging to the diffuse reflection conservative gray interval in the point set, and delete the gray proportion in the point set is less than zero, the pixel belongs to the diffuse reflection conservative gray interval; the retained pixel not belonging to the diffuse reflection conservative gray interval is added to the point set, and the added pixel belonging to the diffuse reflection conservative gray interval is used as the boundary of the first growth mirror reflection region, and the boundary of the mirror reflection region is continued to diffuse outward to obtain the growth mirror reflection region. wherein the detection of whether the grown specular reflection region meets the preset condition to stop growing the initial specular reflection region if it is detected that the grown specular reflection region meets the preset condition comprises: calculating a gray scale difference value of new multiple adjacent pixels of a pixel at a boundary of the grown specular reflection region, checking whether the pixel at the boundary of the grown specular reflection region belongs to a diffuse reflection conservative gray scale interval if the gray scale difference value of the new multiple adjacent pixels is greater than a difference value of a previous step, and regarding an edge of a previous step as a specular reflection edge and stopping the diffusion in the direction if the pixel at the boundary of the grown specular reflection region belongs to the diffuse reflection conservative gray scale interval.

2. The method of claim 1, wherein, The calculation of the gray scale proportion of the initial specular reflection region of the target polarization image comprises: identifying an initial specular reflection region in the target polarization image; counting a gray scale value of a pixel of the initial specular reflection region; calculating the gray scale proportion according to the gray scale value.

3. The method of claim 1, wherein, The calculation formula of the gray scale proportion is: wherein, is the number of points whose gray scale accounts for a proportion of the whole two-dimensional polarization image, is the number of points whose gray scale accounts for a proportion of the whole two-dimensional polarization image, is the number of points whose gray scale accounts for a proportion of the whole two-dimensional polarization image, is the number of points 4. A polarized image region growing mirror reflection repair apparatus, characterized by, comprises: a calculation module configured to calculate a gray scale proportion of an initial specular reflection region of a target polarization image to obtain a specular reflection threshold of the initial specular reflection region; a region growth module configured to determine at least one growth initial point according to the specular reflection threshold to grow the initial specular reflection region based on the at least one growth initial point to obtain a grown specular reflection region; a repairing module configured to detect whether the grown specular reflection region meets a preset condition to stop growing the initial specular reflection region and repair each pixel of the grown specular reflection region to eliminate the grown specular reflection region if it is detected that the grown specular reflection region meets the preset condition. The region growing module comprises: based on the at least one growing initial point, counting the pixels satisfying the mirror reflection threshold as a point set, and calculating the gray difference between each pixel in the point set and its multiple adjacent pixels; calculating the gray proportion of each pixel in the target polarization image , and determining that the gray proportion is greater than zero, the pixel does not belong to the diffuse reflection conservative gray interval, so as to retain the pixel not belonging to the diffuse reflection conservative gray interval in the point set, and delete the gray proportion in the point set is less than zero, the pixel belongs to the diffuse reflection conservative gray interval; the retained pixel not belonging to the diffuse reflection conservative gray interval is added to the point set, and the pixel not belonging to the diffuse reflection conservative gray interval is taken as the boundary of the mirror reflection region after the first growth, and the external diffusion is continued through the boundary of the mirror reflection region after the first growth, so as to obtain the grown mirror reflection region. wherein the repairing module comprises: calculating a gray scale difference value of new multiple adjacent pixels of a pixel at a boundary of the grown specular reflection region, checking whether the pixel at the boundary of the grown specular reflection region belongs to a diffuse reflection conservative gray scale interval if the gray scale difference value of the new multiple adjacent pixels is greater than a difference value of a previous step, and regarding an edge of a previous step as a specular reflection edge and stopping the diffusion in the direction if the pixel at the boundary of the grown specular reflection region belongs to the diffuse reflection conservative gray scale interval.

5. The apparatus of claim 4, wherein, The calculation module comprises: an identifying unit configured to identify an initial specular reflection region in the target polarization image; a statistical unit configured to count gray values of the pixels in the initial specular reflection region; a calculation unit configured to calculate the gray proportion according to the gray values.

6. An electronic device, comprising: The application further provides a computer readable storage medium storing the computer program. The application further provides a computer readable storage medium storing the computer program.

7. A computer readable storage medium having stored thereon a computer program, characterized in that, The application further provides a computer readable storage medium storing the computer program.

8. A computer program product comprising a computer program, characterized in that, The application further provides a computer readable storage medium storing the computer program.

Citation Information

Patent Citations

  • Cloth cover positioning method in complex environment

    CN110501339A

  • Highlight image restoration method based on hue

    CN113793274A