CN114219736A - Image chromatic aberration correction method and device, electronic equipment and storage medium - Google Patents

Image chromatic aberration correction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114219736A
CN114219736A CN202111568538.9A CN202111568538A CN114219736A CN 114219736 A CN114219736 A CN 114219736A CN 202111568538 A CN202111568538 A CN 202111568538A CN 114219736 A CN114219736 A CN 114219736A
Authority
CN
China
Prior art keywords
target
color channel
chromatic aberration
offset
image
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.)
Pending
Application number
CN202111568538.9A
Other languages
Chinese (zh)
Inventor
刘永劼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aixin Yuanzhi Semiconductor Shanghai Co Ltd
Original Assignee
Aixin Yuanzhi Semiconductor Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aixin Yuanzhi Semiconductor Shanghai Co Ltd filed Critical Aixin Yuanzhi Semiconductor Shanghai Co Ltd
Priority to CN202111568538.9A priority Critical patent/CN114219736A/en
Publication of CN114219736A publication Critical patent/CN114219736A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

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

Abstract

The application provides an image chromatic aberration correction method, an image chromatic aberration correction device, electronic equipment and a storage medium, and relates to the technical field of digital image processing. The method comprises the following steps: determining the offset of a target color channel corresponding to a target point based on a reference color channel of the target point in the target image; fitting the offset to obtain color difference offset degree data of a target color channel; and performing color difference correction on the target image based on the color difference offset degree data to obtain a corrected image. According to the chromatic aberration correction method and device, the chromatic aberration offset degree of other color channels can be obtained by keeping one color channel as a reference color channel by utilizing the physical characteristics of lens chromatic dispersion, so that chromatic aberration of a target image is corrected according to chromatic aberration offset degree data and a chromatic aberration correction algorithm, an engineer does not need to debug parameters and adjust positions for many times to correct chromatic aberration, labor and time cost is reduced, and chromatic aberration correction efficiency and accuracy are effectively improved.

Description

