Image dispersion correction method, device, electronic device and storage medium

By detecting and matching the inter-channel edges of the film camera image, calculating the aberration offset and performing dispersion correction, the dispersion problem of film camera image is solved, and automatic correction and image quality improvement are achieved.

CN113989131BActive Publication Date: 2024-11-19AEROSPACE INFORMATION RES INST CAS
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202111092532.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-17
Publication Date
2024-11-19
Estimated Expiration
2041-09-17

AI Technical Summary

Technical Problem

The diffraction main mirror of the thin film camera has strong dispersion characteristics, which leads to red or blue edges in the image, affecting the image clarity, especially under strong light conditions and at large light incident angles. The imaging characteristics of the thin film camera need to be targeted. Perform image dispersion correction to improve image quality.

Method used

By acquiring the sub-image to be corrected, detecting the straight edges of each sub-image channel, matching the reference channel and the edges of the correction channel, calculating the aberration offsets between channels, determining the aberration offsets of the central pixel, and based on these offsets The image is dispersion corrected and a new coordinate grid is constructed to resample it to correct the dispersion.

Benefits of technology

Automatic dispersion correction of film camera images is realized, the clarity and quality of the image is improved, and the dispersion space inequality caused by uneven assembly of film main mirrors is adaptively handled, thus reducing manual intervention and improving application capabilities in the field of remote sensing. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113989131B_ABST
    Figure CN113989131B_ABST
Patent Text Reader

Abstract

The present invention provides an image dispersion correction method, device, electronic device and storage medium, wherein the method comprises: obtaining a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected; determining the aberration offset between channels of each sub-image to be corrected; and performing dispersion correction on the image to be corrected according to the aberration offset between channels of each sub-image to be corrected. The image dispersion correction method, device, electronic device and storage medium provided by the present invention can realize automatic correction of image dispersion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image dispersion correction method, device, electronic equipment and storage medium. Background Art

[0002] The film camera is a thin film diffraction optical imaging system. Its main mirror is made of high molecular polymer film material and uses diffraction imaging. Compared with traditional reflective optical imaging systems, it has the advantages of light structure, easy replication, foldable and unfoldable, and loose system tolerance requirements. Because of these characteristics, its aperture can be made very large, providing new ideas for the future realization of high-orbit and high-spatial-resolution earth observation in space.

[0003] In the prior art, the diffraction primary mirror of the film camera has a strong dispersion characteristic. Under certain lighting conditions, the image formed is prone to dispersion, resulting in a decrease in image clarity. The so-called dispersion effect of the image refers to the phenomenon that red or blue edges appear at the edges of the target object in the image. This phenomenon is particularly significant when the light is strong and the incident angle of the light is large. The reason for this phenomenon is that light of different wavelengths has different refractive indices, which disperses during the imaging process, and then exhibits spatial position differences between bands in the imaging system to produce red or blue edges, which appear as inter-band aberrations in the image. Therefore, in order to improve the quality of the diffraction image of the film camera and enable the film camera to be better applied in fields such as remote sensing, it is an important issue that the industry needs to solve urgently to correct the dispersion effect of the image formed by the film camera based on its imaging characteristics. Summary of the invention

[0004] In view of the problems existing in the prior art, the embodiments of the present invention provide an image dispersion correction method, device, electronic device and storage medium.

[0005] The present invention provides an image dispersion correction method, comprising:

[0006] Acquire a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected;

[0007] Determining the aberration offset between channels of each sub-image to be corrected;

[0008] The image to be corrected is subjected to dispersion correction according to the aberration offset between channels of each sub-image to be corrected.

[0009] According to an image dispersion correction method provided by the present invention, determining the aberration offset between channels of each sub-image to be corrected comprises:

[0010] Detecting straight line edges of each target channel of each sub-image to be corrected; the target channel includes a reference channel and a correction channel, and the correction channel includes two channels other than the reference channel;

[0011] Matching the straight line edge of the reference channel with the straight line edge of the correction channel to obtain a target straight line edge that matches the straight line edge of the reference channel;

[0012] Determine the aberration offset between the reference channel and the correction channel of the straight line edge of the reference channel and the matching target straight line edge;

[0013] The aberration offset is determined as the aberration offset of the central pixel of the sub-image to be corrected.

[0014] According to an image dispersion correction method provided by the present invention, determining the aberration offset as the aberration offset of the central pixel of the sub-image to be corrected comprises:

[0015] Determine a corresponding mean value of horizontal aberration offset and a mean value of vertical aberration offset according to all the aberration offsets between the reference channel and the correction channel;

[0016] The mean value of the aberration horizontal offset and the mean value of the aberration vertical offset are determined as the aberration offset of the central pixel of the sub-image to be corrected.

[0017] According to an image dispersion correction method provided by the present invention, the dispersion correction of the image to be corrected according to the aberration offset between channels of each sub-image to be corrected comprises:

[0018] For each pixel of the image to be corrected, determining a target horizontal offset and a target vertical offset of the pixel in the correction channel relative to the reference channel;

[0019] Determine new coordinates of the pixel in the correction channel according to the target horizontal offset and the target vertical offset of the pixel, and determine the digital quantization value of the original coordinate corresponding to the new coordinate as the digital quantization value of the new coordinate, to obtain the original coordinate grid of the correction channel;

[0020] The image to be corrected is subjected to dispersion correction according to the original coordinate grid, the target horizontal offset of each pixel, and the target vertical offset.

