Dual bad line repair method and device for detector image, electronic product and medium
Patent Information
- Application Number
- CN202311269433.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-09-27
AI Technical Summary
[0005]本发明的目的在于针对X射线探测器图像的双坏线缺陷问题,尽可能的保留图像有效信息,提升图像处理效果并且提高处理速度,以解决上述背景技术中存在的不足
[0034]本发明通过双坏线邻域点判断双坏线点是否需要修复,尽可能保留图像中无需修复的原始数据,利用基于修正结构张量的修复算法,适用于不同的拍摄条件,如钢棒、散料、钢棒加散料等多种情况,可以有效的修复图像缺陷,保留图像的特征信息。本发明方法不需要对硬件设计做改动,可以降低产品成本,提高出货良率。
Smart Images

Figure CN117392012B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of X-ray detectors. Specifically, it relates to a method, apparatus, electronic product, and medium for repairing double bad lines in X-ray detector images. Background Technology
[0002] Currently, in the field of X-ray detectors, the repair of double bad line defects generally involves calculating the weighted average of pixel values in the neighborhood of the bad pixel using a coefficient matrix. This method can effectively repair image defects, but its performance is not ideal when processing images with obvious features, mainly due to the following reasons:
[0003] (1) Only a few pixels in the neighborhood of the bad pixel are considered. These pixels contain less image information and cannot accurately reflect the texture and other details of the image.
[0004] (2) When repairing double bad line defects, the image details become blurred, and if there are objects such as steel bars in the image, obvious broken traces will appear on the repaired image. Summary of the Invention
[0005] The purpose of this invention is to address the double bad line defect problem in X-ray detector images by preserving as much effective image information as possible, improving image processing performance and increasing processing speed, thereby overcoming the shortcomings of the aforementioned background technology.
[0006] To achieve the above objectives, in a first aspect, the present invention provides a method for repairing double bad lines in a detector image, comprising:
[0007] The initialization steps involve obtaining the image values of all points in the detector image and the positions of the double bad lines in the detector image. The double bad line points are initialized and marked as bad points, while other points are initialized and marked as good points.
[0008] The steps for judging double bad lines and bad points: In this step, for a double bad line point in the detector image, the image value of the good points in the first neighborhood of the point is used to determine the good point threshold range of the point. If the original image value of the point falls outside the good point range, the double bad line point needs to be repaired and finally marked as a bad point; otherwise, the double bad line point does not need to be repaired and is finally marked as a good point.
[0009] The steps for repairing double-line defects are as follows: In this step, for a double-line defect in the detector image, the corrected structure tensor of the second neighborhood of the defect is obtained, and the structural features of the second neighborhood of the defect are obtained based on the corrected structure tensor. The weights of the good points in the second neighborhood of the defect are determined based on the structural features of the second neighborhood of the defect. The image values of the good points in the second neighborhood of the double-line defect are weighted and averaged to obtain the image value of the repaired double-line defect, and the point is marked as a good point.
[0010] The step of traversing all double-defect points completes the identification and repair of double-defect points in the detector image.
[0011] In some embodiments of the present invention, in the step of traversing all double-defect points, a step of judging double-defect points is first performed on all double-defect points, and good points are removed from the double-defect points. Then, a step of repairing double-defect points is performed on all double-defect points. Alternatively, for a double-defect point in the detector image, a step of judging double-defect points is first performed. If the point is a double-defect point, a step of repairing double-defect points is performed on the point. After the point is repaired, it is used as a good point to participate in the judgment and repair of double-defect points of other double-defect points. If the point is a good point, the judgment and repair of double-defect points of the next double-defect point is performed until all double-defect points are traversed.
[0012] In some embodiments of the present invention, the good point threshold range of a point is determined using the image values of good points in the first neighborhood of that point using the following formula:
[0013] T1=Avg+α×(A max -A min ),
[0014] T2=Avg-β×(A max -A min ),
[0015] Where T1 and T2 are the upper and lower limits of the good point threshold range, respectively, and A max and A min These are the maximum and minimum values of the good point images in the first neighborhood, respectively. Avg is the mean of the good point image values in the first neighborhood. Furthermore, Avg is the value excluding the maximum value A. max and minimum value A min The mean of the image values of other good points in the neighborhood, where α and β are numbers in the interval (0, 1).
[0016] In some embodiments of the present invention, α is 0.05 and β is 0.5.
[0017] In some embodiments of the present invention, the traversal is performed sequentially from one end of the double bad line to the other end.
[0018] In some embodiments of the present invention, the structural features of the second neighborhood of the bad point are the two eigenvalues and the eigenvector of the minimum eigenvalue of the corrected structure tensor of the second neighborhood of the bad point; for a double-bad-line bad point x = (i * j * The second neighborhood is the midpoint of Ω, y = (k, p), and the second neighborhood modifies the structure tensor. for:
[0019]
[0020] Among them, v σ It is the original detector image u and the convolution kernel function K σ (*) The locally smoothed image v obtained by convolution σ v σ (*) represents the image value at the location* of the locally smoothed image. This represents the gradient in the i-th direction. K represents the gradient in the j-direction. ρ (*) is the convolution kernel function, and σ and ρ are the ranges of details ignored in the computation of coherent directions; modified structure tensor The two eigenvalues are arranged from smallest to largest as λ1 and λ2, and the eigenvector corresponding to λ1 is c = (c1, c2).
[0021] In some embodiments of the present invention, the double bad line bad point x = (i * j * The weight ω(k,p) of the good point y=(k,p) in the second neighborhood Ω is:
[0022]
[0023] Where μ represents the coherence intensity parameter of the second neighborhood of the double-broken line fault point x.
[0024]
[0025] ∈ represents the radius of the second neighborhood on which the double-line bad spot repair depends, and κ represents the diffusion degree parameter of the second neighborhood on which the double-line bad spot repair depends.
[0026] Secondly, the present invention provides a double bad line repair device for detector images, comprising:
[0027] An initialization unit is used to obtain the image values of all points in the detector image and the position of the double bad lines in the detector image. The double bad line points are initialized and marked as bad points, and the other points are initialized and marked as good points.
[0028] The double bad line bad point judgment unit is used to determine the good point threshold range of a double bad line point in the detector image by using the image value of the good points in the first neighborhood of the point. If the original image value of the point falls outside the good point range, the double bad line point needs to be repaired and finally marked as a bad point; otherwise, the double bad line point does not need to be repaired and is finally marked as a good point.
[0029] The double-line defect repair unit is used to, for a double-line defect in the detector image, obtain the corrected structure tensor of the second neighborhood of the defect, obtain the structural features of the second neighborhood of the defect based on the corrected structure tensor, determine the weight of the good points in the second neighborhood of the defect based on the structural features of the second neighborhood of the defect, perform a weighted average of the image values of the good points in the second neighborhood of the double-line defect to obtain the repaired image value of the double-line defect, and mark the point as a good point.
[0030] The traversal control unit is used to control the traversal of all double-defect points, and to complete the identification and repair of double-defect points in the detector image.
[0031] Thirdly, the present invention provides an electronic product comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the double bad line repair method for the detector image.
[0032] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for repairing double bad lines in a detector image.
[0033] Beneficial effects
[0034] This invention determines whether double-defect lines need repair by identifying their neighborhood points, preserving as much original data as possible in the image that does not require repair. Utilizing a repair algorithm based on modified structure tensors, it is applicable to various shooting conditions, such as steel bars, loose materials, and steel bars with loose materials, effectively repairing image defects while preserving image feature information. This method requires no changes to the hardware design, reducing product costs and improving yield. Attached Figure Description
[0035] Figure 1 This is a flowchart of a method for repairing double bad lines in a detector image according to one embodiment of the present invention.
[0036] Figure 2 This is an example of a detector image with double bad lines in one embodiment of the present invention.
[0037] Figure 3 This is an example of a detector image repaired with double bad lines in one embodiment of the present invention.
[0038] Figure 4 This is an example of a detector image with double bad lines in another embodiment of the present invention.
[0039] Figure 5This is an example of an image after double bad lines in the detector image are repaired according to another embodiment of the present invention.
[0040] Figure 6 This is a schematic diagram illustrating the composition principle of a double-bad-line repair device for detector images in one embodiment of the present invention.
[0041] Figure 7 This is a schematic diagram illustrating the composition of an electronic product according to one embodiment of the present invention. Detailed Implementation
[0042] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0043] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0044] In response to the problem of double bad line defects in current detectors, and in order to preserve the effective information of the double bad lines as much as possible and ensure the speed of defect repair, this invention proposes a method, device, electronic product, and medium for repairing double bad lines in detector images.
[0045] This invention determines whether a double-line defect needs repair by analyzing the image values of neighboring points, preserving as much of the original data in the image as possible that does not require repair. For double-line defects requiring repair, the trend features of image values (e.g., grayscale values in a grayscale image, R, G, or B values in an RGB image) in the vicinity of the point are first obtained, and then the point is repaired based on these features. To prevent unsolvable cases, we use a modified structure vector to extract structural features from the neighborhood of the point to be repaired. Based on the eigenvalues and orientations of the structure tensor, the weights of good points in the neighborhood are determined, and then a weighted average is used to obtain the grayscale value of the current defective point. After repair, the point to be repaired can participate in the repair of adjacent points as a non-repairable point, and the repair of the detector image is completed by traversing all points to be repaired.
[0046] This invention discloses a repair method based on modified structure tensors, applicable to various shooting conditions such as steel bars, loose materials, and steel bars with loose materials. It can effectively repair image defects while preserving image feature information. This method requires no modifications to the hardware design, reducing product costs and improving yield.
[0047] The method for repairing double bad lines in detector images according to one embodiment of the present invention is as follows: Figure 1 As shown, it includes:
[0048] The initialization steps involve obtaining the image values of all points in the detector image and the positions of the double bad lines in the detector image. The double bad line points are initialized and marked as bad points, while other points are initialized and marked as good points.
[0049] The steps for judging double bad lines and bad points: In this step, for a double bad line point in the detector image, the image value of the good points in the first neighborhood of the point is used to determine the good point threshold range of the point. If the original image value of the point falls outside the good point range, the double bad line point needs to be repaired and finally marked as a bad point; otherwise, the double bad line point does not need to be repaired and is finally marked as a good point.
[0050] The steps for repairing double-line defects are as follows: In this step, for a double-line defect in the detector image, the corrected structure tensor of the second neighborhood of the defect is obtained, and the structural features of the second neighborhood of the defect are obtained based on the corrected structure tensor. The weights of the good points in the second neighborhood of the defect are determined based on the structural features of the second neighborhood of the defect. The image values of the good points in the second neighborhood of the double-line defect are weighted and averaged to obtain the image value of the repaired double-line defect, and the point is marked as a good point.
[0051] The step of traversing all double-defect points completes the identification and repair of double-defect points in the detector image.
[0052] In some embodiments of the present invention, in the step of traversing all double-defect points, a step of judging double-defect points is first performed on all double-defect points, and good points are removed from the double-defect points. Then, a step of repairing double-defect points is performed on all double-defect points. Alternatively, for a double-defect point in the detector image, a step of judging double-defect points is first performed. If the point is a double-defect point, a step of repairing double-defect points is performed on the point. After the point is repaired, it is used as a good point to participate in the judgment and repair of double-defect points of other double-defect points. If the point is a good point, the judgment and repair of double-defect points of the next double-defect point is performed until all double-defect points are traversed.
[0053] In some embodiments of the present invention, the good point threshold range of a point is determined using the image values of good points in the first neighborhood of that point using the following formula:
[0054] T1=Avg+α×(A max -A min ),
[0055] T2=Avg-β×(A max -A min ),
[0056] Where T1 and T2 are the upper and lower limits of the good point threshold range, respectively, and A max and A min These are the maximum and minimum values of the good point images in the first neighborhood, respectively. Avg is the mean of the good point image values in the first neighborhood. Furthermore, Avg is the value excluding the maximum value A. max and minimum value A min The mean value of the image values of other good points in the surrounding neighborhood, where α and β are numbers in the interval (0, 1). Preferably, α is 0.05 and β is 0.5.
[0057] In some embodiments of the present invention, the traversal is performed sequentially from one end of the double bad line to the other end.
[0058] In some embodiments of the present invention, the structural features of the second neighborhood of the bad point are the two eigenvalues and the eigenvector of the minimum eigenvalue of the corrected structure tensor of the second neighborhood of the bad point; for a double-bad-line bad point x = (i * j * The second neighborhood is the midpoint of Ω, y = (k, p), and the second neighborhood modifies the structure tensor. for:
[0059]
[0060] Among them, v σ It is the original detector image u and the convolution kernel function K σ (*) The locally smoothed image v obtained by convolution σ v σ (*) represents the image value at the location* of the locally smoothed image. This represents the gradient in the i-th direction. K represents the gradient in the j-direction. ρ (*) is the convolution kernel function, and σ and ρ are the ranges of details ignored in the computation of coherent directions; modified structure tensor The two eigenvalues are arranged from smallest to largest as λ1 and λ2, and the eigenvector corresponding to λ1 is c = (c1, c2).
[0061] In some embodiments of the present invention, the double bad line bad point x = (i * j * The weight ω(k,p) of the good point y=(k,p) in the second neighborhood Ω is:
[0062]
[0063] Where μ represents the coherence intensity parameter of the second neighborhood of the double-broken line fault point x.
[0064]
[0065] ∈ represents the radius of the second neighborhood on which the double-line defect repair depends, i.e., the local radius on which the double-line defect repair depends. The closer it is to the point to be repaired, the greater the correlation. In some embodiments of this invention, the points used for repair are at least the six surrounding good points. κ is a diffusion parameter of the second neighborhood on which the double-line defect repair depends. ∈ and κ are related. If the local radius of the region on which the double-line defect repair depends is selected to be larger, more details are actually ignored, and the diffusion degree is greater.
[0066] In some embodiments of the present invention, specifically, the size of image I is known to be (width×height), where width represents the width of image I and height represents the height of image I. The positions of the double bad lines are from point (1, j0) to point (width, j0) and from point (1, j0+1) to point (width, j0+1). In order to retain as much information as possible from the original image, we first filter the points on the double bad lines that need to be repaired, distinguishing between points that need to be repaired and points that do not need to be repaired.
[0067] During initialization, points with two bad lines are initially marked as bad points, while other points are initially marked as good points. Then, a repair judgment is performed on the bad lines. The image values of the neighboring points in the first neighborhood of each bad line point determine whether repair is needed. If no repair is needed, the original data in the image is preserved. The bad point judgment for bad lines utilizes correlation; therefore, many surrounding points can be used. The neighboring points in the first neighborhood of a bad line point can be points on multiple adjacent parallel lines; generally, points on two adjacent lines are selected.
[0068] For example, consider a point (i, j0) on a double-defect line in the detector image (excluding the endpoints) and its adjacent defective points (i, j0+1), (i-1, j0), (i+1, j0), (i-1, j0+1), and (i+1, j0+1), which are initially initialized as defective points. The six surrounding good points (i-1, j0-1), (i, j0-1), (i+1, j0-1), (i-1, j0+2), (i, j0+2), and (i+1, j0+2) are sorted from smallest to largest, and these six sorted points are denoted as A1 to A6. To distinguish between points on the double-defect line that do not require repair and points that need repair, a threshold range is set based on the mean of the six points. Points within this range are considered points that do not require repair, while points outside the range are considered points that need repair.
[0069] T1 = Avg + α*(A6 - A1)
[0070] T2 = Avg - β*(A6 - A1)
[0071] When the grayscale of a point on a double bad line is within (T2, T1), we determine that the point is a good point; otherwise, it is a bad point that needs to be repaired. The parameters α and β are values in the range (0, 1). The smaller α is, the lower the upper limit of the grayscale value for determining a good point; similarly, the larger β is, the lower the lower limit of the grayscale value for determining a good point. In some embodiments of this invention, (α, β) = (0.05, 0.5) is used as the default parameter.
[0072] Preferably, considering that there is also a possibility of bad pixels in the surrounding six points, the average value can be taken after removing the points with the lowest and highest gray levels, i.e., Avg = (A2 + A3 + A4 + A5) / 4.
[0073] If the defective point is the left endpoint of the double defective line in the detector image, only four points (i+1, j0-1), (i, j0-1), (i, j0+2), and (i+1, j0+2) are considered when determining the defective point. If the defective point is the right endpoint of the double defective line in the detector image, only four points (i, j0-1), (i-1, j0-1), (i, j0+2), and (i-1, j0+2) are considered when determining the defective point.
[0074] When repairing bad pixels, points in the second neighborhood of the bad pixel are used for repair. The radii of the first and second neighborhoods can be the same or different. Generally, the radius of the second neighborhood is smaller than that of the first neighborhood, indicating that the bad pixel is closer, has a higher correlation, and a better repair effect. Preferably, points on two adjacent lines are selected.
[0075] For the double-line defect point x = (i) that is determined to need repair, * j * To obtain surrounding features and determine the weights used to repair defective points in the second neighborhood, the first step is to calculate the coherence directions of the second neighborhood of that point. To prevent unsolvable cases, we use a modified structure tensor. That is, before calculating the structure tensor, we convolve the original detector image u with a given kernel function to achieve local smoothing. In some embodiments of this invention, the convolution kernel function used is a two-dimensional Gaussian distribution, i.e.:
[0076]
[0077] The larger the σ we choose, the more details are ignored. When convolving the original detector image, we generally choose σ = 1.5. Let Ω be the second neighborhood of the current bad point x, and y be the points within the second neighborhood. The resulting locally smoothed image v... σ :
[0078]
[0079] in:
[0080] u(x) is the image value at position x in the original detector image u;
[0081] This means that the value is 1 within the second neighborhood Ω and 0 outside the range.
[0082] The corrected structure tensor of the second neighborhood:
[0083]
[0084] Right now:
[0085]
[0086] This represents the gradient in the i-th direction. This represents the gradient in the j-direction.
[0087] When calculating the corrected structure tensor, the convolution kernel used is still a two-dimensional Gaussian distribution. In some embodiments of this invention, the coefficient ρ is selected with a default value of 7. Next, the eigenvectors of the two eigenvalues and the smallest eigenvalue of the structure tensor are calculated. We denote the two eigenvalues as λ1 and λ2 arranged from smallest to largest. The eigenvector c = (c1, c2) corresponding to λ1 is the direction of coherence. The vector perpendicular to c is c′ = (-c2, c1).
[0088] Next, regarding the point to be repaired, x = (i * j * For a good point y = (k, p) in the second neighborhood of ), we calculate the corresponding weight ω(y) = ω(k, p):
[0089]
[0090] Where μ represents the coherence intensity parameter of the second neighborhood of the double-broken line fault point x.
[0091]
[0092] When the two eigenvalues of the structure tensor are equal, any orthogonal vector can represent the eigenvector. In this case, the coherence of the coherent direction we obtain is very weak, so we define the coherence strength as 1.
[0093] ∈ represents the radius of the second neighborhood upon which the double-line defect repair depends, σ and ρ represent the range of details ignored in the direction of coherence calculation, and κ is the diffusion parameter of the second neighborhood upon which the double-line defect repair depends. Generally, the larger ∈ is, the larger κ is. In some embodiments of the present invention, ∈ is 5 and κ is 25.
[0094] Finally, after obtaining the weights of each point, we determine the current point u(i) to be repaired. * j * The gray value of ) is determined by the weighted average of the good points in the second neighborhood:
[0095]
[0096] In one embodiment of the method of the present invention, the detector image before repair processing is as follows: Figure 2 As shown, the image after repair is as follows: Figure 3 As shown. In one embodiment of the method of the present invention, the detector image before repair processing is as follows. Figure 4 As shown, the image after repair is as follows: Figure 5 As shown in the images before and after restoration, it is evident that this invention effectively repairs image defects while preserving the image's feature information.
[0097] like Figure 6 As shown, the structure conversion device for tag-type messages in one embodiment of the present invention includes:
[0098] An initialization unit is used to obtain the image values of all points in the detector image and the position of the double bad lines in the detector image. The double bad line points are initialized and marked as bad points, and the other points are initialized and marked as good points.
[0099] The double bad line bad point judgment unit is used to determine the good point threshold range of a double bad line point in the detector image by using the image value of the good points in the first neighborhood of the point. If the original image value of the point falls outside the good point range, the double bad line point needs to be repaired and finally marked as a bad point; otherwise, the double bad line point does not need to be repaired and is finally marked as a good point.
[0100] The double-line defect repair unit is used to, for a double-line defect in the detector image, obtain the corrected structure tensor of the second neighborhood of the defect, obtain the structural features of the second neighborhood of the defect based on the corrected structure tensor, determine the weight of the good points in the second neighborhood of the defect based on the structural features of the second neighborhood of the defect, perform a weighted average of the image values of the good points in the second neighborhood of the double-line defect to obtain the repaired image value of the double-line defect, and mark the point as a good point.
[0101] The traversal control unit is used to control the traversal of all double-defect points, and to complete the identification and repair of double-defect points in the detector image.
[0102] In one embodiment, the present invention provides an electronic product, such as... Figure 7 As shown, the electronic device includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the double bad line repair method for the detector image described above.
[0103] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripherals, voltage regulators, and power management circuits, via interfaces, as is well known in the art. Interfaces provide a connection between the bus and the transceiver, such as communication interfaces or user interfaces. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0104] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0105] In one embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the above-described embodiment of the method for repairing double bad lines in a detector image.
[0106] Those skilled in the art will understand from the foregoing description that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic storage devices, and optical storage devices.
[0107] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, or methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules / units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or modules or units may be electrical, mechanical, or other forms.
[0108] The modules / units described as separate components may or may not be physically separate. The components shown as modules / units may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules / units can be selected to achieve the objectives of the embodiments of this application, depending on actual needs. For example, the functional modules / units in the various embodiments of this application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0109] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0110] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0111] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A method for repairing double bad lines in a detector image, comprising: The initialization steps involve obtaining the image values of all points in the detector image and the positions of the double bad lines in the detector image. The double bad line points are initialized and marked as bad points, while other points are initialized and marked as good points. The steps for judging double bad lines and bad points: In this step, for a double bad line point in the detector image, the image value of the good points in the first neighborhood of the point is used to determine the good point threshold range of the point. If the original image value of the point falls outside the good point range, the double bad line point needs to be repaired and finally marked as a bad point; otherwise, the double bad line point does not need to be repaired and is finally marked as a good point. The steps for repairing double-line defects are as follows: In this step, for a double-line defect in the detector image, the structure tensor of the second neighborhood of the defect is obtained based on the local smoothing map, and the structural features of the second neighborhood of the defect are obtained according to the structure tensor. The weights of the good points in the second neighborhood of the defect are determined according to the structural features of the second neighborhood of the defect. The image values of the good points in the second neighborhood of the double-line defect are weighted and averaged to obtain the image value of the repaired double-line defect, and the point is marked as a good point. The step of traversing all double bad line points completes the identification and repair of double bad line points in the detector image; The structural features of the second neighborhood of the bad point are the two eigenvalues of the structural tensor of the second neighborhood of the bad point and the eigenvector of the minimum eigenvalue; for double bad lines bad points And its second neighborhood is the midpoint of Ω Second Neighborhood Structure Tensor for: , in, It is the original detector image u and the convolution kernel function. Locally smoothed image obtained by convolution , This is the image value at position ✽ of the locally smoothed image. This represents the gradient in the i-th direction. This represents the gradient in the j-direction. It is the convolution kernel function. and The range of details ignored in the computation of coherent directions; structure tensor The two eigenvalues are arranged in ascending order as follows: and , corresponding to eigenvectors .
2. The method for repairing double bad lines in detector images as described in claim 1, wherein, In the step of traversing all double bad line points, first traverse all double bad line points to perform the double bad line point judgment step, remove the good points among the double bad line points, and then traverse all double bad line points to perform the double bad line point repair step. Alternatively, for a double-defect point in the detector image, first perform a double-defect point judgment step. If the point is a double-defect point, then perform a double-defect point repair step for that point. After the point is repaired, it becomes a good point and participates in the double-defect point judgment and repair of other double-defect points. If the point is a good point, then perform the double-defect point judgment and repair of the next double-defect point, until all double-defect points have been traversed.
3. The method for repairing double bad lines in detector images as described in claim 1, wherein, The threshold range for good points at a given point is determined using the image values of good points in the first neighborhood of that point, and is calculated using the following formula: , , in, and These are the upper and lower limits of the good threshold range, respectively. and These are the maximum and minimum values of the good point images in the first neighborhood, respectively. It is the mean value of the good point image values in the first neighborhood. and It is a number in the interval (0,1).
4. The method for repairing double bad lines in detector images as described in claim 3, wherein, α takes the value of 0.05, and β takes the value of 0.
5.
5. The method for repairing double bad lines in a detector image as described in claim 3, wherein, Traversal is done sequentially from one end of the double-ended line to the other.
6. The method for repairing double bad lines in a detector image as described in claim 1, wherein, Double bad lines and bad pixels The second neighborhood Ω is a good point weight for: , in, This represents the coherence intensity parameter of the second neighborhood of the double-line defect point x. , The radius of the second neighborhood upon which the repair of double-line defects depends. The diffusion parameter of the second neighborhood on which the repair of double-line defects depends.
7. A device for repairing double bad lines in a detector image, comprising: An initialization unit is used to obtain the image values of all points in the detector image and the position of the double bad lines in the detector image. The double bad line points are initialized and marked as bad points, and the other points are initialized and marked as good points. The double bad line bad point judgment unit is used to determine the good point threshold range of a double bad line point in the detector image by using the image value of the good points in the first neighborhood of the point. If the original image value of the point falls outside the good point range, the double bad line point needs to be repaired and finally marked as a bad point; otherwise, the double bad line point does not need to be repaired and is finally marked as a good point. The double-line defect repair unit is used to, for a double-line defect in a detector image, obtain the structure tensor of the second neighborhood of the defect based on the locally smoothed image, obtain the structural features of the second neighborhood of the defect based on the structure tensor, determine the weight of the good points in the second neighborhood of the defect based on the structural features of the second neighborhood of the defect, perform a weighted average of the image values of the good points in the second neighborhood of the double-line defect to obtain the repaired image value of the double-line defect, and mark the point as a good point. The traversal control unit is used to control the traversal of all double bad line points, and to complete the judgment and repair of double bad line points in the detector image. The structural features of the second neighborhood of the bad point are the two eigenvalues of the structural tensor of the second neighborhood of the bad point and the eigenvector of the minimum eigenvalue; for double bad lines bad points And its second neighborhood is the midpoint of Ω Second Neighborhood Structure Tensor for: , in, It is the original detector image u and the convolution kernel function. Locally smoothed image obtained by convolution , This is the image value at position ✽ of the locally smoothed image. This represents the gradient in the i-th direction. This represents the gradient in the j-direction. It is the convolution kernel function. and The range of details ignored in the computation of coherent directions; structure tensor The two eigenvalues are arranged in ascending order as follows: and , corresponding to eigenvectors .
8. An electronic product comprising: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed, enable the at least one processor to perform the double bad line repair method for the detector image as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, wherein, When the computer program is executed by the processor, it implements the double bad line repair method for the detector image according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image defective pixel detection method and edge-based restoration algorithm
CN112365435A
Image processing method and image processing apparatus
US20120038797A1