Image chromatic aberration correction method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of digital image processing technologies, and in particular, to a method and an apparatus for correcting image chromatic aberration, an electronic device, and a storage medium.
Background
Due to the physical properties of the lens, chromatic aberration may exist in an image captured by the camera. This is because the different wavelengths of light make the lens incapable of focusing all wavelengths of color to the same focal plane. Because the current camera generally adopts a photosensitive sensor of Red, Green and Blue, the light of the three colors of RGB can be gathered to different focal planes, thereby forming chromatic aberration.
In the prior art, a lens material causing small chromatic aberration, such as fluorite, is generally selected as a mode for correcting chromatic aberration, but the properties of the lens material are not very stable, and the production cost is too high, so that the lens material is generally used only in a few high-end lenses with a low selling price and a high-end lens, and cannot be popularized and used. In a large number of practical applications, people can set in an ISP (Image Signal Processing), but when setting, an experienced engineer needs to adjust parameters for different lenses to configure reasonable parameters, so that when correcting chromatic aberration of an Image at present, the chromatic aberration is greatly affected by manpower, the time cost is high, and the chromatic aberration correction efficiency and accuracy are low.
Disclosure of Invention
In view of the above, an object of the embodiments of the present application is to provide an image chromatic aberration correction method, an image chromatic aberration correction device, an electronic device, and a storage medium, so as to solve the problem of low image chromatic aberration correction efficiency in the prior art.
In order to solve the above problem, in a first aspect, the present application provides an image chromatic aberration correction method, including:
determining the offset of a target color channel corresponding to a target point based on a reference color channel of the target point in a target image;
fitting the offset to obtain color difference offset degree data of the target color channel;
and carrying out color difference correction on the target image based on the color difference offset degree data to obtain a corrected image.
In the implementation mode, one color channel in the target image is kept still and is used as a reference color channel to calibrate other target color channels, and the chromatic aberration offset degree data capable of representing the physical characteristics of the lens can be obtained through fitting on the basis of the determined offset, so that the chromatic aberration of the target image is corrected by using a chromatic aberration correction algorithm according to the chromatic aberration offset degree data, an engineer with work experience does not need to configure reasonable parameters aiming at multiple debugging parameters of different lenses to realize the correction of the chromatic aberration, the parameters can be automatically set to correct the chromatic aberration, the method is suitable for various types of lenses and various application scenes, the labor and time cost is reduced, and the chromatic aberration correction efficiency and accuracy are effectively improved.
Optionally, the determining, based on a reference color channel of a target point in a target image, an offset of a target color channel corresponding to the target point includes:
determining the reference color channel in a first color channel, a second color channel and a third color channel of the target point in the target image;
marking a corresponding target color parameter in a non-reference color channel as the target color channel;
calculating the offset of the target color channel at the center of the target point based on the reference color channel.
In the implementation manner, due to the color difference, the colors of three color channels in a plurality of target points of the target image are not gathered at the same position, the corresponding color channel is selected as a reference color channel in the three color channels according to the actual requirement and the setting condition, the pixel coordinate in the reference color channel is fixed, and the corresponding target color parameter is automatically calibrated in the non-reference color channel to be used as the target color channel needing to be corrected. Since the colors of the reference color channel and the target color channel should be focused on the same position when there is no chromatic aberration, the offset of the target color channel generated at the center of the target point can be calculated based on the reference color channel on the basis of the target point, thereby calculating the offset of chromatic aberration existing in the target image.
Optionally, fitting the offset to obtain color difference offset degree data of the target color channel, including:
acquiring a plurality of focal radii and ellipse parameters of the target point;
fitting the offset based on the ellipse parameters and the plurality of focal radii to obtain the chromatic aberration offset degree data.
In the implementation manner, based on the physical characteristics of the lens dispersion corresponding to the target image, the pixel offset degree of chromatic aberration distributed by the ellipse parameter and the focal radius in the target point can be obtained, and the offset amount at the center of the target point is fitted by the plurality of focal radii and the ellipse parameter of the target point, so that the corresponding chromatic aberration offset degree data can be obtained, thereby obtaining the pixel offset result of chromatic aberration, without manually calibrating the chromatic aberration offset parameter by an engineer, and improving the obtaining efficiency of the chromatic aberration offset degree data.
Optionally, the performing color difference correction on the target image based on the color difference offset degree data to obtain a corrected image includes:
determining initial coordinates of the target color channel based on the color difference offset degree data;
adjusting the initial coordinates to obtain adjusted coordinates;
and carrying out color difference correction on the target image based on the adjustment coordinates to obtain the corrected image.
In the implementation manner, on the basis of the acquired chromatic aberration offset degree data, a chromatic aberration correction algorithm can be designed without manually calibrating the chromatic aberration degree parameter of each pixel position in the target image by an engineer, and the offset value of each pixel position is stored in the chromatic aberration correction algorithm in a table form for chromatic aberration correction. The method can automatically adjust the coordinates of the relative position of the pixel of the target color channel according to the chromatic aberration offset degree data to obtain the corresponding adjusted coordinates, thereby removing the chromatic aberration influence in the target color channel, realizing chromatic aberration correction of the target image, obtaining the corresponding corrected image, and effectively improving the efficiency and accuracy of chromatic aberration correction.
Optionally, the adjusting the initial coordinate to obtain an adjusted coordinate includes:
calculating a target radian based on the optical center position of the target color channel;
searching in a chromatic aberration corresponding table based on the target radian, and determining a corresponding radial offset;
and adjusting the position of the initial coordinate based on the radial offset to obtain the adjusted coordinate.
In the implementation manner, when the pixel position in the target color channel is adjusted, the corresponding target radian can be calculated according to the optical center position of the target color channel, in a color difference corresponding table corresponding to color difference offset degree data stored in a color difference correction algorithm, searching and matching are performed according to the target radian, the radial offset during adjustment is determined, the initial coordinate is offset according to the radial offset, an adjusted coordinate is obtained, automatic adjustment of the pixel position in the target color channel is realized, an engineer is not required to adjust the pixel position according to manually calibrated color difference parameters, and the efficiency and the accuracy of pixel position adjustment are improved.
Optionally, the performing, based on the adjustment coordinate, color difference correction on the target image to obtain the corrected image includes:
calculating interpolation data of adjacent coordinates in the target color channel within a preset range of the adjusted coordinates;
and carrying out color difference correction on the target color channel in the target image based on the interpolation data to obtain the corrected image.
In the implementation manner, when performing color difference correction, in order to improve the accuracy of the color difference correction, a plurality of adjacent coordinates of the same channel as the target color channel can be selected in a preset range around the adjustment coordinate to perform interpolation calculation, so as to obtain corresponding interpolation data, the interpolation data is used as a pixel position to perform color difference correction on the target color channel in the input target image, and a plurality of pixel coordinates in the range can be subjected to color difference correction, so that the range and the accuracy of the color difference correction are improved.
Optionally, before determining, based on a reference color channel of a target point in a target image, an offset of a target color channel corresponding to the target point, the method further includes:
obtaining a test image needing chromatic aberration correction;
and calibrating the test image to obtain the target image with a plurality of target points.
In the above implementation, before the target image is acquired, the image of the corresponding lens may be preprocessed. And acquiring a test image which is shot in a corresponding lens and needs to be subjected to chromatic aberration correction, and performing point location calibration on the test image to obtain a target image with a plurality of target points so as to correct chromatic aberration of the target image.
In a second aspect, the present application also provides an image chromatic aberration correcting apparatus, including:
the offset module is used for determining the offset of a target color channel corresponding to a target point based on a reference color channel of the target point in a target image;
the fitting module is used for fitting the offset to obtain chromatic aberration offset degree data of the target color channel;
and the correction module is used for carrying out chromatic aberration correction on the target image based on the chromatic aberration offset degree data to obtain a corrected image.
In the above implementation, the offset amount of the target color channel in the target image, which is based on the reference color channels of the plurality of target points, in the target point is determined by the offset module; fitting the offset through a fitting module to obtain chromatic aberration offset degree data capable of representing the physical characteristics of the lens; the correction module corrects the chromatic aberration of the target image by using the chromatic aberration correction algorithm according to the chromatic aberration offset degree data, does not need an engineer with work experience to configure reasonable parameters aiming at different lenses for multiple debugging parameters so as to correct the chromatic aberration, can automatically set the parameters so as to correct the chromatic aberration, is suitable for various types of lenses and various application scenes, reduces the labor and time cost, and effectively improves the correction efficiency and accuracy of the chromatic aberration.
In a third aspect, the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and the processor executes the steps in any one of the foregoing implementation manners when reading and executing the program instructions.
In a fourth aspect, the present application further provides a computer-readable storage medium, where computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the steps in any of the above implementation manners are performed.
In summary, the present application provides an image chromatic aberration correction method, apparatus, electronic device, and storage medium, which can utilize the physical characteristics of lens chromatic dispersion, and obtain chromatic aberration offset degrees of other color channels by using one color channel as a reference color channel, so as to correct chromatic aberration of a target image according to chromatic aberration offset degree data and a chromatic aberration correction algorithm, and do not need an engineer to debug parameters and position adjustment many times to correct chromatic aberration, thereby reducing labor and time costs, and effectively improving chromatic aberration correction efficiency and accuracy.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of an image chromatic aberration correction method according to an embodiment of the present application;
fig. 3 is a detailed flowchart of a step S200 according to an embodiment of the present disclosure;
fig. 4 is a detailed flowchart of a step S300 according to an embodiment of the present disclosure;
fig. 5 is a detailed flowchart of a step S400 provided in an embodiment of the present application;
fig. 6 is a detailed flowchart of step S420 according to an embodiment of the present disclosure;
fig. 7 is a detailed flowchart of a step S430 according to an embodiment of the present disclosure;
fig. 8 is a schematic block structure diagram of an image chromatic aberration correction apparatus according to an embodiment of the present application.
Icon: 100-an electronic device; 111-a memory; 112-a memory controller; 113-a processor; 114-peripheral interfaces; 115-input-output unit; 116-a display unit; 500-image chromatic aberration correction means; 510-an offset module; 520-a fitting module; 530-corrective module.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without any creative effort belong to the protection scope of the embodiments of the present application.
Conventionally, when correcting Color differences of an Image, it is usually set in an ISP (Image Signal Processing) and a corresponding Color difference Correction algorithm is added to correct the Color differences, for example, a purple edge removal module of a CAC (Color interference Correction), however, the CAC algorithm module generally has more parameters, and an experienced engineer is required to adjust the parameters of different lenses to configure reasonable parameters, during configuration, an engineer is required to manually calibrate the degree of color difference of each pixel position on the image, and the offset value of each pixel position is stored in the form of a mesh (wireless mesh network) table, when the parameters are configured in the table, the cost of labor and time is large, the storage pressure is large, the chromatic aberration correction result of the image is greatly influenced by manpower, so that the correction efficiency and accuracy of the current chromatic aberration are low.
Therefore, in order to solve the above problems, an embodiment of the present invention provides an image color difference correction method, which is applied to an electronic device, where the electronic device may be an electronic device with a logic calculation function, such as a server, a Personal Computer (PC), a tablet PC, a smart phone, a Personal Digital Assistant (PDA), and the like, and can perform color difference correction on an image quickly and accurately, eliminate an influence caused by color difference in the image, and reduce a color distortion in the image.
Optionally, referring to fig. 1, fig. 1 is a block schematic diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 100 may include a memory 111, a memory controller 112, a processor 113, a peripheral interface 114, an input-output unit 115, and a display unit 116. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely exemplary and is not intended to limit the structure of the electronic device 100. For example, electronic device 100 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The above-mentioned elements of the memory 111, the memory controller 112, the processor 113, the peripheral interface 114, the input/output unit 115 and the display unit 116 are electrically connected to each other directly or indirectly, so as to implement data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The processor 113 is used to execute the executable modules stored in the memory.
The Memory 111 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 111 is configured to store a program, and the processor 113 executes the program after receiving an execution instruction, and the method executed by the electronic device 100 defined by the process disclosed in any embodiment of the present application may be applied to the processor 113, or implemented by the processor 113.
The processor 113 may be an integrated circuit chip having signal processing capability. The Processor 113 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The peripheral interface 114 couples various input/output devices to the processor 113 and memory 111. In some embodiments, the peripheral interface 114, the processor 113, and the memory controller 112 may be implemented in a single chip. In other examples, they may be implemented separately from the individual chips.
The input/output unit 115 is used to provide input data to the user. The input/output unit 115 may be, but is not limited to, a mouse, a keyboard, and the like.
The display unit 116 provides an interactive interface (e.g., a user operation interface) between the electronic device 100 and the user or is used for displaying image data to the user for reference. In this embodiment, the display unit may be a liquid crystal display or a touch display. In the case of a touch display, the display can be a capacitive touch screen or a resistive touch screen, which supports single-point and multi-point touch operations. The support of single-point and multi-point touch operations means that the touch display can sense touch operations simultaneously generated from one or more positions on the touch display, and the sensed touch operations are sent to the processor for calculation and processing. In the embodiment of the present application, the display unit 116 may display an image before color difference correction and an image after color difference correction.
The electronic device in this embodiment may be configured to perform each step in each image chromatic aberration correction method provided in this embodiment. The following describes in detail the implementation of the image chromatic aberration correction method by several embodiments.
Referring to fig. 2, fig. 2 is a schematic flow chart of an image chromatic aberration correction method according to an embodiment of the present application, where the method includes the following steps:
step S200, determining an offset of a target color channel corresponding to a target point in a target image based on a reference color channel of the target point.
The target image may include a plurality of target points, the reference color channel and the target color channel are channels for storing information of color elements in the image, and because light of three colors of RGB of the target image is collected to different focal planes in a plurality of photosensitive sensors (sensors) of the camera, for example, the photosensitive sensors of RGB (Red, Green, Blue) of bayer pattern (bayer array), thereby forming a color difference phenomenon, one color channel in the target image may be kept stationary on the basis of the photosensitive sensors, and used as the reference color channel, calibration may be performed on other target color channels, and a corresponding offset of the target color channel in the target point may be determined.
Optionally, before acquiring the target image, the method may further include: obtaining a test image needing chromatic aberration correction; and calibrating the test image to obtain a target image with a plurality of target points. The image of the corresponding shot can be preprocessed. And acquiring a test image which is shot in a corresponding lens and needs to be subjected to chromatic aberration correction, and performing point location calibration on the test image to obtain a target image with a plurality of target points so as to correct chromatic aberration of the target image.
And step S300, fitting the offset to obtain color difference offset degree data of the target color channel.
Due to the physical characteristic of lens dispersion, when chromatic aberration is formed, the deviation degree of the pixel position is the characteristic of approximate isofocal radius distribution of a concentric ellipse cluster and the like, fitting is carried out on the basis of the deviation amount, chromatic aberration deviation degree data representing the deviation degree of the pixel position can be obtained, and therefore the deviation degree of a target color channel in a target point is obtained.
And step S400, performing chromatic aberration correction on the target image based on the chromatic aberration offset degree data to obtain a corrected image.
The chromatic aberration correction algorithm can be designed through the chromatic aberration offset degree data, so that the target image is automatically subjected to chromatic aberration correction, and a corresponding corrected image is obtained. An engineer with work experience is not required to debug the parameters of different lenses, so that reasonable parameters are configured to correct the image.
Optionally, the target image includes a plurality of target points, and when performing color difference correction on the target image, the correction order of the target points is not limited. According to a preset correction sequence, each target point may be sequentially subjected to chromatic aberration correction in the manner shown in the embodiment shown in fig. 1, so as to achieve chromatic aberration correction of the target image. And simultaneously determining the offset corresponding to the target color channel in the target points, fitting the offset to obtain corresponding chromatic aberration offset degree data, and simultaneously performing chromatic aberration correction on the target points according to the chromatic aberration offset degree data, thereby realizing chromatic aberration correction on the target image. And after the data of the corresponding chromatic aberration offset degrees in all the target points are obtained, chromatic aberration correction can be simultaneously carried out on the target points, so that chromatic aberration correction of the target image is realized.
In the embodiment shown in fig. 2, the parameters can be automatically calculated and acquired to correct the image, so that the method is suitable for various types of lenses and various application scenes, the labor and time costs are reduced, and the correction efficiency and accuracy of chromatic aberration are effectively improved.
Optionally, referring to fig. 3, fig. 3 is a detailed flowchart of step S200 according to an embodiment of the present application, and step S200 may further include steps S210 to S230.
Step S210, determining the reference color channel in the first color channel, the second color channel and the third color channel of the target point in the target image.
The first color channel, the second color channel, and the third color channel are respectively one of three colors of RGB, and a corresponding color channel may be selected as a reference color channel in the three color channels according to actual requirements and setting conditions, for example, a G color channel corresponding to a Green color is used as a reference color channel.
Step S220, a corresponding target color parameter is calibrated in a non-reference color channel to serve as the target color channel.
After the reference color channel is determined, corresponding parameter calibration may be performed according to the color of the non-reference color channel to serve as a target color channel to be corrected, for example, when the G color channel is the reference color channel, color parameters of the R color channel and the B color channel are respectively used as the target color parameters, the target color parameters are calibrated in the R color channel and the B color channel, and the calibrated R color channel and the calibrated B color channel are used as the target color channel to be corrected.
Step S230, calculating the offset of the target color channel at the center of the target point based on the reference color channel.
Wherein, because of the color difference phenomenon, the colors of three color channels in a plurality of target points of the target image are not gathered at the same position, and the colors of the reference color channel and the target color channel should be focused at the same position when there is no color difference. The pixel position in the determined reference color channel can thus be kept fixed, and the offset of one or more target color channels at the center of the target point can be calculated using the reference color channel as a reference.
In the embodiment shown in fig. 3, based on the target point, the offset amount of the target color channel generated at the center of the target point can be calculated with reference to the reference color channel, so as to calculate the offset amount of the color difference existing in the target image.
Optionally, referring to fig. 4, fig. 4 is a detailed flowchart of step S300 according to an embodiment of the present disclosure, and step S300 may further include steps S310 to S320.
Step S310, acquiring a plurality of focal radii and ellipse parameters of the target point.
Since the degree of displacement of the pixel position in the lens has the characteristic of approximately equal focal radius distribution in concentric elliptical clusters and the like, a plurality of focal radii and elliptical parameters in the target point can be calculated. The focal radius is a section of a connecting line of any point on the conical curve and the focal point of the conical curve, is not a constant value, or is a chord diameter passing through a focal point of a chord of the section of the connecting line of any point on the curve and the focal point. In a chordal conic section (other than a circle) through the focus and perpendicular to the axis, the chord through the focus and perpendicular to the axis. The ellipse parameters include various parameters of a plurality of concentric ellipse clusters on the target point, such as ellipse area, ellipse intersection position, and the like.
Step S320, fitting the offset based on the ellipse parameter and the plurality of focal radii, and obtaining the chromatic aberration offset degree data.
On the basis of the obtained ellipse parameters and the plurality of focal radii, the offset of the center of the target point can be fitted to obtain color difference offset degree data which can represent that the pixel position of the target color channel is similar to a concentric ellipse cluster and is distributed with equal focal radii by different focal radii, so that the pixel offset degree of the color difference of the target color channel relative to the reference color channel in the target point is obtained.
Optionally, according to the fitting result of the offset amounts in the plurality of target points, a visual display result of the plurality of target points can also be generated to display the display colors of the plurality of target points.
In the embodiment shown in fig. 4, an engineer is not required to calibrate the color difference offset parameter manually, the color difference offset degree data of the target color channel can be automatically calculated, and the acquisition efficiency of the color difference offset degree data is improved.
Optionally, referring to fig. 5, fig. 5 is a detailed flowchart of step S400 provided in the present embodiment, and step S400 may further include steps S410 to S430.
Step S410, determining an initial coordinate of the target color channel based on the color difference offset degree data.
After obtaining the color difference offset degree data, a color difference correction algorithm in the color difference correction module may be designed in the electronic device according to the color difference offset degree data, for example, a CAC algorithm is designed, a target image is input into a DST (dispersed Substrate transfer) in the algorithm, and an initial coordinate of a target color channel is determined in the DST system according to the color difference offset degree data.
Step S420, adjusting the initial coordinate to obtain an adjusted coordinate.
When the pixel position of the color channel is adjusted, the coordinate of the relative position of the pixel of the target color channel can be automatically adjusted according to the color difference deviation degree data to obtain the corresponding adjustment coordinate, an engineer is not required to manually calibrate the color difference degree parameter of each pixel position in the target image, the error influence and the time cost during manual calibration are reduced, and the efficiency and the accuracy of position adjustment are effectively improved.
And step S430, performing color difference correction on the target image based on the adjustment coordinates to obtain the corrected image.
And performing color difference correction on the target image in a color difference correction algorithm according to the adjustment coordinates, so as to obtain a corrected image without the influence of color difference.
In the embodiment shown in fig. 5, the chromatic aberration correction can be automatically performed on the target image according to the chromatic aberration offset degree data, and the efficiency and the accuracy of chromatic aberration correction are effectively improved.
Optionally, referring to fig. 6, fig. 6 is a detailed flowchart of step S420 according to an embodiment of the present disclosure, and step S420 may further include steps S421 to S423.
Step S421, calculating the target radian based on the optical center position of the target color channel.
When the pixel position in the target color channel is adjusted, the optical center position of the target color channel can be obtained, the target radian of the optical center position is calculated, and the angle position of the target color in the optical center position can be known.
Step S422, searching in a color difference corresponding table based on the target radian, and determining the corresponding radial offset.
In a color difference corresponding table corresponding to the color difference offset degree data stored in the color difference correction algorithm, searching and matching can be carried out according to the target radian, and the radial offset during adjustment is determined, so that the pixel position of the target color channel is adjusted.
It is worth mentioning that, in the color difference correction algorithm designed by the present application, information such as color difference offset degree data of each pixel position does not need to be saved in a mesh table form, and only a color difference corresponding table corresponding to the color difference offset degree data needs to be saved, and parameters in the color difference corresponding table lut (look Up table) are few, and the parameters therein can be automatically calibrated and obtained, so that the parameter adjustment is convenient, an engineer does not need to perform multiple debugging and configuration, the storage pressure can be effectively reduced, and the parameter obtaining efficiency is improved.
Step S423, adjusting the position of the initial coordinate based on the radial offset to obtain the adjusted coordinate.
And shifting the initial coordinate according to the radial offset, and radially scaling the relative positions of the points on the target color channel plane to the respective optical center positions to obtain the adjusted coordinate.
In the embodiment shown in fig. 6, the pixel position in the target color channel can be automatically adjusted without an engineer adjusting the pixel position according to the manually calibrated color difference parameter, so that the efficiency and the accuracy of adjusting the pixel position are improved.
Optionally, referring to fig. 7, fig. 7 is a detailed flowchart of step S430 according to an embodiment of the present application, and step S430 may further include steps S431 to S432.
Step S431, calculating interpolation data of adjacent coordinates in the target color channel within the preset range of the adjustment coordinate.
In order to improve the accuracy of chromatic aberration correction, a plurality of adjacent coordinates of the same channel as a target color channel can be selected in a preset range around an adjustment coordinate for interpolation calculation to obtain corresponding interpolation data, the interpolation data can be subjected to interpolation on the basis of discrete data, so that the continuous curve passes through all given discrete data points, and the approximate values of the function at other points are estimated according to the value conditions of the function at a limited number of points, so that the method can be used for filling gaps among pixels during image transformation and expanding the correction range during chromatic aberration correction.
Step S432, performing color difference correction on the target color channel in the target image based on the interpolation data, to obtain the corrected image.
The calculated interpolation data is used as the pixel position of the DST system in the chromatic aberration correction algorithm, so that chromatic aberration correction with a large range is carried out on a target color channel in an input target image, and when correction of a plurality of target points is completed, a corrected image without chromatic aberration influence is obtained.
In the embodiment shown in fig. 7, the chromatic aberration correction can be performed on a plurality of pixel coordinates within the range, and the range and the accuracy of chromatic aberration correction are improved.
Referring to fig. 8, fig. 8 is a schematic block diagram of an image chromatic aberration correction apparatus according to an embodiment of the present application, where the image chromatic aberration correction apparatus 500 may include:
a shift module 510, configured to determine, based on a reference color channel of a target point in a target image, a shift amount of a target color channel corresponding to the target point;
a fitting module 520, configured to fit the offset to obtain color difference offset degree data of the target color channel;
a correcting module 530, configured to perform color difference correction on the target image based on the color difference offset degree data, so as to obtain a corrected image.
In an optional embodiment, the offset module 510 may further include a reference determination sub-module, a parameter calibration sub-module, and an offset calculation sub-module;
a reference determination submodule configured to determine the reference color channel in a first color channel, a second color channel, and a third color channel of the target point in the target image;
the parameter calibration submodule is used for calibrating corresponding target color parameters in a non-reference color channel to serve as the target color channel;
an offset calculation submodule for calculating the offset of the target color channel at the center of the target point based on the reference color channel.
In an optional embodiment, the fitting module 520 may further include a parameter submodule and a fitting submodule;
the parameter submodule is used for acquiring a plurality of focal radii and ellipse parameters of the target point;
and the fitting submodule is used for fitting the offset based on the ellipse parameters and the plurality of focal radii to obtain the chromatic aberration offset degree data.
In an optional embodiment, the correction module 530 may further include a coordinate sub-module, an adjustment sub-module, and a correction sub-module;
a coordinate submodule for determining initial coordinates of the target color channel based on the color difference offset degree data;
the adjusting submodule is used for adjusting the initial coordinate to obtain an adjusted coordinate;
and the correction submodule is used for carrying out color difference correction on the target image based on the adjustment coordinate to obtain the corrected image.
In an optional embodiment, the adjustment submodule may further include an arc unit, a radial unit, and an offset unit;
a radian unit used for calculating a target radian based on the optical center position of the target color channel;
the radial unit is used for searching in a chromatic aberration corresponding table based on the target radian and determining the corresponding radial offset;
and the offset unit is used for adjusting the position of the initial coordinate based on the radial offset to obtain the adjusted coordinate.
In an optional embodiment, the correction submodule may further include an interpolation unit and a correction unit;
the interpolation unit is used for calculating interpolation data of adjacent coordinates in the target color channel within a preset range of the adjustment coordinates;
and the correction unit is used for carrying out color difference correction on the target color channel in the target image based on the interpolation data to obtain the corrected image.
In an optional embodiment, the image chromatic aberration correction apparatus 500 may further include a preprocessing module, configured to obtain a test image that needs chromatic aberration correction; and calibrating the test image to obtain the target image with a plurality of target points.
Since the principle of the apparatus in the embodiment of the present application for solving the problem is similar to that of the foregoing embodiment of the image chromatic aberration correcting method, the implementation of the image chromatic aberration correcting apparatus 500 in the embodiment of the present application can refer to the description in the foregoing embodiment of the image chromatic aberration correcting method, and repeated details are omitted.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores program instructions, and when the processor reads and runs the program instructions, the processor executes the steps in any one of the methods of correcting image chromatic aberration provided in this embodiment.
It should be understood that the electronic device may be a personal computer, tablet computer, smart phone, personal digital assistant, etc. electronic device having logic computing functionality.
The embodiment of the present application further provides a computer-readable storage medium, where computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the steps in any one of the methods of correcting image chromatic aberration provided in this embodiment are executed.
In summary, the embodiments of the present application provide an image chromatic aberration correction method, an apparatus, an electronic device, and a storage medium, which can utilize the physical characteristics of lens chromatic dispersion, and obtain chromatic aberration offset degrees of other color channels by using one color channel as a reference color channel, so as to correct chromatic aberration of a target image according to chromatic aberration offset degree data and a chromatic aberration correction algorithm, and perform chromatic aberration correction without multiple parameter debugging and position adjustment by an engineer, thereby reducing labor and time costs, and effectively improving chromatic aberration correction efficiency and accuracy.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. The apparatus embodiments described above are merely illustrative, and for example, the block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices according to various embodiments of the present application. In this regard, each block in the block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams, and combinations of blocks in the block diagrams, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Therefore, the present embodiment further provides a readable storage medium, in which computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the computer program instructions perform the steps of any of the block data storage methods. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RanDom Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. An image chromatic aberration correction method, characterized by comprising:
determining the offset of a target color channel corresponding to a target point based on a reference color channel of the target point in a target image;
fitting the offset to obtain color difference offset degree data of the target color channel;
and carrying out color difference correction on the target image based on the color difference offset degree data to obtain a corrected image.
2. The method of claim 1, wherein determining the offset of the target color channel corresponding to the target point based on the reference color channel of the target point in the target image comprises:
determining the reference color channel in a first color channel, a second color channel and a third color channel of the target point in the target image;
marking a corresponding target color parameter in a non-reference color channel as the target color channel;
calculating the offset of the target color channel at the center of the target point based on the reference color channel.
3. The method of claim 1, wherein fitting the offset to obtain color difference offset level data for the target color channel comprises:
acquiring a plurality of focal radii and ellipse parameters of the target point;
fitting the offset based on the ellipse parameters and the plurality of focal radii to obtain the chromatic aberration offset degree data.
4. The method according to claim 1, wherein the performing color difference correction on the target image based on the color difference offset degree data to obtain a corrected image comprises:
determining initial coordinates of the target color channel based on the color difference offset degree data;
adjusting the initial coordinates to obtain adjusted coordinates;
and carrying out color difference correction on the target image based on the adjustment coordinates to obtain the corrected image.
5. The method of claim 4, wherein the adjusting the initial coordinates to obtain adjusted coordinates comprises:
calculating a target radian based on the optical center position of the target color channel;
searching in a chromatic aberration corresponding table based on the target radian, and determining a corresponding radial offset;
and adjusting the position of the initial coordinate based on the radial offset to obtain the adjusted coordinate.
6. The method according to claim 4, wherein the performing color difference correction on the target image based on the adjustment coordinates to obtain the corrected image comprises:
calculating interpolation data of adjacent coordinates in the target color channel within a preset range of the adjusted coordinates;
and carrying out color difference correction on the target color channel in the target image based on the interpolation data to obtain the corrected image.
7. The method of claim 1, wherein before determining the offset of the target color channel corresponding to the target point based on the reference color channel of the target point in the target image, the method further comprises:
obtaining a test image needing chromatic aberration correction;
and calibrating the test image to obtain the target image with a plurality of target points.
8. An apparatus for correcting chromatic aberration of an image, the apparatus comprising:
the offset module is used for determining the offset of a target color channel corresponding to a target point based on a reference color channel of the target point in a target image;
the fitting module is used for fitting the offset to obtain chromatic aberration offset degree data of the target color channel;
and the correction module is used for carrying out chromatic aberration correction on the target image based on the chromatic aberration offset degree data to obtain a corrected image.
9. An electronic device comprising a memory having stored therein program instructions and a processor that, when executed, performs the steps of the method of any of claims 1-7.
10. A computer-readable storage medium having computer program instructions stored thereon for execution by a processor to perform the steps of the method of any one of claims 1-7.
CN202111568538.9A 2021-12-21 2021-12-21 Image chromatic aberration correction method and device, electronic equipment and storage medium Pending CN114219736A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111568538.9A CN114219736A (en) 2021-12-21 2021-12-21 Image chromatic aberration correction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111568538.9A CN114219736A (en) 2021-12-21 2021-12-21 Image chromatic aberration correction method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114219736A true CN114219736A (en) 2022-03-22

