A purple edge detection method, a purple edge detection device and a computer device
Patent Information
- Application Number
- CN202611169469.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-30
AI Technical Summary
在相关技术中,通常会将像素所在的纯色高饱和区域(例如,红色区域、黄色区域等)误判为高亮区域,进而导致紫边检测准确率下降
[0021]由此可知,在上述紫边检测方法中,可以先从像素对应的像素窗口中提取各色彩通道的通道像素值,而后,确定各色彩通道的通道像素值的加权通道像素值以及各色彩通道的通道像素值中的最小通道像素值,通过对加权通道像素值以及最小通道像素值进行融合计算得到像素的目标亮度。加权通道像素值能够表征像素的整体亮度水平,最小通道像素值在真正的高亮区域中较高、在纯色高饱和区域中较低,能够区分真正的高亮区域与纯色高饱和区域。通过该方式融合计算得到的目标亮度融合了加权通道像素值对整体亮度的表征能力和最小通道像素值对真正的高亮区域与纯色高饱和区域的区分能力,基于该目标亮度判定像素是否处于高亮区域,可以有效减少纯色高饱和区域被误判为高亮区域的情况。在此基础上,进一步结合紫边约束条件进行紫边检测,可以避免因纯色高饱和区域被误判为高亮区域而导致的紫边像素误判,从而有效提升紫边检测的准确率。
Smart Images