[0021] According to an image dispersion correction method provided by the present invention, determining a target horizontal offset and a target vertical offset of the pixel in the correction channel relative to the reference channel comprises:

[0022] Determine position information of central pixels of a preset number of sub-images to be corrected that are adjacent to the pixel;

[0023] Determine the target horizontal offset according to the position information of the central pixels of the preset number of sub-images to be corrected and the average value of the aberration horizontal offset corresponding to each of the position information;

[0024] The target vertical offset is determined according to the position information of the central pixels of the preset number of sub-images to be corrected and the average value of the aberration vertical offset corresponding to each of the position information.

[0025] According to an image dispersion correction method provided by the present invention, the dispersion correction is performed on the image to be corrected according to the original coordinate grid, the target horizontal offset and the target vertical offset of each pixel, comprising:

[0026] Determine a corresponding target horizontal offset mean value according to the target horizontal offset, and determine a corresponding target vertical offset mean value according to the target vertical offset;

[0027] Constructing a new coordinate grid of the correction channel according to the position information of all pixels in the reference channel of the image to be corrected, the mean value of the target horizontal offset of all pixels in the correction channel and the corresponding mean value of the target vertical offset;

[0028] The original coordinate grid of the correction channel is resampled based on the new coordinate grid.

[0029] The present invention also provides an image dispersion correction device, comprising:

[0030] An acquisition unit, used for acquiring a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected;

[0031] A determination unit, used to determine the aberration offset between channels of each sub-image to be corrected;

[0032] The correction unit is used to perform dispersion correction on the image to be corrected according to the aberration offset between channels of each sub-image to be corrected.

[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned image dispersion correction methods are implemented.

[0034] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned image dispersion correction methods are implemented.

[0035] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above-mentioned image dispersion correction methods are implemented.

[0036] The image dispersion correction method, device, electronic device and storage medium provided by the present invention calculate the aberration offset between the channels of each sub-image to be corrected when each sub-image to be corrected is acquired, and perform dispersion correction on the image to be corrected according to the aberration offset between the channels of each sub-image to be corrected, thereby realizing automatic correction of image dispersion. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 It is one of the flow charts of the image dispersion correction method provided by the present invention;

[0039] Figure 2 It is a partially enlarged schematic diagram of the dispersion of the image of the thin film camera provided by the present invention;

[0040] Figure 3 This is the second flow chart of the image dispersion correction method provided by the present invention;

[0041] Figure 4 This is the third flow chart of the image dispersion correction method provided by the present invention;

[0042] Figure 5 This is the fourth flow chart of the image dispersion correction method provided by the present invention;

[0043] Figure 6 is a partial enlarged schematic diagram of a film camera image after dispersion correction provided by the present invention;

[0044] Figure 7 It is a structural schematic diagram of the image dispersion correction device provided by the present invention;

[0045] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] Combine the following Figure 1-Figure 6 The image dispersion correction method of the present invention is described.

[0048] Figure 1 is one of the flow charts of the image dispersion correction method provided by the present invention, such as Figure 1 As shown, the method includes:

[0049] Step 110: Obtain the sub-image to be corrected.

[0050] The sub-image to be corrected is an image obtained by slicing the image to be corrected. Preferably, the image to be corrected is a film camera image.

[0051] Specifically, the method of obtaining the image to be corrected may include: obtaining the film camera image in real time through a film camera, or obtaining the film camera image from a storage device, or receiving the film camera image sent by other devices. When the image to be corrected is obtained, the digital quantization values ​​of the three channels of the image to be corrected are obtained, wherein the three channels are respectively a red (R) channel, a green (G) channel, and a blue (B) channel, and the image to be corrected is sliced, and the image to be corrected is evenly and overlappedly cut into N×N sub-images to be corrected, and the size of each sub-image to be corrected must be greater than or equal to a preset size (for example, the preset size is 127×127), and the overlap ratio between the sub-images to be corrected must be greater than a preset ratio (for example, the preset ratio is 30%), and the size of N is jointly determined by the size of the input film camera image and the size of the sub-image to be corrected. Figure 2 FIG. 1 is a partial enlarged schematic diagram of the dispersion of the image of the thin film camera provided by the present invention, such as Figure 2 As shown, the dotted part and the oblique line part are the parts where the dispersion effect occurs. Specifically, in the image, the dotted part can appear blue, and the oblique line part can appear red. The present invention mainly performs dispersion correction on the red or blue part of the image.

[0052] Step 120: Determine the aberration offset between channels of each sub-image to be corrected.

[0053] Specifically, the aberration offset between each sub-image channel to be corrected is calculated using an edge detection algorithm and a line detection algorithm.

[0054] Step 130: Perform dispersion correction on the image to be corrected according to the aberration offset between channels of each sub-image to be corrected.

[0055] Specifically, when the aberration offset between each sub-image channel to be corrected is obtained, the dispersion correction of the image to be corrected is implemented by using the spatial interpolation and resampling method.

[0056] The image dispersion correction method provided by the present invention calculates the aberration offset between the channels of each sub-image to be corrected when each sub-image to be corrected is obtained, and performs dispersion correction on the image to be corrected according to the aberration offset between the channels of each sub-image to be corrected, thereby realizing automatic correction of image dispersion.

[0057] Based on the above embodiments, Figure 3 FIG. 2 is a flow chart of the image dispersion correction method provided by the present invention. Figure 3 As shown, step 120 specifically includes the following steps 121 to 124:

[0058] Step 121: Detect the straight line edges of each target channel of each sub-image to be corrected.

