CN108009994B - Bad line repairing method, device and equipment - Google Patents

Bad line repairing method, device and equipment Download PDF

Info

Publication number
CN108009994B
CN108009994B CN201711009556.7A CN201711009556A CN108009994B CN 108009994 B CN108009994 B CN 108009994B CN 201711009556 A CN201711009556 A CN 201711009556A CN 108009994 B CN108009994 B CN 108009994B
Authority
CN
China
Prior art keywords
repaired
image
bad
line
repairing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711009556.7A
Other languages
Chinese (zh)
Other versions
CN108009994A (en
Inventor
李海春
王柳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Medical Systems Co Ltd
Original Assignee
Neusoft Medical Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Neusoft Medical Systems Co Ltd filed Critical Neusoft Medical Systems Co Ltd
Priority to CN201711009556.7A priority Critical patent/CN108009994B/en
Publication of CN108009994A publication Critical patent/CN108009994A/en
Application granted granted Critical
Publication of CN108009994B publication Critical patent/CN108009994B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method, a device and equipment for repairing a broken wire, wherein the method comprises the following steps: determining that a grid shadow exists on an image to be repaired; obtaining the direction information of the grid shadow; determining a bad line consistent with the direction information of the grid shadow on the image to be repaired according to the direction information of the grid shadow; obtaining the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number; and repairing the bad line on the image to be repaired by using the average gray value. Because the influence of the grid shadow on the pixel points which are separated from the bad line by the preset number is small, the bad line is repaired by utilizing the gray average value of the pixel points which are positioned at the two sides of the bad line and are separated from the bad line by the preset number, and the bad line on the low-density grid image can be repaired well.

Description

Bad line repairing method, device and equipment
Technical Field
The present application relates to the field of data processing, and in particular, to a method, an apparatus, and a device for repairing a bad wire.
Background
Due to the relationship of the detector process, a bad line usually exists on an output image, the quality of the image is affected, and the image needs to be repaired.
In general, the detector automatically repairs a bad line on an output image according to the bad point diagram. However, for an image using a low-density grid, due to the existence of a grid shadow on the image, even if the image is repaired by the detector itself, the bad wire repairing effect on the image in accordance with the direction of the grid shadow is still not good enough, as shown in fig. 1, which is a schematic diagram of the repairing effect of the low-density grid image repaired by the detector itself, wherein the bad wire repairing effect outlined is poor.
Therefore, a method for repairing a bad wire is needed, which can repair a bad wire on a low-density grid image.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, and a device for repairing a bad wire, which can have a better repairing effect on a bad wire on a low-density grid image.
In a first aspect, the present invention provides a method for repairing a damaged line, the method including:
determining that a grid shadow exists on an image to be repaired;
obtaining the direction information of the grid shadow;
determining a bad line consistent with the direction information of the grid shadow on the image to be repaired according to the direction information of the grid shadow;
obtaining the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number;
and repairing the bad line on the image to be repaired by using the average gray value.
Optionally, the determining that a grid shadow exists on the image to be repaired includes:
respectively acquiring a frequency curve in the horizontal direction and a frequency curve in the vertical direction on an image to be restored;
calculating the dispersion degree of the frequency curve in the horizontal direction and the frequency curve in the vertical direction within the pre-acquired grid shadow frequency distribution range respectively;
judging whether a grid shadow exists on the image to be repaired or not according to the discrete degree;
and if the discrete degree is larger than a preset threshold value, determining that the grid shadow exists on the image to be repaired.
Optionally, the obtaining the direction information of the grid shadow includes:
and obtaining the direction information of the grid shadow according to the direction of the frequency curve corresponding to the discrete degree greater than a preset first threshold value.
Optionally, the method further includes:
and after repairing the bad lines on the image to be repaired by using the average gray value, inhibiting the grid shadow on the image to be repaired.
Optionally, the method further includes:
after determining that no grid shadow exists on the image to be repaired or repairing the bad line on the image to be repaired by using the gray average value,
aiming at any dead pixel on the dead line, the following steps are executed:
respectively calculating gray value standard deviations of pixel points in other directions except the direction of the bad line in a preset area with the bad point as the center of a circle;
calculating the gray average value of each pixel point in the direction corresponding to the minimum gray value standard difference;
and repairing the dead pixel by using the gray average value.
Optionally, the method further includes:
after determining that no grid shadow exists on the image to be repaired or repairing the bad line on the image to be repaired by using the gray average value, the following steps are executed for any bad point on the bad line:
respectively calculating gray value standard deviations of pixel points in other directions except the direction of the bad line in a preset area with the bad point as the center of a circle;
if the gray value standard deviation of the pixel points in any direction is smaller than a preset second threshold, calculating the gray average value of each pixel point in the direction corresponding to the gray value standard deviation;
and repairing the dead pixel by using the gray average value.
In a second aspect, the present invention provides a damaged wire repair device, the device comprising:
the first determining module is used for determining that a grid shadow exists on the image to be repaired;
the first acquisition module is used for acquiring the direction information of the grid shadow;
the second determining module is used for determining a bad line on the image to be repaired, which is consistent with the direction information of the grid shadow, according to the direction information of the grid shadow;
the second acquisition module is used for acquiring the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number;
and the first repairing module is used for repairing the bad line on the image to be repaired by utilizing the gray average value.
Optionally, the first determining module includes:
the acquisition submodule is used for respectively acquiring a frequency curve in the horizontal direction and a frequency curve in the vertical direction on the image to be repaired;
the calculation submodule is used for calculating the dispersion degree of the frequency curve in the horizontal direction and the frequency curve in the vertical direction within the pre-acquired grid shadow frequency distribution range;
the judging submodule is used for judging whether the grid shadow exists on the image to be repaired or not according to the discrete degree;
and the determining submodule is used for determining that the grid shadow exists on the image to be repaired when the discrete degree is greater than a preset threshold value.
Optionally, the first obtaining module is specifically configured to:
and obtaining the direction information of the grid shadow according to the direction of the frequency curve corresponding to the discrete degree larger than a preset threshold value.
Optionally, the apparatus further comprises:
and the suppression module is used for suppressing the grid shadow on the image to be repaired after the bad lines on the image to be repaired are repaired by using the gray average value.
Optionally, the apparatus further comprises:
a first calculating module, configured to calculate, after it is determined that a grid shadow does not exist on the image to be repaired or the bad line on the image to be repaired is repaired by using the gray average value, gray value standard deviations of pixel points in other directions except the direction of the bad line for any bad point on the bad line in a preset region with the bad point as a center of a circle;
the second calculation module is used for calculating the gray average value of each pixel point in the direction corresponding to the minimum gray value standard deviation;
and the second repairing module is used for repairing the dead pixel by using the gray average value.
Optionally, the apparatus further comprises:
a third calculating module, configured to calculate, after it is determined that a grid shadow does not exist on the image to be repaired or the bad line on the image to be repaired is repaired by using the gray average value, gray value standard deviations of pixel points in other directions except the direction of the bad line for any bad point on the bad line in a preset region with the bad point as a center of a circle;
the fourth calculation module is used for calculating the gray average value of each pixel point in the direction corresponding to the gray standard deviation when the gray standard deviation of the pixel point in any direction is smaller than a preset second threshold;
and the third repairing module is used for repairing the dead pixel by using the gray average value.
In a third aspect, the present invention provides a damaged line repairing apparatus, including: a memory and a processor, wherein the processor is capable of,
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the following steps according to instructions in the program code: determining that a grid shadow exists on an image to be repaired; obtaining the direction information of the grid shadow; determining a bad line consistent with the direction information of the grid shadow on the image to be repaired according to the direction information of the grid shadow; obtaining the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number; and repairing the bad line on the image to be repaired by using the average gray value.
The invention provides a bad line repairing method, which is characterized in that after a gate shadow exists on an image to be repaired, bad lines in the same direction as the gate shadow on the image to be repaired are determined according to direction information of the gate shadow, and the bad lines are repaired by utilizing gray average values of pixel points which are positioned at two sides of the bad lines and are separated from the bad lines by a preset number. Because the influence of the grid shadow on the pixel points which are separated from the bad line by the preset number is small, the bad line is repaired by utilizing the gray average value of the pixel points which are positioned at the two sides of the bad line and are separated from the bad line by the preset number, and the bad line on the low-density grid image can be repaired well.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic diagram illustrating a repairing effect of a low-density grid image repaired by a detector itself;
fig. 2 is a flowchart of a bad line repairing method according to an embodiment of the present application;
FIG. 3a is a schematic diagram of a horizontal frequency curve of an image A to be repaired;
FIG. 3b is a schematic diagram of a frequency curve in the vertical direction of the image A to be repaired;
FIG. 4 is a bad point map of an image to be restored;
FIG. 5 is a schematic diagram of an image to be repaired with a grid shadow;
FIG. 6a is a diagram illustrating the effect of self-repairing by a prior art probe;
FIG. 6b is a diagram illustrating the repairing effect of the bad wire repairing method according to the embodiment of the present invention;
FIG. 7 is a schematic illustration of a line-to-line card image placed at an angle of 45;
fig. 8 is a flowchart of another bad line repairing method provided in the embodiment of the present application;
FIG. 9 is a schematic image of a vertical direction fault line;
fig. 10 is a diagram illustrating an effect of repairing a damaged line by using the damaged line repairing method according to the embodiment of the present invention;
fig. 11 is a schematic structural diagram of a damaged line repairing apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a damaged line repairing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Due to the detector technology, a bad line is generally present on an output image. In order to ensure the quality of an image, a detector itself usually repairs a bad line on the image, but the inventor finds that the image using a low-density grid has a poor repairing effect even if the detector itself repairs the bad line.
Regularly and uniformly distributed streaks (hereinafter referred to as grid streaks) generally appear in an image using a low-density grid, and the direction of the streaks coincides with the distribution of the lead lines in the low-density grid. The method and the device determine whether the image is the low-density grid image or not by identifying the grid shadow in the image, and further repair the bad lines of the image.
After determining that a grid shadow exists on an image to be repaired, determining a bad line on the image to be repaired, which is consistent with the direction of the grid shadow according to the direction information of the grid shadow, and repairing the bad line by utilizing the gray average value of pixel points which are positioned at two sides of the bad line and are separated from the bad line by a preset number. Because the influence of the grid shadow on the pixel points which are separated from the bad line by the preset number is small, the bad line is repaired by utilizing the gray average value of the pixel points which are positioned at the two sides of the bad line and are separated from the bad line by the preset number, and the bad line on the low-density grid image can be repaired well.
Specifically, an embodiment of the present invention provides a damaged line repairing method, and referring to fig. 2, is a flowchart of the damaged line repairing method provided in the embodiment of the present invention, where the method includes:
s201: and determining that the grid shadow exists on the image to be repaired.
Since the grid shadow exists on the image using the low-density grid, the invention can determine whether the image to be repaired uses the low-density grid or not by identifying the grid shadow on the image to be repaired. In addition, the direction of the grid shadow existing on the image using the low-density grid is horizontal or vertical.
In practical application, because the grid shadow is horizontal or vertical, the image to be restored is traversed along the horizontal direction and the vertical direction respectively to obtain frequency curves in the horizontal direction and the vertical direction.
Specifically, when the image to be restored is traversed along the horizontal direction, fourier transform is performed on pixel values of pixels in each row to obtain a fourier spectrum corresponding to the pixels in each row, the fourier spectra corresponding to the pixels in each row in the horizontal direction are added to obtain an average value, and finally log transform is performed on the average value to obtain a frequency curve in the horizontal direction.
Similarly, when the image to be restored is traversed along the vertical direction, fourier transform is performed on the pixel values of each column of pixels to obtain a fourier spectrum corresponding to each column of pixels, the fourier spectra corresponding to each row of pixels in the vertical direction are added to obtain an average value, and finally log transform is performed on the average value to obtain a frequency curve in the vertical direction.
After obtaining the frequency curves in the horizontal direction and the vertical direction of the image to be restored, respectively calculating the frequency curves in the horizontal direction and the frequency curves in the vertical direction, and respectively obtaining the discrete degrees within the grid shadow frequency distribution range. The dispersion degree can be used as a standard for judging whether the grating shadow exists in the image to be repaired, the greater the dispersion degree is, the greater the possibility of existence of the grating shadow is, and the greater the dispersion degree is, the greater the amplitude of the frequency curve in the frequency distribution range of the grating shadow is reflected by the frequency curve. In addition, the grid shadow frequency distribution range is used for representing the range in which the grid shadow frequency is mainly concentrated, and can be determined according to factors such as the resolution of the detector outputting the image to be repaired, the specification of the used low-density grid, the installation distance between the detector and the grid, the distance between the bulb tube and the detector and the like.
In practical application, after obtaining the dispersion degrees of the frequency curve in the horizontal direction and the frequency curve in the vertical direction in the grid shadow frequency distribution range, judging whether the dispersion degrees in the two directions are smaller than a preset threshold (for example, setting the dispersion degrees to be 0.06), if so, determining that the grid shadow does not exist on the image to be repaired, otherwise, determining that the grid shadow exists on the image to be repaired.
S202: and obtaining the direction information of the grid shadow.
In the embodiment of the invention, if the grid shadow exists in the image to be repaired, the grid shadow exists in the direction with larger dispersion degree in the image to be repaired.
As shown in fig. 3a and 3b, fig. 3a is a schematic diagram of a frequency curve of the image a to be repaired in the horizontal direction, and fig. 3b is a schematic diagram of a frequency curve of the image a to be repaired in the vertical direction. As can be seen from the figure, the dispersion degree of the frequency curve in the vertical direction of the image a to be repaired in the grid shadow frequency distribution range (0.85-0.95) is larger than the preset threshold, which indicates that the grid shadow exists in the vertical direction of the image a to be repaired, i.e., the direction information of the grid shadow is in the vertical direction.
S203: and determining a bad line on the image to be repaired, which is consistent with the direction information of the grid shadow, according to the direction information of the grid shadow.
In the embodiment of the invention, after the direction information of the grid shadow is determined, the bad point diagram of the image to be repaired is scanned according to the direction information of the grid shadow, and the bad line on the image to be repaired, which is consistent with the direction information of the grid shadow, is determined.
As shown in fig. 4, the bad point image of the image to be repaired is shown, where the pixel value of the bad point position on the bad point image is 1, and the pixel values of other positions are 0. If the direction information of the grid shadow is in the vertical direction, scanning the bad point image along the vertical direction of the bad point image, and if the number of the bad points with the pixel value of 1 in a certain column accounts for a certain proportion of the total number of the pixels in the column, determining that the column is a bad line. And if the direction information of the grid shadow is in the horizontal direction, scanning the bad point image along the horizontal direction of the bad point image, and if the number of the bad points with the pixel value of 1 of a certain row accounts for a certain proportion of the total number of the pixels of the row, determining the bad line of the row.
In the embodiment of the invention, the position of the bad line in the bad point diagram is the same as the position of the bad line on the image to be repaired, so that the bad line on the image to be repaired can be determined after the bad line in the bad point diagram is determined.
S204: and obtaining the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number.
In the embodiment of the invention, after the bad line in the image to be repaired is determined, the gray average value of the pixel points which are positioned at two sides of the bad line and are separated from the bad line by the preset number is calculated. As shown in fig. 5, the schematic diagram of the image to be repaired with the gate shadow is shown, where 1 represents a bad line in the same direction as the gate shadow, and 2 represents a pixel point separated from the bad line by a preset number. And calculating the gray average value of the pixel points at the position 2 for repairing the bad line at the position 1.
In addition, in practical application, the preset number of the intervals can be determined according to the resolution of the detector outputting the image to be repaired and the related parameters of the used low-density grid. Specifically, as shown in fig. 5, it may also be directly determined that the preset number of the separated pixels is 1, that is, the average gray level values of the pixels located at both sides of the bad line and separated from the bad line by 1 pixel are calculated.
S205: and repairing the bad line on the image to be repaired by using the average gray value.
In the embodiment of the invention, after the gray average value is obtained, the gray value of the pixel point with the position of the bad line on the repaired image is set as the gray average value, and the repair of the bad line is completed.
As shown in fig. 6a and 6b, fig. 6a is a diagram of the effect of self-repairing by a detector in the prior art, it can be found that the bad line processing effect is poor, and the position of the bad line still has an artifact; fig. 6b is a diagram of the effect of repairing the bad line by the bad line repairing method provided by the embodiment of the invention, and the bad line has no artifact and has a good repairing effect.
Therefore, in the method for repairing the dead pixel, after the gate shadow exists on the image to be repaired, the dead pixel with the same direction as the gate shadow on the image to be repaired is determined according to the direction information of the gate shadow, and the dead pixel is repaired by utilizing the gray average value of the pixel points which are positioned at the two sides of the dead pixel and are separated from the dead pixel by the preset number. Because the influence of the grid shadow on the pixel points which are separated from the bad line by the preset number is small, the bad line is repaired by utilizing the gray average value of the pixel points which are positioned at the two sides of the bad line and are separated from the bad line by the preset number, and the bad line on the low-density grid image can be repaired well.
In addition, because the grid shadow exists in the image to be repaired and the existence of the grid shadow also affects the image quality, the embodiment of the invention can also inhibit the grid shadow on the image to be repaired.
In practical application, a fixed filter can be set to suppress grid shadow according to the frequency curves of the image to be restored in the horizontal direction and the vertical direction. Specifically, the method of setting the fixed filter may be to set a V-shaped filtering frequency curve according to information such as the specification and experience of the used grid, and filter the image to be restored by using the V-shaped filtering frequency curve, so as to suppress the grid image.
In addition, a filter adaptive to the image to be restored can be automatically set according to the frequency curves in the horizontal direction and the vertical direction of the image to be restored, and the grid shadow can be restrained.
In addition, no matter whether a grid shadow exists on the image to be repaired or not, if a straight line which is intersected with the bad line and has a certain included angle exists in the image to be repaired, the position of the bad line still has an artifact after the detector is used for repairing. For example, there are line-to-line card images placed at an angle of 45 °, images of straight line pairs placed at an angle of 45 °, and the like, and as shown in fig. 7, there are artifacts at the positions framed in the schematic diagram of the line-to-line card images placed at an angle of 45 °.
In order to achieve a better repairing effect on a bad line on an image to be repaired meeting the above conditions, an embodiment of the present invention further provides a bad line repairing method, and referring to fig. 8, a flowchart of another bad line repairing method provided in an embodiment of the present invention is provided, where the method specifically includes:
s801: judging whether a grid shadow exists on the image to be repaired; if so, S802 is performed, otherwise, S807 is performed.
S802: and if the grid shadow exists on the image to be repaired, acquiring the direction information of the grid shadow.
S803: and determining a bad line on the image to be repaired, which is consistent with the direction information of the grid shadow, according to the direction information of the grid shadow.
S804: and obtaining the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number.
S805: and repairing the bad line on the image to be repaired by using the average gray value.
The above-mentioned S801 to S805 are the same as S201 to S205, and it can be understood that the description is omitted here.
S806: and inhibiting the grid shadow on the image to be repaired.
In the embodiment of the invention, the grating shadow can be suppressed by arranging a fixed filter or an adaptive filter.
In addition, when a straight line intersecting the broken line and forming a certain included angle (e.g., 30-60 degrees) exists on the image to be repaired, even after the broken line is repaired in S801-S806, the existence of the artifact on the image to be repaired can be obviously observed, so in order to ensure the repairing effect on the broken line, the embodiment of the invention can also default to continue to execute S807-S809 so as to continue to repair the image to be repaired.
S807: and aiming at any dead point on the dead line, respectively calculating the gray value standard deviation of the pixel points in other directions except the direction of the dead line in a preset area taking the dead point as the center of a circle.
In the embodiment of the invention, when it is determined that the grid shadow does not exist on the image to be repaired in step S801, step S807 is directly executed so as to repair the bad line on the image to be repaired, and even if a straight line which is intersected with the bad line and forms a certain included angle exists on the image to be repaired, the repairing effect on the bad line can be ensured.
In addition, after the execution of S806 is finished, S807 may be executed by default, so that the image to be repaired in which the artifact still exists is repaired after the bad line is repaired in S801-S806, and the repairing effect on the bad line is ensured. In S807, for any dead pixel on the dead line, the following operations are performed:
firstly, a preset area is determined by taking the dead pixel as a circle center and taking a preset R as a radius. Secondly, in the preset area, the gray value standard deviation of the pixel points in other directions except the bad line direction is calculated respectively. As shown in fig. 9, there is a schematic image of a vertical dead line, where the position of 0 represents any dead pixel on the dead line, and the positions of 1, 2, and 3 represent pixel points in other directions except the direction of the dead line. Specifically, the gray value standard deviation of the pixel point at the position 1 is calculated, and similarly, the gray value standard deviation of the pixel points at the positions 2 and 3 is calculated.
S808: and calculating the gray average value of each pixel point in the direction corresponding to the minimum gray value standard deviation.
The smaller the standard deviation of the gray value is, the smaller the difference of the gray value of each pixel point in the direction is, so that in order to avoid the occurrence of artifacts at the position of the dead line, the average value of the gray value of each pixel point in the direction corresponding to the minimum standard deviation of the gray value is used for repairing the dead point.
In one case, if there are at least two directions in which the standard deviation of the gray values is minimum, the average gray value of each pixel point in the at least two directions can be calculated for repairing the dead pixel.
S809: and repairing the dead pixel by using the gray average value.
In the embodiment of the invention, after the gray average value of each pixel point in the direction corresponding to the minimum gray value standard deviation is obtained through calculation, the gray value of the dead pixel is set as the gray average value, and the repair of the dead pixel is completed.
In another implementation manner, the method can also continue to repair the bad line on the image to be repaired after determining that a straight line which is intersected with the bad line and has a certain included angle exists on the image to be repaired.
The method for determining whether a straight line which is intersected with a bad line and has a certain included angle exists on an image to be repaired may include that, for any bad point on the bad line in the image to be repaired, in a preset area with the bad point as a circle center, gray value standard deviations of pixel points in other directions except the direction of the bad line are respectively calculated, whether a gray value standard deviation which is smaller than a preset second threshold exists is further judged, and if the gray value standard deviation exists, it is judged that a straight line which is intersected with the bad line and has a certain included angle exists in the direction corresponding to the gray value standard deviation.
In addition, the method for determining whether a straight line which intersects with the bad line and has a certain included angle exists on the image to be repaired may be further configured to perform full-image scanning on the image to be repaired to determine whether a straight line which intersects with the bad line and has a certain included angle exists on the image to be repaired.
After determining that a straight line which is intersected with the bad line and has a certain included angle exists on the image to be repaired, calculating the gray average value of each pixel point in the direction corresponding to the gray value standard deviation smaller than the second threshold; and finally, repairing the dead pixel by using the gray average value.
In practical application, when it is determined that no grid shadow exists on the image to be repaired in S801, the step of determining that a straight line intersecting with the broken line and having a certain included angle exists on the image to be repaired is performed, so that the broken line on the image to be repaired is repaired, and even if a straight line intersecting with the broken line and having a certain included angle exists on the image to be repaired, the repairing effect on the broken line can be ensured.
Or after the execution of S806 is finished, the step of determining that a straight line intersecting the bad line and having a certain included angle exists on the image to be repaired may be executed continuously by default, so that the image to be repaired, in which the artifact still exists, is repaired continuously after the bad line passing through S801-S806 is repaired, and the repairing effect on the bad line is ensured.
When each dead pixel in the dead line is repaired, the dead line on the image is obtained without an artifact, as shown in fig. 10, which is an effect diagram for repairing the dead line by using the dead line repairing method provided by the embodiment of the present invention, wherein the artifact on the image disappears and the repairing effect is obvious.
In addition, an embodiment of the present invention further provides a damaged line repairing apparatus, and referring to fig. 11, the damaged line repairing apparatus according to the embodiment of the present invention is schematically shown in a structural diagram, where the apparatus includes:
a first determining module 1101, configured to determine that a grid shadow exists on an image to be repaired;
a first obtaining module 1102, configured to obtain direction information of the grid shadow;
a second determining module 1103, configured to determine, according to the direction information of the grid shadow, a bad line on the image to be repaired, where the bad line is consistent with the direction information of the grid shadow;
a second obtaining module 1104, configured to obtain a gray average value of pixels that are located on both sides of the bad line and separated from the bad line by a preset number;
a first repairing module 1105, configured to repair the bad line on the image to be repaired by using the average grayscale value.
Wherein the first determining module may include:
the acquisition submodule is used for respectively acquiring a frequency curve in the horizontal direction and a frequency curve in the vertical direction on the image to be repaired;
the calculation submodule is used for calculating the dispersion degree of the frequency curve in the horizontal direction and the frequency curve in the vertical direction within the pre-acquired grid shadow frequency distribution range;
the judging submodule is used for judging whether the grid shadow exists on the image to be repaired or not according to the discrete degree;
and the determining submodule is used for determining that the grid shadow exists on the image to be repaired when the discrete degree is greater than a preset threshold value.
The first obtaining module is specifically configured to:
and obtaining the direction information of the grid shadow according to the direction of the frequency curve corresponding to the discrete degree larger than a preset threshold value.
Optionally, the apparatus further comprises:
and the suppression module is used for suppressing the grid shadow on the image to be repaired after the bad lines on the image to be repaired are repaired by using the gray average value.
In order to further improve the effect of repairing the broken wire, the device may further include:
a first calculating module, configured to calculate, after it is determined that a grid shadow does not exist on the image to be repaired or the bad line on the image to be repaired is repaired by using the gray average value, gray value standard deviations of pixel points in other directions except the direction of the bad line for any bad point on the bad line in a preset region with the bad point as a center of a circle;
the second calculation module is used for calculating the gray average value of each pixel point in the direction corresponding to the minimum gray value standard deviation;
and the second repairing module is used for repairing the dead pixel by using the gray average value.
In another implementation, the apparatus may further include:
a third calculating module, configured to calculate, after it is determined that a grid shadow does not exist on the image to be repaired or the bad line on the image to be repaired is repaired by using the gray average value, gray value standard deviations of pixel points in other directions except the direction of the bad line for any bad point on the bad line in a preset region with the bad point as a center of a circle;
the fourth calculation module is used for calculating the gray average value of each pixel point in the direction corresponding to the gray standard deviation when the gray standard deviation of the pixel point in any direction is smaller than a preset second threshold;
and the third repairing module is used for repairing the dead pixel by using the gray average value.
In the dead pixel repairing device provided by the embodiment of the invention, after the gate shadow exists on the image to be repaired, the dead line in the same direction as the gate shadow on the image to be repaired is determined according to the direction information of the gate shadow, and the dead line is repaired by utilizing the gray average value of the pixel points which are positioned at the two sides of the dead line and are separated from the dead line by the preset number. Because the influence of the grid shadow on the pixel points which are separated from the bad line by the preset number is small, the bad line is repaired by utilizing the gray average value of the pixel points which are positioned at the two sides of the bad line and are separated from the bad line by the preset number, and the bad line on the low-density grid image can be repaired well.
In addition, the embodiment of the invention repairs the bad line on the card image of the line pair inclined at 45 degrees by using the average gray value of the pixel points in the direction with the minimum standard deviation of the gray value in the preset area, so that the bad line has better repairing effect.
Correspondingly, an embodiment of the present invention further provides a damaged line repairing apparatus, as shown in fig. 12, where the damaged line repairing apparatus may include:
a processor 1201, a memory 1202, an input device 1203, and an output device 1204. The number of the processors 1201 may be one or more, and one processor is taken as an example in fig. 12. In some embodiments of the present invention, the processor 1201, the memory 1202, the input device 1203 and the output device 1204 may be connected by a bus or other means, wherein the connection by the bus is illustrated in fig. 12.
The memory 1202 may be used to store software programs and modules, and the processor 1201 executes various functional applications and data processing of the bad wire repairing apparatus by running the software programs and modules stored in the memory 1202. The memory 1202 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 1202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The input device 1203 may be used to receive input numeric or character information and generate signal inputs related to user settings and functional control of the bad wire repair apparatus.
Specifically, in this embodiment, the processor 1201 loads the executable file corresponding to the process of one or more application programs into the memory 1202 according to the following instructions, and the processor 1201 runs the application programs stored in the memory 1202, thereby implementing various functions:
determining that a grid shadow exists on an image to be repaired;
obtaining the direction information of the grid shadow;
determining a bad line consistent with the direction information of the grid shadow on the image to be repaired according to the direction information of the grid shadow;
obtaining the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number;
and repairing the bad line on the image to be repaired by using the average gray value.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method, the device and the equipment for repairing the damaged wire provided by the embodiment of the application are described in detail, a specific example is applied in the description to explain the principle and the implementation of the application, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (13)

1. A method for repairing a damaged line, the method comprising:
determining that a grid shadow exists on an image to be repaired;
obtaining the direction information of the grid shadow;
determining a bad line consistent with the direction information of the grid shadow on the image to be repaired according to the direction information of the grid shadow;
obtaining the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number; the preset number is a numerical value determined according to the resolution of the detector of the image to be repaired and the relevant parameters of the used low-density grid;
and repairing the bad line on the image to be repaired by using the average gray value.
2. The method for repairing the bad line according to claim 1, wherein the determining that the grating shadow exists on the image to be repaired comprises:
respectively acquiring a frequency curve in the horizontal direction and a frequency curve in the vertical direction on an image to be restored;
calculating the dispersion degree of the frequency curve in the horizontal direction and the frequency curve in the vertical direction within the pre-acquired grid shadow frequency distribution range respectively;
judging whether a grid shadow exists on the image to be repaired or not according to the discrete degree;
and if the discrete degree is larger than a preset threshold value, determining that the grid shadow exists on the image to be repaired.
3. The method for repairing a bad wire according to claim 2, wherein the obtaining the direction information of the grid shadow comprises:
and obtaining the direction information of the grid shadow according to the direction of the frequency curve corresponding to the discrete degree greater than a preset first threshold value.
4. The bad line repairing method according to any one of claims 1-3, further comprising:
and after repairing the bad lines on the image to be repaired by using the average gray value, inhibiting the grid shadow on the image to be repaired.
5. The bad line repairing method according to claim 1, further comprising:
after determining that no grid shadow exists on the image to be repaired or repairing the bad line on the image to be repaired by using the gray average value,
aiming at any dead pixel on the dead line, the following steps are executed:
respectively calculating gray value standard deviations of pixel points in other directions except the direction of the bad line in a preset area with the bad point as the center of a circle;
calculating the gray average value of each pixel point in the direction corresponding to the minimum gray value standard difference;
and repairing the dead pixel by using the gray average value.
6. The bad line repairing method according to claim 1, further comprising:
after determining that no grid shadow exists on the image to be repaired or repairing the bad line on the image to be repaired by using the gray average value, the following steps are executed for any bad point on the bad line:
respectively calculating gray value standard deviations of pixel points in other directions except the direction of the bad line in a preset area with the bad point as the center of a circle;
if the gray value standard deviation of the pixel points in any direction is smaller than a preset second threshold, calculating the gray average value of each pixel point in the direction corresponding to the gray value standard deviation;
and repairing the dead pixel by using the gray average value.
7. A damaged wire repair device, the device comprising:
the first determining module is used for determining that a grid shadow exists on the image to be repaired;
the first acquisition module is used for acquiring the direction information of the grid shadow;
the second determining module is used for determining a bad line on the image to be repaired, which is consistent with the direction information of the grid shadow, according to the direction information of the grid shadow;
the second acquisition module is used for acquiring the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number; the preset number is a numerical value determined according to the resolution of the detector of the image to be repaired and the relevant parameters of the used low-density grid;
and the first repairing module is used for repairing the bad line on the image to be repaired by utilizing the gray average value.
8. The bad wire repairing apparatus according to claim 7, wherein said first determining module comprises:
the acquisition submodule is used for respectively acquiring a frequency curve in the horizontal direction and a frequency curve in the vertical direction on the image to be repaired;
the calculation submodule is used for calculating the dispersion degree of the frequency curve in the horizontal direction and the frequency curve in the vertical direction within the pre-acquired grid shadow frequency distribution range;
the judging submodule is used for judging whether the grid shadow exists on the image to be repaired or not according to the discrete degree;
and the determining submodule is used for determining that the grid shadow exists on the image to be repaired when the discrete degree is greater than a preset threshold value.
9. The damaged line repairing device according to claim 8, wherein the first obtaining module is specifically configured to:
and obtaining the direction information of the grid shadow according to the direction of the frequency curve corresponding to the discrete degree larger than a preset threshold value.
10. The damaged line repair device of any one of claims 7-9, wherein the device further comprises:
and the suppression module is used for suppressing the grid shadow on the image to be repaired after the bad lines on the image to be repaired are repaired by using the gray average value.
11. The bad line repair apparatus of claim 7, further comprising:
a first calculating module, configured to calculate, after it is determined that a grid shadow does not exist on the image to be repaired or the bad line on the image to be repaired is repaired by using the gray average value, gray value standard deviations of pixel points in other directions except the direction of the bad line for any bad point on the bad line in a preset region with the bad point as a center of a circle;
the second calculation module is used for calculating the gray average value of each pixel point in the direction corresponding to the minimum gray value standard deviation;
and the second repairing module is used for repairing the dead pixel by using the gray average value.
12. The bad line repair apparatus of claim 7, further comprising:
a third calculating module, configured to calculate, after it is determined that a grid shadow does not exist on the image to be repaired or the bad line on the image to be repaired is repaired by using the gray average value, gray value standard deviations of pixel points in other directions except the direction of the bad line for any bad point on the bad line in a preset region with the bad point as a center of a circle;
the fourth calculation module is used for calculating the gray average value of each pixel point in the direction corresponding to the gray standard deviation when the gray standard deviation of the pixel point in any direction is smaller than a preset second threshold;
and the third repairing module is used for repairing the dead pixel by using the gray average value.
13. A damaged wire repair device, the device comprising: a memory and a processor, wherein the processor is capable of,
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the following steps according to instructions in the program code: determining that a grid shadow exists on an image to be repaired; obtaining the direction information of the grid shadow; determining a bad line consistent with the direction information of the grid shadow on the image to be repaired according to the direction information of the grid shadow; obtaining the gray average value of pixel points which are positioned at two sides of the bad line and separated from the bad line by a preset number; repairing the bad line on the image to be repaired by using the gray average value;
the preset number is a value determined according to the resolution of the detector of the image to be repaired and the relevant parameters of the used low-density grid.
CN201711009556.7A 2017-10-25 2017-10-25 Bad line repairing method, device and equipment Active CN108009994B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711009556.7A CN108009994B (en) 2017-10-25 2017-10-25 Bad line repairing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711009556.7A CN108009994B (en) 2017-10-25 2017-10-25 Bad line repairing method, device and equipment

Publications (2)

Publication Number Publication Date
CN108009994A CN108009994A (en) 2018-05-08
CN108009994B true CN108009994B (en) 2020-08-04

Family

ID=62051035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711009556.7A Active CN108009994B (en) 2017-10-25 2017-10-25 Bad line repairing method, device and equipment

Country Status (1)

Country Link
CN (1) CN108009994B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111275639B (en) * 2020-01-17 2023-06-20 深圳市安健科技股份有限公司 Line pixel defect correction method and terminal for X-ray image

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0962888A2 (en) * 1998-06-02 1999-12-08 General Electric Company Method for removing grid line artifacts in x-ray images
CN101795349A (en) * 2010-03-24 2010-08-04 深圳迈瑞生物医疗电子股份有限公司 Method for processing faulty wire of x-ray flat panel detector image and device thereof
US20140241496A1 (en) * 2013-02-22 2014-08-28 Naoki Hasegawa Radiographic apparatus and method for the same
EP1505540B1 (en) * 2003-08-07 2014-11-19 Canon Kabushiki Kaisha Removal of gridlines in radiographic image
CN104915930A (en) * 2014-03-14 2015-09-16 深圳迈瑞生物医疗电子股份有限公司 Method and device for carrying out gray scale compensation and noise suppression on image
CN105574816A (en) * 2014-10-13 2016-05-11 Ge医疗系统环球技术有限公司 Method and device for eliminating grid shadows of X-ray images as well as X-ray machine updating package
CN106651814A (en) * 2017-01-12 2017-05-10 沈阳东软医疗系统有限公司 Image processing method and apparatus
CN107145832A (en) * 2017-04-11 2017-09-08 江苏邦融微电子有限公司 A kind of scaling method and its self-repair method of capacitance type fingerprint acquisition system bad line

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0962888A2 (en) * 1998-06-02 1999-12-08 General Electric Company Method for removing grid line artifacts in x-ray images
EP1505540B1 (en) * 2003-08-07 2014-11-19 Canon Kabushiki Kaisha Removal of gridlines in radiographic image
CN101795349A (en) * 2010-03-24 2010-08-04 深圳迈瑞生物医疗电子股份有限公司 Method for processing faulty wire of x-ray flat panel detector image and device thereof
US20140241496A1 (en) * 2013-02-22 2014-08-28 Naoki Hasegawa Radiographic apparatus and method for the same
CN104915930A (en) * 2014-03-14 2015-09-16 深圳迈瑞生物医疗电子股份有限公司 Method and device for carrying out gray scale compensation and noise suppression on image
CN105574816A (en) * 2014-10-13 2016-05-11 Ge医疗系统环球技术有限公司 Method and device for eliminating grid shadows of X-ray images as well as X-ray machine updating package
CN106651814A (en) * 2017-01-12 2017-05-10 沈阳东软医疗系统有限公司 Image processing method and apparatus
CN107145832A (en) * 2017-04-11 2017-09-08 江苏邦融微电子有限公司 A kind of scaling method and its self-repair method of capacitance type fingerprint acquisition system bad line

Also Published As

Publication number Publication date
CN108009994A (en) 2018-05-08

Similar Documents

Publication Publication Date Title
KR102363265B1 (en) Adaptive local threshold and color filtering
JP4908440B2 (en) Image processing apparatus and method
CN108009994B (en) Bad line repairing method, device and equipment
CN105991554A (en) Vulnerability detection method and equipment
CN113034447B (en) Edge defect detection method and device
CN111866501A (en) Camera module detection method and device, electronic equipment and medium
CN105205803A (en) Display panel defect detection method
CN112014349A (en) Terahertz time-domain spectral imaging restoration method and device, storage medium and terminal
JP2018148280A5 (en)
EP2618306A1 (en) Method and apparatus for correcting corner point of image and image processing device
CN110288557B (en) Infrared image restoration method, device, equipment and readable storage medium
JP2019074496A (en) Crack detector, crack detection method, and computer program
CN112070700B (en) Method and device for removing protrusion interference noise in depth image
US20170146462A1 (en) System and method of analyzing a curved surface
CN111723753A (en) Satellite remote sensing image strip removing method and device and electronic equipment
US20170318245A1 (en) Method for detecting defective pixels
CN117011532A (en) Image processing method, apparatus, device, storage medium, and program product
CN115294564A (en) Method, device, medium and electronic equipment for detecting identification effectiveness of point cloud data
CN112766256B (en) Grating phase diagram processing method and device, electronic equipment and storage medium
KR20150086758A (en) Apparatus and methdo for processing graphic
CN114757870A (en) Grid map quality evaluation method and device, computer equipment and storage medium
CN109829019B (en) Data conversion method and device of vector data and electronic equipment
CN113870403A (en) Information processing method and device for image rendering
CN114494118A (en) Method for detecting width of target object and method for detecting length of target object
CN109963150B (en) Detection method, system and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 110179 No. 177-1 Innovation Road, Hunnan District, Shenyang City, Liaoning Province

Applicant after: DongSoft Medical System Co., Ltd.

Address before: 110179 No. 177-1 Innovation Road, Hunnan District, Shenyang City, Liaoning Province

Applicant before: Dongruan Medical Systems Co., Ltd., Shenyang

GR01 Patent grant
GR01 Patent grant