Figure CN123015705A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a purple edge detection method, a purple edge detection device, and a computer device. Background Technology
[0002] In devices such as smartphones, digital cameras, and dashcams, purple fringing is a common image artifact in high-contrast scenes, typically appearing as a purplish-red or magenta edge at the boundary between bright and dark areas. To eliminate the impact of purple fringing on image quality, it can be detected, and then the detected purple fringed areas can be color corrected or desaturated to eliminate the purple fringing artifact and restore true colors.
[0003] In the process of purple fringing detection, it is possible to first determine whether the current pixel is in a bright area, and then further combine color information, edge information, etc. to perform purple fringing detection. In related technologies, pure color high-saturation areas (such as red areas, yellow areas, etc.) where pixels are located are often misidentified as bright areas, which leads to a decrease in the accuracy of purple fringing detection. Summary of the Invention
[0004] This application provides a purple edge detection method, a purple edge detection device, and a computer device, which can avoid misjudging purple edge pixels caused by pure color high saturation areas being misjudged as bright areas, thereby effectively improving the accuracy of purple edge detection.
[0005] According to a first aspect of the embodiments of this application, a purple edge detection method is provided, comprising: Acquire the image to be detected; For each pixel in the image to be detected, the channel pixel value of each color channel is extracted from the pixel window corresponding to the pixel, the weighted channel pixel value of each color channel is determined, and the minimum channel pixel value is determined from the channel pixel values of each color channel. Based on the pixel noise, the weighted channel pixel values and the minimum channel pixel values are fused to obtain the target brightness of the pixel. The noise is used to characterize the proportion of the minimum channel pixel value in the fusion calculation. Based on the target brightness and the preset brightness threshold, the highlight determination result of the pixel is determined. The highlight determination result is used to indicate whether the pixel is in the highlight area. Based on the highlight determination results and the preset purple edge constraint conditions, the purple edge detection results of the pixels are determined.
[0006] In some embodiments of this application, before fusing the weighted channel pixel values and the minimum channel pixel values based on the pixel noise to obtain the target brightness of the pixel, the method further includes: The noise of a pixel is determined based on the variance of the pixel value of each pixel in the pixel window, the weighted channel pixel value, and the difference information of the channel pixel values of each color channel. The difference information is any one of the following: the difference between the maximum and minimum channel pixel values of each color channel, the variance of the channel pixel values of each color channel, the standard deviation of the channel pixel values of each color channel, and the absolute difference of the channel pixel values of each color channel.
[0007] Therefore, the above method can evaluate the noise of a pixel from three dimensions: the weighted channel pixel value corresponding to the pixel, the fluctuation degree of the pixels around the pixel, and the difference information of the channel pixel values of each color channel, so that the determined noise can more accurately reflect the actual situation of the current pixel.
[0008] In some embodiments of this application, pixel noise is determined based on the variance of pixel values of each pixel in the pixel window, the weighted channel pixel values, and the difference information of channel pixel values of each color channel, including: Based on the preset brightness-noise correspondence, the basic noise corresponding to the weighted channel pixel value is determined. The basic noise represents the inherent noise intensity of the image sensor under the brightness corresponding to the weighted channel pixel value. Weighted noise is obtained by performing a weighted operation on the variance of the pixel value of each pixel in the pixel window, the basic noise, and the difference of the channel pixel values of each color channel. The weighted noise is normalized to obtain the pixel noise.
[0009] Therefore, the above method can uniformly map three dimensions—weighted channel pixel values reflecting the inherent noise characteristics of the image sensor, the fluctuation degree of pixels around the pixel, and the difference information of channel pixel values of each color channel—to a preset range to obtain standardized noise. This provides an accurate and standardized noise basis for subsequent adaptive adjustment of the fusion ratio of minimum channel pixel values and weighted channel pixel values.
[0010] In some embodiments of this application, the target brightness of a pixel is obtained by fusing the weighted channel pixel values and the minimum channel pixel values based on the pixel noise, including: Calculate the difference between pixel 1 and the noise of pixel 1; The product of the difference and the preset base proportion is normalized to obtain the first proportion corresponding to the minimum channel pixel value in the fusion calculation. The first proportion is negatively correlated with the pixel noise. The preset base proportion is used to characterize the proportion of the minimum channel pixel value in the fusion calculation under noise-free conditions. The difference between 1 and the first proportion is used as the second proportion corresponding to the weighted channel pixel value in the fusion calculation; Based on the first and second proportions, the weighted channel pixel values and the minimum channel pixel values are fused and calculated to obtain the target brightness of the pixel.
[0011] Therefore, it can be seen that during the fusion calculation of weighted channel pixel values and minimum channel pixel values by the terminal device, when the noise is low, the reliability of the minimum channel pixel value is higher, and its proportion in the fusion calculation is larger, thus fully utilizing its ability to distinguish between highlight and solid color areas. When the noise is high, the reliability of the minimum channel pixel value decreases, and its proportion in the fusion calculation is smaller. Correspondingly, the weighted channel pixel value has a larger proportion in the fusion calculation, thus utilizing its noise resistance stability. Therefore, a target brightness that balances discrimination accuracy and noise resistance stability can be obtained under different noise conditions.
[0012] In some embodiments of this application, the highlight determination result of a pixel is determined based on the target brightness and a preset brightness threshold, including: Compare the target brightness with the preset brightness threshold; If the target brightness is greater than the preset brightness threshold, the pixel is determined to be in the high-brightness area; If the target brightness is not greater than the preset brightness threshold, the pixel is determined not to be in the high-brightness area.
[0013] Therefore, by presetting a brightness threshold to filter the bright areas of pixels, the range of purple edge detection can be effectively reduced, the amount of calculation in subsequent steps can be reduced, and the overall efficiency of purple edge detection can be improved.
[0014] In some embodiments of this application, the purple edge detection result of a pixel is determined based on the highlight determination result and a preset purple edge constraint condition, including: If the highlight determination result indicates that the pixel is in the highlight area and the pixel meets the preset purple edge constraint condition, the pixel is determined to be a purple edge pixel; Otherwise, determine that the pixel is not a purple-edged pixel.
[0015] Therefore, the terminal device can accurately distinguish the pixels that truly belong to the purple edge in the highlighted area, while excluding non-purple edge pixels in the highlighted area that do not meet the preset purple edge constraint conditions, thus providing accurate purple edge detection results for subsequent purple edge correction.
[0016] In some embodiments of this application, a pixel satisfies a preset purple edge constraint condition including any one or more of the following: the pixel's chromaticity is within a preset purple chromaticity range, the pixel is located in an image edge region, and there are pixels in a preset neighborhood of the pixel whose target brightness is greater than a preset brightness threshold.
[0017] Therefore, it can be seen that the terminal device can further detect purple edges on pixels by using preset purple edge constraints, thereby further improving the accuracy of purple edge detection.
[0018] According to a second aspect of the embodiments of this application, a purple edge detection device is provided, comprising: The acquisition module is used to acquire the image to be detected; The determination module is used to extract the channel pixel values of each color channel from the pixel window corresponding to each pixel in the image to be detected, determine the weighted channel pixel value of each color channel, and determine the minimum channel pixel value from the channel pixel values of each color channel. The fusion calculation module is used to perform fusion calculations on the weighted channel pixel values and the minimum channel pixel values based on the pixel noise to obtain the target brightness of the pixel. The noise is used to characterize the proportion of the minimum channel pixel value in the fusion calculation. The determination module is also used to determine the highlight determination result of the pixel based on the target brightness and the preset brightness threshold. The highlight determination result is used to indicate whether the pixel is in the highlight area. The determination module is also used to determine the purple edge detection result of a pixel based on the highlight determination result and the preset purple edge constraint conditions.
[0019] According to a third aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory being used to store at least one program, the at least one program being loaded by the processor and executed by any of the purple edge detection methods described above.
[0020] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein at least one program is stored in the computer-readable storage medium, and the at least one program is loaded and executed by a processor to implement any of the purple edge detection methods described above.
[0021] Therefore, in the above-mentioned purple fringing detection method, the channel pixel values of each color channel can be extracted from the pixel window corresponding to the pixel. Then, the weighted channel pixel value and the minimum channel pixel value of each color channel are determined. The target brightness of the pixel is obtained by fusing the weighted channel pixel value and the minimum channel pixel value. The weighted channel pixel value can represent the overall brightness level of the pixel, while the minimum channel pixel value is higher in true bright areas and lower in pure color high-saturation areas, which can distinguish between true bright areas and pure color high-saturation areas. The target brightness obtained by fusing the weighted channel pixel value's ability to represent the overall brightness and the minimum channel pixel value's ability to distinguish between true bright areas and pure color high-saturation areas can be combined. Determining whether a pixel is in a bright area based on this target brightness can effectively reduce the situation where pure color high-saturation areas are misclassified as bright areas. On this basis, further combining purple fringing constraints for purple fringing detection can avoid misjudging purple fringed pixels caused by pure color high-saturation areas being misclassified as bright areas, thereby effectively improving the accuracy of purple fringing detection. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A schematic flowchart illustrating a purple edge detection method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a purple edge detection device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0026] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various objects, these objects should not be limited by the terms.
[0027] These terms are simply used to distinguish one object from another. For example, without departing from the various examples, a first action can be called a second action, and similarly, a second action can be called a first action. Both the first and second actions can be actions, and in some cases, they can be separate and distinct actions.
[0028] "At least one" refers to one or more actions. For example, at least one action can be one action, two actions, three actions, or any integer number of actions greater than or equal to one. "Multiple" refers to two or more actions. For example, multiple actions can be two actions, three actions, or any integer number of actions greater than or equal to two.
[0029] In devices such as smartphones, digital cameras, and dashcams, purple fringing is a common image artifact in high-contrast scenes, typically appearing as a purplish-red or magenta edge at the boundary between bright and dark areas. To eliminate the impact of purple fringing on image quality, it can be detected, and then the detected purple-fringed areas can be color-corrected or desaturated to eliminate the artifact and restore true colors. During purple fringing detection, it's possible to first determine if the current pixel is in a bright area, and then further combine color information and edge information for purple fringing detection.
[0030] In related technologies, areas of high saturation in a single color (e.g., red, yellow) are often misclassified as bright areas, leading to a decrease in the accuracy of purple fringing detection. Specifically, when determining whether a pixel is in a bright area, these technologies typically calculate the brightness value of the pixel by merging the values of all color channels in the pixel's region. If the calculated brightness value is high, the pixel is considered to be in a bright area. However, if the pixel is in a high-saturation area of a single color such as red or yellow, the brightness value calculated using the aforementioned method is also high due to the high pixel value of each individual color channel. This causes such areas to be incorrectly identified as bright areas, resulting in a decrease in the accuracy of purple fringing detection.
[0031] To address the aforementioned technical problems, this application provides a purple edge detection method that can avoid misjudging purple edge pixels due to high-saturation areas of solid colors being mistaken for bright areas, thereby effectively improving the accuracy of purple edge detection.
[0032] Figure 1 This is a flowchart illustrating a purple edge detection method provided in an embodiment of this application. The following is a summary of the process. Figure 1 The purple edge detection method is described in detail below. The execution subject of this method can be a terminal device with image acquisition function, such as a smartphone, digital camera, or dashcam, or a server that communicates with these terminal devices. The purple edge detection method is described below with the terminal device as the execution subject. The purple edge detection method can include: S101 to S105, as follows.
[0033] S101, acquire the image to be detected.
[0034] S102, for each pixel in the image to be detected, extract the channel pixel value of each color channel from the pixel window corresponding to the pixel, determine the weighted channel pixel value of each color channel, and determine the minimum channel pixel value from the channel pixel values of each color channel.
[0035] The terminal device can first acquire the image to be detected captured by the image sensor inside the terminal device. The image to be detected can be an unprocessed RAW format or Bayer format image, which retains the most original color channel information of each pixel. For example, the image to be detected can be a Bayer format image with RGGB arrangement. As another example, the image to be detected can also be a Bayer format image with other arrangements such as GRBG, BGGR, or GBRG, and this application does not make specific limitations on this.
[0036] After acquiring the image to be detected, the terminal device can perform purple edge detection processing on each pixel in the image to be detected one by one.
[0037] Specifically, for each pixel, the terminal device can extract the channel pixel values of each color channel from the pixel window corresponding to that pixel. Here, a pixel window refers to a local image region containing the pixel and its surrounding neighboring pixels that provides the pixel values for each color channel. Taking a Bayer format image arranged in RGGB as an example, the pixel window can be an RGGB unit containing the currently processed pixel, and the terminal device can extract the channel pixel values of the four color channels (R, G1, G2, and B) from the corresponding pixel window.
[0038] After extracting the channel pixel values of each color channel from the corresponding pixel window, the terminal device can determine the weighted channel pixel value of each color channel. Specifically, the terminal device can perform a weighted summation of the channel pixel values of these color channels according to the preset weight coefficients corresponding to each color channel to obtain the weighted channel pixel value.
[0039] The specific values of the weight coefficients for each color channel can be adaptively adjusted based on the actual application scenario and sensor characteristics. Continuing with the example of a Bayer format image arranged in RGGB, since the human visual system has varying sensitivities to different wavelengths of light—the human eye is typically most sensitive to green light, followed by red light, and least sensitive to blue light—the weight coefficients for each color channel are usually allocated in the order G > R > B. For example, the weight coefficient for the red (R) color channel is 0.299, the weight coefficients for the green (G1 and G2) color channels are 0.2935 and 0.2935 respectively, and the weight coefficient for the blue (B) color channel is 0.114.
[0040] Furthermore, the terminal device can determine the minimum channel pixel value from the channel pixel values of each color channel. Continuing with the example of a Bayer format image arranged in RGGB, the extracted channel pixel values are R=200, G1=180, G2=190, and B=50. The terminal device then determines the minimum channel pixel value as the B channel pixel value of 50 by comparing the magnitudes of the four channel pixel values. That is, the minimum channel pixel value is 50.
[0041] In some embodiments of this application, the determination of the minimum channel pixel value can also be implemented differently from the above method. For example, the minimum channel pixel value corresponding to each of the multiple RGGB units around the pixel can be obtained first, and then local statistics can be performed on the obtained multiple minimum channel pixel values (e.g., taking the average value, median value, or minimum value, etc.), and the statistical result can be used as the minimum channel pixel value of the pixel.
[0042] S103, based on the pixel noise, perform a fusion calculation on the weighted channel pixel value and the minimum channel pixel value to obtain the target brightness of the pixel. The noise is used to characterize the proportion of the minimum channel pixel value in the fusion calculation.
[0043] The aforementioned weighted channel pixel value is obtained by weighted summation of the channel pixel values of each color channel. It has a good smoothing and suppression effect on single-color channel noise and can maintain the stability of pixel brightness calculation. However, because it merges the channel pixel values of each channel during the calculation process, when the pixel is located in a pure color high-saturation region such as red or yellow, the calculated weighted channel pixel value is also high because the channel pixel value of a single color channel is high. If this weighted channel pixel value is used as the target brightness of the pixel, it is impossible to distinguish whether the pixel is in a pure color high-saturation region or a true high-brightness region.
[0044] Therefore, terminal devices introduce a minimum channel pixel value when calculating the target brightness of pixels. Since the pixel values of all channels are relatively high in truly bright areas, the minimum channel pixel value is also relatively high. In contrast, in highly saturated solid color areas, only some color channels have high pixel values, while the pixel values of other color channels are relatively low. Therefore, the minimum channel pixel value can be used to characterize whether each color channel has reached high brightness, thus accurately distinguishing between bright areas and highly saturated solid color areas.
[0045] Because the pixel values of individual color channels are quite sensitive to noise, under low-noise conditions, the minimum channel pixel value can accurately reflect whether each channel has reached a high brightness level, thus effectively distinguishing between bright areas and solid color high-saturation areas. However, when the noise is high, the minimum channel pixel value may be abnormally low due to noise interference. In this case, the minimum channel pixel value cannot truly reflect the common brightness level of the four color channels, leading to reduced reliability. In other words, the minimum channel pixel value has high discrimination accuracy under low-noise conditions, but its stability is relatively insufficient under high-noise conditions.
[0046] While weighted channel pixel values have limited ability to distinguish solid color areas, they have a good smoothing and noise suppression effect. Therefore, based on the noise of the current pixel, the proportion of minimum channel pixel values and weighted channel pixel values in the target brightness calculation can be adaptively adjusted, and the weighted channel pixel values and minimum channel pixel values can be fused to obtain the target brightness of the pixel, so as to obtain a target brightness that balances discrimination accuracy and noise resistance stability under different noise conditions.
[0047] S104, based on the target brightness and the preset brightness threshold, determine the brightness determination result of the pixel. The brightness determination result is used to indicate whether the pixel is in the bright area.
[0048] S105, Based on the highlight determination result and the preset purple edge constraint conditions, determine the purple edge detection result of the pixel.
[0049] After determining the target brightness of a pixel, the terminal device can determine whether the pixel is in a bright area based on the target brightness. Specifically, the terminal device can compare the target brightness of the pixel with a preset brightness threshold to determine the brightness determination result of the pixel, which indicates whether the pixel is in a bright area.
[0050] After obtaining the highlight determination result for a pixel, the terminal device can determine the purple edge detection result of the pixel based on the highlight determination result and the preset purple edge constraint conditions, that is, determine whether the pixel is a purple edge pixel. Specifically, if the highlight determination result indicates that the pixel is in a highlight area, it can be further determined whether the pixel meets the preset purple edge constraint conditions to determine whether the pixel is a purple edge pixel. If the highlight determination result indicates that the pixel is not in a highlight area, the terminal device can directly determine that the pixel is a non-purple edge pixel without further determining whether it meets the purple edge constraint conditions.
[0051] Therefore, in the above-mentioned purple fringing detection method, the channel pixel values of each color channel can be extracted from the pixel window corresponding to the pixel. Then, the weighted channel pixel value and the minimum channel pixel value of each color channel are determined. The target brightness of the pixel is obtained by fusing the weighted channel pixel value and the minimum channel pixel value. The weighted channel pixel value can represent the overall brightness level of the pixel, while the minimum channel pixel value is higher in true bright areas and lower in pure color high-saturation areas, which can distinguish between true bright areas and pure color high-saturation areas. The target brightness obtained by fusing the weighted channel pixel value's ability to represent the overall brightness and the minimum channel pixel value's ability to distinguish between true bright areas and pure color high-saturation areas can be combined. Determining whether a pixel is in a bright area based on this target brightness can effectively reduce the situation where pure color high-saturation areas are misclassified as bright areas. On this basis, further combining purple fringing constraints for purple fringing detection can avoid misjudging purple fringed pixels caused by pure color high-saturation areas being misclassified as bright areas, thereby effectively improving the accuracy of purple fringing detection.
[0052] In some embodiments of this application, S103 involves the terminal device performing a fusion calculation on the weighted channel pixel value and the minimum channel pixel value based on the pixel noise to obtain the target brightness of the pixel. Before S103, the above method further includes: S106, determining the pixel noise based on the variance of the pixel value of each pixel in the pixel window, the weighted channel pixel value, and the difference information of the channel pixel values of each color channel. The difference information is any one of the following: the difference between the maximum and minimum channel pixel values in each color channel, the variance of the channel pixel values of each color channel, the standard deviation of the channel pixel values of each color channel, and the absolute difference of the channel pixel values of each color channel.
[0053] Specifically, the terminal device can first determine the variance of the pixel values of each pixel within the corresponding pixel window. This variance characterizes the degree of fluctuation in the pixel values within the pixel window. A larger variance indicates greater fluctuation in the pixel values within the pixel window, suggesting that the pixel window may contain rich texture details or strong noise. Conversely, a smaller variance indicates less fluctuation in the pixel values within the pixel window, suggesting that the pixel window may be located in a flat area with less influence from noise or texture.
[0054] The terminal device can then determine the difference information of the channel pixel values of each color channel within the pixel window. This difference information can be used to characterize the dispersion between the channel pixel values of each color channel. The greater the dispersion between the channel pixel values of each color channel, the more uneven the distribution of pixel values in each color channel. The pixel may be in a highly saturated region of pure color (e.g., red region, yellow region, etc.). In this case, the difference between the color channels may be due to true spectral characteristics rather than noise, and the difference between the color channels should contribute little to the noise estimation; conversely, a smaller difference will contribute more.
[0055] Specifically, the difference information can be the difference between the maximum and minimum channel pixel values in each color channel, the variance or standard deviation of the channel pixel values in each color channel, or the sum of the absolute differences in the channel pixel values in each color channel, that is, the sum of the absolute values of the pairwise differences between the channel pixel values in each color channel. This application does not make any specific limitations on this.
[0056] Finally, the terminal device can determine the noise of a pixel based on the variance of the pixel values of each pixel in the pixel window, the weighted channel pixel values that can characterize the inherent noise of the sensor, and the difference information of the channel pixel values of each color channel. Specifically, the noise of a pixel can be determined by weighted summation of these three factors. The specific method for determining the noise will be explained in the following content and will not be explained here.
[0057] It should be noted that when determining the above variance and the above difference information, the pixel window can be the same as the pixel window used to extract the channel pixel values of each color channel in S102, or it can be a local window of a larger range (e.g., 3×3, 5×5 or 7×7 size) that is different from the pixel window used to extract the channel pixel values of each color channel.
[0058] As can be seen, the above method can evaluate the noise of a pixel from three dimensions: the weighted channel pixel value corresponding to the pixel, the fluctuation degree of the pixels around the pixel, and the difference information of the channel pixel values of each color channel, so that the determined noise can more accurately reflect the actual situation of the current pixel.
[0059] In some embodiments of this application, S106 is involved. The terminal device can determine the noise of a pixel based on the variance of the pixel value of each pixel in the pixel window, the weighted channel pixel value, and the difference information of the channel pixel value of each color channel. S106 may include S1061 to S1063, as follows.
[0060] S1061, Based on the preset brightness-noise correspondence, determine the basic noise corresponding to the weighted channel pixel value. The basic noise represents the inherent noise intensity of the image sensor under the brightness corresponding to the weighted channel pixel value.
[0061] The preset brightness-noise correspondence refers to the relationship between the inherent noise intensity of the image sensor and the pixel brightness. The noise characteristics of the image sensor are closely related to pixel brightness; generally, the noise in low-brightness areas is greater than that in high-brightness areas. Therefore, the lower the weighted channel pixel value, the greater the corresponding fundamental noise; conversely, the higher the weighted channel pixel value, the smaller the corresponding fundamental noise. This correspondence can be obtained in advance through calibration. It can be stored in the ISP within the terminal device in the form of a lookup table, or it can be represented and stored using a piecewise function or a polynomial fitting function; this application does not specifically limit this.
[0062] S1062, perform a weighted operation on the variance of the pixel value of each pixel in the pixel window, the basic noise, and the difference information of the channel pixel values of each color channel to obtain weighted noise.
[0063] Specifically, the terminal device can configure preset weighting coefficients for the variance of pixel values of each pixel in the pixel window corresponding to the pixel, the basic noise corresponding to the weighted channel pixel values, and the difference information of channel pixel values of each color channel. The variance, the basic noise, and the difference information are then multiplied by their respective weighting coefficients, and the three products are summed to obtain the weighted noise. The weighting coefficients are preset empirical values, which can be obtained through experimental calibration based on the noise characteristics of the image sensor and the application scenario.
[0064] S1063 normalizes the weighted noise to obtain the pixel noise.
[0065] After obtaining the weighted noise, the terminal device can normalize the weighted noise to obtain the noise of the pixel. Through normalization, the noise can be uniformly mapped to a preset range (e.g., the range from 0 to 1), which facilitates the determination of the proportion of minimum channel pixel value and weighted channel pixel value based on the noise in the subsequent fusion calculation step.
[0066] The pixel noise is specifically calculated using the following formula:
[0067] in, Represents pixel noise. Represents the normalization function. This represents the variance of the pixel values of each pixel within the pixel window. express The corresponding weighting coefficients, Indicates the fundamental noise. Indicates the weighted channel pixel value. This indicates the preset brightness-to-noise correspondence. express The corresponding weighting coefficients, This indicates the difference in pixel values across different color channels. express The corresponding weighting coefficients.
[0068] As can be seen, the above method can uniformly map three dimensions—weighted channel pixel values reflecting the inherent noise characteristics of the image sensor, the fluctuation degree of pixels around the pixel, and the difference information of channel pixel values of each color channel—to a preset range, thereby obtaining standardized noise. This provides an accurate and standardized noise basis for subsequent adaptive adjustment of the fusion ratio of minimum channel pixel values and weighted channel pixel values.
[0069] In some embodiments of this application, S103 is involved, in which the terminal device can perform a fusion calculation on the weighted channel pixel value and the minimum channel pixel value based on the pixel noise to obtain the target brightness of the pixel. S103 may include: S1031 to S1034, as follows.
[0070] S1031, calculate the difference between pixel 1 and the noise of pixel 1.
[0071] S1032, normalize the product of the difference and the preset base ratio to obtain the first ratio corresponding to the minimum channel pixel value in the fusion calculation. The first ratio is negatively correlated with the pixel noise. The preset base ratio is used to characterize the ratio of the minimum channel pixel value in the fusion calculation under noise-free conditions.
[0072] After acquiring the noise of a pixel, the terminal device can calculate the difference between 1 and the noise of that pixel, and multiply this difference by a preset base ratio. The base ratio is a pre-set constant, ranging from 0 to 1, used to characterize the basic proportion of the smallest channel pixel value in the target brightness calculation under ideal noise-free conditions. The specific value of the base ratio can be preset or adaptively adjusted according to the actual application scenario, image sensor characteristics, and the sensitivity requirements of purple fringing detection. For example, it can be set to 0.5, 0.6, or 0.8.
[0073] Then, the result of multiplying the above difference by the preset base ratio can be normalized to obtain the first ratio corresponding to the minimum channel pixel value in the fusion calculation. The first ratio is as follows:
[0074] in, This represents the first proportion corresponding to the smallest channel pixel value in the fusion calculation. Represents the normalization function. This indicates the preset base percentage. The first percentage represents the noise of a pixel. The first percentage is negatively correlated with the pixel noise. The smaller the pixel noise, the larger the first percentage, and the larger the pixel noise, the smaller the first percentage.
[0075] S1033, the difference between 1 and the first proportion is used as the second proportion corresponding to the weighted channel pixel value in the fusion calculation.
[0076] S1034, based on the first proportion and the second proportion, the weighted channel pixel value and the minimum channel pixel value are fused and calculated to obtain the target brightness of the pixel.
[0077] After determining the first proportion, the terminal device can use the difference between 1 and the first proportion as the second proportion corresponding to the weighted channel pixel value in the fusion calculation. Then, based on the first and second proportions, the weighted channel pixel value and the minimum channel pixel value are fused and calculated to obtain the target brightness of the pixel. The target brightness is specifically calculated using the following formula:
[0078] in, Indicates the target brightness. This represents the first proportion corresponding to the smallest channel pixel value in the fusion calculation. Indicates the weighted channel pixel value. This represents the minimum channel pixel value.
[0079] It can be seen that during the fusion calculation of weighted channel pixel values and minimum channel pixel values, when the noise is low, the reliability of the minimum channel pixel value is higher, and its proportion in the fusion calculation is larger, thus fully leveraging its ability to distinguish between highlight and solid color areas. When the noise is high, the reliability of the minimum channel pixel value decreases, and its proportion in the fusion calculation is smaller. Correspondingly, the weighted channel pixel value has a larger proportion in the fusion calculation, thus utilizing its noise resistance stability. Therefore, a target brightness that balances discrimination accuracy and noise resistance stability can be obtained under different noise conditions.
[0080] In some embodiments of this application, S104 is involved. The terminal device can determine the high brightness determination result of the pixel based on the target brightness and the preset brightness threshold. S104 may include S1041 to S1043, as follows.
[0081] S1041, compare the target brightness with the preset brightness threshold.
[0082] S1042, If the target brightness is greater than the preset brightness threshold, determine that the pixel is in the high-brightness area.
[0083] S1043, If the target brightness is not greater than the preset brightness threshold, determine that the pixel is not in the high-brightness area.
[0084] After determining the target brightness of a pixel, the terminal device can compare the target brightness with a preset brightness threshold (Th_Y). The preset brightness threshold is a critical value used to distinguish between bright and non-bright areas. This threshold can be a fixed value preset based on the dynamic range of the image sensor, the scene brightness distribution, or the sensitivity requirements of purple fringing detection, or it can be a dynamic value adaptively determined based on the overall brightness distribution of the image. This application does not specifically limit it in this regard.
[0085] If the target brightness is greater than the preset brightness threshold, the pixel is determined to be in a high-brightness area. If the target brightness is not greater than the preset brightness threshold, the pixel is determined not to be in a high-brightness area.
[0086] When a pixel is not in a highlight area, it cannot belong to a purple edge area. The terminal device can directly determine that the pixel is a non-purple edge pixel without further purple edge constraint judgment.
[0087] Therefore, by presetting a brightness threshold to filter the bright areas of pixels, the range of purple edge detection can be effectively reduced, the amount of calculation in subsequent steps can be reduced, and the overall efficiency of purple edge detection can be improved.
[0088] In some embodiments of this application, S105 is involved. The terminal device can determine the purple edge detection result of the pixel based on the highlight determination result and the preset purple edge constraint condition. S105 may include S1051 and S1052, as follows.
[0089] S1051, if the highlight determination result indicates that the pixel is in the highlight area and the pixel meets the preset purple edge constraint condition, the pixel is determined to be a purple edge pixel.
[0090] S1052, otherwise, determine if the pixel is not a purple-edged pixel.
[0091] If the highlight determination result indicates that the current pixel is in a highlighted area, the terminal device can further determine whether the pixel meets the preset purple edge constraint condition. When the highlight determination result indicates that the pixel is in a highlighted area and the pixel meets the preset purple edge constraint condition, the terminal device can determine that the pixel is a purple edge pixel.
[0092] If the highlight determination result indicates that the current pixel is not in the highlight area, the terminal device can directly determine that the pixel is a non-purple-edge pixel. Since purple edges can only appear in the highlight area, pixels in the non-highlight area cannot belong to the purple-edge area, so there is no need to determine whether it meets the purple-edge constraint condition.
[0093] If the highlight determination result indicates that the pixel is in the highlight area, but the pixel does not meet the preset purple edge constraint condition, the terminal device can also determine that the pixel is not a purple edge pixel.
[0094] It can be seen that the terminal device can accurately distinguish the pixels that are truly purple edges in the highlighted area, while excluding non-purple edge pixels in the highlighted area that do not meet the preset purple edge constraint conditions, thus providing accurate purple edge detection results for subsequent purple edge correction.
[0095] In some embodiments of this application, a pixel satisfying a preset purple edge constraint condition may include any one or more of the following: the pixel's chromaticity is within a preset purple chromaticity range, the pixel is located in an image edge region, or there are pixels in a preset neighborhood of the pixel whose target brightness is greater than a preset brightness threshold.
[0096] A pixel can satisfy a preset purple fringing constraint if its chromaticity falls within a preset purple chromaticity range. This preset range refers to a chromaticity interval pre-defined based on the distribution characteristics of purple fringing in the color space, encompassing the chromaticity values corresponding to the typically magenta to purplish-red hues of purple fringing. If a pixel's chromaticity falls within the preset purple chromaticity range, it indicates that the pixel's color characteristics conform to the color characteristics of purple fringing, meaning the pixel exhibits a magenta or purplish-red tendency.
[0097] A pixel can also satisfy the preset purple fringing constraint if it is located in an image edge region. If a pixel is located in an image edge region, it means that the pixel is situated at a location in the image where brightness changes drastically, i.e., at the boundary between a bright and dark area, which aligns with the physical characteristic that purple fringing typically occurs at the boundary between bright and dark areas. The terminal device can determine whether a pixel is in an image edge region through edge detection. For example, it can calculate the brightness gradient magnitude of the pixel; if the brightness gradient magnitude is greater than a preset edge threshold, then the pixel is determined to be in an image edge region. Otherwise, it is not in an image edge region.
[0098] A pixel can also satisfy the preset purple fringing constraint if: there are pixels within a preset neighborhood of the pixel whose target brightness is greater than a preset brightness threshold. Since purple fringing does not occur alone, but is an artifact generated adjacent to the edge of a bright area, the terminal device can acquire a preset neighborhood centered on the pixel (e.g., 3×3, 5×5, etc.), traverse each pixel within this neighborhood, and check if there are any pixels whose target brightness is greater than the preset brightness threshold. If so, it indicates that there are pixels in a bright area surrounding the pixel, suggesting that the pixel conforms to the spatial distribution characteristics of purple fringing, which typically occurs near bright areas.
[0099] In the embodiments of this application, one of the above-mentioned purple edge constraints can be used, or any combination thereof can be used. This application does not make any specific limitation on this.
[0100] Therefore, in the above-mentioned purple fringing detection method, the channel pixel values of each color channel can be extracted from the pixel window corresponding to the pixel. Then, the weighted channel pixel value and the minimum channel pixel value of each color channel are determined. The target brightness of the pixel is obtained by fusing the weighted channel pixel value and the minimum channel pixel value. The weighted channel pixel value can represent the overall brightness level of the pixel, while the minimum channel pixel value is higher in true bright areas and lower in pure color high-saturation areas, which can distinguish between true bright areas and pure color high-saturation areas. The target brightness obtained by fusing the weighted channel pixel value's ability to represent the overall brightness and the minimum channel pixel value's ability to distinguish between true bright areas and pure color high-saturation areas can be combined. Determining whether a pixel is in a bright area based on this target brightness can effectively reduce the situation where pure color high-saturation areas are misclassified as bright areas. On this basis, further combining purple fringing constraints for purple fringing detection can avoid misjudging purple fringed pixels caused by pure color high-saturation areas being misclassified as bright areas, thereby effectively improving the accuracy of purple fringing detection.
[0101] Embodiments of this application also provide a purple edge detection device, such as... Figure 2 As shown, Figure 2 This is a schematic diagram of a purple edge detection device provided in an embodiment of this application. The purple edge detection device 200 can be deployed on terminal devices with image acquisition capabilities, such as smartphones, digital cameras, and dashcams, or it can be deployed on a server that communicates with these terminal devices. The purple edge detection device 200 includes: The acquisition module 201 is used to acquire the image to be detected; The determination module 202 is used to extract the channel pixel value of each color channel from the pixel window corresponding to each pixel in the image to be detected, determine the weighted channel pixel value of each color channel, and determine the minimum channel pixel value from the channel pixel values of each color channel. The fusion calculation module 203 is used to perform fusion calculation on the weighted channel pixel value and the minimum channel pixel value according to the pixel noise to obtain the target brightness of the pixel. The noise is used to characterize the proportion of the minimum channel pixel value in the fusion calculation. The determining module 202 is further configured to determine the highlight determination result of the pixel based on the target brightness and the preset brightness threshold. The highlight determination result is used to indicate whether the pixel is in the highlight area. The determining module 202 is also used to determine the purple edge detection result of the pixel based on the highlight determination result and the preset purple edge constraint conditions.
[0102] In some embodiments of this application, the determining module 202 is further configured to determine the noise of a pixel based on the variance of the pixel values of each pixel in the pixel window, the weighted channel pixel values, and the difference information of the channel pixel values of each color channel, wherein the difference information is any one of the difference between the maximum and minimum channel pixel values of each color channel, the variance of the channel pixel values of each color channel, the standard deviation of the channel pixel values of each color channel, and the absolute difference of the channel pixel values of each color channel.
[0103] In some embodiments of this application, the determining module 202 is further configured to: determine the basic noise corresponding to the weighted channel pixel value according to a preset brightness-noise correspondence relationship, wherein the basic noise represents the inherent noise intensity of the image sensor under the brightness corresponding to the weighted channel pixel value; perform a weighting operation on the variance of the pixel value of each pixel in the pixel window, the basic noise, and the difference information of the channel pixel values of each color channel to obtain the weighted noise; and perform normalization processing on the weighted noise to obtain the pixel noise.
[0104] In some embodiments of this application, the fusion calculation module 203 is specifically used to: calculate the difference between the pixel and the noise of the pixel; normalize the product of the difference and a preset base ratio to obtain a first ratio corresponding to the minimum channel pixel value in the fusion calculation, wherein the first ratio is negatively correlated with the noise of the pixel, and the preset base ratio is used to characterize the ratio of the minimum channel pixel value in the fusion calculation under noise-free conditions; use the difference between the pixel and the first ratio as a second ratio corresponding to the weighted channel pixel value in the fusion calculation; and perform fusion calculation on the weighted channel pixel value and the minimum channel pixel value according to the first ratio and the second ratio to obtain the target brightness of the pixel.
[0105] In some embodiments of this application, the determining module 202 is specifically used to compare the target brightness with a preset brightness threshold; if the target brightness is greater than the preset brightness threshold, determine that the pixel is in a bright area; if the target brightness is not greater than the preset brightness threshold, determine that the pixel is not in a bright area.
[0106] In some embodiments of this application, the determining module 202 is specifically used to determine that if the highlight determination result indicates that the pixel is in the highlight area and the pixel meets the preset purple edge constraint condition, the pixel is a purple edge pixel; otherwise, the pixel is determined not to be a purple edge pixel.
[0107] In some embodiments of this application, a pixel satisfies a preset purple edge constraint condition including any one or more of the following: the pixel's chromaticity is within a preset purple chromaticity range, the pixel is located in an image edge region, and there are pixels in a preset neighborhood of the pixel whose target brightness is greater than a preset brightness threshold.
[0108] Embodiments of this application also provide a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement any of the purple edge detection methods described above.
[0109] Taking computer devices as terminals as an example, Figure 3 A schematic diagram of the structure of a terminal provided in an embodiment of this application is shown below. Figure 3 In some embodiments of this application, terminal 300 may be: a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 300 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0110] Typically, terminal 300 includes a processor 301 and a memory 302.
[0111] In some embodiments of this application, processor 301 may include one or more processing cores, such as a quad-core processor, a penta-core processor, etc. Processor 301 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 301 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 301 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 301 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0112] The memory 302 may include one or more computer-readable storage media, which may be non-transitory. The memory 302 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 302 are used to store at least one program code, which is executed by the processor 301 to implement the process of terminal execution in the method embodiments of this application.
[0113] In some embodiments, the terminal 300 may also optionally include a peripheral device interface 303 and at least one peripheral device. The processor 301, memory 302, and peripheral device interface 303 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of a display screen 304, a camera assembly 305, an audio circuit 306, and a power supply 307.
[0114] The peripheral device interface 303 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 301 and the memory 302. In some embodiments, the processor 301, memory 302, and peripheral device interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, memory 302, and peripheral device interface 303 can be implemented on separate chips or circuit boards, and this application embodiment does not limit this.
[0115] Display screen 304 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 304 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 301 for processing. In this case, display screen 304 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 304, disposed on the front panel of terminal 300; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 300 or in a folded design; in other embodiments, display screen 304 may be a flexible display screen, disposed on a curved or folded surface of terminal 300. Furthermore, display screen 304 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Display screen 304 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0116] The camera assembly 305 is used to acquire images or videos. In some embodiments, the camera assembly 305 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 305 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0117] The audio circuit 306 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals which are then input to the processor 301 for processing. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 300. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 301 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 306 may also include a headphone jack.
[0118] Power supply 307 is used to power the various components in terminal 300. Power supply 307 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 307 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0119] Those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on terminal 300, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0120] Taking computer equipment as a server as an example, Figure 4 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 400 can vary significantly due to different configurations or performance. It may include one or more processors 401 (Central Processing Units, CPUs) and one or more memories 402. The one or more memories 402 store at least one computer program, which is loaded and executed by the one or more processors 401 to implement the aforementioned image noise reduction method. Of course, the server 400 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 400 may also include other components for implementing device functions, which will not be elaborated upon here.
[0121] Embodiments of this application also provide a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to perform the method described above. Optionally, the computer-readable storage medium may be read-only memory (ROM), random access memory (RAM), compact-disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0122] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0123] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for detecting purple edge, characterized in that, include: Acquire the image to be detected; For each pixel in the image to be detected, the channel pixel value of each color channel is extracted from the pixel window corresponding to the pixel, the weighted channel pixel value of each color channel is determined, and the minimum channel pixel value is determined from the channel pixel values of each color channel. Based on the noise of the pixel, the weighted channel pixel value and the minimum channel pixel value are fused and calculated to obtain the target brightness of the pixel. The noise is used to characterize the proportion of the minimum channel pixel value in the fusion calculation. Based on the target brightness and the preset brightness threshold, the highlight determination result of the pixel is determined, and the highlight determination result is used to indicate whether the pixel is in the highlight area; Based on the highlight determination result and the preset purple edge constraint conditions, the purple edge detection result of the pixel is determined.
2. The method according to claim 1, characterized in that, Before fusing the weighted channel pixel values and the minimum channel pixel values based on the pixel noise to obtain the target brightness of the pixel, the method further includes: The noise of the pixel is determined based on the variance of the pixel values of each pixel in the pixel window, the weighted channel pixel values, and the difference information of the channel pixel values of each color channel. The difference information is any one of the following: the difference between the maximum and minimum channel pixel values of each color channel, the variance of the channel pixel values of each color channel, the standard deviation of the channel pixel values of each color channel, and the absolute difference of the channel pixel values of each color channel.
3. The method according to claim 2, characterized in that, Based on the variance of pixel values in the pixel window, the weighted channel pixel values, and the difference in channel pixel values of each color channel, the noise of the pixel is determined, including: Based on a preset brightness-noise correspondence, the basic noise corresponding to the weighted channel pixel value is determined. The basic noise represents the inherent noise intensity of the image sensor under the brightness corresponding to the weighted channel pixel value. A weighted noise is obtained by performing a weighted operation on the variance of the pixel value of each pixel in the pixel window, the basic noise, and the difference information of the channel pixel values of each color channel; The weighted noise is normalized to obtain the noise of the pixel.
4. The method according to claim 1, characterized in that, Based on the noise of the pixel, the weighted channel pixel value and the minimum channel pixel value are fused and calculated to obtain the target brightness of the pixel, including: Calculate the difference between pixel 1 and the noise of the pixel; The product of the difference and the preset base ratio is normalized to obtain the first ratio corresponding to the minimum channel pixel value in the fusion calculation. The first ratio is negatively correlated with the noise of the pixel. The preset base ratio is used to characterize the ratio of the minimum channel pixel value in the fusion calculation under noise-free conditions. The difference between 1 and the first proportion is used as the second proportion corresponding to the weighted channel pixel value in the fusion calculation; Based on the first ratio and the second ratio, the weighted channel pixel value and the minimum channel pixel value are fused and calculated to obtain the target brightness of the pixel.
5. The method according to claim 1, characterized in that, Based on the target brightness and a preset brightness threshold, the highlight determination result of the pixel is determined, including: Compare the target brightness with a preset brightness threshold; If the target brightness is greater than the preset brightness threshold, the pixel is determined to be in a high-brightness area; If the target brightness is not greater than the preset brightness threshold, it is determined that the pixel is not in a high-brightness area.
6. The method according to claim 1, characterized in that, Based on the highlight determination result and the preset purple edge constraint conditions, the purple edge detection result of the pixel is determined, including: If the highlight determination result indicates that the pixel is in the highlight area and the pixel meets the preset purple edge constraint condition, the pixel is determined to be a purple edge pixel; Otherwise, determine that the pixel is not a purple-edged pixel.
7. The method according to claim 6, characterized in that, The pixel satisfies the preset purple edge constraint conditions as follows: the pixel's chromaticity is within a preset purple chromaticity range, the pixel is located in the image edge region, and there are any one or more of the following in the preset neighborhood of the pixel: the pixel's chromaticity is within a preset range of purple chromaticity, the pixel is located in the image edge region, and there are pixels in the preset neighborhood of the pixel whose target brightness is greater than a preset brightness threshold.
8. A purple edge detection device, characterized in that, include: The acquisition module is used to acquire the image to be detected; The determination module is used to extract the channel pixel values of each color channel from the pixel window corresponding to each pixel in the image to be detected, determine the weighted channel pixel value of each color channel, and determine the minimum channel pixel value from the channel pixel values of each color channel. The fusion calculation module is used to perform fusion calculation on the weighted channel pixel value and the minimum channel pixel value based on the noise of the pixel to obtain the target brightness of the pixel, wherein the noise is used to characterize the proportion of the minimum channel pixel value in the fusion calculation; The determining module is further configured to determine the highlight determination result of the pixel based on the target brightness and a preset brightness threshold, wherein the highlight determination result is used to indicate whether the pixel is in a highlight area; The determining module is further configured to determine the purple edge detection result of the pixel based on the highlight determination result and the preset purple edge constraint conditions.
9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory being used to store at least one program, the at least one program being loaded by the processor and executed as described in any one of claims 1 to 7, the purple edge detection method.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the purple edge detection method as described in any one of claims 1 to 7.