[0059] Wherein, the target channel includes a reference channel and a correction channel, and the correction channel includes two channels other than the reference channel. Due to the wavelength-related imaging physical characteristics of the film camera, dispersion generally has red edges and blue edges, which indicates that the offset between the red channel and the blue channel is the largest. Therefore, the reference channel of the present invention includes a green channel, and the correction channel includes a red channel and a blue channel.

[0060] Specifically, an edge detection algorithm is used to perform edge detection on each target channel of the sub-image to be corrected, and a Hough transform is used to detect the straight line edge of each target channel of each sub-image to be corrected. The edge detection algorithm can be a Canny operator, which is a multi-step image edge detection algorithm, including filtering denoising, image gradient calculation, non-maximum suppression, dual threshold processing, and hysteresis edge tracking.

[0061] Regarding the filtering and denoising part, a Gaussian filter can be used for filtering and denoising. The filter kernel size of the Gaussian filter is usually 5×5 or 7×7. For a filter kernel size of (2k+1)×(2k+1), the values ​​of each element in the template of the Gaussian filter can be calculated using formula (1):

[0062]

[0063] in, represents the value of each element of the Gaussian filter, q represents the horizontal coordinate position of the filter kernel matrix, j represents the vertical coordinate position of the filter kernel matrix, σ is the standard deviation, which can be selected as 0.8, and the value of k is a positive integer.

[0064] Regarding the image gradient calculation part, the Sobel operator can be used. The Sobel operator contains two groups of 3×3 convolution operators, one group is the horizontal convolution operator, and the other group is the vertical convolution operator. They perform plane convolution with the sub-image to be corrected to obtain the horizontal gradient and vertical gradient of the sub-image to be corrected. x It can be expressed by formula (2), the vertical convolution operator Sobel y It can be expressed by formula (3):

[0065]

[0066]

[0067] The horizontal convolution operator is convolved with the sub-image to be corrected to obtain the gradient component dx in the horizontal direction of the sub-image to be corrected. dx can be calculated using formula (4); the vertical convolution operator is convolved with the sub-image to be corrected to obtain the gradient component dy in the vertical direction of the sub-image to be corrected. dy can be calculated using formula (5).

[0068] dx=Sobel x *f(x,y) (4)

[0069] dy=Sobel y *f(x,y) (5)

[0070] Where f(x, y) represents the pixel grayscale value at the single-channel image (x, y).

[0071] The gradient size G of each pixel in the sub-image to be corrected can be calculated using formula (6). The gradient direction of each pixel is It can be calculated using formula (7):

[0072]

[0073]

[0074] Regarding the non-maximum suppression part, non-maximum suppression is a method of edge refinement. Since the gradient edge obtained by the Sobel operator is usually more than one pixel wide, but multiple pixels wide, non-maximum suppression is used to retain the local maximum gradient, and suppress all gradient values ​​except the maximum gradient, that is, only the sharpest position of the gradient change is retained. The specific method is to compare the edge strength of the current pixel with the edge strength of the pixel in the positive gradient direction and the negative gradient direction respectively. If the edge strength of the current pixel is the largest compared with the edge strength of other pixels in the mask with the same direction, the edge strength of the current pixel is retained; otherwise, it will be suppressed. The specific steps of the non-maximum suppression method can refer to the non-maximum suppression steps in the relevant technology, which will not be repeated here.

[0075] Regarding the double threshold processing part, the double threshold processing distinguishes the edge pixels finally obtained by non-maximum suppression by setting two thresholds, a high threshold and a low threshold. Pixels with gradient strength greater than the high threshold are considered to be strong edge points, while pixels with gradient strength between the high threshold and the low threshold are considered to be weak edge points. Pixels with gradient strength less than the low threshold are further suppressed.

[0076] Regarding the lagging edge tracking part, it is mainly to determine whether the weak edge point is a real edge point. It is generally believed that the weak edge point caused by the real edge point is connected to the strong edge point, while the weak edge point caused by noise is not connected to the strong edge point. Therefore, for each weak edge point, the pixel gradient intensity is searched from the preset number of neighborhoods (for example, 8 neighborhoods) of the weak edge point. If there is a pixel gradient intensity greater than the high threshold, the weak edge point is determined to be a real edge point and retained; otherwise, it is discarded.

[0077] Furthermore, after edge detection is performed on each target channel of each sub-image to be corrected, the image edge detected by the Canny operator needs to be transformed from the rectangular coordinate system to the polar coordinate system using the Hough transform. The specific spatial transformation can be calculated using formula (8):

[0078] ρ=x·cos(θ)+y·sin(θ) (8)

[0079] Wherein, x represents the abscissa in the rectangular coordinate system, y represents the ordinate in the rectangular coordinate system, ρ represents the distance from the straight line to the origin O in the rectangular coordinate system, and θ represents the angle between the perpendicular line between the straight line and the origin O in the rectangular coordinate system and the positive direction of the X-axis.

[0080] The number of pixels falling into the same position in the polar coordinate space is recorded, and filtered through a specific threshold to obtain a straight edge of a certain length, and finally the straight edge of the blue channel, the straight edge of the green channel, and the straight edge of the red channel of the sub-image to be corrected are obtained respectively.

[0081] Step 122: Match the straight line edge of the reference channel with the straight line edge of the correction channel to obtain a target straight line edge that matches the straight line edge of the reference channel.

[0082] Specifically, with the straight edge obtained by the green channel detection as a reference, for each straight edge of the green channel, the matching straight edge in the red channel and the blue channel is searched, that is, the matching target straight edge is searched. The specific method is: first, all the straight edges detected by the green channel are sorted from high to low according to the number of pixels in the straight edge, that is, the straight edges are sorted according to the length, and then for the straight edges of the sorted green channel, all the straight edges detected by the red channel and all the straight edges detected by the blue channel are traversed to search for the target straight edge matched in the red channel and the target straight edge matched in the blue channel. When the relationship between the straight edge of the red channel and the straight edge of the green channel satisfies formula (9), it is considered that the straight edge in the green channel matches the target straight edge of the red channel; when the relationship between the straight edge of the blue channel and the straight edge of the green channel satisfies formula (9), it is considered that the straight edge in the green channel matches the target straight edge of the blue channel.

[0083] |ρ R,B -ρ G |≤5&|θ R,B -θ G |≤1(9)

[0084] Among them, ρ R,B Represents the distance from the straight edge of the red channel and the blue channel to the origin O in the rectangular coordinate system, ρ G Represents the distance from the straight edge of the green channel to the origin O in the rectangular coordinate system, θ R,B Represents the angle between the perpendicular line from the origin O to the straight edge of the red channel and the blue channel in the rectangular coordinate system and the positive direction of the X axis, θ G It represents the angle between the perpendicular line from the origin O to the straight edge of the green channel and the positive direction of the X-axis in the rectangular coordinate system.

[0085] Step 123: Determine the aberration offset between the straight line edge of the reference channel and the matched target straight line edge between the reference channel and the correction channel.

[0086] Specifically, the aberration offset between the straight line edge of the reference channel and the matched target straight line edge in the red channel and the green channel is calculated by formula (10), and the aberration offset between the straight line edge of the reference channel and the matched target straight line edge in the blue channel and the green channel is calculated by formula (11).

[0087] D R-G,i =ρ R,i -ρG,i (10)

[0088] D G-B,i =ρ G,i -ρ B,i (11)

[0089] Among them, i represents the i-th pair of matching straight line edges, D R-G,i represents the aberration offset between the red channel and the green channel of the i-th pair of matching straight line edges, ρ R,i represents the distance from the target straight line edge of the red channel in the i-th pair of matching straight line edges to the origin O, ρ G,i represents the distance from the straight edge of the green channel in the i-th pair of matching straight edges to the origin O, D G-B,i represents the aberration offset between the blue channel and the green channel of the i-th pair of matching straight line edges, ρ B,i Represents the distance from the target straight line edge of the blue channel in the i-th pair of matching straight line edges to the origin O.

[0090] Step 124: Determine the aberration offset as the aberration offset of the central pixel of the sub-image to be corrected.

[0091] Specifically, a corresponding aberration horizontal offset mean and aberration vertical offset mean are determined according to all the aberration offsets between the reference channel and the correction channel; and the aberration horizontal offset mean and the aberration vertical offset mean are determined as the aberration offset of the central pixel of the sub-image to be corrected.

[0092] For example, the horizontal aberration offset between the straight line edge of the reference channel and the matched target straight line edge between the red channel and the green channel is calculated using formula (12), and the vertical aberration offset between the straight line edge of the reference channel and the matched target straight line edge between the red channel and the green channel is calculated using formula (13):

[0093] v1 h,i =D R-G,i / sinθ 1i (12)

[0094] v1 v,i =D R-G,i / cosθ 1i (13)

[0095] Among them, v1 h,i Indicates the horizontal disparity offset between the red channel and the green channel of the i-th pair of matching straight line edges, v1 v,i represents the vertical disparity offset between the red channel and the green channel of the i-th pair of matching straight line edges, θ 1iIt represents the angle between the perpendicular line from the origin O to the straight line edge of the red channel corresponding to the i-th pair of matching straight line edges in the rectangular coordinate system and the positive direction of the X-axis.

[0096] Formula (14) is used to calculate the horizontal aberration offset between the straight line edge of the reference channel and the matched target straight line edge in the blue channel and the green channel, and formula (15) is used to calculate the vertical aberration offset between the straight line edge of the reference channel and the matched target straight line edge in the blue channel and the green channel:

[0097] v2 h,i =D G-B,i / sinθ 2i (14)

[0098] v2 v,i =D G-B,i / cosθ 2i (15)

[0099] Among them, v2 h,i Indicates the horizontal disparity offset between the blue channel and the green channel of the i-th pair of matching straight line edges, v2 v,i represents the vertical disparity offset between the blue channel and the green channel of the i-th pair of matching straight line edges, θ 2i It represents the angle between the perpendicular line from the origin O to the straight line edge of the blue channel corresponding to the i-th pair of matching straight line edges in the rectangular coordinate system and the positive direction of the X-axis.

[0100] Furthermore, formula (16) is used to calculate the mean horizontal aberration offset between the straight line edge of the reference channel and the matched target straight line edge in the red channel and the green channel, and formula (17) is used to calculate the mean vertical aberration offset between the straight line edge of the reference channel and the matched target straight line edge in the red channel and the green channel.

[0101]

[0102]

[0103] Among them, N p Indicates the total number of matching straight line edges, v1 h represents the mean horizontal disparity offset between the red channel and the green channel of the i-th pair of matching straight line edges, v1 v Represents the mean vertical disparity offset between the red channel and the green channel for the i-th pair of matching straight line edges.

[0104] Furthermore, formula (18) is used to calculate the mean horizontal aberration offset between the straight line edge of the reference channel and the matched target straight line edge in the blue channel and the green channel, and formula (19) is used to calculate the mean vertical aberration offset between the straight line edge of the reference channel and the matched target straight line edge in the blue channel and the green channel.

