A method, apparatus and electronic device for image color fringing correction
By fusing the color edge probability and initial correction information from multiple detection results, combined with a preset fusion strategy and color matrix, the problem of image color edge correction error accumulation in existing technologies is solved, achieving a more efficient and smoother color edge correction effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-03
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, the fusion of multi-scale and multi-detection results results in error accumulation during image color edge correction, leading to poor correction results.
By fusing the color edge probability and initial correction information from n detection results, and employing various preset fusion strategies, such as taking the largest value, taking the smallest value, product, mean, and weighted mean fusion, the correction effect is improved, and further correction is performed in conjunction with a preset color correction matrix.
It improves the accuracy and efficiency of image color fringing correction, enhances the smoothness and applicability of correction results, reduces error accumulation, and improves image quality.
Smart Images

Figure CN116012257B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and more specifically, to an image color fringing correction method, apparatus, and electronic device. Background Technology
[0002] Due to the existence of chromatic dispersion, image acquisition devices may exhibit color fringing phenomena such as purple fringing when acquiring images. The presence of color fringing greatly affects the quality of the images acquired by the image acquisition device, so it is necessary to correct the color fringing in the image.
[0003] At present, the correction information for color edges can be obtained by fusing multiple scale and multiple detection results. However, this fusion method will cause the accumulation of errors, resulting in poor correction results for color edges. Summary of the Invention
[0004] The purpose of this application is to provide an image color fringing correction method, apparatus, and electronic device to improve the color fringing correction results.
[0005] In a first aspect, embodiments of this application provide an image edge correction method, comprising: performing edge detection on an image to be corrected, obtaining n detection results, where n>1; the detection results include edge probability of pixels in the image to be corrected and initial correction information; fusing the edge probability and initial correction information contained in the n detection results respectively to obtain a first fused edge probability and a first fused correction information; and performing edge correction on the image to be corrected according to the first fused edge probability and the first fused correction information.
[0006] In the implementation of the above scheme, by fusing the initial correction information contained in the n detection results and using the fused correction information for color edge correction, the above image color edge correction method is more effective and smoother in correcting color edge pixels, thus effectively improving the color edge correction effect of the above image color edge correction method.
[0007] In one implementation of the first aspect, the step of fusing the edge probabilities and initial correction information contained in the n detection results to obtain a first fused edge probability and first fused correction information includes: fusing the edge probabilities contained in the n detection results according to a first preset fusion strategy to obtain a first fused edge probability; the first preset fusion strategy includes at least one of: maximum fusion, minimum fusion, product fusion, mean fusion, and weighted mean fusion; and fusing the initial correction information contained in the n detection results according to a second preset fusion strategy to obtain first fused correction information; the second preset fusion strategy includes at least one of: mean fusion and weighted mean fusion.
[0008] In the implementation of the above scheme, the fusion of color edge probabilities can adopt at least one of the following: maximum fusion, minimum fusion, product fusion, mean fusion, and weighted mean fusion. The fusion of initial correction information can adopt at least one of the following: mean fusion and weighted mean fusion. Users can preset any combination of methods so that the first preset fusion strategy and the second preset fusion strategy can meet the correction requirements, making the above image color edge correction method applicable to more scenarios and improving the applicability of the above image color edge correction method. In addition, using the fused color edge probabilities and correction information to correct the image to be corrected improves the fault tolerance rate of color edge detection and effectively improves the correction effect of the above image color edge correction method.
[0009] In one implementation of the first aspect, after performing color edge correction on the image to be corrected, the method further includes: fusing the color edge probabilities contained in n detection results to obtain a second fused color edge probability; and correcting the image to be corrected after color edge correction according to the second fused color edge probability and a preset color correction matrix.
[0010] In the implementation of the above scheme, based on the use of fusion color edge probability and fusion initial correction information to correct the image to be corrected, a preset color correction matrix is used to correct the image after color edge correction, which further improves the color edge correction effect of the above image color edge correction method.
[0011] In one implementation of the first aspect, the step of fusing the edge probabilities contained in the n detection results to obtain a second fused edge probability includes: fusing the edge probabilities contained in the n detection results according to a third preset fusion strategy to obtain a second fused edge probability; the third preset fusion strategy includes at least one of: taking the largest fusion, taking the smallest fusion, product fusion, mean fusion, and weighted mean fusion.
[0012] In the implementation of the above scheme, the fusion of color edge probabilities can adopt at least one of the following: large-value fusion, small-value fusion, product fusion, mean fusion, and weighted mean fusion. Users can preset any combination of methods so that the third preset fusion strategy can meet the correction requirements, making the above image color edge correction method applicable to more scenarios and improving the applicability of the above image color edge correction method. In addition, based on the correction of the image to be corrected by using the fused color edge probabilities and the fused initial correction information, the image after color edge correction is corrected again by using a preset color correction matrix, which further improves the color edge correction effect of the above image color edge correction method.
[0013] In one implementation of the first aspect, the step of detecting color edges in the image to be corrected includes: determining the edge confidence, target color confidence, and dispersion defect confidence of a pixel in the image to be corrected; determining the color edge probability of a pixel in the image to be corrected based on the edge confidence, the target color confidence, and the dispersion defect confidence; and determining the initial correction information of the pixel based on the color edge probability of the pixel.
[0014] In the implementation of the above scheme, the edge probability of a pixel and the initial correction information of the pixel can be determined by calculating the edge confidence, target color confidence, and dispersion defect confidence of the pixel, which improves the correction efficiency of the above image edge correction method. By repeating the above edge detection steps, n detection results can be obtained quickly, which further improves the correction efficiency of the above image edge correction method. At the same time, when calculating the edge probability, the edge confidence, target color confidence, and dispersion defect confidence of the pixel are taken into account, which improves the edge detection accuracy and further improves the edge correction effect of the above image edge correction method.
[0015] In one implementation of the first aspect, determining the initial correction information of a pixel based on the edge probability of the pixel includes: if the edge probability of the pixel is greater than a preset probability threshold, then obtaining the initial correction information of the pixel based on the neighboring pixel information of the pixel.
[0016] In the implementation of the above scheme, before calculating the initial correction information of the pixel, a preset probability threshold is used to determine whether the pixel is a color edge. The initial correction information of the pixel is calculated only when the probability of the pixel being a color edge is greater than the preset probability threshold. This avoids invalid data processing and effectively improves the color edge correction efficiency of the above image color edge correction method.
[0017] In one implementation of the first aspect, after performing color edge detection on the image to be corrected and obtaining n detection results, the method further includes: constructing n detection mask images based on the n detection results; the intensity channel of each pixel in the detection mask image stores the color edge probability of the pixel in the image to be corrected, and the color channel stores the initial correction information of the pixel in the image to be corrected; before fusing the color edge probability and the initial correction information contained in the n detection results to obtain the first fused color edge probability and the first fused correction information, the method further includes: querying the color edge probability and the initial correction information of the corresponding pixel in the detection mask image.
[0018] In the implementation of the above scheme, a detection mask is used to store the color edge probability and initial correction information of the pixels in the image to be corrected. The color edge probability and initial correction information of the pixels in the image to be corrected can be quickly queried in the detection mask, which improves the correction efficiency of the above image color edge correction method.
[0019] Secondly, embodiments of this application provide an image color fringing correction device, comprising:
[0020] The detection module is used to perform color edge detection on the image to be corrected and obtain n detection results, where n>1; the detection results include the color edge probability of pixels in the image to be corrected and the initial correction information.
[0021] The first fusion module is used to fuse the color edge probabilities and the initial correction information contained in the n detection results respectively to obtain the first fused color edge probabilities and the first fused correction information;
[0022] The first correction module is used to perform color edge correction on the image to be corrected based on the first fused color edge probability and the first fused correction information.
[0023] Thirdly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when read and executed by a processor, perform the method provided in the first aspect or any possible implementation thereof.
[0024] Fourthly, embodiments of this application provide an electronic device, including: a processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other through the communication bus; the memory stores program instructions executable by the processor, and the computer program instructions are read and executed by the processor to perform the method provided in the first aspect or any possible implementation of the first aspect.
[0025] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing embodiments of this application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0026] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 A schematic flowchart illustrating the image color fringing correction method provided in this application embodiment;
[0028] Figure 2 This is a schematic diagram of the image color fringing correction device provided in the embodiments of this application;
[0029] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of this application, and are therefore merely examples and should not be used to limit the scope of protection of this application.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0032] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0033] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0034] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0035] Please see Figure 1 This application provides an image color fringing correction method, including:
[0036] Step S110: Perform color edge detection on the image to be corrected and obtain n detection results, where n>1; the detection results include the color edge probability of pixels in the image to be corrected and the initial correction information;
[0037] Step S120: Fuse the color edge probabilities and initial correction information contained in the n detection results respectively to obtain the first fused color edge probability and the first fused correction information;
[0038] Step S130: Perform color edge correction on the image to be corrected based on the first fusion color edge probability and the first fusion correction information.
[0039] In the implementation of the above scheme, by fusing the color edge probabilities contained in the n detection results and using the fused color edge probabilities for color edge correction, the color edge detection accuracy of the above image color edge correction method is improved. At the same time, by fusing the initial correction information contained in the n detection results and using the fused correction information for color edge correction, the above image color edge correction method is more effective and smooth in correcting color edge pixels, thus effectively improving the color edge correction effect of the above image color edge correction method.
[0040] Step S110 is described in detail below:
[0041] As an optional implementation of the above-mentioned image edge correction method, step S110 performs edge detection on the image to be corrected, including: determining the edge confidence, target color confidence, and dispersion defect confidence of pixels in the image to be corrected; determining the edge probability of pixels in the image to be corrected based on the edge confidence, target color confidence, and dispersion defect confidence; and determining the initial correction information of pixels based on the edge probability of pixels. An example of this implementation is:
[0042] Operators such as the Laplacian operator are used to perform edge detection on the image to be corrected, and the edge confidence of each pixel is obtained.
[0043] The color of each pixel is detected, the hue of each pixel is calculated, and the confidence level of whether a pixel is a certain color is determined based on the hue, which is the target color confidence level. For example, if you want to correct the purple fringing in the image to be corrected, the target color confidence level is the confidence level that a pixel is a purple pixel.
[0044] Based on prior conditions, determine whether a pixel is a defect caused by dispersion and determine the confidence level of dispersion defects;
[0045] The edge confidence, target color confidence, and dispersion defect confidence are multiplied, added, or weighted and added together to finally determine the color edge probability of the pixel.
[0046] The initial correction information for each pixel is determined based on the probability of its color edge.
[0047] It is understandable that in step S110, when performing color edge detection on the image to be corrected, the probability of color edge for each pixel in the image to be corrected can be calculated, or the region where color edge may occur can be determined, and then the probability of color edge for the pixels in that region can be calculated. The method for determining the region where color edge may occur can refer to existing technologies.
[0048] It should be noted that the n detection results obtained in step S110 can be obtained by one or more color edge detection algorithms, and each detection algorithm only needs to obtain the color edge probability of the pixels in the image to be corrected.
[0049] As an optional implementation of the above-described image edge correction method, step S110 determines the initial correction information of a pixel based on its edge probability, including: if the edge probability of a pixel is greater than a preset probability threshold, then the initial correction information of the pixel is obtained based on the neighboring pixel information. For example, this implementation may involve: pre-setting an edge probability threshold; if the edge probability of a pixel is greater than the preset probability threshold, then the pixel is determined to be an edge; then, non-edge pixels are selected from the neighboring pixels of the pixel; and the initial correction information for the pixel is obtained using the YUV or RGB channel information of the non-edge pixels.
[0050] As an optional implementation of the above-mentioned image edge correction method, after performing edge detection on the image to be corrected in step S110 and obtaining n detection results, the method further includes: constructing n detection mask images based on the n detection results; the intensity channel of each pixel in the detection mask image stores the edge probability of the pixel in the image to be corrected, and the color channel stores the initial correction information of the pixel in the image to be corrected. At this time, before fusing the edge probabilities and the initial correction information contained in the n detection results in step S120 to obtain the first fused edge probability and the first fused correction information, the method further includes: querying the edge probability of the corresponding pixel and the initial correction information in the detection mask image. For example, this implementation involves constructing n detection mask images for the n detection results, with the size of the detection mask image being the same as the size of the image to be corrected. The intensity channel of each pixel in the detection mask image stores the edge probability of the corresponding pixel in the image to be corrected, and the color channel stores the initial correction information of the corresponding pixel in the image to be corrected. That is, the intensity of a pixel in the detection mask image corresponds to the edge probability of the corresponding pixel in the image to be corrected, and the color of a pixel in the detection mask image corresponds to the initial correction information of the corresponding pixel in the image to be corrected.
[0051] Understandably, the initial calibration information can be in YUV or RGB format. When the initial calibration information is in YUV format, the number of color channels for pixels in the detection mask is two; when the initial calibration information is in RGB format, the number of color channels for pixels in the detection mask is three. Furthermore, before storing the color edge probability in the intensity channel of the detection mask, the color edge probability needs to be normalized.
[0052] It should be noted that different edge detection algorithms may divide the image to be corrected into images of different scales, resulting in the detection mask image constructed using the detection results being inconsistent in size with the image to be corrected. In this case, it is necessary to restore the detection mask image to the same size as the image to be corrected.
[0053] Step S120 is described below:
[0054] As an optional implementation of the above-mentioned image edge correction method, step S120 fuses the edge probabilities and initial correction information contained in n detection results to obtain a first fused edge probability and first fused correction information, including: fusing the edge probabilities contained in n detection results according to a first preset fusion strategy to obtain a first fused edge probability; the first preset fusion strategy includes at least one of: maximum fusion, minimum fusion, product fusion, mean fusion, and weighted mean fusion; fusing the initial correction information contained in n detection results according to a second preset fusion strategy to obtain first fused correction information; the second preset fusion strategy includes at least one of: mean fusion and weighted mean fusion. For example, taking the fusion of edge probabilities contained in 4 detection results as an example, if a certain pixel is considered to be an edge, the method for obtaining the first fused edge probability is as follows:
[0055] combine_mask1=Proc(Proc(Proc(i,i+1),i+2),i+3)
[0056] Proc(i,i+1)=max(mask1[i],mask1[i+1])
[0057] or min(mask1[i],mask1[i+1])
[0058] or mask1[i]*mask1[i+1]
[0059] Or mean(mask1[i]+mask1[i+1])
[0060] or mean(ω) i mask1[i]+ω i+1 mask1[i+1])
[0061] Where mask1[i] is the probability of the color edge of the pixel in the i-th detection mask; ω i and ω i+1 These are the weights of the i-th and (i+1)-th detection mask images when fusing the edge probability, respectively.
[0062] The method for obtaining the first fusion correction information is as follows:
[0063] combine_mask2=mean(mask2[i],mask2[i+1])
[0064] or mean(ω) i ′mask2[i],ω i+1 ′mask2[i+1])
[0065] Where mask2[i] represents the initial correction information of the pixel in the i-th detection mask image, ω i ′ and ω i+1 ′ represent the weights of the i-th and (i+1)-th detection mask images when fusing the initial correction information.
[0066] As can be seen from the above formula combine_mask1=Proc(Proc(Proc(i,i+1),i+2),i+3), when fusing the edge probabilities in the detection results, it is fusing in pairs. That is, the edge probabilities in the two detection results are fused first, and then the fused result is fused with the edge probabilities in the third detection result. This fusion method allows users to customize the fusion method between the edge probabilities of each pair of detection results. Meanwhile, the first preset fusion strategy mentioned above is a fusion strategy preset by the user according to the color edge correction requirements. For example, if the color edge correction requirement is to focus on removing color edges, then the fusion of mask1[i] and mask1[i+1] can all adopt the larger fusion method, i.e., max(mask1[i], mask1[i+1]); if the color edge correction requirement is to reproduce the pixels of the original image, then the fusion of mask1[i] and mask1[i+1] can all adopt the smaller fusion method, i.e., min(mask1[i], mask1[i+1]). The above content only describes two relatively simple requirements of the above image color edge correction method in actual application. However, the actual correction requirements are not limited to these two. Users can customize any fusion method between any two detection results.
[0067] Step S130 is described in detail below:
[0068] Step S130, based on the first fusion edge probability and the first fusion correction information, performs edge correction on the image to be corrected as follows:
[0069] R correction1 =R*(1-combine_mask1)+R′*combine_mask1
[0070] G correction1 =G*(1-combine_mask1)+G′*combine_mask1
[0071] B correction1 =B*(1-combine_mask1)+B′*combine_mask1
[0072] Where R, G, and B are the values of the R, G, and B channels of the corresponding pixels in the image to be corrected, respectively; R′, G′, and B′ are the initial correction information after fusion, combine_mask2.
[0073] It is understandable that the above method is illustrated using RGB color information in the detected mask as an example. If the color information is in YUV format, it can be converted to RGB format before the above steps are used to correct the color edges. Additionally, the color channels of the image to be corrected may not be in RGB format. In this case, the image to be corrected can be format-converted to RGB format.
[0074] As an optional implementation of the above-described image color edge correction method, after color edge correction of the image to be corrected in step S130, the method further includes: fusing the color edge probabilities contained in n detection results to obtain a second fused color edge probability; and correcting the image to be corrected after color edge correction based on the second fused color edge probability and a preset color correction matrix. For example, this implementation involves fusing the color edge probabilities contained in n detection results to obtain the second fused color edge probability combine_mask3.
[0075] Then, the image to be corrected is corrected using a base color matrix for color correction and a color correction matrix for reducing the color saturation of the image to be corrected, specifically as follows:
[0076] R correction2 =R correction1 *[(Color_Matrix_base*(1-combine_mask3)+Color_Matrix_correction*combine_mask3]
[0077] Among them, Color_Matrix_base is the base color matrix; Color_Matrix_correction is the color correction matrix. The matrix forms of Color_Matrix_base and Color_Matrix_correction can refer to existing technologies.
[0078] As an optional implementation of the above-mentioned image edge correction method, fusing the edge probabilities contained in n detection results to obtain a second fused edge probability includes: fusing the edge probabilities contained in n detection results according to a third preset fusion strategy to obtain a second fused edge probability; the third preset fusion strategy includes at least one of: maximum fusion, minimum fusion, product fusion, mean fusion, and weighted mean fusion. For example, taking the fusion of edge probabilities contained in four detection results as an example, if a certain pixel is considered to have an edge, the method for obtaining the second fused edge probability is as follows:
[0079] combine_mask3=Proc(Proc(Proc(i,i+1),i+2),i+3)
[0080] Proc(i,i+1)=max(mask1[i],mask1[i+1])
[0081] or min(mask1[i],mask1[i+1])
[0082] or mask1[i]*mask1[i+1]
[0083] Or mean(mask1[i]+mask1[i+1])
[0084] or mean(ω) i "mask1[i]+ω i+1 "mask1[i+1])
[0085] Where mask1[i] is the probability of the color edge of the pixel in the i-th detection mask; ω i " and ω i+1 "" represents the weights of the i-th and (i+1)-th detection masks when fusing color edge probabilities for color matrix correction.
[0086] It should be noted that the third preset fusion strategy and the first preset fusion strategy mentioned above can be the same fusion strategy or different fusion strategies.
[0087] Please see Figure 2 Based on the same inventive concept, this application also provides an image color fringing correction device 200, comprising:
[0088] Detection module 210 is used to perform color edge detection on the image to be corrected and obtain n detection results, where n>1; the detection results include the color edge probability of pixels in the image to be corrected and initial correction information;
[0089] The first fusion module 220 is used to fuse the color edge probabilities and the initial correction information contained in the n detection results respectively to obtain the first fused color edge probabilities and the first fused correction information;
[0090] The first correction module 230 is used to perform color edge correction on the image to be corrected based on the first fusion color edge probability and the first fusion correction information.
[0091] As an optional implementation of the aforementioned image color fringing correction device, the fusion module 220 includes:
[0092] The first fusion unit is configured to fuse the edge probabilities contained in n detection results according to a first preset fusion strategy to obtain a first fused edge probability; the first preset fusion strategy includes at least one of: taking the largest fusion, taking the smallest fusion, product fusion, mean fusion, and weighted mean fusion.
[0093] The second fusion unit is used to fuse the initial correction information contained in the n detection results according to the second preset fusion strategy to obtain the first fusion correction information; the second preset fusion strategy includes at least one of mean fusion and weighted mean fusion.
[0094] As an optional embodiment of the above-mentioned image color fringing correction device, the image color fringing correction device further includes:
[0095] The second fusion module is used to fuse the color edge probabilities contained in the n detection results to obtain the second fused color edge probability;
[0096] The second correction module is used to correct the image to be corrected after color edge correction based on the second fused color edge probability and the preset color correction matrix.
[0097] It should be noted that the second correction module can also directly correct the image to be corrected. That is, the user can choose to use the first correction module alone, the second correction module alone, or a combination of the first and second correction modules to correct the image to be corrected.
[0098] As an optional implementation of the above-mentioned image color edge correction device, the second fusion module specifically involves: fusing the color edge probabilities contained in n detection results according to a third preset fusion strategy to obtain a second fused color edge probability; the third preset fusion strategy includes at least one of the following: taking the largest fusion, taking the smallest fusion, product fusion, mean fusion, and weighted mean fusion.
[0099] As an optional implementation of the above-mentioned image edge correction device, the detection module 210 specifically comprises: determining the edge confidence, target color confidence, and dispersion defect confidence of the pixels in the image to be corrected; determining the edge probability of the pixels in the image to be corrected based on the edge confidence, the target color confidence, and the dispersion defect confidence; and determining the initial correction information of the pixels based on the edge probability of the pixels.
[0100] As an optional implementation of the above-mentioned image color edge correction device, the detection module 210 determines the initial correction information of the pixel based on the color edge probability of the pixel, including: if the color edge probability of the pixel is greater than a preset probability threshold, then the initial correction information of the pixel is obtained based on the neighboring pixel information of the pixel.
[0101] As an optional implementation of the above-mentioned image edge correction device, after the detection module 210 performs edge detection on the image to be corrected and obtains n detection results, it further includes: constructing n detection mask images based on the n detection results; the intensity channel of each pixel in the detection mask image stores the edge probability of the pixel in the image to be corrected, and the color channel stores the initial correction information of the pixel in the image to be corrected; before fusing the edge probability and the initial correction information contained in the n detection results to obtain the first fused edge probability and the first fused correction information, it further includes: querying the edge probability and the initial correction information of the corresponding pixel in the detection mask image.
[0102] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of this application. (Refer to...) Figure 3 The electronic device 300 includes a processor 310, a memory 320, and a communication interface 330. These components are interconnected and communicate with each other via a communication bus 340 and / or other forms of connection mechanism (not shown).
[0103] The memory 320 includes one or more (only one is shown in the figure), which may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The processor 310 and other possible components may access the memory 320 to read and / or write data therein.
[0104] Processor 310 includes one or more (only one is shown in the figure), which can be an integrated circuit chip with signal processing capabilities. The processor 310 described above can be a general-purpose processor, including a central processing unit (CPU), a microcontroller unit (MCU), a network processor (NP), or other conventional processors; it can also be a special-purpose processor, including a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0105] Communication interface 330 includes one or more (only one is shown in the figure) and can be used to communicate directly or indirectly with other devices to exchange data. For example, communication interface 330 can be an Ethernet interface; it can be a mobile communication network interface, such as an interface for 3G, 4G, or 5G networks; or it can be other types of interfaces with data transmission and reception functions.
[0106] One or more computer program instructions may be stored in the memory 320, and the processor 310 may read and run these computer program instructions to implement the image color fringing correction method provided in the embodiments of this application and other desired functions.
[0107] Understandable. Figure 3The structure shown is for illustrative purposes only; the electronic device 300 may also include components that are more advanced than those shown. Figure 3 The more or fewer components shown, or having the same Figure 3 The different configurations shown. Figure 3 The components shown can be implemented using hardware, software, or a combination thereof. For example, electronic device 300 can be a single server (or other device with computing power), a combination of multiple servers, a cluster of a large number of servers, etc., and can be either a physical device or a virtual device.
[0108] This application also provides a computer-readable storage medium storing computer program instructions. These computer program instructions are read and executed by a computer's processor to perform the image color fringing correction method provided in this application. For example, the computer-readable storage medium can be implemented as follows: Figure 3 The memory 320 in the electronic device 300.
[0109] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0110] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0111] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0112] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for correcting color fringing in images, characterized in that, include: Perform color fringing detection on the image to be corrected and obtain... One test result, The detection results include the color edge probability of pixels in the image to be corrected and the initial correction information. separate fusion The first fused color edge probability and the first fused correction information are obtained by taking the color edge probability and the initial correction information contained in the detection results. Based on the first fusion edge probability and the first fusion correction information, edge correction is performed on the image to be corrected; The step of detecting color edges in the image to be corrected includes: determining the edge confidence, target color confidence, and dispersion defect confidence of pixels in the image to be corrected; determining the color edge probability of pixels in the image to be corrected based on the edge confidence, target color confidence, and dispersion defect confidence; and determining the initial correction information of pixels based on the color edge probability of pixels. The step of determining the initial correction information of a pixel based on the edge probability of the pixel includes: if the edge probability of the pixel is greater than a preset probability threshold, then obtaining the initial correction information of the pixel based on the neighboring pixel information; the step of obtaining the initial correction information of the pixel based on the neighboring pixel information includes: filtering non-edge pixels among the neighboring pixels of the pixel, and using the YUV channel information or RGB channel information of the non-edge pixels to obtain the initial correction information of the pixel; Color fringing detection is performed on the image to be corrected to obtain... Following the test results, it also includes: according to the... Each test result is used to construct... A detection mask image; the intensity channel of each pixel in the detection mask image stores the color edge probability of the pixel to be corrected, and the color channel stores the initial correction information of the pixel to be corrected; The separate fusion Before obtaining the first fused color edge probability and the first fused correction information, the detection result includes: querying the color edge probability and the initial correction information of the corresponding pixel in the detection mask image.
2. The image color fringing correction method according to claim 1, characterized in that, The respective fusions The first fused color edge probability and the first fused correction information are obtained by taking the color edge probability and the initial correction information contained in the detection results, including: According to the first preset fusion strategy, fusion The first fused edge probability is obtained from the edge probability contained in the detection result; the first preset fusion strategy includes at least one of the following: large fusion, small fusion, product fusion, mean fusion, and weighted mean fusion. According to the second preset fusion strategy, fusion The first fusion correction information is obtained from the initial correction information contained in the detection result; the second preset fusion strategy includes at least one of mean fusion and weighted mean fusion.
3. The image color fringing correction method according to claim 1, characterized in that, After performing color fringing correction on the image to be corrected, the method further includes: Fusion The second fused color edge probability is obtained from the color edge probabilities contained in the detection results. The image to be corrected after color edge correction is corrected based on the second fusion color edge probability and the preset color correction matrix.
4. The image color fringing correction method according to claim 3, characterized in that, The fusion The second fused color edge probability is obtained from the color edge probabilities contained in the detection results, including: According to the third preset fusion strategy, fusion The second fused edge probability is obtained from the edge probability contained in the detection result; the third preset fusion strategy includes at least one of the following: large fusion, small fusion, product fusion, mean fusion, and weighted mean fusion.
5. An image color fringing correction device, characterized in that, include: The detection module is used to detect color fringes in the image to be corrected and obtain... One test result, The detection results include the color edge probability of pixels in the image to be corrected and the initial correction information. The first fusion module is used for fusion separately. The first fused color edge probability and the first fused correction information are obtained by taking the color edge probability and the initial correction information contained in the detection results. The first correction module is used to perform color edge correction on the image to be corrected based on the first fused color edge probability and the first fused correction information; The detection module is specifically used to determine the edge confidence, target color confidence, and dispersion defect confidence of pixels in the image to be corrected; determine the color edge probability of pixels in the image to be corrected based on the edge confidence, target color confidence, and dispersion defect confidence; and determine the initial correction information of pixels based on the color edge probability of pixels. The detection module determines the initial correction information of a pixel based on the color edge probability of the pixel, including: if the color edge probability of the pixel is greater than a preset probability threshold, then the initial correction information of the pixel is obtained based on the neighboring pixel information; obtaining the initial correction information of the pixel based on the neighboring pixel information includes: filtering non-color edge pixels among the neighboring pixels of the pixel, and using the YUV channel information or RGB channel information of the non-color edge pixels to obtain the initial correction information of the pixel; The detection module performs color fringing detection on the image to be corrected and obtains... Following the test results, it also includes: according to the... Each test result is used to construct... A detection mask image; the intensity channel of each pixel in the detection mask image stores the color edge probability of the pixel to be corrected, and the color channel stores the initial correction information of the pixel to be corrected; The detection module is fused in the respective... Before obtaining the first fused color edge probability and the first fused correction information, the detection result includes: querying the color edge probability and the initial correction information of the corresponding pixel in the detection mask image.
6. An electronic device, characterized in that, include: A processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; The memory stores program instructions that can be executed by the processor, and the processor can execute the method as described in any one of claims 1-4 by calling the program instructions.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a computer, cause the computer to perform the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Image purple edge elimination method and device and storage medium
CN112887693A
Image color edge correction method and device, electronic equipment and storage medium
CN113132705A