Polarization image region growth specular reflection repairing method and device

By calculating the grayscale proportion and area growth technology of the initial specular reflection area of ​​the polarized image, the automatic detection and repair of the specular reflection area in the polarized image is achieved, solving the problems of low processing efficiency and lack of recognition accuracy in the prior art, and achieving efficient and accurate specular reflection repair.

CN119521014AActive Publication Date: 2025-02-25WUHAN UNIV
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art requires manual adjustment when processing complex or changing polarized image scenes, which is time-consuming and labor-intensive, making it difficult to meet the needs of large-scale image processing. The accuracy of the specular reflection area recognition results is lacking, and different polarized images require independent threshold settings, making it difficult to cope with the processing needs of large numbers of samples.

Method used

By calculating the grayscale proportion of the initial specular reflection area of ​​the polarized image, the specular reflection threshold is determined, the initial growth point is determined based on the threshold, and the area is grown until the preset conditions are met, the specular reflection area is repaired, and automatic detection and repair are achieved.

Benefits of technology

Automatic detection and repair of specular reflection areas in polarized images is realized, which greatly reduces manual intervention, improves image processing efficiency and accuracy, adapts to the processing of large-scale polarized image data, and ensures the accuracy of specular reflection removal effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119521014A_ABST
    Figure CN119521014A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image restoration, in particular to a polarization image region growth specular reflection restoration method and device, and the method comprises the steps: calculating the gray scale ratio of an initial specular reflection region of a target polarization image, so as to obtain a specular reflection threshold value of the initial specular reflection region; determining at least one growth initial point according to the specular reflection threshold value to grow the initial specular reflection region to obtain a grown specular reflection region; and when it is detected that the increased specular reflection area meets a preset condition, increasing of the initial specular reflection area is stopped, and each pixel of the increased specular reflection area is repaired so as to eliminate the increased specular reflection area. According to the invention, automatic detection and restoration of the specular reflection area in the polarization image can be realized, manual intervention is greatly reduced, the efficiency and precision of image processing are improved, the requirements for the computing power and the computing cost of a computer are reduced, and a large amount of polarization image data can be effectively processed.
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 restoration, and in particular to a method and device for polarized image region growth mirror reflection restoration. Background Art

[0002] In the related art, the traditional method is a fixed threshold method or an edge detection technology. Among them, when the fixed threshold method processes the specular reflection in the polarized image, the fixed threshold method can distinguish the specular reflection area from other areas by setting a fixed pixel value threshold, and then process the specular reflection area. Edge detection technology is mainly used to detect edge information in the image, that is, the location where the brightness or color in the image changes significantly. When processing the specular reflection in the polarized image, the edge detection technology can help us more accurately identify the boundary between the specular reflection area and other areas. In the polarized image, the specular reflection area often has different polarization characteristics from other areas. 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 specular reflection component, so as to more accurately detect the edge information.

[0003] However, the methods in the related art are only applicable to simple scenes in most cases. When dealing with complex or changing scenes, manual adjustments are often required, which is time-consuming and labor-intensive and difficult to meet large-scale image processing needs. The recognition results of the mirror reflection area are also lacking in accuracy, which affects the overall image analysis results. Different polarization images may require independent threshold settings, which makes it difficult to cope with the processing needs of the mirror reflection area of ​​the polarization image when the number of samples is large, and this problem needs to be solved urgently. Summary of the invention

[0004] The present application provides a method and device for repairing mirror reflections by growing polarized image regions, in order to solve the problem that the methods in the related art are only applicable to simple scenes in most cases, and often require manual adjustment when processing complex or changing scenes, which is time-consuming and labor-intensive and difficult to meet large-scale image processing needs. The recognition results of the mirror reflection regions are also lacking in accuracy, thereby affecting the overall image analysis results. Different polarized images may require independent threshold settings, making it difficult to cope with the processing needs of the mirror reflection regions of polarized images when the number of samples is large.

[0005] The first aspect of the present application provides a method for repairing mirror reflections by growing a polarized image area, comprising the following steps: calculating the grayscale ratio of an initial mirror reflection area of ​​a target polarized image to obtain a mirror reflection threshold of the initial mirror reflection area; determining at least one initial growth point according to the mirror reflection threshold to grow the initial mirror reflection area based on the at least one initial growth point to obtain a grown mirror reflection area; detecting whether the grown mirror reflection area meets a preset condition, so as to stop growing the initial mirror reflection area if it is detected that the grown mirror reflection area meets the preset condition, and repairing each pixel of the grown mirror reflection area to eliminate the grown mirror reflection area.

[0006] Optionally, in one embodiment of the present application, the calculation of the grayscale ratio of the initial specular reflection area of ​​the target polarization image includes: identifying the initial specular reflection area in the target polarization image; counting the grayscale values ​​of the pixels in the initial specular reflection area; and calculating the grayscale ratio based on the grayscale values.

[0007] Optionally, in one embodiment of the present application, determining at least one initial growth point according to the mirror reflection threshold value to grow the initial mirror reflection area based on the at least one initial growth point to obtain the mirror reflection area after growth, includes: calculating the grayscale interpolation of multiple adjacent pixels around the at least one initial growth point; performing regional growth on the initial mirror reflection area based on the at least one initial growth point and the grayscale interpolation to obtain the mirror reflection area after growth.

[0008] Optionally, in one embodiment of the present application, before stopping the growth of the initial mirror reflection area, it also includes: calculating the grayscale interpolation of the adjacent points of the edge of the grown mirror reflection area; detecting the grayscale value of the edge of the grown mirror reflection area; and determining whether the grown mirror reflection area meets a preset condition based on the adjacent point grayscale interpolation and the grayscale value.

[0009] Optionally, in one embodiment of the present application, the calculation formula of the grayscale ratio can be expressed as:

[0010]

[0011] Among them, r an is the proportion of the grayscale of 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,h+Δj)}, n GrayValue is the number of pixels whose gray value is GrayValue, n all is the number of pixels in the entire image.

[0012] The second aspect of the present application provides a polarized image region growth mirror reflection repair device, including: a first calculation module, used to calculate the grayscale ratio of the initial mirror reflection area of ​​the target polarized image to obtain the mirror reflection threshold of the initial mirror reflection area; a region growth module, used to determine at least one growth initial point according to the mirror reflection threshold, so as to grow the initial mirror reflection area based on the at least one growth initial point to obtain the grown mirror reflection area; a repair module, used to detect whether the grown mirror reflection area meets a preset condition, so as to stop growing the initial mirror reflection area when it is detected that the grown mirror reflection area meets the preset condition, and repair each pixel of the grown mirror reflection area to eliminate the grown mirror reflection area.

[0013] Optionally, in one embodiment of the present application, the calculation module includes: an identification unit for identifying an initial specular reflection area in the target polarization image; a statistical unit for counting the grayscale values ​​of pixels in the initial specular reflection area; and a first calculation unit for calculating the grayscale ratio based on the grayscale value.

[0014] Optionally, in one embodiment of the present application, the region growing module includes: a second calculation unit, used to calculate the grayscale interpolation of multiple adjacent pixels around the at least one growth initial point; and a region growing unit, used to perform region growth on the initial mirror reflection area based on the at least one growth initial point and the grayscale interpolation to obtain the grown mirror reflection area.

[0015] Optionally, in one embodiment of the present application, it also includes: a second calculation module, used to calculate the grayscale interpolation of the adjacent points of the edge of the grown mirror reflection area before stopping the growth of the initial mirror reflection area; a detection module, used to detect the grayscale value of the edge of the grown mirror reflection area; and a determination module, used to determine whether the grown mirror reflection area meets a preset condition based on the adjacent point grayscale interpolation and the grayscale value.

[0016] Optionally, in one embodiment of the present application, the calculation formula of the grayscale ratio can be expressed as:

[0017]

[0018] Among them, r an is the proportion of the grayscale of 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 GrayValueis the number of pixels whose gray value is GrayValue, n all is the number of pixels in the entire 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 area growth mirror reflection repair method as described in the above embodiment.

[0020] The fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned polarized image area growth mirror reflection repair method.

[0021] The fifth aspect of the present application provides a computer program product, including a computer program, which, when executed, is used to implement the above-mentioned polarized image area growth mirror reflection repair method.

[0022] The embodiment of the present application can determine the specular reflection threshold of the initial specular reflection area and then determine the initial growth point, so as to perform regional growth on the initial specular reflection area, eliminate the specular reflection area after growth, and repair the target polarization image. Thus, the automatic detection and repair of the specular reflection area in the polarization image is realized, the manual intervention is greatly reduced, the efficiency and accuracy of image processing are improved, and the particularity of the polarization image is fully considered, the requirements of computer computing power and computing cost are reduced, and a large amount of polarization image data can be effectively processed. At the same time, the accuracy of the specular reflection removal effect in the processed polarization image can be effectively guaranteed. Thus, the method in the related art is solved. In most cases, it is only applicable to simple scenes. When processing complex or changing scenes, manual adjustment is often required, which is time-consuming and laborious and difficult to meet large-scale image processing requirements. The accuracy of the recognition result of the specular reflection area is also lacking, thereby affecting the overall image analysis results, and different polarization images may require independent threshold settings, which is difficult to cope with the processing requirements of the specular reflection area of ​​the polarization image when the number of samples is large.

[0023] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0025] Figure 1 A schematic diagram of a framework for polarized image region growth and specular reflection restoration according to an embodiment of the present application;

[0026] Figure 2 A flowchart of a method for repairing mirror reflections in a polarized image region growth according to an embodiment of the present application;

[0027] Figure 3 A schematic diagram of a process for determining a mirror reflection threshold according to an embodiment of the present application;

[0028] Figure 4 A schematic diagram of a process of growing and repairing a mirror reflection area according to an embodiment of the present application;

[0029] Figure 5 A schematic diagram of a repair result verification process according to an embodiment of the present application;

[0030] Figure 6 It is a schematic structural diagram of a polarized image region growth specular reflection repair device provided according to an embodiment of the present application;

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

[0032] Reference numerals:

[0033] 10-Polarized image region growth mirror reflection repair device: 100-first calculation module, 200-region growth 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, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0035] The following describes the method and device for repairing the mirror reflection of the polarized image region growth in the embodiment of the present application with reference to the accompanying drawings. In view of the fact that the methods in the related art mentioned in the above background technology are only applicable to simple scenes in most cases, manual adjustment is often required when processing complex or changing scenes, which is time-consuming and labor-intensive and difficult to meet the large-scale image processing requirements. The accuracy of the recognition result of the mirror reflection area is also lacking, thereby affecting the overall image analysis results. Different polarized images may require independent threshold settings, which is difficult to deal with the problem of the processing requirements of the mirror reflection area of ​​the polarized image when the number of samples is large. The present application provides a method for repairing the mirror reflection of the polarized image region growth, in which the mirror reflection threshold of the initial mirror reflection area can be determined and then the initial growth point can be determined to perform regional growth on the initial mirror reflection area, eliminate the mirror reflection area after growth, and repair the target polarized image. As a result, the automatic detection and repair of the mirror reflection area in the polarized image is realized, the manual intervention is greatly reduced, the efficiency and accuracy of the image processing are improved, and the particularity of the polarized image is fully considered, the requirements of the computer computing power and the calculation cost are reduced, and a large amount of polarized image data can be effectively processed. At the same time, the accuracy of the mirror reflection removal effect in the processed polarized image can be effectively guaranteed. This solves the problem that the methods in the related art are only applicable to simple scenes in most cases. When processing complex or changing scenes, manual adjustment is often required, which is time-consuming and labor-intensive and difficult to meet large-scale image processing needs. The recognition results of the mirror reflection area are also lacking in accuracy, which affects the overall image analysis results. Different polarization images may require independent threshold settings, making it difficult to cope with the processing needs of the mirror reflection area of ​​the polarization image when the number of samples is large.

[0036] Before explaining the method for repairing the mirror reflection of the polarized image region growth in the embodiment of the present application, the framework of the repairing the mirror reflection of the polarized image region growth involved in the embodiment of the present application is first explained.

[0037] In modern medical imaging and related scientific research, polarization images can provide important information about the surface characteristics, materials, and structures of objects, which is often difficult to observe in non-polarized light images. The use of the Mueller matrix and its derived parameters is a relatively complete method for characterizing the polarization information of biological tissues, and is called the "fingerprint" of the optical properties of biological tissues. However, a major challenge facing polarization imaging technology is the interference of specular reflections. Specular reflections can not only distort the true colors in the image, but also cover up or change important details in the image, affecting subsequent image analysis and processing, resulting in misjudgment or omission of results.

[0038] In conventional non-polarized light images, specular reflection is usually related to the intensity and angle of the incident light and the surface characteristics of the object being photographed. Under incident light of the same light intensity, the specular reflection area produced by the non-polarized 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 the polarization characteristics of the object. This means that the same object can produce reflections of different intensities and characteristics under different polarization states. Especially when collecting polarization images of fresh samples, the thickness and other physical characteristics of the sample often lead to significant specular reflections, which cannot correctly reflect the true polarization characteristics of the sample area in the image.

[0039] For the same sample, the collected polarization images are generally multiple backscattered images taken by rotating the wave plate of the optical device to change the polarized incident light. If specular reflection occurs, it is usually manifested as a white spot at the same position in multiple images, and the corresponding grayscale value is distributed in the high grayscale range, replacing the original scattering result of the incident light with different polarizations, that is, the sample loses the light intensity information containing polarization in this area. Therefore, the area where specular reflection occurs will seriously affect the subsequent calculation of the Mueller matrix and polarization decomposition. This is because the Mueller matrix reflects the polarization characteristics of the object, and the occurrence of specular reflection is irrelevant to the polarization characteristics of the object. At the same time, when the Lu-Chipman method is used for polarization decomposition, singular values ​​of the parameter matrix will appear, making the parameter matrix irreversible and unable to perform subsequent operations. If these polarization images are not properly preprocessed, 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 of the framework of polarized image region growth and specular reflection repair according to one embodiment of the present application. Figure 1 As shown, the embodiment of the present application is based on a polarization image of a fresh sample affected by mirror reflection, and calculates a preliminary mirror reflection threshold of an initial mirror reflection area through an adaptive threshold algorithm. Based on the preliminary mirror reflection threshold, the initial mirror reflection area is region-grown through a region growing algorithm to obtain a polarization image of the mirror reflection area that can be region-grown. A test algorithm is used to test whether the mirror reflection area at this time meets the conditions. If it does not meet the conditions and fails the test, the process of region growing and testing is repeated. If it passes the test and meets the conditions, the mirror reflection area of ​​the polarization image is repaired to obtain a processed polarization image.

[0041] Specifically, Figure 2 A flow chart of a polarized image region growth specular reflection repair method provided in an embodiment of the present application.

[0042] like Figure 2As shown, the polarized image region growth mirror reflection repair method includes the following steps:

[0043] In step S201, the grayscale ratio of the initial specular reflection area of ​​the target polarization image is calculated to obtain the specular reflection threshold of the initial specular reflection area.

[0044] It can be understood that the target polarization image here can be understood as the polarization image of the mirror reflection area in the image that needs to be repaired.

[0045] In some embodiments, specular reflections are easily generated in some polarized images, especially in polarized images of some fresh tissue samples, where specular reflections are more obvious, which can easily lead to the loss of important image information. Directly processing the specular reflection area can easily misinterpret some diffuse reflection areas as specular reflections or the identified specular reflection area cannot completely cover the real specular reflection area. Therefore, when repairing the specular reflections in the polarized images, the embodiments of the present application can start from the specular reflection area.

[0046] Specifically, the embodiment of the present application can first calculate the grayscale ratio of the initial specular reflection area in the target polarization image, and then obtain the specular reflection threshold of the initial specular reflection area. It should be noted that the initial specular reflection area here can be understood as the initial specular reflection area directly identified by relevant technology or relevant computer software technology.