[0105]

[0106]

[0107] Among them, v2 h represents the mean horizontal disparity offset between the blue channel and the green channel of the i-th pair of matching straight line edges, v2 v Represents the mean vertical disparity offset between the blue channel and the green channel for the i-th pair of matching straight line edges.

[0108] After calculating the mean value of the horizontal aberration offset and the mean value of the vertical aberration offset between the red channel and the green channel, and the mean value of the horizontal aberration offset and the mean value of the vertical aberration offset between the blue channel and the green channel, it is considered that the aberration offsets between the channels of the sub-image to be corrected have spatial consistency. Therefore, the calculated mean value of the horizontal aberration offset and the mean value of the vertical aberration offset between the red channel and the green channel are assigned to the central pixel of the sub-image to be corrected, and the horizontal aberration offset and the vertical aberration offset of the central pixel of the sub-image to be corrected between the red channel and the green channel are obtained; the calculated mean value of the horizontal aberration offset and the mean value of the vertical aberration offset between the blue channel and the green channel are assigned to the central pixel of the sub-image to be corrected, and the horizontal aberration offset and the vertical aberration offset of the central pixel of the sub-image to be corrected between the blue channel and the green channel are obtained.

[0109] Repeat the above method for calculating the horizontal aberration offset and the vertical aberration offset of the central pixel of the sub-image to be corrected between the red channel and the green channel, and between the blue channel and the green channel, calculate the horizontal aberration offset and the vertical aberration offset between the corresponding channels of each sub-image to be corrected in the image to be corrected, and assign them to the central pixel of the corresponding sub-image to be corrected, and finally obtain the horizontal aberration offset and the vertical aberration offset of the central pixel of each sub-image to be corrected in the image to be corrected between the corresponding channels.

[0110] Based on the above embodiments, Figure 4 FIG. 3 is a flow chart of the image dispersion correction method provided by the present invention. Figure 4 As shown, step 130 specifically includes the following steps 131 to 133:

[0111] Step 131: for each pixel of the image to be corrected, determine a target horizontal offset and a target vertical offset of the pixel in the correction channel relative to the reference channel.

[0112] Specifically, the position information of the central pixels of a preset number of sub-images to be corrected adjacent to the pixel is determined; the target horizontal offset is determined according to the position information of the central pixels of the preset number of sub-images to be corrected and the average of the aberration horizontal offsets corresponding to each of the position information; the target vertical offset is determined according to the position information of the central pixels of the preset number of sub-images to be corrected and the average of the aberration vertical offsets corresponding to each of the position information.

[0113] For example, based on the horizontal aberration offset and vertical aberration offset of the central pixel of each sub-image to be corrected between the corresponding channels obtained by the above calculation, the target horizontal offset and target vertical offset of each pixel in the red channel and the blue channel of the entire image to be corrected relative to the green channel are calculated by bilinear interpolation. The specific calculation process is: for a pixel (x, y), according to the central pixel of the sub-image to be corrected where the pixel (y, y) is located, the positions of the central pixels of the four sub-images to be corrected adjacent to the pixel are determined, which are defined as (x1, y1), (x1, y2), ( x2, y1) and (x2, y2), and then bilinear interpolation is used to calculate the aberration horizontal offset and aberration vertical offset of the red channel and the green channel of the pixel (x, y). Specifically, the aberration horizontal offset of the red channel of the pixel (x, y) can be calculated by formula (20), the aberration vertical offset of the red channel of the pixel (x, y) can be calculated by formula (21), the aberration horizontal offset of the blue channel of the pixel (x, y) can be calculated by formula (22), and the aberration vertical offset of the blue channel of the pixel (x, y) can be calculated by formula (23):

[0114]

[0115] in, Indicates the horizontal offset of the aberration of the red channel image pixel (x, y), Indicates the aberration horizontal offset of the neighboring center pixel (x1, y1) of the red channel pixel (x, y), Indicates the aberration horizontal offset of the neighboring center pixel (x2, y1) of the red channel pixel (x, y), Indicates the horizontal offset of the aberration of the neighboring center pixel (x1, y2) of the red channel pixel (x, y). Indicates the horizontal offset of the aberration of the neighboring center pixel (x2, y2) of the red channel pixel (x, y).

[0116]

[0117] in, Indicates the vertical offset of the aberration of the red channel image pixel (x, y), Indicates the vertical offset of the aberration of the neighboring center pixel (x1, y1) of the red channel pixel (x, y). Indicates the vertical offset of the aberration of the neighboring center pixel (x2, y1) of the red channel pixel (x, y). Indicates the vertical offset of the aberration of the neighboring center pixel (x1, y2) of the red channel pixel (x, y). Indicates the vertical offset of the aberration of the neighboring center pixel (x2, y2) of the red channel pixel (x, y).

[0118]

[0119] in, Indicates the horizontal offset of the aberration of the blue channel image pixel (x, y), Indicates the aberration horizontal offset of the neighboring center pixel (x1, y1) of the blue channel pixel (x, y). Indicates the aberration horizontal offset of the neighboring center pixel (x2, y1) of the blue channel pixel (x, y). Indicates the aberration horizontal offset of the neighboring center pixel (x1, y2) of the blue channel pixel (x, y). Indicates the horizontal offset of the aberration of the neighboring center pixel (x2, y2) of the blue channel pixel (x, y).

[0120]

[0121] in, Indicates the vertical offset of the aberration of the blue channel image pixel (x, y), Indicates the vertical offset of the aberration of the neighboring central pixel (x1, y1) of the blue channel pixel (x, y). Indicates the vertical offset of the aberration of the neighboring central pixel (x2, y1) of the blue channel pixel (x, y). Indicates the vertical offset of the aberration of the neighboring center pixel (x1, y2) of the blue channel pixel (x, y). Indicates the vertical offset of the aberration of the neighboring center pixel (x2, y2) of the blue channel pixel (x, y).

[0122] It should be noted that, for pixels at the edge of the image to be corrected, the aberration offset value of the central pixel of the sub-image to be corrected that is most adjacent to the edge pixel may also be used to assign the value.

[0123] Step 132, determine the new coordinates of the pixel in the correction channel according to the target horizontal offset and the target vertical offset of the pixel, and determine the digital quantization value of the original coordinate corresponding to the new coordinate as the digital quantization value of the new coordinate, to obtain the original coordinate grid of the correction channel.

[0124] Specifically, after obtaining the target horizontal offset and target vertical offset of each pixel in the red channel and the blue channel of the entire image to be corrected, for each pixel, the original horizontal coordinate position of the pixel and the target horizontal offset of the pixel in the red channel are added, and the original vertical coordinate position of the pixel and the target vertical offset of the pixel in the red channel are added to obtain the new coordinate of the pixel in the red channel; the original horizontal coordinate position of the pixel and the target horizontal offset of the pixel in the blue channel are added, and the original vertical coordinate position of the pixel and the target vertical offset of the pixel in the blue channel are added to obtain the new coordinate of the pixel in the blue channel; and the digital quantization value of the pixel obtained previously is assigned to the new coordinate, and finally the original coordinate grid of the red channel and the original coordinate grid of the blue channel are obtained, and the original coordinate grid at this time is an irregular grid.

[0125] Step 133: Perform dispersion correction on the image to be corrected according to the original coordinate grid, the target horizontal offset and the target vertical offset of each pixel.

[0126] Specifically, Figure 5 FIG. 4 is a flow chart of the image dispersion correction method provided by the present invention. Figure 5 As shown, step 133 specifically includes the following steps 1331 to 1333:

[0127] Step 1331: determine a corresponding target horizontal offset mean value according to the target horizontal offset, and determine a corresponding target vertical offset mean value according to the target vertical offset.

[0128] Specifically, the formula (24) is used to calculate the mean target horizontal offset of the red channel of the pixel (x, y) relative to the green channel, the formula (25) is used to calculate the mean target vertical offset of the red channel of the pixel (x, y) relative to the green channel, the formula (26) is used to calculate the mean target horizontal offset of the blue channel of the pixel (x, y) relative to the green channel, and the formula (27) is used to calculate the mean target vertical offset of the blue channel of the pixel (x, y) relative to the green channel:

[0129]

[0130] in, Indicates the target horizontal offset of the red channel relative to the green channel of the pixel (x, y).

[0131]

[0132] in, Indicates the target vertical offset of the red channel relative to the green channel of the pixel (x, y).

[0133]

[0134] in, Indicates the target vertical offset of the blue channel relative to the green channel of pixel (x,y).

[0135]

[0136] in, Indicates the target vertical offset of the blue channel relative to the green channel of pixel (x,y).

[0137] Step 1332: construct a new coordinate grid of the correction channel according to the position information of all pixels in the reference channel of the image to be corrected, the target horizontal offset mean value of all pixels in the correction channel, and the corresponding target vertical offset mean value.

[0138] Specifically, when calculating the target horizontal offset mean and the corresponding target vertical offset mean of all pixels in the red channel of the image to be corrected, for each pixel, the horizontal coordinate of the pixel in the green channel of the image to be corrected is added to the target horizontal offset mean of the pixel to obtain the horizontal position of the pixel in the new coordinate grid; the vertical coordinate of the pixel in the green channel of the image to be corrected is added to the target vertical offset mean of the pixel to obtain the vertical position of the pixel in the new coordinate grid, and finally the new coordinate grid of each pixel in the red channel is obtained.

[0139] When calculating the target horizontal offset mean and the corresponding target vertical offset mean of all pixels in the blue channel of the image to be corrected, for each pixel, the horizontal coordinate of the pixel in the green channel of the image to be corrected is added to the target horizontal offset mean of the blue channel of the pixel to obtain the horizontal position of the pixel in the blue channel in the new coordinate grid; the vertical coordinate of the pixel in the green channel of the image to be corrected is added to the target vertical offset mean of the blue channel of the pixel to obtain the vertical position of the pixel in the blue channel in the new coordinate grid, and finally the new coordinate grid of each pixel in the blue channel is obtained.

[0140] Step 1333: resample the original coordinate grid of the correction channel based on the new coordinate grid.

[0141] Specifically, when a new coordinate grid of the red channel and a new coordinate grid of the blue channel of the image to be corrected are obtained, the original coordinate grid of the red channel is resampled based on the new coordinate grid of the red channel to obtain a dispersion-corrected image of the red channel; and the original coordinate grid of the blue channel is resampled based on the new coordinate grid of the blue channel to obtain a dispersion-corrected image of the blue channel, and finally a dispersion-corrected film camera image is output. Figure 6 It is a schematic diagram of a partial enlargement of a film camera image after dispersion correction provided by the present invention.

[0142] It should be noted that when the horizontal aberration offset and the vertical aberration offset of the central pixel of each sub-image to be corrected are obtained, each horizontal aberration offset and each vertical aberration offset are compared. If all horizontal aberration offsets are equal and all vertical aberration offsets are also equal, it means that the film primary mirror is assembled flat, and there is no need to execute steps 1331 to 1333, and the original coordinate grid can be directly resampled; if all horizontal aberration offsets or all vertical aberration offsets are not equal, it means that the film primary mirror is assembled unevenly, and at this time it is necessary to execute steps 1331 to 1333 to perform dispersion correction.

[0143] The present invention can realize automatic dispersion correction of film camera images. After the relevant parameters of the equipment are pre-set, no other manual intervention and assistance are required. At the same time, the uneven dispersion space caused by the uneven assembly of the film primary mirror is taken into account, and the aberration offset of each channel in the entire image to be corrected can be adaptively calculated.

[0144] The image dispersion correction device provided by the present invention is described below. The image dispersion correction device described below and the image dispersion correction method described above can be referenced to each other.

[0145] Figure 7 is a schematic diagram of the structure of the image dispersion correction device provided by the present invention, such as Figure 7 As shown, the image dispersion correction device includes an acquisition unit 710, a determination unit 720 and a correction unit 730; wherein:

[0146] An acquisition unit 710 is used to acquire a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected;

[0147] A determination unit 720, configured to determine an aberration offset between channels of each sub-image to be corrected;

[0148] The correction unit 730 is used to perform dispersion correction on the image to be corrected according to the aberration offset between channels of each sub-image to be corrected.

[0149] The image dispersion correction device provided by the present invention calculates the aberration offset between the channels of each sub-image to be corrected when each sub-image to be corrected is acquired, and performs dispersion correction on the image to be corrected according to the aberration offset between the channels of each sub-image to be corrected, thereby realizing automatic correction of image dispersion.

[0150] Based on any of the foregoing embodiments, the determining unit 720 is specifically configured to:

[0151] Detecting straight line edges of each target channel of each sub-image to be corrected; the target channel includes a reference channel and a correction channel, and the correction channel includes two channels other than the reference channel;

[0152] Matching the straight line edge of the reference channel with the straight line edge of the correction channel to obtain a target straight line edge that matches the straight line edge of the reference channel;

[0153] Determine the aberration offset between the reference channel and the correction channel of the straight line edge of the reference channel and the matching target straight line edge;

[0154] The aberration offset is determined as the aberration offset of the central pixel of the sub-image to be corrected.

[0155] Based on any of the foregoing embodiments, the determining unit 720 is further specifically configured to:

[0156] Determine a corresponding mean value of horizontal aberration offset and a mean value of vertical aberration offset according to all the aberration offsets between the reference channel and the correction channel;

[0157] The mean value of the aberration horizontal offset and the mean value of the aberration vertical offset are determined as the aberration offset of the central pixel of the sub-image to be corrected.

[0158] Based on any of the above embodiments, the correction unit 730 is specifically used for:

[0159] For each pixel of the image to be corrected, determining a target horizontal offset and a target vertical offset of the pixel in the correction channel relative to the reference channel;

[0160] Determine new coordinates of the pixel in the correction channel according to the target horizontal offset and the target vertical offset of the pixel, and determine the digital quantization value of the original coordinate corresponding to the new coordinate as the digital quantization value of the new coordinate, to obtain the original coordinate grid of the correction channel;

[0161] The image to be corrected is subjected to dispersion correction according to the original coordinate grid, the target horizontal offset of each pixel, and the target vertical offset.

[0162] Based on any of the above embodiments, the correction unit 730 is further specifically configured to:

[0163] Determine position information of central pixels of a preset number of sub-images to be corrected that are adjacent to the pixel;

[0164] Determine the target horizontal offset according to the position information of the central pixels of the preset number of sub-images to be corrected and the average value of the aberration horizontal offset corresponding to each of the position information;

[0165] The target vertical offset is determined according to the position information of the central pixels of the preset number of sub-images to be corrected and the average value of the aberration vertical offset corresponding to each of the position information.

[0166] Based on any of the above embodiments, the correction unit 730 is further specifically configured to:

[0167] Determine a corresponding target horizontal offset mean value according to the target horizontal offset, and determine a corresponding target vertical offset mean value according to the target vertical offset;

[0168] Constructing a new coordinate grid of the correction channel according to the position information of all pixels in the reference channel of the image to be corrected, the mean value of the target horizontal offset of all pixels in the correction channel and the corresponding mean value of the target vertical offset;

[0169] The original coordinate grid of the correction channel is resampled based on the new coordinate grid.

[0170] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the image dispersion correction method, which includes: obtaining a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected;

[0171] Determining the aberration offset between channels of each sub-image to be corrected;

[0172] The image to be corrected is subjected to dispersion correction according to the aberration offset between channels of each sub-image to be corrected.

[0173] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0174] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the image dispersion correction method provided by the above methods, the method comprising: obtaining a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected;

[0175] Determining the aberration offset between channels of each sub-image to be corrected;

[0176] The image to be corrected is subjected to dispersion correction according to the aberration offset between channels of each sub-image to be corrected.

[0177] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for image dispersion correction provided by the above methods is implemented, the method comprising: obtaining a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected;

[0178] Determining the aberration offset between channels of each sub-image to be corrected;

[0179] The image to be corrected is subjected to dispersion correction according to the aberration offset between channels of each sub-image to be corrected.

