CN115661122A - Method and system for removing image grid lines - Google Patents
Method and system for removing image grid lines Download PDFInfo
- Publication number
- CN115661122A CN115661122A CN202211424333.8A CN202211424333A CN115661122A CN 115661122 A CN115661122 A CN 115661122A CN 202211424333 A CN202211424333 A CN 202211424333A CN 115661122 A CN115661122 A CN 115661122A
- Authority
- CN
- China
- Prior art keywords
- image
- grid
- pixel value
- spectrogram
- critical point
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000006243 chemical reaction Methods 0.000 claims abstract description 9
- 238000003384 imaging method Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 11
- 239000000835 fiber Substances 0.000 description 5
- 238000005253 cladding Methods 0.000 description 3
- 210000000709 aorta Anatomy 0.000 description 1
- 239000013078 crystal Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 238000002324 minimally invasive surgery Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000010453 quartz Substances 0.000 description 1
- VYPSYNLAJGMNEJ-UHFFFAOYSA-N silicon dioxide Inorganic materials O=[Si]=O VYPSYNLAJGMNEJ-UHFFFAOYSA-N 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Abstract
The invention relates to a method and a system for removing image grid lines, which relate to the technical field of image processing; the method comprises the steps of carrying out color space conversion on an obtained target image, and extracting a brightness component in the obtained color space image to obtain a grid image; performing Fourier transform on the grid image to obtain a spectrogram; determining the diameter of each grid frequency in the spectrogram according to a set pixel value threshold; determining the side length of each grid according to the diameter; determining a central candidate point of the grid according to the set neighborhood range; setting a neighborhood range to be determined according to the side length of the grid; performing interpolation operation on four adjacent central candidate points by adopting a bilinear interpolation method to obtain an interpolated pixel value, and replacing the pixel values around the central candidate points by adopting the interpolated pixel value; after the replacement of the pixel values around the center candidate points of all the grids is finished, reconstructing a color mode to obtain a target image with the grids removed; the invention can remove the grids and improve the definition of the image.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to an image gridding stripe removing method and system.
Background
The fiberscope is a special scope equipped for an endoscope imaging system, and can be applied to various minimally invasive surgery scenes, such as a laryngoscope, a bronchoscope, a gastroscope, an aorta root endoscope and the like. It consists of a bundle of fibers made of glass or quartz crystal, each fiber consisting of a core with a high refractive index and a cladding with a low refractive index, light entering the fiber from one end, being guided along the core of the fiber by internal reflection of the core and the cladding, and being imaged on a sensor (sensor). Due to the lower refractive index of the cladding, a more pronounced lattice-like structure is formed.
The mesh has a large influence on the definition of an image, and particularly when a dynamic scene is observed, a key observation object in the scene is difficult to grasp, so that a focus cannot be better positioned. Therefore, how to remove the mesh is crucial.
Disclosure of Invention
The invention aims to provide a method and a system for removing image grid lines, which are used for removing grids and improving the definition of an image.
In order to achieve the purpose, the invention provides the following scheme:
an image gridline removal method, the method comprising:
acquiring a target image; the target image is a white balance image obtained by adopting endoscope imaging;
performing color space conversion on the target image to obtain a color space image, and extracting a brightness component in the color space image to obtain a grid image;
performing Fourier transform on the grid image to obtain a spectrogram;
determining the diameter of each grid frequency in the spectrogram according to a set pixel value threshold; the grid frequency is a circular area formed by pixel values larger than a set pixel value threshold value in the spectrogram;
determining the side length of each grid in the grid image according to the diameter;
for any grid, determining a central candidate point of the grid according to a set neighborhood range; the set neighborhood range is determined according to the side length of the grid;
for pixel values around any central candidate point, performing interpolation operation on four adjacent central candidate points by adopting a bilinear interpolation method to obtain an interpolated pixel value, and replacing the pixel values around the central candidate point by adopting the interpolated pixel value;
after the replacement of the pixel values around the center candidate points of all the grids in the grid image is finished, reconstructing a color mode to obtain a reconstructed image; and the reconstructed image is the target image with the grid removed.
Optionally, the fourier transform is performed on the mesh image to obtain a spectrogram, and specifically includes:
intercepting the grid image according to a set pixel critical value to obtain an intercepted grid image;
and performing Fourier transform on the intercepted grid image to obtain a frequency spectrogram.
Optionally, the determining, according to the set pixel value threshold, the diameter of each grid frequency in the spectrogram specifically includes:
performing traversal search on the spectrogram from four directions of edge positions to the center position of the spectrogram at the same time; the four directions are the upper left corner direction, the upper right corner direction, the lower left corner direction and the lower right corner direction of the spectrogram;
for any direction, if the pixel value searched at the current position of the spectrogram and the pixel values at the adjacent positions are both greater than the set pixel value threshold, determining the current position of the spectrogram as a critical point;
for the spectrogram, after searching is completed in four directions, obtaining an upper left critical point, an upper right critical point, a lower left critical point and a lower right critical point;
determining a distance between two critical points in a target critical point pair as a diameter of the grid frequency;
the target critical point pair includes the upper left critical point and the lower right critical point, or the target critical point pair includes the lower left critical point and the upper right critical point.
Optionally, the determining, for any grid, the central candidate point of the grid according to the set neighborhood range specifically includes:
for any pixel in the grid, searching a maximum pixel value and a minimum pixel value in a set neighborhood range of the pixel;
calculating a difference value between the maximum pixel value and the minimum pixel value;
and if the difference value is greater than the set difference value, determining the position of the maximum pixel value as a central candidate point of the grid.
Optionally, the intercepting the grid image according to the set pixel critical value to obtain an intercepted grid image specifically includes:
performing pixel traversal search from four directions to the central position of the grid image at the edge position of the grid image; the four directions are an upper left corner direction, an upper right corner direction, a lower left corner direction and a lower right corner direction of the grid image;
for any direction, if the pixels searched at the current position of the grid image and the pixels at the adjacent positions are smaller than the set pixel critical value, determining the current position of the grid image as an interception critical point;
for the grid image, after searching is completed in all four directions, obtaining an upper left interception critical point, an upper right interception critical point, a lower left interception critical point and a lower right interception critical point;
and intercepting the grid image by adopting an intercepting area formed by the upper left intercepting critical point, the upper right intercepting critical point, the lower left intercepting critical point and the lower right intercepting critical point to obtain an intercepted grid image.
Optionally, the calculation formula of the color space image is:
wherein Y represents a luminance component of the color space image; cb represents a blue chrominance component of the color space image; cr represents a red chrominance component of a color space image; r represents a red channel component of the target image; g represents a green channel component of the target image; b denotes the blue channel component of the target image.
Optionally, the calculation formula of the side length of the grid is as follows:
N=r/2
wherein N is the side length of the grid, and r is the diameter of the grid frequency.
Optionally, the calculation formula of the interpolated pixel value is:
where f (x, y) represents a function of the interpolated pixel value; q 11 、Q 21 、Q 12 And Q 22 Four neighboring center candidate points; f (x, y 1) represents Q 11 And Q 21 Interpolation operation is carried out; f (x, y 2) is Q 12 And Q 22 Interpolation operation is carried out; center candidate point Q 11 The coordinates of (a) are (x, y 1); center candidate point Q 21 Has the coordinates of (x) 2 ,y 1 ) (ii) a Center candidate point Q 12 Has the coordinates of (x) 1 ,y 2 ) (ii) a Center candidate point Q 22 Has the coordinates of (x) 2 ,y 2 )。
An image gridline removal system, the system comprising:
the target image acquisition module is used for acquiring a target image; the target image is a white balance image obtained by adopting endoscope imaging;
the grid image determining module is used for carrying out color space conversion on the target image to obtain a color space image, and extracting the brightness component in the color space image to obtain a grid image;
the frequency spectrogram acquisition module is used for carrying out Fourier transform on the grid image to obtain a frequency spectrogram;
the calculation module is used for determining the diameter of each grid frequency in the spectrogram according to a set pixel value threshold; the grid frequency is a circular area surrounded by pixel values larger than a set pixel value threshold value in the spectrogram;
the determining module of the side length of the grid is used for determining the side length of each grid in the grid image according to the diameter;
the center candidate point determining module is used for determining the center candidate point of the grid according to a set neighborhood range for any grid; the set neighborhood range is determined according to the side length of the grid;
the interpolation pixel value processing module is used for carrying out difference operation on four adjacent center candidate points by adopting a bilinear interpolation method for pixel values around any center candidate point to obtain an interpolation pixel value, and replacing the pixel values around the center candidate point with the interpolation pixel value;
the image reconstruction module is used for reconstructing a color mode to obtain a reconstructed image after the replacement of pixel values around the center candidate points of all the grids in the grid image is finished; and the reconstructed image is the target image with the grid removed.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
the embodiment of the invention provides an image gridding grain removing method and system, which are characterized in that a white balance image obtained by adopting endoscope imaging, namely a target image, is subjected to color space conversion to obtain a color space image, and a brightness component in the color space image is extracted to obtain a grid image; performing Fourier transform on the grid image to obtain a spectrogram, and further determining the diameter of each grid frequency and the side length of each grid in the spectrogram; then determining and setting a neighborhood range through the side length of the grid, and further determining a central candidate point of the grid; for pixel values around any central candidate point, performing interpolation operation on four adjacent central candidate points by adopting a bilinear interpolation method, and replacing the pixel values around the central candidate point with the interpolation pixel values obtained by operation; after the replacement of pixel values around the center candidate points of all the grids in the grid image is finished, reconstructing a color mode to obtain a reconstructed image; reconstructing an image into a target image with grids removed; by means of color space conversion, fourier transformation, interpolation operation and final color mode reconstruction of the target image, grid lines in the target image are weakened and removed, and therefore grids can be removed, and image definition is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flowchart of an image gridding stripe removing method according to an embodiment of the present invention;
FIG. 2 is a block diagram of an image gridding based system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a grid image before being intercepted according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a truncated mesh image according to an embodiment of the present invention;
FIG. 5 is a spectrum diagram according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating bilinear interpolation provided in accordance with an embodiment of the present invention;
FIG. 7 is a schematic diagram of a first target image acquired by a fiberscope according to an embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating a partial magnification of a first target image according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a partial enlargement of a reconstructed image corresponding to a first target image according to an embodiment of the present invention;
FIG. 10 is a schematic illustration of a second target image acquired by another fiberscope according to an embodiment of the present invention;
FIG. 11 is a schematic diagram illustrating a partial magnification of a second target image according to an embodiment of the present invention;
fig. 12 is a schematic diagram of a local enlargement of a reconstructed image corresponding to a second target image according to an embodiment of the present invention.
Description of the symbols:
the device comprises a target image acquisition module-1, a grid image determination module-2, a spectrogram acquisition module-3, a calculation module-4, a grid side length determination module-5, a center candidate point determination module-6, an interpolation pixel value processing module-7 and an image reconstruction module-8.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The invention aims to provide a method and a system for removing image grid lines, which are used for removing grids and improving the definition of an image.
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, the present invention is described in detail with reference to the accompanying drawings and the detailed description thereof.
Example 1
As shown in fig. 1, an embodiment of the present invention provides an image moire removing method, where the method includes:
step 100: acquiring a target image; the target image is a white balance image obtained by endoscopic imaging.
Step 200: and performing color space conversion on the target image to obtain a color space image, and extracting a brightness component in the color space image to obtain a grid image.
The calculation formula of the color space image is as follows:
wherein Y represents a luminance component of the color space image; cb represents a blue chrominance component of the color space image; cr represents a red chrominance component of a color space image; r represents a red channel component of the target image; g represents a green channel component of the target image; b denotes the blue channel component of the target image.
Step 300: and carrying out Fourier transform on the grid image to obtain a spectrogram.
Step 300 specifically includes:
intercepting the grid image according to a set pixel critical value to obtain an intercepted grid image; and carrying out Fourier transform on the intercepted grid image to obtain a spectrogram.
The method includes the following steps of intercepting a grid image according to a set pixel critical value to obtain an intercepted grid image, and specifically includes:
performing pixel traversal search from four directions to the central position of the grid image at the edge position of the grid image; the four directions are an upper left corner direction, an upper right corner direction, a lower left corner direction and a lower right corner direction of the grid image.
For any direction, if the pixel searched at the current position of the grid image and the pixels at the adjacent positions are smaller than the set pixel critical value, determining the current position of the grid image as an interception critical point.
And for the grid image, after the search is completed in all four directions, obtaining an upper left interception critical point, an upper right interception critical point, a lower left interception critical point and a lower right interception critical point.
And intercepting the grid image by adopting an intercepting area formed by the upper left intercepting critical point, the upper right intercepting critical point, the lower left intercepting critical point and the lower right intercepting critical point to obtain the intercepted grid image.
The method comprises the steps of extracting brightness components in color space images to obtain grid images, namely taking the brightness components of the Y color space images as input, wherein due to the fact that the diameter of a fiberscope is small and the clear aperture is small, the shot images, namely the grid images, have obvious black circles, only the contents in the circles are effective contents, and the contents outside the circles are completely black, and have no effective information. Therefore, the picture needs to be cut out, and the picture in the circle is cut out. The pictures before and after the interception are shown in fig. 3 and 4. The intercepting steps are as follows:
in the first step, since the part outside the black circle is shielded, no light is irradiated, the pixel value of the formed image is small, and the difference between the part outside the black circle and the part inside the black circle is large, an appropriate threshold value is set to distinguish the part outside the black circle from the part inside the black circle, and a pixel threshold value k (generally k = 15) is set, which is the pixel value of the image, the pixel value outside the black circle is generally smaller than 15, and the pixel value inside the black circle is generally larger than 15.
And secondly, traversing the picture, respectively finding out four critical points of which the upper, lower, left and right image values of the edge of the image circle are larger than k, traversing the upper points from the upper left corner of the image line by line and downwards for searching, traversing the lower points from the lower left corner of the image line by line and upwards for searching, traversing the left points from the upper left corner of the image line by line and rightwards for searching, and traversing the right points from the upper right corner of the image line by line and leftwards for searching. The condition of judging whether the point is the critical point is that the point and the eight surrounding points are all larger than the threshold value to be the critical point, otherwise, the search is continued to be traversed.
And thirdly, determining a starting point of the captured picture, and taking an abscissa of the critical point of the left side point and an ordinate of the critical point of the upper side point as coordinates of the starting point.
And fourthly, determining the width of the intercepted picture, namely an intercepted area, comparing the distances between the upper critical point and the lower critical point and the left critical point and the right critical point, and selecting the image with larger distance as the width of the intercepted picture, wherein the intercepted picture is also a square because the circle is a perfect circle.
Fourier transform is performed on the intercepted mesh image to obtain a spectrogram, as shown in fig. 5. The formula for performing the fourier transform is:
f1 And (g, h) represents values of g rows and h columns of pixel points in the intercepted grid image, M is the side length of the intercepted grid image, and F (u, v) represents values of u rows and v columns of pixel points in the acquired frequency spectrogram after Fourier transform is performed on the intercepted grid image.
Step 400: determining the diameter of each grid frequency in the spectrogram according to a set pixel value threshold; the grid frequency is a circular area surrounded by pixel values which are larger than a set pixel value threshold value in the spectrogram.
Specifically, determining the diameter of each grid frequency in the spectrogram according to a set pixel value threshold specifically includes:
traversing and searching the spectrogram from four directions of the edge position to the central position of the spectrogram simultaneously; the four directions are the upper left corner direction, the upper right corner direction, the lower left corner direction and the lower right corner direction of the spectrogram.
For any direction, if the pixel value searched at the current position of the spectrogram and the pixel values of the adjacent positions are both greater than the set pixel value threshold, determining the current position of the spectrogram as a critical point.
For the spectrogram, after searching is completed in all four directions, an upper left critical point, an upper right critical point, a lower left critical point and a lower right critical point are obtained.
Determining the distance between two critical points in the target critical point pair as the diameter of the grid frequency; the target critical point pair includes an upper left critical point and a lower right critical point, or the target critical point pair includes a lower left critical point and an upper right critical point.
In short, the diameter r of the grid frequency shown on the spectrogram (i.e., the brightest circle on the spectrogram is the concentrated grid frequency) is determined.
In a first step, a pixel value threshold p (typically p = 10) is set, representing a threshold value of the intensity of the grid frequency.
And secondly, traversing the spectrogram, respectively finding out four critical points with the upper, lower, left and right numerical values of the brightest circle being larger than p, wherein the upper points traverse downwards line by line from the upper left corner of the image, the lower points traverse upwards line by line from the lower left corner of the image, the left points traverse rightwards line by line from the upper left corner of the image, and the right points traverse leftwards line by line from the upper right corner of the image. The condition of judging as the critical point is that the point and the eight surrounding points are all larger than the pixel value threshold value p; otherwise, the search is continued to be traversed.
And thirdly, calculating the side length of the square framed by the four points, namely the diameter of the grid frequency.
Step 500: and determining the side length of each grid in the grid image according to the diameter.
The calculation formula of the side length of the grid is as follows:
N=r/2
wherein, N is the side length of the grid, and r is the diameter of the grid frequency.
Step 600: for any grid, determining a central candidate point of the grid according to a set neighborhood range; the set neighborhood range is determined according to the side length of the grid.
for any pixel in the grid, searching a maximum pixel value and a minimum pixel value in a set neighborhood range of the pixel; calculating a difference value between the maximum pixel value and the minimum pixel value; and if the difference value is greater than the set difference value, determining the position of the maximum pixel value as a central candidate point of the grid.
In this step, the center point of each mesh is determined; due to the nature of the fiber, the center point of the grid is typically brightest, i.e., the pixel value is largest. For each pixel point P (a, b), finding the maximum value P _ max (a, b) and the minimum value P _ min (a, b) in the range of its neighborhood N × N, giving the minimum difference value d (generally d = 100), if P _ max (a, b) -P _ min (a, b) > d, thenPoint (a) max ,b max ) The center candidate point of the grid.
Step 700: and for the pixel value around any central candidate point, performing interpolation operation on four adjacent central candidate points by adopting a bilinear interpolation method to obtain an interpolated pixel value, and replacing the pixel value around the central candidate point by adopting the interpolated pixel value.
Namely, after the central candidate point of the grid is determined, the image is divided into three RGB channels for reconstruction, and for all pixel points except the central point of the grid in the image, four adjacent central candidate points are utilized for bilinear interpolation to obtain a new pixel value. As shown in fig. 6. The point P is a point to be interpolated, and Q11, Q12, Q21 and Q22 are adjacent four central points. And replacing the original pixel value with the pixel value obtained by the new interpolation, and removing the grid after the interpolation of all the points is completed.
The calculation formula of the interpolation pixel value is:
where f (x, y) represents a function of the interpolated pixel value; q 11 、Q 21 、Q 12 And Q 22 Four neighboring center candidate points; f (x, y 1) represents Q 11 And Q 21 Interpolation operation is carried out between; f (x, y 2) is Q 12 And Q 22 Interpolation operation is carried out between; center candidate point Q 11 The coordinates of (a) are (x, y 1); center candidate point Q 21 Has the coordinates of (x) 2 ,y 1 ) (ii) a Center candidate point Q 12 Has the coordinates of (x) 1 ,y 2 ) (ii) a Center candidate point Q 22 Has the coordinates of (x) 2 ,y 2 )。
Step 800: when the replacement of the pixel values around the center candidate points of all the grids in the grid image is completed, reconstructing a color mode to obtain a reconstructed image; and reconstructing the image into the target image with the grid removed.
Because the same fiberscope is used in the same operation, after the white balance image at the beginning of the operation determines the center of the grid, all the images can be subjected to interpolation reconstruction by using the information. After the grid graphs of different types of fiberscopes are reconstructed, all grids are removed.
Fig. 7, 8 and 9 show a comparison of the first target image acquired by one fiberscope before and after grid removal.
Fig. 10, 11 and 12 show comparison diagrams before and after grid removal of a second target image acquired by another fiberscope. Therefore, the method for removing the image grid lines provided by the embodiment of the invention can remove grids and improve the definition of a fiberscope image.
Example 2
The embodiment of the invention provides an image grid line removing system, which comprises: the device comprises a target image acquisition module 1, a grid image determination module 2, a frequency spectrogram acquisition module 3, a calculation module 4, a determination module 5 for the side length of a grid, a center candidate point determination module 6, an interpolation pixel value processing module 7 and an image reconstruction module 8.
A target image obtaining module 1, configured to obtain a target image; the target image is a white balance image obtained by endoscopic imaging.
And the grid image determining module 2 is used for performing color space conversion on the target image to obtain a color space image, and extracting the brightness component in the color space image to obtain a grid image.
And the spectrogram acquisition module 3 is used for performing Fourier transform on the grid image to obtain a spectrogram.
The calculation module 4 is used for determining the diameter of each grid frequency in the spectrogram according to the set pixel value threshold; the grid frequency is a circular area surrounded by pixel values which are larger than a set pixel value threshold value in the spectrogram.
And the determining module 5 for the side length of the grid is used for determining the side length of each grid in the grid image according to the diameter.
A central candidate point determining module 6, configured to determine, for any grid, a central candidate point of a grid according to a set neighborhood range; the set neighborhood range is determined according to the side length of the grid.
And the interpolation pixel value processing module 7 is configured to perform difference operation on four adjacent center candidate points by using a bilinear interpolation method for pixel values around any center candidate point to obtain an interpolation pixel value, and replace the pixel value of the center candidate point with the interpolation pixel value.
The image reconstruction module 8 is used for reconstructing a color mode to obtain a reconstructed image after the replacement of the pixel values of the center candidate points of all the grids in the grid image is finished; and reconstructing the image into the target image with the grid removed.
The method and the system for removing the image grid lines solve the problems that the grid lines of different lens types are inconsistent and therefore self-adaptive removal is difficult, and the image containing the grid lines is not clear. By adopting the method and the system for removing the image grid lines, the image grid lines can be self-adaptively weakened, grids can be self-adaptively removed, the definition of a fiberscope image is improved, and doctors are helped to better position focuses and perform operations.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the description of the method part.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the foregoing, the description is not to be taken in a limiting sense.
Claims (9)
1. An image gridlines removal method, the method comprising:
acquiring a target image; the target image is a white balance image obtained by adopting endoscope imaging;
performing color space conversion on the target image to obtain a color space image, and extracting a brightness component in the color space image to obtain a grid image;
performing Fourier transform on the grid image to obtain a spectrogram;
determining the diameter of each grid frequency in the spectrogram according to a set pixel value threshold; the grid frequency is a circular area formed by pixel values larger than a set pixel value threshold value in the spectrogram;
determining the side length of each grid in the grid image according to the diameter;
for any grid, determining a central candidate point of the grid according to a set neighborhood range; the set neighborhood range is determined according to the side length of the grid;
for pixel values around any central candidate point, performing interpolation operation on four adjacent central candidate points by adopting a bilinear interpolation method to obtain an interpolated pixel value, and replacing the pixel values around the central candidate point by adopting the interpolated pixel value;
when the replacement of the pixel values around the center candidate points of all the grids in the grid image is completed, reconstructing a color mode to obtain a reconstructed image; the reconstructed image is the target image with the grid removed.
2. The method for removing image gridlines according to claim 1, wherein the fourier transform is performed on the grid image to obtain a spectrogram, specifically comprising:
intercepting the grid image according to a set pixel critical value to obtain an intercepted grid image;
and carrying out Fourier transform on the intercepted grid image to obtain a spectrogram.
3. The method according to claim 1, wherein the determining the diameter of each grid frequency in the spectrogram according to a set pixel value threshold specifically includes:
performing traversal search on the spectrogram from four directions of edge positions to the center position of the spectrogram at the same time; the four directions are the upper left corner direction, the upper right corner direction, the lower left corner direction and the lower right corner direction of the spectrogram;
for any direction, if the pixel value searched at the current position of the spectrogram and the pixel values of the adjacent positions are both greater than the set pixel value threshold, determining the current position of the spectrogram as a critical point;
for the spectrogram, after searching is completed in four directions, obtaining an upper left critical point, an upper right critical point, a lower left critical point and a lower right critical point;
determining a distance between two critical points in a target critical point pair as a diameter of the grid frequency;
the target critical point pair includes the upper left critical point and the lower right critical point, or the target critical point pair includes the lower left critical point and the upper right critical point.
4. The method according to claim 1, wherein the determining the central candidate point of the grid for any grid according to the set neighborhood range specifically includes:
for any pixel in the grid, searching a maximum pixel value and a minimum pixel value in a set neighborhood range of the pixel;
calculating a difference value between the maximum pixel value and the minimum pixel value;
and if the difference value is greater than the set difference value, determining the position of the maximum pixel value as the center candidate point of the grid.
5. The method for removing the image grid lines according to claim 2, wherein the intercepting the grid image according to the set pixel critical value to obtain the intercepted grid image specifically comprises:
performing pixel traversal search from four directions to the central position of the grid image at the edge position of the grid image; the four directions are an upper left corner direction, an upper right corner direction, a lower left corner direction and a lower right corner direction of the grid image;
for any direction, if the pixels searched at the current position of the grid image and the pixels at the adjacent positions are smaller than the set pixel critical value, determining the current position of the grid image as an interception critical point;
for the grid image, after searching is completed in all four directions, obtaining an upper left interception critical point, an upper right interception critical point, a lower left interception critical point and a lower right interception critical point;
and intercepting the grid image by adopting an intercepting area consisting of the upper left intercepting critical point, the upper right intercepting critical point, the lower left intercepting critical point and the lower right intercepting critical point to obtain an intercepted grid image.
6. The method according to claim 1, wherein the color space image is calculated by the formula:
wherein Y represents a luminance component of the color space image; cb represents a blue chrominance component of the color space image; cr represents a red chrominance component of a color space image; r represents a red channel component of the target image; g represents a green channel component of the target image; b denotes a blue channel component of the target image.
7. The method according to claim 5, wherein the side length of the mesh is calculated by the formula:
N=r/2
wherein, N is the side length of the grid, and r is the diameter of the grid frequency.
8. The image gridline removal method according to claim 1, wherein the calculation formula of the interpolated pixel value is:
where f (x, y) represents a function of the interpolated pixel value; q 11 、Q 21 、Q 12 And Q 22 Four neighboring center candidate points; f (x, y 1) represents Q 11 And Q 21 Interpolation operation is carried out between; f (x, y 2) is Q 12 And Q 22 Interpolation operation is carried out between; center candidate point Q 11 The coordinates of (a) are (x, y 1); center candidate point Q 21 Has the coordinates of (x) 2 ,y 1 ) (ii) a Center candidate point Q 12 Has the coordinates of (x) 1 ,y 2 ) (ii) a Center candidate point Q 22 Has the coordinates of (x) 2 ,y 2 )。
9. An image gridlines removal system, the system comprising:
the target image acquisition module is used for acquiring a target image; the target image is a white balance image obtained by adopting endoscope imaging;
the grid image determining module is used for carrying out color space conversion on the target image to obtain a color space image, and extracting the brightness component in the color space image to obtain a grid image;
the spectrogram acquisition module is used for performing Fourier transform on the grid image to obtain a spectrogram;
the calculation module is used for determining the diameter of each grid frequency in the spectrogram according to a set pixel value threshold; the grid frequency is a circular area surrounded by pixel values larger than a set pixel value threshold value in the spectrogram;
the determining module of the side length of the grid is used for determining the side length of each grid in the grid image according to the diameter;
the central candidate point determining module is used for determining a central candidate point of the grid according to a set neighborhood range for any grid; the set neighborhood range is determined according to the side length of the grid;
the interpolation pixel value processing module is used for carrying out difference operation on four adjacent center candidate points by adopting a bilinear interpolation method for pixel values around any center candidate point to obtain an interpolation pixel value, and replacing the pixel values around the center candidate points by adopting the interpolation pixel value;
the image reconstruction module is used for reconstructing a color mode to obtain a reconstructed image after the replacement of pixel values around the center candidate points of all the grids in the grid image is finished; and the reconstructed image is the target image with the grid removed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211424333.8A CN115661122B (en) | 2022-11-14 | 2022-11-14 | Image grid pattern removing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211424333.8A CN115661122B (en) | 2022-11-14 | 2022-11-14 | Image grid pattern removing method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115661122A true CN115661122A (en) | 2023-01-31 |
CN115661122B CN115661122B (en) | 2024-01-12 |
Family
ID=85021972
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211424333.8A Active CN115661122B (en) | 2022-11-14 | 2022-11-14 | Image grid pattern removing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115661122B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117314798A (en) * | 2023-11-29 | 2023-12-29 | 国药新光医疗科技有限公司 | Method for removing fiber mirror image grid |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102004914A (en) * | 2010-08-12 | 2011-04-06 | 汉王科技股份有限公司 | Method and device for detecting round seal position |
CN107516298A (en) * | 2017-07-21 | 2017-12-26 | 安徽航天生物科技股份有限公司 | A kind of endoscopic images processing method |
CN112884666A (en) * | 2021-02-02 | 2021-06-01 | 杭州海康慧影科技有限公司 | Image processing method, image processing device and computer storage medium |
CN113068015A (en) * | 2021-03-24 | 2021-07-02 | 南京锐普创科科技有限公司 | Endoscope image distortion correction system based on optical fiber probe |
CN113989313A (en) * | 2021-12-23 | 2022-01-28 | 武汉智博通科技有限公司 | Edge detection method and system based on image multidimensional analysis |
CN115063311A (en) * | 2022-06-13 | 2022-09-16 | 中国电子科技集团公司第五十四研究所 | Quick star map tailing straight line removing method |
CN115170686A (en) * | 2022-06-14 | 2022-10-11 | 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) | Fiber micro-endoscope image reconstruction method based on contrast learning and storage medium |
-
2022
- 2022-11-14 CN CN202211424333.8A patent/CN115661122B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102004914A (en) * | 2010-08-12 | 2011-04-06 | 汉王科技股份有限公司 | Method and device for detecting round seal position |
CN107516298A (en) * | 2017-07-21 | 2017-12-26 | 安徽航天生物科技股份有限公司 | A kind of endoscopic images processing method |
CN112884666A (en) * | 2021-02-02 | 2021-06-01 | 杭州海康慧影科技有限公司 | Image processing method, image processing device and computer storage medium |
CN113068015A (en) * | 2021-03-24 | 2021-07-02 | 南京锐普创科科技有限公司 | Endoscope image distortion correction system based on optical fiber probe |
CN113989313A (en) * | 2021-12-23 | 2022-01-28 | 武汉智博通科技有限公司 | Edge detection method and system based on image multidimensional analysis |
CN115063311A (en) * | 2022-06-13 | 2022-09-16 | 中国电子科技集团公司第五十四研究所 | Quick star map tailing straight line removing method |
CN115170686A (en) * | 2022-06-14 | 2022-10-11 | 合肥综合性国家科学中心人工智能研究院(安徽省人工智能实验室) | Fiber micro-endoscope image reconstruction method based on contrast learning and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117314798A (en) * | 2023-11-29 | 2023-12-29 | 国药新光医疗科技有限公司 | Method for removing fiber mirror image grid |
CN117314798B (en) * | 2023-11-29 | 2024-05-03 | 国药新光医疗科技有限公司 | Method for removing fiber mirror image grid |
Also Published As
Publication number | Publication date |
---|---|
CN115661122B (en) | 2024-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2312858B1 (en) | Image processing apparatus, imaging apparatus, image processing method, and program | |
CN102968761B (en) | Image processing equipment and image processing method | |
EP1931130B1 (en) | Image processing apparatus, image processing method, and program | |
JP5840008B2 (en) | Image processing apparatus, image processing method, and program | |
US8351776B2 (en) | Auto-focus technique in an image capture device | |
CN100576924C (en) | Image processing equipment and image processing method | |
US20150092992A1 (en) | Image processing device, image capturing apparatus, and image processing method | |
CN1937781A (en) | Image processing apparatus and image processing method | |
KR101174742B1 (en) | Methods and apparatuses for addressing chromatic aberrations and purple fringing | |
JP2007129535A (en) | Image processor, image processing method, program thereof, and computer-readable recording medium recorded with same program | |
CN113676629B (en) | Image sensor, image acquisition device, image processing method and image processor | |
CN115661122B (en) | Image grid pattern removing method and system | |
CN109064415A (en) | Image processing method, system, readable storage medium storing program for executing and terminal | |
KR101257946B1 (en) | Device for removing chromatic aberration in image and method thereof | |
JP2008011289A (en) | Digital camera | |
CN113852759B (en) | Image enhancement method and shooting device | |
JP2009284009A (en) | Image processor, imaging device, and image processing method | |
JP2010219683A (en) | Image processing device, image processing method, and program | |
JP5268321B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP6213466B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP2015035782A (en) | Image processing device, imaging device, microscope system, image processing method, and image processing program | |
KR101205833B1 (en) | Apparatus and method for image processing for digital zooming system | |
CN105654541A (en) | Window image processing method and device | |
EP2306397A1 (en) | Method and system for optimizing lens aberration detection | |
JP6238673B2 (en) | Image processing apparatus, imaging apparatus, imaging system, image processing method, image processing program, and 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |