Image processing method and device, electronic equipment and computer readable storage medium

By determining the center point of the image feature and the color correction weight map, the problem of inaccurate correction of the highlight area is solved, the accurate correction of the blue-slight area in the image is achieved, and the color restoration effect of the image is improved.

CN120339086APending Publication Date: 2025-07-18GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510443985.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In traditional technology, the correction of the highlight area is not accurate enough, especially in images taken under night scenes or indoor mixed light sources, where white highlights appear blue.

Method used

By determining the characteristic center point of the region of interest in the image, a color correction weight map is obtained based on the distance value between the pixel point and the center point, and weighted fusion processing is performed to correct the blue-slight highlight area in the image.

Benefits of technology

Improve the correction accuracy of blue highlight areas in the image, ensure natural color restoration and uniform transition, and improve the imaging effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339086A_ABST
    Figure CN120339086A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device, electronic equipment and a computer readable storage medium. The method comprises the steps of determining a feature center point of a region of interest in a to-be-processed image according to color feature information of the to-be-processed image; obtaining a color correction weight map of the to-be-processed image according to the distance value between each pixel point of the to-be-processed image and the feature center point; according to the color correction weight map, performing weighted fusion processing on the to-be-processed image and a reference image of the to-be-processed image to obtain a color correction image of the to-be-processed image; the color channel values of all pixel points in the reference image are the same. By adopting the method, the accuracy of correcting the bluish highlight area in the image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, electronic device, and computer-readable storage medium. Background Art

[0002] High Dynamic Range (HDR) imaging captures multiple photos with different exposure levels and then combines these photos into an image with a higher dynamic range. Generally, when performing HDR multi-exposure synthesis, underexposed frames that are not overexposed are used for the highlight areas. After the effects of white balance parameter and color correction matrix parameter, the white light will be bluish, resulting in the problem that white high-light light signs appear bluish when the medium and low color temperatures are present in the captured images under mixed light sources such as night scenes and indoors.

[0003] In traditional technologies, through image algorithm processing, the bluish highlight areas in the image are detected and then corrected to white. However, there is a problem in traditional technologies that the correction of the bluish highlight areas in the image is not accurate enough. Summary of the Invention

[0004] Embodiments of the present application provide an image processing method, apparatus, electronic device, and computer-readable storage medium, which can improve the accuracy of correcting bluish highlight areas in an image.

[0005] In a first aspect, an embodiment of the present application provides an image processing method, and the method includes:

[0006] Determine a feature center point of an area of interest in the to-be-processed image according to color feature information of the to-be-processed image;

[0007] Obtain a color correction weight map of the to-be-processed image according to distance values between each pixel point of the to-be-processed image and the feature center point;

[0008] Perform weighted fusion processing on the to-be-processed image and a reference image of the to-be-processed image according to the color correction weight map to obtain a color-corrected image of the to-be-processed image; color channel values of each pixel point in the reference image are the same.

[0009] In a second aspect, an embodiment of the present application provides an image processing apparatus, and the apparatus includes:

[0010] A first determination module, configured to determine a feature center point of an area of interest in the to-be-processed image according to color feature information of the to-be-processed image;

[0011] An obtaining module, configured to obtain a color correction weight map of the to-be-processed image according to distance values between each pixel point of the to-be-processed image and the feature center point;

[0012] A processing module, configured to perform weighted fusion processing on the image to be processed and the reference image of the image to be processed according to the color correction weight map, so as to obtain a color correction image of the image to be processed; color channel values of all pixel points in the reference image are the same.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor. When a computer program stored in the memory is executed by the processor, the processor is caused to execute the steps of the image processing method as described in the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method as described in the first aspect are implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the method as described in the first aspect are implemented.

[0016] For the above image processing method, device, electronic device, and computer-readable storage medium, since the region of interest in the image to be processed is a blue-biased region related to the color feature information of the image to be processed, the feature center point of the region of interest in the image to be processed can be accurately determined according to the color feature information of the image to be processed, ensuring the accuracy of the determined feature center point. Thus, according to the distance values between each pixel point of the image to be processed and the feature center point, the color correction weight map of the image to be processed can be accurately obtained. Furthermore, according to the determined color correction weight map, weighted fusion processing is performed on the image to be processed and the reference image of the image to be processed to correct the blue-biased highlight region in the image to be processed, so that the obtained color correction image has natural color restoration, uniform transition, and higher accuracy, greatly improving the imaging effect expressiveness of the color correction image. Description of the Drawings

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following described drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0018] Figure 1 It is a flowchart of the image processing method in one embodiment;

[0019] Figure 2 It is a flowchart of the image processing method in another embodiment;

[0020] Figure 3 is a flowchart of an image processing method in another embodiment;

[0021] Figure 4 is a flowchart of an image processing method in another embodiment;

[0022] Figure 5 is a conceptual architecture diagram of an image processing method in one embodiment;

[0023] Figure 6 is a structural block diagram of an image processing apparatus in one embodiment;

[0024] Figure 7 is an internal structural schematic diagram of a computer device in one embodiment. Detailed implementation manners

[0025] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0026] In one embodiment, as Figure 1 shown, an image processing method is provided. In this embodiment, it is exemplified that the method is applied to an electronic device. It can be understood that the method can also be applied to a server, and can also be applied to a system including an electronic device and a server, and is implemented through the interaction between the electronic device and the server. In this embodiment, the method includes the following steps:

[0027] S201, determine the feature center point of the region of interest in the image to be processed according to the color feature information of the image to be processed.

[0028] Among them, the image to be processed may be an image including a white high-brightness light board taken under mixed light sources such as at night or indoors. When the white high-brightness light board is in a medium-low color temperature, it will appear bluish. Therefore, it is necessary to perform color correction on the bluish region.

[0029] As an alternative implementation, the image to be processed can be converted from the RGB color space to the HSV color space, and then the color values of each pixel in the image to be processed are statistically analyzed in the HSV color space to obtain the occurrence frequencies of different color values in the image to be processed, thereby obtaining the color feature information of the image to be processed. Then, using the color feature information of the image to be processed and a preset color threshold, each pixel of the image to be processed is screened, and the qualified pixel points are marked, and the formed set of pixel points is determined as the region of interest of the image to be processed. Further, in a possible embodiment, the geometric center of all pixel points in the region of interest can be calculated, and the geometric center of all pixel points in the region of interest is determined as the characteristic center point of the region of interest. It can be understood that the region of interest of the image to be processed in this embodiment can be the blueish highlight region in the image to be processed.

[0030] S202. Obtain the color correction weight map of the image to be processed according to the distance values between the pixel points of the image to be processed and the characteristic center point.

[0031] First of all, it should be noted that in the embodiment of the present application, obtaining the region of interest of the image to be processed, that is, the blueish highlight region in the image to be processed, is to statistically analyze the characteristic representations of this part of the region, that is, to anchor the representative features (characteristic center points) of the color deviation region in the image to be processed. When performing color correction on the image to be processed, calculate the distance values between all pixels of the entire image and the characteristic center point. According to the principle that the closer a point is to the characteristic center point, the higher the correction weight, and the farther a point is from the characteristic center point, the lower the correction weight, obtain the color correction weights corresponding to the pixel points of the image to be processed, so as to obtain the color correction weight map of the image to be processed.

[0032] Exemplarily, the distance value between each pixel point of the image to be processed and the characteristic center point of the region of interest can be calculated according to the formula In the formula, represents the distance value between the pixel point of the image to be processed and the characteristic center point of the region of interest, represents the pixel point of the image to be processed, represents the characteristic center point of the region of interest. As an alternative implementation, a mapping relationship between the distance values between the pixel points of the image to be processed and the characteristic center point of the region of interest and the color correction weights of the pixel points can be established in advance, and the color correction weights of the pixel points of the image to be processed are obtained using this mapping relationship, thereby obtaining the color correction weight map of the image to be processed.

[0033] S203. Perform weighted fusion processing on the image to be processed and the reference image of the image to be processed according to the color correction weight map to obtain the color corrected image of the image to be processed; the color channel values of each pixel point in the reference image are the same.

[0034] It should be noted that the target correction color for color correction of the image to be processed is white, with the same three-channel values and in the highlight area. Therefore, the target correction color can be selected as the maximum value among the three-channel values. That is, in this embodiment, the same color channel values of each pixel point in the reference image of the image to be processed mean that the R, G, and B channels of each pixel in the image to be processed are the same and equal to the . In a possible implementation, the color correction weight map can be used to perform weighted fusion processing on the image to be processed and the reference image of the image to be processed according to the following formula to obtain the color correction image of the image to be processed: , where represents the color correction image of the image to be processed, represents the image to be processed, represents the above-mentioned color correction weight map, represents the reference image of the image to be processed.

