Purple fringing correction method and purple fringing correction device
By calculating the distance between pixels in the purple edge area and the overexposed and non-overexposed areas, determining the weight and changing the pixel value, the problem of false color at the purple edge during the imaging process is solved and the image quality is improved.
Patent Information
- Application Number
- CN202111128211.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-09-26
AI Technical Summary
During the imaging process, false color areas, especially the appearance of purple fringes, caused by lens chromatic aberration, imaging device crosstalk, and color interpolation have a negative impact on image quality and are difficult to effectively eliminate.
By determining the distance between the pixels in the purple edge area of the image and the overexposed area and the non-overexposed non-purple edge area, calculate the weight of the pixel, and change the pixel value based on the weight and the characteristics of the purple edge area to achieve the correction of the purple edge area. .
It effectively eliminates the influence of false colors in the purple edge area, improves the image quality, and adapts to different shapes and complex purple edge situations.
Smart Images

Figure CN113784101B
Abstract
Description
Technical Field
[0001] The present disclosure relates to image processing, and more particularly, to a purple fringing correction method and a purple fringing correction device. Background Art
[0002] During the imaging process, due to lens chromatic aberration, imaging device crosstalk, and color interpolation, a false color area will appear at the junction of the overexposed area and the normal exposure area. Generally speaking, this false color area appears purple and is called purple fringing, but depending on the lens and shooting conditions, the color of the false color can also be greenish. In the following, purple fringing refers to these false color areas. The appearance of this false color area will have a negative impact on the image quality, so how to eliminate purple fringing is a problem that needs to be solved.
[0003] Public Content
[0004] This disclosure is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
[0005] A purple fringing correction method and a purple fringing correction device are provided.
[0006] In a general aspect, a purple fringing correction method is provided, the method comprising: determining: a first distance between a first pixel in a first pixel group in a purple fringed area in an image and an overexposed area in the image, and a second distance between (a) a first pixel in the first pixel group and (b) a non-overexposed and non-purple fringed area in the image; and correcting the first pixel based on the first distance and the second distance.
[0007] The step of correcting the first pixel in the purple-fringed area may include: determining a first weight of the first pixel based on the first distance and the second distance, wherein the first weight is greater than or equal to 0 and less than or equal to 1; and changing a pixel value of the first pixel based on the first weight of the first pixel.
[0008] The step of determining the first weight of the first pixel may include: calculating the ratio between the second distance and the sum of the first distance and the second distance as a first coefficient, wherein when the sum of the first distance and the second distance is less than a first threshold, the first coefficient is 1; determining the first weight of the first pixel by mapping the first coefficient to a predetermined mapping curve, wherein the larger the first coefficient, the larger the first weight of the first pixel.
[0009] The step of changing the pixel value of the first pixel may include: determining a second weight of the purple-fringed region based on at least one of (c) the color of the pixel in the purple-fringed region, (d) the brightness of the pixel in the purple-fringed region, and (e) the edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1; calculating a third weight of the first pixel based on the first weight of the first pixel and the second weight of the purple-fringed region; and changing the pixel value of the first pixel based on the third weight of the first pixel.
[0010] The step of calculating the third weight of the first pixel may include calculating the third weight of the first pixel as a product of the first weight of the first pixel and the second weight of the purple-fringe region.
[0011] The pixel value of the first pixel may include: a color component of the first pixel, and the step of changing the pixel value of the first pixel includes: calculating the first value of the first pixel by mapping a third weight of the first pixel to a predetermined mapping curve, wherein the larger the third weight of the first pixel, the larger the first value of the first pixel; and changing the color component of the first pixel based on the product of the color component of the first pixel and a difference between 1 and the first value of the first pixel.
[0012] The pixel value of the first pixel may include: a color component of the first pixel, wherein the step of changing the pixel value of the first pixel includes: calculating a second value of the first pixel by mapping a third weight of the first pixel to a predetermined mapping curve, wherein the larger the third weight of the first pixel, the larger the second value of the first pixel; obtaining (f) a first color component of a first reference point in an overexposed area at a first distance from the first pixel, (g) a second color component of a second reference point in a non-overexposed and non-purple-fringed area at a second distance from the first pixel, and (h) the color component of the first pixel; calculating a difference between the first color component and the second color component as a color component difference; and changing the color component of the first pixel based on a difference between the color component of the first pixel and a product of the color component difference and the second value of the first pixel.
[0013] The first pixel group may include a plurality of non-adjacent pixels, wherein the purple fringing correction method further includes: calculating a third weight of a second pixel between the plurality of pixels in a purple fringing area by interpolating a plurality of third weights of the plurality of pixels; and changing a pixel value of the second pixel based on the third weight of the second pixel.
[0014] The pixel value of the second pixel may include: a color component of the second pixel, wherein the step of changing the pixel value of the second pixel includes: calculating the first value of the second pixel by mapping a third weight of the second pixel to a predetermined mapping curve, wherein the larger the third weight of the second pixel, the larger the first value of the second pixel; and changing the color component of the second pixel based on the product of the color component of the second pixel and a difference between 1 and the first value of the second pixel.
[0015] The step of determining a second weight of the purple-fringed region may include determining the second weight of the purple-fringed region based on at least one of (i) a purple degree of pixels in the purple-fringed region, (j) a brightness degree of pixels in the purple-fringed region, and (k) a gradient degree of an edge of the purple-fringed region.
[0016] The first pixel group may include a plurality of non-adjacent pixels, and the purple fringe correction method further includes: calculating a first weight of a second pixel between the plurality of pixels in the purple fringe area by interpolating a plurality of first weights of the plurality of pixels; and changing a pixel value of the second pixel based on the first weight of the second pixel.
[0017] The step of changing the pixel value of the second pixel may include: determining a second weight of the purple-fringed region based on at least one of (l) the color of the pixel in the purple-fringed region, (m) the brightness of the pixel in the purple-fringed region, and (n) the edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1; calculating a third weight of the second pixel based on the first weight of the second pixel and the second weight of the purple-fringed region; and changing the pixel value of the second pixel based on the calculated third weight of the second pixel.
[0018] The pixel value of the second pixel may include: a color component of the second pixel, wherein the step of changing the pixel value of the second pixel includes: calculating the first value of the second pixel by mapping a third weight of the second pixel to a predetermined mapping curve, wherein the larger the third weight of the second pixel, the larger the first value of the second pixel; and changing the color component of the second pixel based on the product of the color component of the second pixel and a difference between 1 and the first value of the second pixel.
[0019] The first pixel group may include a plurality of non-adjacent pixels, and the purple fringe correction method further includes: calculating a pixel value of a second pixel between the plurality of pixels in the purple fringe area by interpolating pixel values in the plurality of pixels.
[0020] The first pixel group may include pixels disposed at predetermined positions in each of a plurality of regions separated from the purple-fringe region.
[0021] The first pixel group may include multiple pixels, and when a first distance of one first pixel among the multiple pixels is the same as the first distance of another first pixel among the multiple pixels, and a second distance of the one first pixel is different from the second distance of the other first pixel among the multiple pixels, the one first pixel and the other first pixel are corrected differently; and / or when the first distance of the one first pixel is different from the first distance of the other first pixel, and the second distance of the one first pixel is the same as the second distance of another first pixel among the multiple pixels, the one first pixel and the other first pixel are corrected differently.
[0022] In one general aspect, a non-transitory computer-readable storage medium storing instructions is provided, wherein when the instructions are executed by a processor, the processor performs the purple fringing correction method of claim 1 .
[0023] In a general aspect, a purple fringing correction device is provided, comprising: a processor; and a memory storing executable instructions in the processor, wherein when the instructions are executed in the processor, the processor: determines: (1) a first distance between a first pixel in a purple fringing region in an image and an overexposed region in the image, and (2) a second distance between (a) the first pixel and (b) a non-overexposed and non-purple fringed region in the image; and corrects the first pixel in the purple fringing region based on the first distance and the second distance.
[0024] The processor may be configured to: determine a first weight of the first pixel based on the first distance and the second distance, wherein the first weight is greater than or equal to 0 and less than or equal to 1; and change a pixel value of the first pixel based on the first weight of the first pixel.
[0025] The processor can be configured to: calculate the ratio between the second distance and the sum of the first distance and the second distance as a first coefficient, wherein when the sum of the first distance and the second distance is less than a first threshold, the first coefficient is 1; determine the first weight of the first pixel by mapping the first coefficient to a predetermined mapping curve, wherein the larger the first coefficient, the larger the first weight of the first pixel.
[0026] The processor may be configured to: determine a second weight of the purple-fringed region based on at least one of (c) the color of the pixel in the purple-fringed region, (d) the brightness of the pixel in the purple-fringed region, and (e) the edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1; calculate a third weight of the first pixel based on the first weight of the first pixel and the second weight of the purple-fringed region; and change the pixel value of the first pixel based on the third weight of the first pixel.
[0027] The processor may be configured to calculate the third weight of the first pixel as a product of the first weight of the first pixel and the second weight of the purple-fringed region.
[0028] The pixel value of the first pixel may include: a color component of the first pixel, and the processor may be configured to: calculate the first value of the first pixel by mapping the third weight of the first pixel to a predetermined mapping curve, wherein the larger the third weight of the first pixel, the larger the first value of the first pixel; and change the color component of the first pixel based on the product of the color component of the first pixel and the difference between 1 and the first value of the first pixel.
[0029] The pixel value of the first pixel may include: a color component of the first pixel, wherein the processor may be configured to: calculate a second value of the first pixel by mapping a third weight of the first pixel to a predetermined mapping curve, wherein the larger the third weight of the first pixel, the larger the second value of the first pixel; obtain (f) a first color component of a first reference point in an overexposed area at a first distance from the first pixel, (g) a second color component of a second reference point in a non-overexposed and non-purple-fringed area at a second distance from the first pixel, and (h) the color component of the first pixel; calculate a difference between the first color component and the second color component as a color component difference; and change the color component of the first pixel based on a difference between the color component of the first pixel and a product of the color component difference and the second value of the first pixel.
[0030] The first pixel group may include a plurality of non-adjacent pixels, wherein the processor may also be configured to: calculate a third weight of a second pixel between the plurality of pixels in the purple-edge area by interpolating a plurality of third weights of the plurality of pixels; and change a pixel value of the second pixel based on the third weight of the second pixel.
[0031] The pixel value of the second pixel may include: a color component of the second pixel, wherein the processor may be configured to: calculate a first value of the second pixel by mapping a third weight of the second pixel to a predetermined mapping curve, wherein a larger the third weight of the second pixel, a larger the first value of the second pixel; and change the color component of the second pixel based on the product of the color component of the second pixel and a difference between 1 and the first value of the second pixel.
[0032] The processor may be configured to determine a second weight of the purple-fringed region based on at least one of (i) a purple degree of pixels in the purple-fringed region, (j) a brightness degree of pixels in the purple-fringed region, and (k) a gradient degree of an edge of the purple-fringed region.
[0033] The first pixel group may include multiple non-adjacent pixels, and the processor may be further configured to: calculate the first weight of the second pixel between the multiple pixels in the purple-edge area by interpolating the multiple first weights of the multiple pixels; and change the pixel value of the second pixel based on the first weight of the second pixel.
[0034] The processor may be configured to: determine a second weight of the purple-fringed region based on at least one of (l) the color of the pixel in the purple-fringed region, (m) the brightness of the pixel in the purple-fringed region, and (n) the edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1; calculate a third weight of the second pixel based on the first weight of the second pixel and the second weight of the purple-fringed region; and change the pixel value of the second pixel based on the calculated third weight of the second pixel.
[0035] The pixel value of the second pixel may include: a color component of the second pixel, wherein the processor may be configured to: calculate a first value of the second pixel by mapping a third weight of the second pixel to a predetermined mapping curve, wherein a larger the third weight of the second pixel, a larger the first value of the second pixel; and change the color component of the second pixel based on the product of the color component of the second pixel and a difference between 1 and the first value of the second pixel.
[0036] The first pixel group may include a plurality of non-adjacent pixels, and the processor may be further configured to calculate a pixel value of a second pixel between the plurality of pixels in the purple-fringe area by interpolating pixel values in the plurality of pixels.
[0037] The first pixel group may include pixels disposed at predetermined positions in each of a plurality of regions separated from the purple-fringe region.
[0038] The first pixel group may include multiple pixels, and the processor may be configured to: when a first distance of one first pixel among the multiple pixels is the same as a first distance of another first pixel among the multiple pixels, and a second distance of the one first pixel is different from a second distance of the other first pixel among the multiple pixels, correct the one first pixel differently from the other first pixel; and / or when the first distance of the one first pixel is different from the first distance of the other first pixel, and the second distance of the one first pixel is the same as the second distance of another first pixel among the multiple pixels, correct the one first pixel differently from the other first pixel.
[0039] In another general aspect, an electronic device includes: a camera configured to capture an image; a processor that determines: (1) a first distance between a first pixel in a purple-fringed region in the image and an overexposed region in the image, and (2) a second distance between (a) the first pixel and (b) a non-overexposed and non-purple-fringed region in the image; and based on the first distance and the second distance, corrects the first pixel in the purple-fringed region. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a block diagram illustrating a purple fringing correction apparatus according to example embodiments.
[0041] Figure 2 is a flowchart illustrating a purple fringing correction method according to example embodiments.
[0042] Figure 3 is a schematic diagram illustrating an image according to example embodiments.
[0043] Figure 4 is a flowchart illustrating a method of changing a first weight of a first pixel according to example embodiments.
[0044] Figure 5 is a flow chart illustrating a method of correcting a second pixel in purple fringing according to example embodiments.
[0045] Figure 6 is a flow chart illustrating a method of correcting a second pixel in purple fringing according to example embodiments.
[0046] Figure 7 is a flow chart illustrating a method of correcting a second pixel in purple fringing according to example embodiments.
[0047] Figure 8 is a block diagram illustrating an electronic device according to an example embodiment.
[0048] Throughout the drawings and detailed description, unless otherwise described or provided, the same figure reference numerals will be understood to refer to the same elements, features, and structures. The drawings may not be to scale, and the relative sizes, proportions, and depictions of the elements in the drawings may be exaggerated for clarity, illustration, and convenience. DETAILED DESCRIPTION
[0049] The following specific embodiments are provided to help the reader obtain a comprehensive understanding of the method, device and / or system described herein. However, after understanding the disclosure of the application, various changes, modifications and equivalents of the method, device and / or system described herein will be clear. For example, the order of operations described herein is only an example, and is not limited to those orders set forth herein, but can be changed as it will be clear after understanding the disclosure of the application, except for the operations that must occur in a specific order. In addition, for increased clarity and conciseness, the description of features known after understanding the disclosure of the application can be omitted.
[0050] The features described herein can be implemented in different forms and should not be interpreted as being limited to the examples described herein. On the contrary, the examples described herein have been provided to illustrate only some of the many possible ways to implement the methods, devices and / or systems described herein that will be clear after understanding the disclosure of the present application.
[0051] Figure 1 is a block diagram illustrating a purple fringing correction apparatus according to example embodiments.
[0052] Reference Figure 1 , the purple fringing correction device 100 may include a memory 110 and a processor 120. Figure 1 Although not shown in the drawings, the purple fringing correction apparatus 100 may be connected to an external memory and / or communicate with an external device. Figure 1 The purple fringing correction device 100 shown may include components associated with the current example. Therefore, it will be clear to those skilled in the art that the purple fringing correction device 100 may include components other than Figure 1Other common components besides those shown in .
[0053] Here, the purple fringing correction device 100 may be implemented using various types of devices such as a personal computer (PC), a server device, a mobile device, an embedded device, etc. In detail, the purple fringing correction device 100 may be included in a smart phone, a tablet device, an augmented reality (AR) device, an Internet of Things (IoT) device, an autonomous driving vehicle, a robotic device, or a medical device that can capture an image and / or process an image, but is not limited thereto.
[0054] The memory 110 stores various data processed in the purple fringing correction device 100. For example, the memory 110 may store data that has been processed or is to be processed in the purple fringing correction device 100. In one example, the memory may store instructions executable in the processor 120. In addition, the memory 110 may store an application or a driver to be driven by the purple fringing correction device 100.
[0055] For example, the memory 110 may include a random access memory (RAM) such as a dynamic random access memory (DRAM) or a static random access memory (SRAM), a read-only memory (RAM), an electrically erasable programmable read-only memory (EEPROM), a CD-ROM, a Blu-ray disc, an optical disc storage device, a hard disk drive (HDD), a solid-state drive (SSD), or a flash memory.
[0056] The processor 120 may control the overall functions of the purple fringing correction apparatus 100. For example, the processor 120 may generally control the purple fringing correction apparatus 100 by executing a program stored in the memory 110. The processor 120 may be implemented as a central processing unit (CPU), a graphics processing unit (GPU), or an application processor (AP) included in the apparatus 100 for processing data, but is not limited thereto.
[0057] The processor 120 may read data (e.g., image data) from the memory 110 or write data (e.g., image data) to the memory 110, and perform purple fringing correction by using the read data / written data. For example, when the instructions are executed in the processor, the processor may be configured to determine: (1) a first distance between (a) a first pixel in a purple fringed region in an image and (b) an overexposed region in the image, and (2) a second distance between (c) the first pixel and (d) a non-overexposed and non-purple fringed region in the image. The processor may correct the first pixel in the purple fringed region based on the first distance and the second distance.
[0058] That is, the purple fringing correction device 100 can adaptively correct the pixels in the purple fringing area based on the distance between the pixel and the overexposed area and the distance between the pixel and the non-overexposed and non-purple fringed area. Therefore, even in the face of complex purple fringing (e.g., purple fringing of different shapes), the purple fringing correction device 100 can effectively correct the purple fringing.
[0059] In the following, reference will be made to Figures 2 to 7 An example of a purple fringing correction method performed by the processor 120 is described.
[0060] Figure 2 is a flowchart illustrating a purple fringing correction method according to example embodiments.
[0061] Reference Figure 2 In operation S210, the processor may determine: (1) a first distance between a first pixel in a purple-fringed region in an image and an overexposed region in the image, and (2) a second distance between the first pixel and a non-overexposed and non-purple-fringed region in the image.
[0062] Here, the purple-fringed region may be predetermined. The purple-fringed region may be predetermined using various methods. For example, the purple-fringed region may be determined based on at least one of the color of a pixel in an image, an edge in an image, and the brightness of a pixel in an image. However, the present disclosure is not limited thereto, and in other examples, any other method may be used to predetermined the purple-fringed region. In addition, the first pixel may be a pixel in a first pixel group.
[0063] In addition, overexposed areas and non-overexposed and non-purple-fringed areas may be predetermined. Overexposed areas and non-overexposed and non-purple-fringed areas may be predetermined using various methods. For example, overexposed areas and non-overexposed and non-purple-fringed areas may be determined based on the brightness of pixels in the image. However, the present disclosure is not limited thereto, and in other examples, any other method may be used to predetermined overexposed areas and non-overexposed and non-purple-fringed areas. For example, overexposed areas and non-overexposed and non-purple-fringed areas may be determined while limiting the number of pixels in the overexposed area. In one example, the processor may preprocess the image (e.g., denoise) before determining the overexposed areas and non-overexposed and non-purple-fringed areas.
[0064] In one embodiment, the first pixel group including the first pixel may include pixels set at a predetermined position in each of a plurality of regions separated (or divided) from the purple-fringed region. For example, the first pixel group may be or may include a plurality of non-adjacent pixels. Here, the plurality of non-adjacent pixels may be a plurality of uniformly distributed pixels or a plurality of non-uniformly distributed pixels. The present disclosure does not limit the distribution of the plurality of pixels. In one example, the predetermined position may include the center of the region. However, the above examples are merely exemplary, and the predetermined positions of the present disclosure are not limited thereto. The region may be divided in any manner. For example, the region may be divided into rectangles. However, the above examples are merely exemplary, and the shapes of the regions of the present disclosure are not limited thereto.
[0065] In operation S210, the first distance between the first pixel and the overexposed area may indicate the degree of the distance between the first pixel and the overexposed area. For example, the first distance may be the shortest distance between the first pixel and the overexposed area. However, the present disclosure is not limited thereto. For example, the first distance may be the average value of multiple distances between a predetermined number of pixels closest to the first pixel in the overexposed area and the first pixel. Please note that the above examples are merely exemplary, and the first distance indicating the degree of the distance between the first pixel and the overexposed area may be specifically defined according to the circumstances.
[0066] Similarly, the second distance between the first pixel and the non-overexposed and non-purple-fringed area may indicate the degree of the distance between the first pixel and the non-overexposed and non-purple-fringed area. For example, the second distance may be the shortest distance between the first pixel and the non-overexposed and non-purple-fringed area. However, the present disclosure is not limited thereto. For example, the second distance may be the average of multiple distances between a predetermined number of pixels closest to the first pixel in the non-overexposed and non-purple-fringed area and the first pixel. Please note that the above example is merely exemplary, and the second distance indicating the degree of the distance between the first pixel and the non-overexposed and non-purple-fringed area may be defined similarly to the first distance depending on the circumstances.
[0067] In addition, the first pixel may be a single pixel or a plurality of pixels. When the first pixel is a plurality of pixels, the corresponding first distance and second distance may be determined for each pixel.
[0068] In operation S220, the processor may correct the first pixel in the purple-fringed area based on the first distance and the second distance.
[0069] In one example, when the first pixel is a plurality of pixels, the processor may correct each pixel separately based on the first distance and the second distance of each pixel.
[0070] In one embodiment, the processor may first determine a first weight of a first pixel in the purple-fringed region based on the first distance and the second distance, wherein the first weight is greater than or equal to 0 and less than or equal to 1. Then, the processor may change at least one pixel data of the first pixel based on the first weight of the first pixel, thereby correcting the first pixel. The at least one pixel data may include pixel data in at least one color domain of one or more color domains (such as, but not limited to, UV domain, CrCb domain and / or HS domain).
[0071] Here, the first weight of the first pixel may indicate the degree to which the first pixel is close to the non-overexposed and non-purple-fringed region relative to the overexposed region. For example, as an illustrative example only, the processor may calculate the ratio between the second distance and the sum of the first distance and the second distance as the first coefficient, and determine the first weight of the first pixel by mapping the first coefficient to a first predetermined mapping curve. The larger the first coefficient, the larger the first weight of the first pixel. In other words, the higher the degree to which the first pixel is close to the non-overexposed and non-purple-fringed region relative to the overexposed region, the larger the first weight.
[0072] In one example, the first predetermined mapping curve can ensure that: when the first coefficient is 0, the first weight is 0; when the first coefficient is 1, the first weight is 1. However, the above examples are only exemplary, and the present disclosure is not limited thereto. A suitable mapping curve can be selected as the first predetermined mapping curve as needed. For example, the first predetermined mapping curve can be a linear curve or a nonlinear curve.
[0073] In certain cases, the processor may set the first coefficient to 1. For example, as an illustrative example only, when the sum of the first distance and the second distance is less than the first threshold, the processor may set the first coefficient to 1. The first pixel may be considered to be in an area adjacent to the overexposed area and the non-overexposed and non-purple-fringed area in the purple-fringe area.
[0074] Figure 3 is a schematic diagram illustrating an image according to example embodiments.
[0075] Reference Figure 3 , the image 300 may include three regions (ie, for example only, an overexposed region in the upper left corner, a purple-fringed region in the middle, and the remaining non-overexposed and non-purple-fringed regions).
[0076] Typically, the shape and size of the purple-fringed region can vary greatly. For example, the shape of the purple-fringed region can be an irregular polygon, an irregular ellipse, or any other shape. In this case, it is often difficult to distinguish some pixels in the purple-fringed region and effectively correct these pixels.
[0077] Specifically, refer to Figure 3, the purple-fringed region may include a pixel (or pixel point) N located on the edge between the non-overexposed and non-purple-fringed region and the purple-fringed region and a pixel M located in the purple-fringed region. For example, a first distance Nd1 from the pixel N to the overexposed region is the same as a first distance Md1 from the pixel M to the overexposed region (for example, a difference between the first distance Nd1 and the first distance Md1 is less than a predetermined threshold), while a second distance Nd2 from the pixel N to the non-overexposed and non-purple-fringed region is different from a second distance Md2 from the pixel M to the non-overexposed region (for example, a difference between the second distance Nd2 and the second distance Md2 is greater than or equal to a predetermined threshold).
[0078] According to an exemplary embodiment of the present disclosure, the processor may differently correct pixel N and pixel M, thereby effectively correcting pixel N and pixel M for a case where pixel N and pixel M are distinguished based on the first distance and the second distance. In this case, pixel N and pixel M may have different first weights.
[0079] Similarly, according to an exemplary embodiment of the present disclosure, when (1) the first distance Nd1 from pixel N to the overexposed region and the first distance Md1 from pixel M to the overexposed region are not the same (e.g., the difference between the first distance Nd1 and the first distance Md1 is greater than or equal to a predetermined threshold), and (2) the second distance Nd2 from pixel N to the non-overexposed and non-purple-fringed region and the second distance Md2 from pixel M to the non-overexposed region are the same (e.g., the difference between the second distance Nd2 and the second distance Md2 is less than a predetermined threshold), the processor may correct pixel N and pixel M differently, thereby effectively correcting pixel N and pixel M while distinguishing pixel N and pixel M based on the first distance and the second distance. In this case, pixel N and pixel M may have different first weights.
[0080] In other words, in the case where the first pixel includes multiple pixels, when a first distance of one pixel among the multiple pixels is the same as a first distance of another pixel among the multiple pixels, and a second distance of the one pixel is different from a second distance of the other pixel, the one pixel is corrected differently from the other pixel; and / or when a first distance of one pixel among the multiple pixels is different from a first distance of another pixel among the multiple pixels, and a second distance of the one pixel is the same as a second distance of the other pixel, the one pixel is corrected differently from the other pixel.
[0081] Therefore, according to the embodiments of the present disclosure, the processor can effectively distinguish and effectively correct pixels that are difficult to distinguish.
[0082] Figure 4 is a flowchart illustrating a method of changing a first weight of a first pixel according to example embodiments.
[0083] Reference Figure 4In operation S410, the processor may determine a second weight of the purple-fringed region based on a color of a pixel in the purple-fringed region, a brightness of a pixel in the purple-fringed region, or an edge of the purple-fringed region.
[0084] The second weight may indicate the overall purple degree of the purple-fringe region. For example, when the second weight is greater, the overall purple degree of the purple region is greater.
[0085] In one example, the color of a pixel in a purple-fringed region may indicate the degree of purple of the pixel, and therefore, the processor may determine the second weight of the purple-fringed region based on the degree of purple of the pixel in the purple-fringed region. For example, the processor may determine the degree of purple of the pixel based on whether the pixel satisfies a threshold condition in the color gamut. In another example, since the purple-fringed region is generally more likely to appear in a brighter region, the brightness of the pixel in the purple-fringed region may be compared with a predetermined threshold to determine the second weight of the purple-fringed region based on the brightness of the pixel. In yet another example, the processor may determine the second weight of the purple-fringed region based on the gradient degree of the edge of the purple-fringed region.
[0086] In other words, the processor may determine the second weight of the purple-fringed region based on at least one of the purple degree of the pixels in the purple-fringed region, the brightness degree of the pixels in the purple-fringed region, and the gradient degree of the edge of the purple-fringed region.
[0087] In operation S420, the processor may calculate a third weight of the first pixel based on the first weight of the first pixel and the second weight of the purple-fringe region.
[0088] As described above, the first weight of the first pixel may indicate the degree to which the first pixel is close to the non-overexposed and non-purple-fringed region relative to the overexposed region, and the second weight may indicate the overall purple degree of the purple-fringed region. Therefore, the third weight of the first pixel calculated based on the first weight of the first pixel and the second weight of the purple-fringed region may indicate both the degree to which the first pixel is close to the non-overexposed and non-purple-fringed region relative to the overexposed region and the overall purple degree of the purple-fringed region.
[0089] In one embodiment, the processor may calculate the third weight of the first pixel as the product of the first weight of the first pixel and the second weight of the purple-fringed region, so that the third weight of the first pixel may indicate both the degree to which the first pixel is close to the non-overexposed and non-purple-fringed region relative to the overexposed region and the overall purple degree of the purple-fringed region. However, the present disclosure is not limited thereto, and it is also feasible to calculate the third weight of the first pixel based on the first weight of the first pixel and the second weight of the purple-fringed region in other ways to obtain the third weight of the first pixel that may indicate both the degree to which the first pixel is close to the non-overexposed and non-purple-fringed region relative to the overexposed region and the overall purple degree of the purple-fringed region.
[0090] In operation S430, the processor may change at least one pixel data of the first pixel based on the calculated third weight of the first pixel.
[0091] In the case where the third weight can indicate both the degree to which the first pixel is close to the non-overexposed and non-purple-fringed region relative to the overexposed region and the overall purple degree of the purple-fringed region, changing at least one pixel data of the first pixel based on the third weight can effectively correct at least one pixel data of the first pixel. This is because, during the correction process, the processor simultaneously considers both the degree to which the first pixel is close to the non-overexposed and non-purple-fringed region relative to the overexposed region and the overall purple degree of the purple-fringed region.
[0092] In one embodiment, at least one pixel data of the first pixel may include a color component of the first pixel. In this case, the first value of the first pixel may be calculated by mapping the third weight of the first pixel to the second predetermined mapping curve. Here, the greater the third weight of the first pixel, the greater the first value of the first pixel. In other words, the second predetermined mapping curve may be a monotonically increasing curve. In a non-limiting example, the second predetermined mapping curve may be a linear curve. However, the present disclosure is not limited thereto, and other nonlinear curves are also feasible.
[0093] For example, taking the UV domain as an example, the processor can obtain the corrected color component through the following formula:
[0094] U=U0×(1-f(w)) (1)
[0095] V=V0×(1-f(w)) (2)
[0096] Wherein, U0 and V0 are the original U component and V component of the first pixel respectively, w is the third weight, and f() corresponds to the second mapping curve.
[0097] That is, the color component of the first pixel may be changed based on the product of the color component of the first pixel and the difference between 1 and the first value of the first pixel. For example, the corrected color component may be obtained by changing the color component of the first pixel to the product of the color component of the first pixel and the difference between 1 and the first value of the first pixel.
[0098] In another embodiment, the processor may calculate the second value of the first pixel by mapping the third weight of the first pixel to a third predetermined mapping curve. Here, the greater the third weight of the first pixel, the greater the second value of the first pixel. In other words, the third predetermined mapping curve may be a monotonically increasing curve. In a non-limiting example, the third predetermined mapping curve may be a linear curve. However, the present disclosure is not limited thereto, and other nonlinear curves are also feasible.
[0099] In this embodiment, the processor may obtain (1) a first color component (UA, VA) of a first reference point A at a first distance from the first pixel in an overexposed region, (2) a second color component (UB, VB) of a second reference point B at a second distance from the first pixel in a non-overexposed and non-purple-fringed region, and (3) a color component (U0, V0) of the first pixel. Then, the processor may calculate the difference between the first color component (UA, VA) and the second color component (UB, VB) as a color component difference DU=UA-UB, DV=VA-VB. Thereafter, the processor may change the color component of the first pixel based on the difference between the color component of the first pixel and the product of the color component difference and the second value of the first pixel. For example, the processor may correct the color component of the first pixel by changing the color component of the first pixel to the difference between the color component of the first pixel and the product of the color component difference and the second value of the first pixel through the following formula.
[0100] U=U0-f(w)×DU (3)
[0101] V=V0-f(w)×DV (4)
[0102] Wherein, U0 and V0 are the original U component and V component of the first pixel respectively, w is the third weight, and f() corresponds to the third mapping curve.
[0103] Here, although the color component of the first pixel is described by taking the UV domain as an example, the disclosure is not limited thereto and can also be applied to any other color domain (such as, but not limited to, the CrCb domain and the HS domain, etc.).
[0104] Since the pixel weights (first weights and / or third weights) and the information of the reference points corresponding to the weights are used simultaneously during the correction process, it is possible to adapt to purple fringes of different shapes and reduce the influence of similar colors to effectively restore the color components of the pixels in the purple fringes.
[0105] Figure 5 is a flow chart illustrating a method of correcting a second pixel in purple fringing according to example embodiments.
[0106] exist Figure 5 In the example, the second pixel may be a pixel between a plurality of non-adjacent pixels included in the first pixel. According to one embodiment, information for changing the second pixel may be obtained using relevant information (e.g., a first weight) of a plurality of pixels included in the first pixel, without using the first distance and the second distance of the second pixel to calculate the information for changing the second pixel, thereby reducing the amount of calculation and the time for correcting the purple-fringed area.
[0107] More specifically, refer to Figure 5In operation S510, the processor may calculate a first weight of a second pixel located between a plurality of pixels in a purple-fringe area by performing interpolation on a plurality of first weights of the plurality of pixels.
[0108] Here, the processor may use various interpolation algorithms to perform interpolation. For example, various interpolation algorithms include but are not limited to nearest neighbor interpolation, bilinear interpolation and / or cubic convolution interpolation, etc. In addition, the first weight of each pixel in the plurality of pixels included in the first pixel may be based on the reference pixel. Figure 4 The purple fringing correction method described is determined.
[0109] In operation S520, the processor may change at least one pixel data of the second pixel based on the first weight of the second pixel, thereby correcting the second pixel.
[0110] Here, the method of changing at least one pixel data of the second pixel in operation S520 may be the same as that described in reference to Figure 4 The method for changing at least one pixel data of the first pixel described in the embodiment is substantially the same. Therefore, the method for changing at least one pixel data of the second pixel in operation S520 will be briefly described below, and reference will be made to the method for changing at least one pixel data of the second pixel in operation S520. Figure 4 The described method of changing at least one pixel data of the first pixel may also be similarly applied to operation S520.
[0111] In one embodiment, the processor may first determine a second weight of the purple-fringed region based on the color of the pixel in the purple-fringed region, the brightness of the pixel in the purple-fringed region, or the edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1. Then, the processor calculates a third weight of the second pixel based on the first weight of the second pixel and the second weight of the purple-fringed region. Finally, the processor may change at least one pixel data of the second pixel based on the calculated third weight of the second pixel.
[0112] In this embodiment, when at least one pixel data of the second pixel includes a color component of the second pixel, the processor may calculate the first value of the second pixel by mapping the third weight of the second pixel to a second predetermined mapping curve, wherein the greater the third weight of the second pixel, the greater the first value of the second pixel. Next, the color component of the second pixel may be changed based on the product of the color component of the second pixel and the difference between 1 and the first value of the second pixel. For example, the corrected second pixel may be obtained by changing the color component of the second pixel to the product of the color component of the second pixel and the difference between 1 and the first value of the second pixel.
[0113] Figure 6 is a flowchart illustrating a method of correcting a second pixel in purple fringing according to example embodiments.
[0114] exist Figure 6In the example, the second pixel may be a pixel between a plurality of non-adjacent pixels. According to one embodiment, the processor may utilize relevant information of the plurality of pixels (e.g., the third weight) to obtain information for changing the second pixel without using the first distance and the second distance of the second pixel to calculate the information for changing the second pixel, thereby reducing the amount of calculation and the time for correcting the purple-fringed area.
[0115] More specifically, refer to Figure 6 In operation S610, the processor may calculate a third weight of a second pixel located between the plurality of pixels in the purple-fringe area by performing interpolation on a plurality of third weights of the plurality of pixels.
[0116] Here, the processor may use various interpolation algorithms to perform interpolation. For example, various interpolation algorithms include but are not limited to nearest neighbor interpolation, bilinear interpolation and / or cubic convolution interpolation, etc. In addition, the third weight of each pixel in the plurality of pixels may be based on the reference pixel. Figure 4 The purple fringing correction method described is determined.
[0117] In operation S620, the processor may change at least one pixel data of the second pixel based on the third weight of the second pixel, thereby correcting the second pixel.
[0118] Here, the method of changing at least one pixel data of the second pixel in operation S620 may be similar to that described in reference to Figure 4 The method for changing at least one pixel data of the first pixel described in the embodiment is substantially the same. Therefore, for the sake of brevity, the method for changing at least one pixel data of the second pixel in operation S620 will be briefly described below, and reference will be made to Figure 4 The described method of changing at least one pixel data of the first pixel may also be similarly applied to operation S620.
[0119] In one embodiment, at least one pixel data of the second pixel may include a color component of the second pixel. The processor may calculate the first value of the second pixel by mapping the third weight of the second pixel to a second predetermined mapping curve, wherein the greater the third weight of the second pixel, the greater the first value of the second pixel. Then, the processor changes the color component of the second pixel based on the product of the color component of the second pixel and the difference between 1 and the first value of the second pixel. For example, the processor may correct the color component of the second pixel by changing the color component of the second pixel to the product of the color component of the second pixel and the difference between 1 and the first value of the second pixel.
[0120] Figure 7 is a flowchart illustrating a method of correcting a second pixel in purple fringing according to example embodiments.
[0121] exist Figure 7In the example, the second pixel may be a pixel between a plurality of non-adjacent pixels. According to one embodiment, the processor may obtain information for changing the second pixel using relevant information of the plurality of pixels (e.g., image data) without using the first distance and the second distance of the second pixel to calculate the information for changing the second pixel, thereby reducing the amount of calculation and the time for correcting the purple-fringed area.
[0122] In operation S710, the processor may calculate at least one image data of a second pixel located between multiple pixels in a purple-fringed area as at least one image data of a corrected second pixel by performing interpolation on at least one image data (e.g., at least one pixel value) of each of the multiple pixels.
[0123] In other words, the processor may correct image data of other pixels (eg, the second pixel) by using the corrected image data of the plurality of pixels.
[0124] Figure 8 is a block diagram illustrating an electronic device according to an example embodiment.
[0125] Reference Figure 8 , the electronic device 800 may include a camera 810 and a processor 820. For example, the electronic device 800 may be applied to or installed in a robot device (such as a drone and an advanced driver assistance system (ADAS)), a smart TV, a smart phone, a medical device, a mobile device, an image display device, a measuring device, an IoT device, and any other various types of electronic devices.
[0126] The camera 800 can capture images. The processor 820 can execute and refer to Figure 1 The processor 820 may perform operations similar to the operations performed by the processor 120 described above. For example, the processor 820 may receive an image and determine: (1) a first distance between a first pixel in a purple-fringed region of the image and an overexposed region of the image and (2) a second distance between the first pixel and a non-overexposed and non-purple-fringed region of the image. The processor 820 may correct the first pixel in the purple-fringed region based on the first distance and the second distance.
[0127] One or more methods described above may be written as a program executable on a computer and may be implemented on a general-purpose digital computer operating the program by using a non-transitory computer-readable recording medium. Various devices may be used to record the structure of the data used in the above method on a computer-readable recording medium. The computer-readable recording medium may include a storage medium, such as a magnetic storage medium (e.g., ROM, RAM, universal serial bus (USB), floppy disk, hard disk, etc.), an optical recording medium (e.g., a compact disc (CD)-ROM, a digital versatile disc (DVD), etc.), etc.
[0128] According to one embodiment, since pixels in a purple-fringed area can be adaptively corrected based on the distance between the pixel and the overexposed area and the distance between the pixel and a non-overexposed and non-purple-fringed area, purple fringing can be effectively corrected even in the face of complex purple fringes (e.g., purple fringes of different shapes).
[0129] According to one embodiment, since pixel N and pixel M can be distinguished based on the first distance and the second distance (for example, pixel N and pixel M with the same first distance but different second distances, or pixel N and pixel M with different first distances but the same second distances), pixel N and pixel M that seem to be difficult to distinguish can be effectively distinguished, and pixel N and pixel M that seem to be difficult to distinguish can be effectively corrected.
[0130] According to one embodiment, since during the correction process, both (1) the degree to which the first pixel is close to the non-overexposed and non-purple-fringed area relative to the overexposed area and (2) the overall purple degree of the purple-fringed area are considered, at least one pixel data of the first pixel can be effectively corrected.
[0131] According to one embodiment, relevant information of multiple pixels (e.g., a first weight) can be used to obtain information for changing a second pixel without using a first distance and a second distance of the second pixel to calculate the information for changing the second pixel, thereby reducing the amount of calculation and the time for correcting the purple-fringed area.
[0132] According to one embodiment, relevant information of multiple pixels (e.g., a third weight) can be used to obtain information for changing the second pixel without using the first distance and the second distance of the second pixel to calculate the information for changing the second pixel, thereby reducing the amount of calculation and the time for correcting the purple-fringed area.
[0133] According to one embodiment, relevant information of multiple pixels (e.g., image data) can be used to obtain information about changing the second pixel, without using the first distance and the second distance of the second pixel to calculate the information about changing the second pixel, thereby saving the amount of calculation and reducing the time used to correct the purple-fringed area.
[0134] According to one embodiment, since the pixel weights (first weights and / or third weights) and the information of the reference points corresponding to the weights are used simultaneously during the correction process, it is possible to adapt to purple fringes of different shapes and reduce the influence of similar colors to effectively restore the color components of the pixels in the purple fringes.
[0135] As conventional in the art, embodiments can be described and illustrated according to the frame of performing one or more functions described.These blocks, which may be referred to as units or modules, etc. in this article, are physically implemented by analog and / or digital circuits (such as, logic gates, integrated circuits, microprocessors, microcontrollers, memory circuits, passive electronic components, active electronic components, optical components, hard-wired circuits, etc.), and may be optionally driven by firmware and / or software.For example, the circuit may be implemented in one or more semiconductor chips, or implemented on substrate supports such as printed circuit boards.The circuit constituting the block may be implemented by dedicated hardware, or by a processor (for example, one or more programmed microprocessors and associated circuits), or by a combination of dedicated hardware for executing some functions of the block and a processor for executing other functions of the block.Without departing from the scope of the present disclosure, each block of the embodiment may be physically divided into two or more interacting and discrete blocks.Similarly, without departing from the scope of the present disclosure, the frame of the embodiment may be physically combined into more complex frames.One aspect of the embodiment may be implemented by instructions stored in a non-transitory storage medium and executed by a processor.
[0136] Although the present disclosure includes specific examples, it will be clear after understanding the disclosure of the present application that various changes in form and detail can be made in these examples without departing from the spirit and scope of the claims and their equivalents. The examples described herein should be considered to be descriptive only, not for the purpose of limitation. The description of the features or aspects in each example will be considered to be applicable to similar features or aspects in other examples. If the described technology is performed in a different order, and / or if the components in the described system, architecture, device or circuit are combined in a different manner, and / or replaced or supplemented by other components or their equivalents, suitable results can be achieved. Therefore, the scope of the disclosure is not limited by a specific embodiment, but by the claims and their equivalents, and all changes within the scope of the claims and their equivalents should be interpreted as included in the disclosure.
Claims
1. A purple fringing correction method, include: Sure: a first distance between a first pixel in a first pixel group in a purple-fringed region in the image and an overexposed region in the image, and (a) a first pixel in the first pixel group and (b) a second distance between a non-overexposed and non-purple-fringed region in the image; correcting the first pixel based on the first distance and the second distance, The first pixel group includes a plurality of pixels. When a first distance of one first pixel among the plurality of pixels is the same as a first distance of another first pixel among the plurality of pixels, and a second distance of the one first pixel is different from a second distance of another first pixel among the plurality of pixels, the one first pixel and the another first pixel are corrected differently; and / or When a first distance of the one first pixel is different from a first distance of the other first pixel and a second distance of the one first pixel is the same as a second distance of another first pixel among the plurality of pixels, the one first pixel and the other first pixel are corrected differently.
2. The purple fringing correction method according to claim 1, in, The step of correcting a first pixel in a purple-fringed region comprises: Determine a first weight of the first pixel based on the first distance and the second distance, wherein the first weight is greater than or equal to 0 and less than or equal to 1; A pixel value of the first pixel is changed based on a first weight for the first pixel.
3. The purple fringing correction method according to claim 2, in, The step of determining a first weight of a first pixel comprises: Calculate a ratio between the second distance and the sum of the first distance and the second distance as a first coefficient, wherein when the sum of the first distance and the second distance is less than a first threshold, the first coefficient is 1; The first weight of the first pixel is determined by mapping the first coefficient to a predetermined mapping curve, wherein the larger the first coefficient is, the larger the first weight of the first pixel is.
4. The purple fringing correction method according to claim 2, in, The step of changing the pixel value of the first pixel comprises: Determine a second weight of the purple-fringed region based on at least one of (c) a color of a pixel in the purple-fringed region, (d) a brightness of a pixel in the purple-fringed region, and (e) an edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1; Calculating a third weight of the first pixel based on the first weight of the first pixel and the second weight of the purple-fringe area; Based on the third weight of the first pixel, a pixel value of the first pixel is changed.
5. The purple fringing correction method according to claim 4, in, The step of calculating the third weight of the first pixel includes: calculating the third weight of the first pixel as the product of the first weight of the first pixel and the second weight of the purple-fringe area, The step of determining the second weight of the purple-fringe area includes: A second weight of the purple-fringed region is determined based on at least one of (i) a purple degree of pixels in the purple-fringed region, (j) a brightness degree of pixels in the purple-fringed region, and (k) a gradient degree of an edge of the purple-fringed region.
6. The purple fringing correction method according to claim 4, in, The pixel value of the first pixel includes: a color component of the first pixel, The step of changing the pixel value of the first pixel comprises: Calculating a first value of the first pixel by mapping a third weight of the first pixel to a predetermined mapping curve, wherein the greater the third weight of the first pixel, the greater the first value of the first pixel; changing a color component of the first pixel based on a product of the color component of the first pixel and a difference between 1 and the first value of the first pixel, or, The step of changing the pixel value of the first pixel includes: Calculating a second value of the first pixel by mapping a third weight of the first pixel to a predetermined mapping curve, wherein the greater the third weight of the first pixel, the greater the second value of the first pixel; Acquire (f) a first color component of a first reference point in an overexposed region that is a first distance away from the first pixel, (g) a second color component of a second reference point in a non-overexposed and non-purple-fringed region that is a second distance away from the first pixel, and (h) a color component of the first pixel; calculating a difference between the first color component and the second color component as a color component difference; The color component of the first pixel is changed based on a difference between the color component of the first pixel and a product of the color component difference and the second value of the first pixel.
7. The purple fringing correction method according to claim 4, in, The plurality of pixels are not adjacent, Wherein, the purple fringing correction method further comprises: calculating a third weight of a second pixel between the plurality of pixels in the purple-fringed area by interpolating a plurality of third weights of the plurality of pixels; changing a pixel value of the second pixel based on a third weight of the second pixel, The pixel value of the second pixel includes: the color component of the second pixel, The step of changing the pixel value of the second pixel includes: calculating a first value of the second pixel by mapping a third weight of the second pixel to a predetermined mapping curve, wherein the greater the third weight of the second pixel, the greater the first value of the second pixel; The color component of the second pixel is changed based on the product of the color component of the second pixel and the difference between 1 and the first value of the second pixel.
8. The purple fringing correction method according to claim 2, in, The plurality of pixels are not adjacent, wherein the first pixel group includes pixels arranged at predetermined positions in each of a plurality of regions separated from the purple-fringe region, The purple fringing correction method further comprises: calculating a first weight of a second pixel between the plurality of pixels in the purple-fringed region by interpolating a plurality of first weights of the plurality of pixels; changing a pixel value of the second pixel based on a first weight for the second pixel, The step of changing the pixel value of the second pixel includes: Determine a second weight of the purple-fringed region based on at least one of (l) a color of a pixel in the purple-fringed region, (m) a brightness of a pixel in the purple-fringed region, and (n) an edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1; Calculating a third weight of the second pixel based on the first weight of the second pixel and the second weight of the purple-fringe area; Based on the calculated third weight of the second pixel, changing the pixel value of the second pixel, The pixel value of the second pixel includes: the color component of the second pixel, The step of changing the pixel value of the second pixel includes: calculating a first value of the second pixel by mapping a third weight of the second pixel to a predetermined mapping curve, wherein the greater the third weight of the second pixel, the greater the first value of the second pixel; changing a color component of the second pixel based on a product of the color component of the second pixel and 1 and a difference between the first value of the second pixel, or, The purple fringing correction method further comprises: A pixel value of a second pixel between the plurality of pixels in the purple-fringe area is calculated by interpolating pixel values in the plurality of pixels.
9. A purple fringing correction device, include: processor; and Memory, which stores instructions executable by the processor, Wherein, when the instruction is executed in the processor, the processor: Determining: (1) a first distance between a first pixel in a first pixel group in a purple-fringed region in an image and an overexposed region in the image, and (2) a second distance between (a) the first pixel and (b) a non-overexposed and non-purple-fringed region in the image; Based on the first distance and the second distance, correcting the first pixel in the purple-fringed region, The first pixel group includes a plurality of pixels. When a first distance of one first pixel among the plurality of pixels is the same as a first distance of another first pixel among the plurality of pixels, and a second distance of the one first pixel is different from a second distance of another first pixel among the plurality of pixels, the one first pixel and the another first pixel are corrected differently; and / or When a first distance of the one first pixel is different from a first distance of the other first pixel and a second distance of the one first pixel is the same as a second distance of another first pixel among the plurality of pixels, the one first pixel and the other first pixel are corrected differently.
10. The purple fringing correction device according to claim 9, in, The processor is configured as: Determine a first weight of the first pixel based on the first distance and the second distance, wherein the first weight is greater than or equal to 0 and less than or equal to 1; A pixel value of the first pixel is changed based on a first weight for the first pixel.
11. The purple fringing correction device according to claim 10, in, The processor is configured as: Calculate a ratio between the second distance and the sum of the first distance and the second distance as a first coefficient, wherein when the sum of the first distance and the second distance is less than a first threshold, the first coefficient is 1; The first weight of the first pixel is determined by mapping the first coefficient to a predetermined mapping curve, wherein the larger the first coefficient is, the larger the first weight of the first pixel is.
12. The purple fringing correction device according to claim 10, in, The processor is configured as: Determine a second weight of the purple-fringed region based on at least one of (c) a color of a pixel in the purple-fringed region, (d) a brightness of a pixel in the purple-fringed region, and (e) an edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1; Calculating a third weight of the first pixel based on the first weight of the first pixel and the second weight of the purple-fringe area; Based on the third weight of the first pixel, a pixel value of the first pixel is changed.
13. The purple fringing correction device according to claim 12, in, The processor is configured to: calculate the third weight of the first pixel as the product of the first weight of the first pixel and the second weight of the purple-fringed area, The processor is configured as follows: A second weight of the purple-fringed region is determined based on at least one of (i) a purple degree of pixels in the purple-fringed region, (j) a brightness degree of pixels in the purple-fringed region, and (k) a gradient degree of an edge of the purple-fringed region.
14. The purple fringing correction device according to claim 12, in, The pixel value of the first pixel includes: a color component of the first pixel, The processor is configured as: Calculating a first value of the first pixel by mapping a third weight of the first pixel to a predetermined mapping curve, wherein the greater the third weight of the first pixel, the greater the first value of the first pixel; changing a color component of the first pixel based on a product of the color component of the first pixel and a difference between 1 and the first value of the first pixel, or, The processor is configured as follows: Calculating a second value of the first pixel by mapping a third weight of the first pixel to a predetermined mapping curve, wherein the greater the third weight of the first pixel, the greater the second value of the first pixel; Acquire (f) a first color component of a first reference point in an overexposed region that is a first distance away from the first pixel, (g) a second color component of a second reference point in a non-overexposed and non-purple-fringed region that is a second distance away from the first pixel, and (h) a color component of the first pixel; calculating a difference between the first color component and the second color component as a color component difference; The color component of the first pixel is changed based on a difference between the color component of the first pixel and a product of the color component difference and the second value of the first pixel.
15. The purple fringing correction device according to claim 12, in, The plurality of pixels are not adjacent, The processor is further configured to: calculating a third weight of a second pixel between the plurality of pixels in the purple-fringed area by interpolating a plurality of third weights of the plurality of pixels; changing a pixel value of the second pixel based on a third weight of the second pixel, The pixel value of the second pixel includes: the color component of the second pixel, The processor is configured as follows: calculating a first value of the second pixel by mapping a third weight of the second pixel to a predetermined mapping curve, wherein the greater the third weight of the second pixel, the greater the first value of the second pixel; The color component of the second pixel is changed based on the product of the color component of the second pixel and the difference between 1 and the first value of the second pixel.
16. The purple fringing correction device according to claim 10, in, The plurality of pixels are not adjacent, wherein the first pixel group includes pixels arranged at predetermined positions in each of a plurality of regions separated from the purple-fringe region, The processor is also configured to: calculating a first weight of a second pixel between the plurality of pixels in the purple-fringed region by interpolating a plurality of first weights of the plurality of pixels; changing a pixel value of the second pixel based on a first weight for the second pixel, The processor is configured as follows: Determine a second weight of the purple-fringed region based on at least one of (l) a color of a pixel in the purple-fringed region, (m) a brightness of a pixel in the purple-fringed region, and (n) an edge of the purple-fringed region, wherein the second weight is greater than or equal to 0 and less than or equal to 1; Calculating a third weight of the second pixel based on the first weight of the second pixel and the second weight of the purple-fringe area; Based on the calculated third weight of the second pixel, changing the pixel value of the second pixel, The pixel value of the second pixel includes: the color component of the second pixel, The processor is configured as follows: calculating a first value of the second pixel by mapping a third weight of the second pixel to a predetermined mapping curve, wherein the greater the third weight of the second pixel, the greater the first value of the second pixel; changing a color component of the second pixel based on a product of the color component of the second pixel and 1 and a difference between the first value of the second pixel, or, The processor is also configured to: A pixel value of a second pixel between the plurality of pixels in the purple-fringe area is calculated by interpolating pixel values in the plurality of pixels.
17. An electronic device, include: a camera configured to capture an image; The processor determines: (1) a first distance between a first pixel in a first pixel group in a purple-fringed region of an image and an overexposed region of the image, and (2) a second distance between (a) the first pixel and (b) a non-overexposed and non-purple-fringed region of the image; and based on the first distance and the second distance, corrects the first pixel in the purple-fringed region. The first pixel group includes a plurality of pixels. When a first distance of one first pixel among the plurality of pixels is the same as a first distance of another first pixel among the plurality of pixels, and a second distance of the one first pixel is different from a second distance of another first pixel among the plurality of pixels, the one first pixel and the another first pixel are corrected differently; and / or When a first distance of the one first pixel is different from a first distance of the other first pixel and a second distance of the one first pixel is the same as a second distance of another first pixel among the plurality of pixels, the one first pixel and the other first pixel are corrected differently.
Citation Information
Patent Citations
Method for eliminating purple edge of image
CN107864365A
Image purple edge elimination method and device and storage medium
CN112887693A
Image processing apparatus and image processing method as well as computer program
CN1774031A
Image processor, image processing method and computer program
JP2006115039A
Apparatus and method of correcting purple fringing
KR1020130000537A