[0047] Next, the process of calculating the grayscale ratio of the initial specular reflection area of ​​the target polarization image is further explained.

[0048] Optionally, in one embodiment of the present application, calculating the grayscale ratio of the initial specular reflection area of ​​the target polarization image includes: identifying the initial specular reflection area in the target polarization image; counting the grayscale values ​​of the pixels in the initial specular reflection area; and calculating the grayscale ratio based on the grayscale values.

[0049] During the actual execution process, when calculating the grayscale ratio of the initial specular reflection area of ​​the target polarized image, the present application needs to first identify the initial specular reflection area of ​​the target polarized image, and then count the grayscale values ​​of all pixels in the initial specular reflection area, and calculate the grayscale ratio of the initial specular reflection area in the target polarized image based on this.

[0050] Take a fresh mouse tissue sample containing a bone tumor as an example. The surface of the tissue sample is not flat, and specular reflection will be generated in certain areas when collecting polarized images, which are manifested in the image as overexposure points or white spots with abnormally high grayscale values. For the fresh mouse tissue sample, the information in the image collected by the optical device is the scattered light intensity information of the sample, which can be mapped to grayscale values ​​and stored in an 8-bit space. Next, the embodiment of the present application can determine the pixel position and grayscale of the initial specular reflection area where specular reflection is generated, record their positions in the grayscale histogram, and then count the grayscale values ​​of the pixels in the initial specular reflection area, and mark these values ​​in the grayscale histogram.