[0035] As a possible implementation, certain adjustments can also be made to the obtained reference image, and the color correction image can be obtained using the adjusted reference image. For example, after taking the maximum value of the three channels of each pixel point in the image to be processed, an additional coefficient can be multiplied to increase the brightness, making the adjusted reference image white and bright. Among them, the coefficient can be adaptively calculated by statistically analyzing the maximum value / quantile maximum value of the pixel values in the region of interest (such as the maximum value at the 99.5% quantile after sorting) . Exemplarily, the adjustment coefficient can be obtained according to the formula , where represents the adjustment coefficient, and then the adjusted reference image can be obtained according to the formula , where represents the adjusted reference image, represents the reference image. Then, replace in the above formula for obtaining the color correction image with to obtain the color correction image of the image to be processed.

[0036] It can be understood that when performing color correction on the image to be processed, the entire image pixels of the image to be processed are affected, which can avoid problems such as inaccurate detection of the region of interest, abnormal blue correction effects after missed segmentation / wrong segmentation.

[0037] In the above image processing method, since the region of interest in the image to be processed is a blue-biased region related to the color feature information of the image to be processed, the characteristic center point of the region of interest in the image to be processed can be accurately determined according to the color feature information of the image to be processed, ensuring the accuracy of the determined characteristic center point. Thus, according to the distance values between each pixel point of the image to be processed and the characteristic center point, the color correction weight map of the image to be processed can be accurately obtained. Furthermore, based on the determined color correction weight map, weighted fusion processing can be performed on the image to be processed and the reference image of the image to be processed, and the blue-biased highlight region in the image to be processed can be corrected, making the obtained color correction image have natural color restoration, uniform transition, and higher accuracy, greatly enhancing the imaging effect expressiveness of the color correction image.

[0038] In this embodiment, the detailed process of obtaining the color correction weight map of the image to be processed will be explained. In one embodiment, the above S202 includes:

[0039] Step A: Obtain the color correction weight map according to each distance value and the preset correction radius.

[0040] As a possible implementation manner, in this embodiment, the variance of the R channel, the variance of the G channel, and the variance of the B channel within the region of interest can be calculated using the standard variance calculation formula, and the average variance of the three channels is, that is, , where represents the average variance of the three channels, , , represent the variances of the three channels. The preset correction radius can include a radius high threshold and a radius low threshold . Then, adjustment parameters are designed in combination with the variance: . Further, the distance from each pixel point to the characteristic center point can be restricted within the range of and using the radius high threshold and the radius low threshold through the following formula. For example, if is less than , it is truncated to to determine the adjusted distance value between each pixel and the characteristic center point: . Then, using the above parameters and formula , the color correction weight map of the image to be processed is obtained.

[0041] In this embodiment, based on the distance values between each pixel point of the image to be processed and the feature center point of the region of interest and the preset correction radius, pixel points closer to the preset correction radius can be assigned higher correction weights, and pixel points farther from the preset correction radius can be assigned lower correction weights, so as to accurately obtain the color correction weight map of the image to be processed, ensuring the accuracy of the obtained color correction weight map.

[0042] In some scenarios, the color correction weight map can be obtained according to the ratio of the distance value between each pixel point and the feature center point of the region of interest to the preset correction radius. In one embodiment, as Figure 2 shown, the above step A includes:

[0043] S301, obtain the ratio of each distance value to the preset correction radius.

[0044] S302, determine the difference between the unit value and each ratio as the color correction weight value of each pixel point, and obtain the color correction weight map.

[0045] Among them, the unit value can be 1. Exemplarily, in this embodiment, each pixel point of the image to be processed can be processed using the formula to determine the color correction weight value of each pixel point and obtain the color correction weight map of the image to be processed. In the formula, represents the color correction weight value of each pixel point, represents the distance value between each pixel point of the image to be processed and the feature center point of the region of interest, represents the preset correction radius.

[0046] In this embodiment, the process of obtaining the ratio of the distance value between each pixel point of the image to be processed and the feature center point of the region of interest to the preset correction radius is relatively simple, and the ratio of the distance value corresponding to each pixel point to the preset correction radius can be quickly obtained. Thus, the difference between the unit value and the ratio corresponding to each pixel point can be quickly obtained, ensuring the efficiency of determining the color correction weight value of each pixel point of the image to be processed, and thus the color correction weight map of the image to be processed can be quickly obtained.