Family

ID=80704611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111568538.9A Pending CN114219736A (en) 2021-12-21 2021-12-21 Image chromatic aberration correction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114219736A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115802173A (en) * 2023-02-06 2023-03-14 北京小米移动软件有限公司 Image processing method and device, electronic equipment and storage medium
CN116055698A (en) * 2022-12-30 2023-05-02 爱芯元智半导体(上海)有限公司 Color adjustment method, color adjustment device and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055698A (en) * 2022-12-30 2023-05-02 爱芯元智半导体(上海)有限公司 Color adjustment method, color adjustment device and electronic equipment
CN116055698B (en) * 2022-12-30 2024-04-12 爱芯元智半导体(宁波)有限公司 Color adjustment method, color adjustment device and electronic equipment
CN115802173A (en) * 2023-02-06 2023-03-14 北京小米移动软件有限公司 Image processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN114219736A (en) Image chromatic aberration correction method and device, electronic equipment and storage medium
US20070242897A1 (en) Method and system for automatic correction of chromatic aberration
CN110858899B (en) Method and system for measuring optical axis center and field angle of camera movement
CN110858872B (en) Optical axis offset compensation method and device
CN105793892B (en) A kind of image processing method, device and picture pick-up device
CN101163253B (en) Method and device for searching new color temperature point
US20050225807A1 (en) Methods and systems for anti shading correction in image sensors
CN102592264A (en) Method of processing image and apparatus for the same
CN103530852A (en) Method for correcting distortion of lens
CN112689140B (en) White balance synchronization method and device, electronic equipment and storage medium
JP2018019273A (en) Image processing device, image processing method, and image processing program
CN211374003U (en) Lens testing device
CN109685794A (en) For mobile phone screen defects detection camera adaptive step DPC algorithm and device
US8634001B2 (en) Image processing apparatus, image processing program, image processing method, and image-pickup apparatus
CN109300091B (en) Radiance correction method and device
CN109978926B (en) Automatic image fusion method and device and terminal equipment
CN112929623A (en) Lens shadow repairing method and device applied to whole screen in correction process
JP7003291B2 (en) Correction method and device for correcting image data
CN110689586B (en) Tongue image identification method in traditional Chinese medicine intelligent tongue diagnosis and portable correction color card used for same
CN115760653A (en) Image correction method, device, equipment and readable storage medium
CN110033412B (en) Image processing method and device
CN114170319A (en) Method and device for adjusting test target
CN113160090B (en) Image correction method and device
CN112465917B (en) Distortion calibration method, system, equipment and storage medium of lens module
US10979609B2 (en) Image sensor comprising lens module and imaging module mounted on body module

Legal Events

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

Country or region after: China

Address after: Room 59, 17th Floor, Science and Technology Innovation Building, No. 777 Zhongguan West Road, Zhuangshi Street, Ningbo City, Zhejiang Province, 315200

Applicant after: Aixin Yuanzhi Semiconductor Co.,Ltd.

Address before: Room 59, 17th Floor, Science and Technology Innovation Building, No. 777 Zhongguan West Road, Zhuangshi Street, Ningbo City, Zhejiang Province, 315200

Applicant before: Aixin Yuanzhi Semiconductor (Ningbo) Co.,Ltd.

Country or region before: China

Country or region after: China

Address after: Room 59, 17th Floor, Science and Technology Innovation Building, No. 777 Zhongguan West Road, Zhuangshi Street, Ningbo City, Zhejiang Province, 315200

Applicant after: Aixin Yuanzhi Semiconductor (Ningbo) Co.,Ltd.

Address before: 201700 room 1190, zone B, floor 11, building 1, No. 158, Shuanglian Road, Qingpu District, Shanghai

Applicant before: Aisin Yuanzhi semiconductor (Shanghai) Co.,Ltd.

Country or region before: China