[0051] Figure 3 FIG. 1 is a flow chart of determining a mirror reflection threshold according to an embodiment of the present application. Figure 3 As shown, there are 32 polarization images in the sample, denoted as I1, I2, …I 32 . Randomly sample the 32 original polarization images of the sample and draw the polarization image numbered 1. For the image numbered 1, first solve the Mueller matrix and polarization decomposition. During the polarization decomposition, record the pixels where the singular matrix appears. These pixels are recorded as {(a1(i1,j1),a2(i2,j2),…an(in,jn)}, where a1,a2,…an are the grayscales of the pixels where the singular matrix appears in the two-dimensional polarization image, i1,i2,…in and ji,j2,…jn are the x-coordinates and y-coordinates of these pixels. These pixels are saved in a two-dimensional array A1. The location of the pixel is the location where the mirror reflection occurs in the sampled polarization image numbered m. Subsequently, the grayscale histogram of the current polarization image is counted. In the histogram, the proportion r1 of the grayscale value of the elements contained in A1 in the grayscale histogram is counted. The specific calculation formula can be expressed as:

[0052]

[0053] Where n is the number of pixels with grayscale value equal to n in the polarization image. all is the number of all pixels in the polarization image.

[0054] Next, the grayscale values ​​of these pixels are integrated in the histogram, and the proportion of the grayscale value of the initial mirror reflection area in the grayscale value of the polarization image of the mouse fresh tissue sample can be counted, and the ratio is calculated as r1, r2, ... rm, where m is the total number of polarization images processed.

[0055] Finally, the average value of r1, r2, ...rm is calculated, that is, the grayscale ratio of the specular reflection area of ​​the polarization image under general conditions can be obtained. For all polarization images collected by the same optical device, their proportion in the histogram can be The high gray value area of ​​​​the same polarization image is taken as the initial specular reflection area. The minimum grayscale value of the high grayscale value area is determined as the threshold of the specular reflection of the image. Thus, the preliminary specular reflection threshold can be extracted, that is, the threshold of the area where the specular reflection is completely generated.

[0056] For example, read the remaining 31 polarization images after removing the image numbered 1, then update the grayscale values ​​of the pixels stored in array A1 and store them as A2, A3, ... A32. Calculate their average values ​​independently to obtain r2, r3, ... r32. Then calculate the average value of r1 to r32 to obtain the initial specular reflection area grayscale ratio of the polarization image under general conditions, which is also recorded as Then, for the 32 polarization images, the proportion of The high gray value area is taken as the initial specular reflection area, accounting for the same polarization image. The minimum gray value of the high gray value area is determined as the threshold of the mirror reflection of the image. The specific implementation process of determining the threshold can be expressed as follows:

[0057] For the two-dimensional polarization image I1, first read the length and width, and use the result of length multiplication by width as the total number of pixels of the two-dimensional polarization image, recorded as sumPoints, and define sumReflection as the total number of pixels in a certain grayscale interval, and then initialize sumReflection.

[0058] Next, we start counting the number of pixels with the maximum grayscale value in the two-dimensional polarization image, and add the statistical results to sumReflectionn. Define the proportional parameter RateReflection = sumReflection / sumPoints, and then determine Yes or No: If Then continue to count the number of pixels whose grayscale value is equal to the maximum grayscale value -1 in the two-dimensional polarization image, and add the new result to sumReflection, and then continue to judge or not; if The counted pixels are considered to meet the grayscale threshold condition, and the counting is stopped, and the current grayscale value is used as the mirror reflection grayscale threshold of the polarization image. At this point, the adaptive threshold of the mirror reflection area in the 32 polarization images with the generation of singular matrices as the identification standard can be obtained.

[0059] Step S202: determining at least one initial growth point according to the mirror reflection threshold value, so as to grow the initial mirror reflection area based on the at least one initial growth point, so as to obtain the grown mirror reflection area.

[0060] Based on the relevant descriptions of other embodiments, it can be understood that when repairing the specular reflection area in the polarized image, it is easy to mistake the diffuse reflection area for the specular reflection area, or the identified initial specular reflection area does not completely cover the real specular reflection area.

[0061] Therefore, the embodiment of the present application can first determine at least one initial growth point based on the obtained mirror reflection threshold, and then grow the initial mirror reflection area based on the initial growth point to obtain a grown mirror reflection area that can effectively cover the real mirror reflection area.

[0062] Next, the process of the initial specular reflection area growth is further explained.

[0063] Optionally, in one embodiment of the present application, at least one initial growth point is determined according to a mirror reflection threshold value, so as to grow an initial mirror reflection area based on the at least one initial growth point to obtain a grown mirror reflection area, including: calculating grayscale interpolation of multiple adjacent pixels around at least one initial growth point; performing regional growth on the initial mirror reflection area based on at least one initial growth point and grayscale interpolation to obtain a grown mirror reflection area.

[0064] Optionally, in one embodiment of the present application, the calculation formula of the grayscale ratio can be expressed as:

[0065]

[0066] Among them, r an is the proportion of the grayscale of 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 whose gray value is GrayValue, n all is the number of pixels in the entire image.

[0067] In the actual implementation process, when performing region growth on the initial mirror reflection area, the present application can first calculate the grayscale interpolation of multiple adjacent pixels around at least one initial growth point, and then perform region growth on the initial mirror reflection area based on the initial growth point and the grayscale interpolation.

[0068] It should be noted that, before performing region growth on the initial specular reflection region, the embodiment of the present application needs to first detect the specular reflection and diffuse reflection mixed region that seriously affects the polarization characteristic expression of the sample. To prevent extreme situations such as the physical structure of the specular reflection region causing a cliff-like drop in high grayscale values ​​in a certain direction, the embodiment of the present application can define a constant a diffuse=50% is the conservative grayscale ratio of diffuse reflection, and then the region growing operation is performed.

[0069] Specifically, the embodiment of the present application can first use the determined mirror reflection threshold as the initial point of growth, and count all pixels that meet the threshold as a point set, calculate the grayscale difference of the 8 pixels adjacent to the point, and obtain the mirror reflection area that meets the initial value. The area diffuses outward by one layer, and updates the edge of the mirror reflection area; then for each pixel on the updated edge, check whether it belongs to the diffuse reflection grayscale. If its value is less than 0, it is considered that this pixel belongs to the diffuse reflection area, delete this pixel from the point set, and stop the area growth operation in this direction; if its value is greater than 0, it is considered that it still belongs to the area with a large mirror reflection weight.

[0070] According to the relevant description of the previous embodiment, it can be understood that the present application can detect the complete specular reflection area in the 32 polarization images, that is, the area where the polarization information of the pixels in some areas is completely lost due to the specular reflection. Therefore, at this time, those areas that will not produce a singular matrix during polarization decomposition but will still seriously affect the expression of the polarization characteristics of the sample and cause some affected pixels to partially lose polarization information can be detected.

[0071] Figure 4 This is a schematic diagram of the process of growing and repairing the mirror reflection area according to an embodiment of the present application. Figure 4 As shown, the embodiment of the present application still defines a constant diffuse =50% is the conservative grayscale ratio of diffuse reflection, and still taking the mth polarization image of 32 polarization images as an example, the determined threshold is used as the initial point of growth, and all pixels that meet the threshold are counted as a point set, and the edge pixels can be recorded as {a1(i1, j1), a2(i2, j2), ...an(in, jn)}. Taking a1(i1, j1) as an example, first calculate the grayscale difference of the 8 adjacent pixels of the point, that is:

[0072]

[0073] Among them, d11, d12, ... d1n are the grayscale differences between the pixels in the point set and the pixels adjacent to them in a certain direction, d1n i1+Δi,j1+Δj 1 represents the first region growth, and n represents d1n i1+Δi,j1+ΔjIt is the grayscale difference between the nth pixel and the 8 adjacent pixels in the point set {(a1(i1, j1), a2(i2, j2), ... an(in, jn)}. The values ​​of Δi and Δj can be ±1. Then the grayscale value of each pixel in {(a1(i1+Δi, j1+Δj), a2(i2+Δi, j2+Δj), ... an(in+Δi, jn+Δj)) is tested to see if it belongs to the diffuse reflection conservative grayscale interval. The specific process can be expressed as follows:

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

[0075]

[0076] Among them, r an is the proportion of the grayscale of 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 whose gray value is GrayValue, n all is the number of pixels in the entire image. Check r an If r an is less than 0, then it proves that a n In the diffuse reflection conservative grayscale range, rather than the specular reflection range, pixel a n Delete 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, then it proves that a n Not in the diffuse reflection conservative grayscale range, a n Retained in the point set {(a1(i1+Δi,j1+Δj), a2(i2+Δi,j2+Δj), ...an(in+Δi,jn+Δj)}.

[0077] After completing the point set {(a1(i1+Δi,j1+Δj), a2(i2+Δi,j2+Δj), ...an(in+Δi,jn+Δj)}, the proportion of the grayscale of each pixel in the entire two-dimensional polarization image is r a1 、r a2 …r anFinally, the pixels that have not been deleted are added to the point set {(a1(i1, j1), a2(i2, j2), ...an(in, jn)} as the boundary of the mirror reflection area after the first growth, and continue to diffuse outward with new edges.

[0078] Optionally, in one embodiment of the present application, before stopping the growth of the initial mirror reflection area, it also includes: calculating the grayscale interpolation of the adjacent points of the edge of the grown mirror reflection area; detecting the grayscale value of the edge of the grown mirror reflection area; and determining whether the grown mirror reflection area meets preset conditions based on the grayscale interpolation and grayscale value of the adjacent points.

[0079] In other embodiments, after the initial mirror reflection area is grown, before the growth of the initial mirror reflection area is stopped, it is necessary to first determine whether the grown mirror reflection area meets the requirements. Specifically, after the initial mirror reflection area continues to diffuse outward with new edges step by step, the embodiment of the present application can calculate the new adjacent point grayscale difference of the pixel at the edge of the grown mirror reflection area. If the new difference is greater than the difference in the previous step, it is checked whether it belongs to the diffuse reflection grayscale operation: if it still belongs to the mirror reflection area, the edge of the mirror reflection is updated; if it belongs to the diffuse reflection area, the edge of the previous step is used as the mirror reflection edge, and the diffusion in this direction is stopped. If the new difference is less than the difference in the previous step, the edge of the mirror reflection is updated.

[0080] For example, Figure 3 As shown, the present application can use the boundary of the mirror reflection area after the first growth as the new boundary, and continue to repeat the outward growth with the new boundary to obtain the boundary of the mirror reflection area after the second growth and the grayscale difference d21, d22, ... d2n between them and the boundary points after the first growth. Compare the sizes of d21, d22, ... d2n with d11, d12, ... d1n respectively, that is, d21 is compared with d11, d22 is compared with d12... d2n is compared with d1n. If the new difference is greater than the difference in the previous step, check whether it belongs to the diffuse reflection grayscale operation: if it still belongs to the mirror reflection area, update the edge of the mirror reflection; if it belongs to the diffuse reflection area, use the edge of the previous step as the mirror reflection edge, and stop the growth in this direction. If the new difference is less than the difference in the previous step, update the edge of the mirror reflection.

[0081] Step S203, detect whether the grown mirror reflection area meets the preset conditions, so that if it is detected that the grown mirror reflection area meets the preset conditions, stop growing the initial mirror reflection area and repair each pixel of the grown mirror reflection area to eliminate the grown mirror reflection area.

[0082] As a possible implementation method, after the initial specular reflection area is grown, it is necessary to check whether the growth can be stopped until the grown specular reflection area meets the preset conditions. The preset conditions here can be understood as the specular reflection area after growth meets the repair conditions, such as clear edges and covering all real specular growth areas. At this time, all pixels to be grown outward can be stopped from growing. Then all the diffused edge points are gathered together to form a new point set, and the image repair algorithm can be used to repair the pixels in the point set to eliminate the grown specular reflection area.

[0083] It should be noted that the elimination of the mirror reflection area is not a single processing process. Because it may involve multiple polarization images, it is necessary to repeatedly detect the mirror growth area, perform regional growth, determine whether it meets certain repair conditions, and finally perform image repair and other processes until all polarization images are processed.

[0084] Among them, when the following conditions are met, it can be determined that the grown mirror reflection area meets certain conditions, and all pixels to be grown outward can stop growing: first, the grayscale difference between all boundary pixels and the boundary pixels of the previous time step is the largest difference in this direction; second, the grayscale value of all edge pixels does not meet the conservative grayscale interval of diffuse reflection. After all the pixels to be grown outward stop growing, all the boundary pixels that have been grown will be continuously updated, and finally form a new point set, which can be recorded as {(b1(i1, j1), b2(i2, j2), ...bn(in, jn)}. Among them, bn in bn(i, j) represents the grayscale 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 extraction of the mirror reflection area of ​​the polarization image is completed. Then, the existing image restoration algorithm is used to fill the grayscale value of the pixels in the extracted mirror reflection area, and the results are stored in the new two-dimensional array I′1, I′2, ...I′ 32 , as the repaired image.

[0085] Furthermore, in order to ensure the effectiveness of the method in the embodiment of the present application, the embodiment of the present application can also verify the repaired polarization image to ensure that the mirror reflection area has been accurately removed and the quality of the polarization image has been improved. The verification process can be expressed as follows:

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

[0087] (2) Based on the pixels outside the repaired area, continue to diffuse outward by a distance of 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 value of the Δ matrix in the polarization decomposition of the temporary boundary is compared with the value of the Δ matrix at the singular point in the previous polarization decomposition, and the difference is taken for verification;

[0088] (3) If the difference is 0 or greater than 0, it proves that the point has not been correctly repaired, and it is marked as a point to be repaired, and the above repair process is repeated; 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 last singular point, it can be considered to be correctly repaired.

[0089] Figure 5 This is a schematic diagram of the repair result verification process of an embodiment of the present application. Figure 5 As shown, there are still 32 polarization images I1, I2, ...I 32 For example, the specific verification process can be expressed as follows:

[0090] (1) Polarization images I1, I2, ...I 32 After the processing is completed, 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 record I′1, I′2, ...I′ 32 The obtained Mueller matrix is ​​M, and the three components of polarization decomposition are D, Δ, and R. For I′1, I′2, ...I′ 32 There are two possible results for finding the Mueller matrix and performing polarization decomposition: ① a singular matrix is ​​generated during polarization decomposition; ② no singular matrix is ​​generated during polarization decomposition. If the result meets the condition ①, it proves that there are still mirror reflection areas in the image, and the mirror reflection area processing process of the polarization image is repeated; if the result meets the condition ②, it proves that there are no mirror reflection areas in the image that will affect the expression of the sample's polarization characteristics, and the next step of processing can be performed.

[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 continue to grow outward by one pixel using the same process of region growth, and this is used as the temporary boundary, denoted as {(b edge1 (i1′,j1′), b edge2 (i2′, j2′), ...b edgenFor each pixel of the temporary boundary, the following operation is performed with the pixel {(a1(i1, j1), a2(i2, j2), ...an(in, jn)} where the singular matrix appears when detecting the initial mirror growth area, with b edge1 For example: ③ According to b edge1 ④ Assume that the pixel found in ③ is a2(i2, j2), calculate the value of Δ(i1′, j1′)-Δ(i2, j2) in the result Δ matrix of polarization decomposition, and make a judgment: if the result is 0 or greater than 0, it proves that the detection of the specular reflection area by the polarization image I1 is incomplete, and the pixel whose polarization characteristics are affected by the specular reflection has not been correctly repaired, and b edge1 (i1′, j1′) is marked as the point to be repaired, and steps 3 to 6 are repeated; if the result is less than 0, the difference between Δ(i1′, j1′) and the average intensity of the Δ matrix is ​​calculated. 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), it can be considered that I′1, I′2, ...I′ 32 In b edge1 The previous pixel in the direction is correctly fixed.

[0092] (3) For {(b edge1 (i1′,j1′), b edge2 (i2′, j2′), ...b edgen (in′, jn′)} The remaining pixels are subjected to the above operation. If all the detected pixels pass the detection, it is considered that the polarization images I′1, I′2, ... I′ 32 The polarization properties of the sample have eliminated the interference of mirror reflection.

[0093] The calculation and polarization decomposition of the Mueller matrix after the repair is completed can make the extracted four characteristic parameters of dichroism parameter, scattering depolarization parameter, phase delay parameter and azimuth angle of the optical axis more accurate, thereby effectively ensuring the validity of the verification results.

[0094] According to the polarization image region growth mirror reflection repair method proposed in the embodiment of the present application, the mirror reflection threshold of the initial mirror reflection region can be determined and then the growth initial point can be determined, so as to perform regional growth on the initial mirror reflection region, eliminate the mirror reflection region after growth, and repair the target polarization image. Thus, the automatic detection and repair of the mirror reflection region in the polarization image is realized, the manual intervention is greatly reduced, the efficiency and accuracy of image processing are improved, and the particularity of the polarization image is fully considered, the requirements of computer computing power and computing cost are reduced, and a large amount of polarization image data can be effectively processed. At the same time, the accuracy of the mirror reflection removal effect in the processed polarization image can be effectively guaranteed. Thus, the problem that 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 labor-intensive and difficult to meet large-scale image processing requirements, and the accuracy of the recognition result of the mirror reflection region is also lacking, thereby affecting the overall image analysis result, and different polarization images may require independent threshold settings, which is difficult to cope with the problem of solving the mirror reflection region of the polarization image when the number of samples is large.

[0095] Next, the polarized image area growth mirror reflection repair device proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.

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

[0097] like Figure 6 As shown, the polarized image region growth mirror reflection restoration device 10 includes: a first calculation module 100, a region growth module 200 and a restoration module 300.

[0098] The first calculation module 100 is used to calculate the grayscale ratio of the initial specular reflection area of ​​the target polarization image to obtain the specular reflection threshold of the initial specular reflection area.

[0099] The region growing module 200 is used to determine at least one growth initial point according to the mirror reflection threshold value, so as to 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 used to detect whether the grown mirror reflection area meets the preset conditions, so as to stop growing the initial mirror reflection area and repair each pixel of the grown mirror reflection area to eliminate the grown mirror reflection area when it is detected that the grown mirror reflection area meets the preset conditions.

[0101] Optionally, in one 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 used to identify the initial mirror reflection area in the target polarization image.

[0103] The statistical unit is used to count the grayscale values ​​of the pixels in the initial specular reflection area.

[0104] The first calculation unit is used to calculate the grayscale ratio according to the grayscale value.

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

[0106] The second calculation unit is used to calculate the grayscale interpolation of multiple adjacent pixels around at least one initial growth point.

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

[0108] Optionally, in one embodiment of the present application, it further includes: a second calculation module, a detection module and a determination module.

[0109] The second calculation module is used to calculate the grayscale interpolation of adjacent points on the edge of the grown mirror reflection area before stopping the growth of the initial mirror reflection area.

[0110] The detection module is used to detect the gray value of the edge of the grown specular reflection area.

[0111] The determination module is used to determine whether the grown mirror reflection area meets the preset conditions based on the grayscale interpolation and grayscale value of the adjacent points.

[0112] Optionally, in one embodiment of the present application, the calculation formula of the grayscale ratio can be expressed as:

[0113]

[0114] Among them, r an is the proportion of the grayscale of 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 whose gray value is GrayValue, n all is the number of pixels in the entire image.

[0115] It should be noted that the above explanation of the embodiment of the polarized image area growth mirror reflection repair method is also applicable to the polarized image area growth mirror reflection repair device of this embodiment, and will not be repeated here.

[0116] According to the polarization image region growth mirror reflection repair device proposed in the embodiment of the present application, the mirror reflection threshold of the initial mirror reflection region can be determined and then the growth initial point can be determined, so as to perform region growth on the initial mirror reflection region, eliminate the mirror reflection region after growth, and repair the target polarization image. Thus, the automatic detection and repair of the mirror reflection region in the polarization image is realized, the manual intervention is greatly reduced, the efficiency and accuracy of image processing are improved, and the particularity of the polarization image is fully considered, the requirements of computer computing power and computing cost are reduced, and a large amount of polarization image data can be effectively processed, and the accuracy of the mirror reflection removal effect in the processed polarization image can be effectively guaranteed. Thus, the method in the related art is solved that in most cases, the method is only applicable to simple scenes, and when processing complex or changing scenes, manual adjustment is often required, which is time-consuming and labor-intensive 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, and different polarization images may require independent threshold settings, which is difficult to cope with the problem of the solution demand of the mirror reflection region of the polarization image when the number of samples is large.

[0117] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

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

[0119] When the processor 702 executes the program, the polarized image region growth mirror reflection repair method provided in the above embodiment is implemented.

[0120] Furthermore, the electronic device further comprises:

[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 computer programs that can be executed on the processor 702 .

[0123] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as 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 to each other through a bus and communicate with 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. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this 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 communicate with each other through an internal interface.

[0126] The processor 702 may 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] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned polarized image area growth mirror reflection repair method.

[0128] An embodiment of the present application also provides a computer program product, including a computer program, which can run computer instructions. When the computer instructions are executed by a processor, the polarized image area growth mirror reflection repair method provided in the embodiment of the present application is implemented.

[0129] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0130] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0131] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.

[0133] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of multiple of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0134] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0135] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0136] The storage medium mentioned above may 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 can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for repairing mirror reflection by region growth of polarized images, characterized in that: The following steps are involved: Calculating the grayscale ratio of the initial specular reflection area of ​​the target polarization image to obtain the specular reflection threshold of the initial specular reflection area; Determining at least one initial growth point according to the mirror reflection threshold value, so as to grow the initial mirror reflection area based on the at least one initial growth point, so as to obtain a grown mirror reflection area; Detect whether the grown mirror reflection area meets a preset condition, so that if it is detected that the grown mirror reflection area meets the preset condition, stop growing the initial mirror reflection area and repair each pixel of the grown mirror reflection area to eliminate the grown mirror reflection area.

2. The method according to claim 1, characterized in that The step of calculating the grayscale ratio of the initial specular reflection area of ​​the target polarization image includes: identifying an initial specular reflection region in the target polarization image; Counting the grayscale values ​​of the pixels in the initial specular reflection area; The grayscale proportion is calculated according to the grayscale value.

3. The method according to claim 1, characterized in that The step of determining at least one initial growth point according to the mirror reflection threshold value, and growing the initial mirror reflection area based on the at least one initial growth point, to obtain the grown mirror reflection area, comprises: Calculating grayscale interpolation values ​​of a plurality of adjacent pixels around the at least one initial growth point; Based on the at least one initial growth point and the grayscale interpolation, region growth is performed on the initial specular reflection region to obtain the grown specular reflection region.

4. The method according to claim 3, characterized in that Before stopping the growth of the initial specular reflection area, the method further includes: Calculate the grayscale interpolation of adjacent points on the edge of the grown specular reflection area; Detecting the grayscale value of the edge of the grown specular reflection area; Based on the adjacent point grayscale interpolation and the grayscale value, it is determined whether the grown specular reflection area meets a preset condition.

5. The method according to claim 1, characterized in that The calculation formula of the grayscale ratio is: Among them, r an is the proportion of the grayscale of 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 whose gray value is GrayValue, n all is the number of pixels in the entire image.

6. A polarized image area growth mirror reflection repair device, characterized in that: include: A calculation module, used for calculating the grayscale ratio of the initial specular reflection area of ​​the target polarization image to obtain the specular reflection threshold of the initial specular reflection area; A region growth module, used to determine at least one growth initial point according to the specular reflection threshold, so as to grow the initial specular reflection region based on the at least one growth initial point, so as to obtain a grown specular reflection region; A repair module is used to detect whether the grown mirror reflection area meets a preset condition, so that if it is detected that the grown mirror reflection area meets the preset condition, the growth of the initial mirror reflection area is stopped, and each pixel of the grown mirror reflection area is repaired to eliminate the grown mirror reflection area.

7. The device according to claim 6, characterized in that The computing module comprises: an identification unit, used to identify an initial specular reflection area in the target polarization image; A statistical unit, used for counting the grayscale values ​​of the pixels in the initial specular reflection area; A calculation unit is used to calculate the grayscale proportion according to the grayscale value.

8. An electronic device, characterized in that: include: 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 area growth mirror reflection repair method as described in any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the polarized image region growth mirror reflection repair method as described in any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed, it is used to implement the polarized image area growth mirror reflection repair method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Cloth cover positioning method in complex environment

    CN110501339A

  • Highlight image restoration method based on hue

    CN113793274A

  • Image processing device, imaging device, and image processing method

    JP2017157043A

  • System and method for removing specularity from an image

    US20120237128A1

  • Inspection method and inspection apparatus

    US20140232849A1