[0047] In some scenarios, the feature center point of the region of interest in the image to be processed can be determined according to the color feature information of the image to be processed and the preset threshold. In one embodiment, as Figure 3 shown, the above S201 includes:

[0048] S401, determine the color feature mask of the image to be processed according to the color feature information and the preset threshold; the color feature mask includes a channel feature mask, a brightness feature mask, a hue feature mask, and a saturation feature mask.

[0049] Among them, the color feature mask of the image to be processed may include a channel feature mask, a brightness feature mask, a hue feature mask, and a saturation feature mask. Correspondingly, the color feature information of the image to be processed may include a color channel value, a brightness channel value, a hue channel value, and a saturation channel value. The preset threshold may include a preset color threshold, a preset brightness threshold, a preset hue threshold, and a preset saturation threshold.

[0050] As a possible implementation manner, in this embodiment, since the blue-biased region usually appears blue / blue-cyan, the region with the largest blue channel value in the color channel values of the image to be processed, or the region with the largest green channel value and the difference between the green channel value and the blue channel value being less than the preset color threshold, may be determined as the channel feature mask. For example, the pixel values of the region with the largest blue channel value in the color channel values of the image to be processed may be set to 1, and the pixel values of other regions may be set to 0. Alternatively, the pixel values of the region with the largest green channel value and the difference between the green channel value and the blue channel value being less than the preset color threshold may be set to 1, and the pixel values of other regions may be set to 0, to obtain the channel feature mask.

[0051] In addition, since the blue-biased region is usually the highlight region in a high-dynamic-range image (such as a light board, a light source, and the irradiated area, etc.), the image to be processed may be converted from an RGB image to an HSV image, and the region where V is greater than the brightness threshold may be calculated according to the brightness V channel value to determine the brightness feature mask. Or, when the image is synthesized by multi-exposure, since different bright and dark frames are split in the image adjustment algorithm for brightness tone fusion, the weight map of the dark frame corresponding to the highlight region may be obtained. Further, the weight map of the dark frame may be used as the brightness feature mask.

[0052] For the hue feature mask, according to the hue H channel of the HSV image converted from the image to be processed, an appropriate threshold may be set to select the region within the hue range from cyan to blue as the hue feature mask. That is, in this embodiment, the region where the distance between the hue channel value and the target hue interval is less than the preset distance threshold may be calculated, and this part of the region may be determined as the hue feature mask. Among them, the target hue interval is the hue interval between cyan and blue. The closer the hue channel value is to the hue interval between cyan and blue, the higher the mask value, and the closer it is to 1. On the contrary, the smaller the mask value, the closer it is to 0.

[0053] For the saturation feature mask, since the blue-biased region of the white light board usually appears light blue and has a low saturation (not a real high-saturation blue light source), a preset saturation threshold may be set according to the saturation S channel value of the HSV image of the image to be processed, and the region where the saturation channel value is less than the preset saturation threshold may be determined as the saturation feature mask. Among them, the lower the saturation channel value, the closer the saturation feature mask is to 1, and the higher the saturation channel value, the closer the saturation feature mask is to 0.

[0054] S402. Determine the overlapping region of the channel feature mask, the luminance feature mask, the hue feature mask, and the saturation feature mask as the region of interest.

[0055] In this embodiment, after determining the channel feature mask, the luminance feature mask, the hue feature mask, and the saturation feature mask of the image to be processed, these mask images can be fused, and the overlapping region of the channel feature mask, the luminance feature mask, the hue feature mask, and the saturation feature mask is determined as the region of interest of the image to be processed.

[0056] S403. Determine the feature center point according to the color channel values of the region of interest.

[0057] Exemplarily, in this embodiment, the average value of the color channel values of the region of interest can be obtained according to the ratio of the sum of the color channel values of each pixel point in the region of interest to the total number of pixel points in the region of interest, and the pixel point corresponding to the average value of the color channel values of the region of interest is determined as the feature center point of the region of interest. Exemplarily, the average value of the color channel values of the region of interest can be obtained by the following formula: , , , where represents the average value of the color channel values of the region of interest of the image to be processed, represents the R color channel value of the pixel point in the region of interest, represents the G color channel value of the pixel point in the region of interest, represents the B color channel value of the pixel point in the region of interest, represents the total number of pixel points in the region of interest.