[0180] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0181] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for image dispersion correction, characterized in that: include: Acquire a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected; Determining the aberration offset between channels of each sub-image to be corrected; Performing dispersion correction on the image to be corrected according to the aberration offset between channels of each sub-image to be corrected; Determining the aberration offset between channels of each sub-image to be corrected comprises: Detecting straight line edges of each target channel of each sub-image to be corrected; the target channel includes a reference channel and a correction channel, and the correction channel includes two channels other than the reference channel; Matching the straight line edge of the reference channel with the straight line edge of the correction channel to obtain a target straight line edge that matches the straight line edge of the reference channel; Determine the aberration offset between the reference channel and the correction channel of the straight line edge of the reference channel and the matching target straight line edge; Determine a corresponding mean value of horizontal aberration offset and a mean value of vertical aberration offset according to all the aberration offsets between the reference channel and the correction channel; Determine the mean value of the horizontal offset of the aberration and the mean value of the vertical offset of the aberration as the aberration offset of the central pixel of the sub-image to be corrected; The performing dispersion correction on the image to be corrected according to the aberration offset between channels of each sub-image to be corrected comprises: For each pixel of the image to be corrected, determining a target horizontal offset and a target vertical offset of the pixel in the correction channel relative to the reference channel; Determine new coordinates of the pixel in the correction channel according to the target horizontal offset and the target vertical offset of the pixel, and determine the digital quantization value of the original coordinate corresponding to the new coordinate as the digital quantization value of the new coordinate, to obtain the original coordinate grid of the correction channel; Performing dispersion correction on the image to be corrected according to the original coordinate grid, the target horizontal offset and the target vertical offset of each pixel; Determining a target horizontal offset and a target vertical offset of the pixel in the correction channel relative to the reference channel comprises: Determining position information of central pixels of a preset number of sub-images to be corrected that are adjacent to the pixel; Determine the target horizontal offset according to the position information of the central pixels of the preset number of sub-images to be corrected and the average value of the aberration horizontal offset corresponding to each of the position information; The target vertical offset is determined according to the position information of the central pixels of the preset number of sub-images to be corrected and the average value of the aberration vertical offset corresponding to each of the position information.

2. The image dispersion correction method according to claim 1, characterized in that: The performing dispersion correction on the image to be corrected according to the original coordinate grid, the target horizontal offset and the target vertical offset of each pixel comprises: Determine a corresponding target horizontal offset mean value according to the target horizontal offset, and determine a corresponding target vertical offset mean value according to the target vertical offset; Constructing a new coordinate grid of the correction channel according to the position information of all pixels in the reference channel of the image to be corrected, the mean value of the target horizontal offsets of all pixels in the correction channel and the corresponding mean value of the target vertical offsets; The original coordinate grid of the correction channel is resampled based on the new coordinate grid.

3. An image dispersion correction device, characterized in that: include: An acquisition unit, used for acquiring a sub-image to be corrected; wherein the sub-image to be corrected is an image obtained by slicing the image to be corrected; A determination unit, used to determine the aberration offset between channels of each sub-image to be corrected; A correction unit, configured to perform dispersion correction on the image to be corrected according to the aberration offset between channels of each sub-image to be corrected; The confirmation sheet is specifically used for: Detecting straight line edges of each target channel of each sub-image to be corrected; the target channel includes a reference channel and a correction channel, and the correction channel includes two channels other than the reference channel; Matching the straight line edge of the reference channel with the straight line edge of the correction channel to obtain a target straight line edge that matches the straight line edge of the reference channel; Determine the aberration offset between the reference channel and the correction channel of the straight line edge of the reference channel and the matching target straight line edge; Determine a corresponding mean value of horizontal aberration offset and a mean value of vertical aberration offset according to all the aberration offsets between the reference channel and the correction channel; Determine the mean value of the horizontal offset of the aberration and the mean value of the vertical offset of the aberration as the aberration offset of the central pixel of the sub-image to be corrected; The correction unit is specifically used for: For each pixel of the image to be corrected, determining a target horizontal offset and a target vertical offset of the pixel in the correction channel relative to the reference channel; Determine new coordinates of the pixel in the correction channel according to the target horizontal offset and the target vertical offset of the pixel, and determine the digital quantization value of the original coordinate corresponding to the new coordinate as the digital quantization value of the new coordinate, to obtain the original coordinate grid of the correction channel; Performing dispersion correction on the image to be corrected according to the original coordinate grid, the target horizontal offset and the target vertical offset of each pixel; The correction unit is also specifically used for: Determining position information of central pixels of a preset number of sub-images to be corrected that are adjacent to the pixel; Determine the target horizontal offset according to the position information of the central pixels of the preset number of sub-images to be corrected and the average value of the aberration horizontal offset corresponding to each of the position information; The target vertical offset is determined according to the position information of the central pixels of the preset number of sub-images to be corrected and the average value of the aberration vertical offset corresponding to each of the position information.

4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the image dispersion correction method as claimed in claim 1 or 2 are implemented.

5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image dispersion correction method as claimed in claim 1 or 2 are implemented.

6. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the image dispersion correction method as claimed in claim 1 or 2 are implemented.

Citation Information

Patent Citations

  • Image processing device for correcting chromatic aberration, method for processing image, program, and storage medium

    CN102474626A

  • Image classifying, retrieving and correcting method and corresponding device

    CN103971134A

  • Rapid detection correction algorithm for refractivity aberration

    CN105719281A

  • Image color correction method and device

    CN111447426A

  • Image color edge correction method and device, electronic equipment and storage medium

    CN113132705A