[0058] In this embodiment, according to the color feature information of the image to be processed and the preset threshold, the channel feature mask, the luminance feature mask, the hue feature mask, and the saturation feature mask of the image to be processed can be accurately determined. The region of interest of the image to be processed is the overlapping region of the channel feature mask, the luminance feature mask, the hue feature mask, and the saturation feature mask. Since the channel feature mask, the luminance feature mask, the hue feature mask, and the saturation feature mask are determined with relatively high accuracy, the region of interest of the image to be processed can also be accurately obtained. Thus, the feature center point of the region of interest can be accurately determined according to the color channel values of the region of interest, ensuring the accuracy of the feature center of the determined region of interest.

[0059] It can be understood that not all photo-taking scenarios require blue bias correction. For example, there is no such problem in outdoor daytime scenes, low-dynamic range scenes, etc. Usually, this problem occurs in high-dynamic range scenes with mixed light sources. Therefore, to reduce unnecessary operations and overhead, it is possible to determine whether to trigger blue bias correction. In one embodiment, as Figure 4 shown, the above method further includes:

[0060] S501, based on the shooting metadata information of the image to be processed, determine whether color correction processing needs to be performed on the image to be processed.

[0061] Among them, the shooting metadata information of the image to be processed may include information such as the model of the shooting lens, focal length, aperture, shooting time, shutter speed, shutter time, aperture value, exposure gain value, sensitivity, etc.

[0062] As a possible implementation, it is possible to determine whether it is a night scene or an indoor scene during shooting, whether there is a dark frame in the multi-exposure frames, and whether it is a high-dynamic range shooting scene based on the shooting metadata information of the image to be processed, and determine whether color correction processing needs to be performed on the image to be processed. Further, when it is determined that it is a night scene, an indoor scene, there is a dark frame in the multi-exposure frames, and it is a high-dynamic range shooting scene during shooting, it is determined that color correction processing needs to be performed on the image to be processed. Exemplarily, when the illuminance parameter is greater than a preset threshold and / or the sensitivity is greater than a preset threshold, it can be determined that it is a night scene or an indoor scene during shooting; when there is an underexposed frame in the multi-exposure frames during exposure, it is determined that there is a dark frame; calculate the exposure ratio hdrRatio using the metadata information, and when the exposure ratio hdrRatio is greater than the threshold, it is determined that it is a high-dynamic range shooting scene. For example, the exposure ratio can be calculated according to the formula to calculate the exposure ratio, where represents the gain value with an exposure value of ev0, represents the shutter time with an exposure value of ev0, represents the gain value with an exposure value of ev-, represents the shutter time with an exposure value of ev-.

[0063] S502, in the case where it is determined that color correction processing needs to be performed on the image to be processed, perform the step of determining the characteristic center point of the region of interest in the image to be processed according to the color characteristic information of the image to be processed.

[0064] In this embodiment, in the case where it is determined according to the shooting metadata information of the image to be processed that color correction processing needs to be performed on the image to be processed, the above image processing method can be executed to perform color correction on the blue-biased highlight region in the image to be processed to obtain the color-corrected image of the image to be processed.

[0065] In this embodiment, based on the shooting metadata information of the image to be processed, it is possible to determine whether color correction processing needs to be performed on the image to be processed. Thus, when it is determined that color correction processing needs to be performed on the image to be processed, color correction processing can be performed on the image to be processed, reducing unnecessary operations and overhead.

[0066] For the convenience of those skilled in the art, as Figure 5 shown, the idea of the image processing method provided by the present disclosure is introduced in detail below: (1) Based on the shooting metadata information of the image to be processed, determine whether color correction processing needs to be performed on the image to be processed to trigger the blue bias correction algorithm; (2) When it is determined that color correction processing needs to be performed on the image to be processed, based on the color channel values, brightness channel values, hue channel values, and saturation channel values of the image to be processed, determine the channel feature mask, brightness feature mask, hue feature mask, and saturation feature mask of the image to be processed; (3) Determine the overlapping region of the channel feature mask, brightness feature mask, hue feature mask, and saturation feature mask as the region of interest of the image to be processed; (4) According to the ratio of the sum of the color channel values of each pixel point in the region of interest to the total number of pixel points in the region of interest, obtain the average value of the color channel values of the region of interest; Determine the pixel point corresponding to the average value of each color channel as the feature center point; (5) According to the distance values between each pixel point of the image to be processed and the feature center point, obtain the color correction weight map of the image to be processed; (6) According to the color correction weight map, perform weighted fusion processing on the image to be processed and the reference image of the image to be processed to obtain the color correction image of the image to be processed; Among them, the color channel values of each pixel point in the reference image are the same. The above image processing method can improve the problem of white light being blue-biased in high-light areas such as light signs and mixed light sources when taking pictures with a mobile phone camera, and does not strongly depend on the segmentation detection accuracy of the problem area, making the color of the corrected result image more natural, the transition more uniform and accurate, and the imaging effect of actual shooting more expressive.

[0067] It should be understood that although each step in the flowcharts involved in the above embodiments is shown in sequence according to the indication of the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps does not have a strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same time, but can be executed at different times. The execution order of these steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0068] Based on the same inventive concept, an embodiment of the present application further provides an image processing apparatus for implementing the above-mentioned image processing method. The solution provided by this apparatus for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following image processing apparatus can refer to the limitations on the image processing method in the foregoing, and will not be elaborated herein.

[0069] In one embodiment, as Figure 6 shown, an image processing apparatus is provided, including: a first determination module, an acquisition module, and a processing module, where:

[0070] The first determination module is configured to determine the feature center point of the region of interest in the image to be processed according to the color feature information of the image to be processed.

[0071] The acquisition module is configured to acquire a color correction weight map of the image to be processed according to the distance values between the pixel points of the image to be processed and the feature center point.

[0072] The processing module is configured to perform weighted fusion processing on the image to be processed and the reference image of the image to be processed according to the color correction weight map, and acquire a color correction image of the image to be processed; the color channel values of the pixel points in the reference image are all the same.

[0073] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, and will not be elaborated herein.

[0074] Based on the above embodiment, optionally, the above acquisition module includes: an acquisition unit, where:

[0075] The acquisition unit is configured to acquire a color correction weight map according to each distance value and a preset correction radius.

[0076] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, and will not be elaborated herein.

[0077] Based on the above embodiment, optionally, the above acquisition unit is configured to acquire the ratio of each distance value to the preset correction radius; determine the difference between the unit value and each ratio as the color correction weight value of each pixel point, and obtain the color correction weight map.

[0078] The image processing apparatus provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, and will not be elaborated herein.

[0079] Based on the above embodiment, optionally, the above first determination module includes: a first determination unit, a second determination unit, and a third determination unit, where:

[0080] A first determination unit, configured to determine a color feature mask of an image to be processed according to color feature information and a preset threshold; the color feature mask includes a channel feature mask, a brightness feature mask, a hue feature mask, and a saturation feature mask.

[0081] A second determination unit, configured to determine an overlapping region of the channel feature mask, the brightness feature mask, the hue feature mask, and the saturation feature mask as a region of interest.

[0082] A third determination unit, configured to determine a feature center point according to color channel values of the region of interest.

[0083] The image processing apparatus provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated herein.

[0084] Based on the above embodiment, optionally, the third determination unit is configured to obtain an average value of each color channel value of the region of interest according to a ratio of a sum of each color channel value of each pixel point in the region of interest to a total number of pixel points in the region of interest; and determine a pixel point corresponding to the average value of each color channel as the feature center point.

[0085] The image processing apparatus provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated herein.

[0086] Based on the above embodiment, optionally, the color feature information includes a color channel value, a brightness channel value, a hue channel value, and a saturation channel value; the first determination unit is configured to determine a region with the largest blue channel value in the color channel values, or a region with the largest green channel value and a difference between the green channel value and the blue channel value less than a preset color threshold as the channel feature mask; determine a region with a brightness channel value greater than a preset brightness threshold as the brightness feature mask; determine a region where a distance between a hue channel value and a target hue interval is less than a preset distance threshold as the hue feature mask; the target hue interval is a hue interval between cyan and blue; and determine a region with a saturation channel value less than a preset saturation threshold as the saturation feature mask.

[0087] The image processing apparatus provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated herein.

[0088] Based on the above embodiment, optionally, the apparatus further includes: a second determination module and an execution module, where:

[0089] A determination module, configured to determine whether color correction processing needs to be performed on the image to be processed according to shooting metadata information of the image to be processed.

[0090] An execution module, configured to, when it is determined that color correction processing needs to be performed on an image to be processed, execute the step of determining the feature center point of the region of interest in the image to be processed according to the color feature information of the image to be processed.

[0091] Each module in the above image processing device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0092] In one embodiment, a computer device is provided. The computer device may be an electronic device, and its internal structure diagram may be as Figure 7 shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor, implements an image processing method. The display unit of the computer device is used to form a visually visible picture, and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.

[0093] Those skilled in the art can understand that Figure 7 the structure shown in

[0094] An embodiment of the present application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, when the computer-executable instructions are executed by one or more processors, cause the processors to execute the steps of the image processing method.

[0095] An embodiment of the present application also provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the image processing method.

[0096] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided by the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided by the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided by the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0097] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0098] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. An image processing method, characterized in that, The method includes: Determining a feature center point of a region of interest in the image to be processed according to the color feature information of the image to be processed; Obtaining a color correction weight map of the image to be processed according to the distance values between each pixel point of the image to be processed and the feature center point; Performing weighted fusion processing on the image to be processed and a reference image of the image to be processed according to the color correction weight map to obtain a color correction image of the image to be processed; color channel values of each pixel point in the reference image are the same.

2. The method according to claim 1, wherein The obtaining a color correction weight map of the image to be processed according to the distance values between each pixel point of the image to be processed and the feature center point includes: Obtaining the color correction weight map according to each of the distance values and a preset correction radius.

3. The method according to claim 2, wherein The obtaining the color correction weight map according to each of the distance values and the preset correction radius includes: Obtaining a ratio of each of the distance values to the preset correction radius; Determining a difference between a unit value and each of the ratios as a color correction weight value of each of the pixel points to obtain the color correction weight map.

4. The method according to claim 1, wherein The determining a feature center point of a region of interest in the image to be processed according to the color feature information of the image to be processed includes: Determining a color feature mask of the image to be processed according to the color feature information and a preset threshold; the color feature mask includes a channel feature mask, a brightness feature mask, a hue feature mask, and a saturation feature mask; Determining an overlapping region of the channel feature mask, the brightness feature mask, the hue feature mask, and the saturation feature mask as the region of interest; Determining the feature center point according to color channel values of the region of interest.

5. The method according to claim 4, wherein The determining the feature center point according to color channel values of the region of interest includes: Obtaining an average value of color channel values of the region of interest according to a ratio of a sum of color channel values of each pixel point in the region of interest to a total number of pixel points in the region of interest; Determining a pixel point corresponding to the average value of each color channel as the feature center point.

6. The method according to claim 4, characterized in that, The color feature information includes color channel values, brightness channel values, hue channel values, and saturation channel values; the determining a color feature mask of the image to be processed according to the color feature information and a preset threshold includes: Determining a region with the largest blue channel value in the color channel values, or a region with the largest green channel value and a difference between the green channel value and the blue channel value being less than a preset color threshold as the channel feature mask; Determining a region with the brightness channel value greater than a preset brightness threshold as the brightness feature mask; Determining a region where a distance between the hue channel value and a target hue interval is less than a preset distance threshold as the hue feature mask; the target hue interval is a hue interval between cyan and blue; Determining a region with the saturation channel value less than a preset saturation threshold as the saturation feature mask.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Determining whether color correction processing needs to be performed on the image to be processed according to shooting metadata information of the image to be processed; In the case of determining that color correction processing needs to be performed on the to-be-processed image, perform the step of determining the feature center point of the region of interest in the to-be-processed image according to the color feature information of the to-be-processed image.

8. An image processing apparatus, characterized in that, The device includes: A first determination module, configured to determine the feature center point of the region of interest in the to-be-processed image according to the color feature information of the to-be-processed image; An acquisition module, configured to acquire the color correction weight map of the to-be-processed image according to the distance values between each pixel point of the to-be-processed image and the feature center point; A processing module, configured to perform weighted fusion processing on the to-be-processed image and the reference image of the to-be-processed image according to the color correction weight map, and acquire the color correction image of the to-be-processed image; color channel values of each pixel point in the reference image are the same.

9. An electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, characterized in that, When the computer program is executed by the processor, the processor is caused to execute the steps of the image processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Traffic signal lamp abnormal image generation method, model training method and electronic equipment

    CN121330646A