Image processing system
By optimizing brightness correction, level correction, color balance, and the Retinex algorithm, the negative impact of image brightness enhancement was resolved, achieving high-quality image processing under low-light conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN TCL CORP RES CO LTD
- Filing Date
- 2024-10-31
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies tend to introduce negative effects such as mosaic and water ripples in image brightness enhancement processing, making it difficult to effectively improve low-light image quality in night scene environments.
By acquiring the image information to be processed, brightness correction, level correction, color balance correction, and brightness enhancement are performed. A neural network model is used to identify the foreground and background regions. Different brightness and color enhancement coefficients are used, and the brightness information is optimized by combining the Retinex algorithm to achieve image brightness enhancement.
It effectively improves image brightness under low-light conditions, avoids mosaic and water ripple effects, enhances image clarity and contrast, and improves the viewing experience.
Smart Images

Figure CN121961944A_ABST
Abstract
Description
Image processing system Technical Field
[0001] This application relates to the field of computer technology, and more specifically to an image processing system. Background Technology
[0002] With the rapid development of digital imaging technology, people have increasingly higher requirements for image quality and processing effects. However, in digital image processing, how to better handle image brightness, especially enhancing the brightness of low-light images in night scenes, has always been an important direction for research and exploration. Current techniques for enhancing image brightness can have serious negative effects on the image, such as pixelation and water ripples. Therefore, this problem needs to be solved. Summary of the Invention
[0003] In a first aspect, this application provides an image processing method, the method comprising:
[0004] Obtain the image information to be processed;
[0005] The image information to be processed is calculated to obtain a first image pixel representation;
[0006] The target image information is determined based on the pixel representation of the first image.
[0007] Secondly, this application also provides an image processing system, the system comprising:
[0008] The acquisition module is used to acquire information about the image to be processed.
[0009] The processing module is used to perform calculations on the image information to be processed to obtain a first image pixel representation;
[0010] The processing module is also used to determine the target image information based on the pixel representation of the first image.
[0011] Thirdly, this application also provides a terminal device, the terminal device including a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor executing the computer program to implement the steps in any of the image processing methods described above.
[0012] Fourthly, this application also provides a computer-readable storage medium storing a computer program that is executed by a processor to implement the steps of any of the image processing methods described above. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 is a scene diagram of the image processing system provided in the embodiment of this application;
[0015] Figure 2 is a schematic flowchart of an embodiment of the image processing method in this application;
[0016] Figure 3 is a schematic diagram of a functional module of the image processing system in an embodiment of this application;
[0017] Figure 4 is a schematic diagram of the structure of the terminal device in an embodiment of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0020] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. Furthermore, it is understood that in the specific embodiments of this application, user information, user data, and other related data are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0021] To enable any person skilled in the art to implement and use this application, the following description is provided. In this description, details are set forth for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be implemented without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0022] This application provides an image processing method, system, device, and storage medium, which are described in detail below.
[0023] Please refer to Figure 1, which is a schematic diagram of an image processing system provided in an embodiment of this application. The image processing system may include a terminal device 100, which allows users to perform image processing. As shown in Figure 1, the user can obtain the image to be processed from a storage device connected to the terminal device 100 to execute the image processing method in this application.
[0024] In this embodiment of the application, the terminal device 100 may include, but is not limited to, desktop computers, portable computers, network servers, PDAs (personal digital assistants), tablet computers, wireless terminal devices, embedded devices, mobile phones, etc.
[0025] In the embodiments of this application, if the storage device is a cloud storage device, the terminal device 100 and the storage device can communicate through any communication method, including but not limited to mobile communication based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), and Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on the TCP / IP Protocol Suite (TCP / IP) and User Datagram Protocol (UDP).
[0026] It should be noted that the scene diagram of the image processing system shown in Figure 1 is merely an example. The image processing system and scene described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of image processing systems and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0027] As shown in Figure 2, Figure 2 is a schematic flowchart of an embodiment of the image processing method in this application. The image processing method may include the following steps 201 to 202:
[0028] 201. Obtain the image information to be processed.
[0029] In this embodiment of the application, the image information to be processed can be any type of image, such as an image in jpg format, an image in gif format, an image in psd format, etc., and the specific embodiment of the application is not limited.
[0030] 202. Perform calculations on the image information to be processed to obtain the first image pixel representation.
[0031] In practice, the image information to be processed can be a photograph taken by a user. To better display the information in the photograph, this application embodiment can perform brightness correction on the image to be processed, for example, by determining the foreground and background regions in the image information; and then identifying various objects, such as portraits and animals, from the foreground region. Afterwards, different brightness enhancement coefficients can be applied to the foreground region, background region, and objects in the foreground region to enhance and correct the image's brightness. Therefore, in this application embodiment, the first image pixel representation can be characterized as the brightness information of a pixel, such as the gamma value of each pixel. Alternatively, the first image pixel representation can also be characterized as the pixel value of each pixel. For example, after determining the pixel value of each pixel, to make the image appear warmer, different color enhancement coefficients can be applied to the foreground region, background region, and objects in the foreground region to make the image appear more vibrant. This includes: if the current pixel value corresponds to dark red, the pixel value corresponding to dark red can be adjusted to the pixel value corresponding to red using the color enhancement coefficient, making the image appear more vivid. Specifically, this application embodiment does not limit the first image pixel representation.
[0032] Furthermore, it should be noted that in the embodiments of this application, the background region, the foreground region, and the objects in the foreground region can be determined by a corresponding neural network model.
[0033] 203. Based on the pixel representation of the first image, the target image information is determined.
[0034] Based on this, when performing brightness correction processing on the image information to be processed, the brightness of the image information to be processed can be detected first. If the brightness value of the image information to be processed is less than the set brightness threshold parameter, then the image to be processed can be corrected. Therefore, the embodiments of this application can perform brightness correction processing on the image information to be processed with low brightness, avoiding the image being too dark and affecting the user's viewing experience. After processing the image according to the first image pixel representation, that is, the image whose brightness has been processed, the target image information can be obtained.
[0035] To better implement the embodiments of this application, in one embodiment, the image information to be processed is corrected to obtain target image information, including:
[0036] The image information to be processed is subjected to level correction processing to obtain first processed image information; the first processed image information is subjected to balance correction processing to obtain second processed image information; based on the second processed image information, first brightness information and second brightness information are determined; based on the first brightness information and second brightness information, target image information is obtained.
[0037] The above embodiments provide a scheme for brightness correction of images. This application also provides an image correction scheme. In practical applications, abnormal pixels on camera sensors caused by hardware defects or damage due to manufacturing defects are called bad pixels. Therefore, when correcting images, bad pixels can be corrected first.
[0038] In this embodiment, "level" refers to the strength or amplitude of an electrical signal, typically used to describe the magnitude of parameters such as voltage, current, or power. In video signals, level represents the intensity of image brightness and color information, affecting image clarity and contrast. Therefore, in this embodiment, level correction processing is the process of correcting abnormal levels. Specifically, when performing bad pixel correction on the image to be processed, level detection can be performed on each pixel first. If there are pixels with abnormal level values, such as a pixel whose level value is much lower than a set value, the level value can be enhanced to remove the bad pixel. By enhancing the level value, the first processed image information can be obtained.
[0039] Subsequently, to prevent the enhanced image from appearing washed out, color balance correction can be performed on the first processed image after acquiring the first processed image information, i.e., before brightness enhancement, according to this embodiment. For example, color balance correction can be performed by enhancing the contrast of the first processed image information; specific embodiments of this application are not limited to this.
[0040] Once the second processed image information with enhanced color is obtained, the brightness of the image can be enhanced. The colors in the image data are arranged in a specific color order, such as clockwise RGBG format. Therefore, the G component in the image data will be twice as many as the R and B components. Here, one set of G components is denoted as G1, and the other as G2. The RG1B set of data is converted to generate Y1U1V1, and the RG2B set of data is converted to generate Y2U2V2, thus obtaining the first and second brightness information.
[0041] Finally, once the first brightness information and the second brightness information are obtained, an average brightness information can be determined based on the two brightness information, and the brightness enhancement coefficient of the average brightness information can be calculated. Then, based on the brightness enhancement coefficient, the brightness enhancement of the second processed image information can be completed, thereby obtaining the target image information.
[0042] It should be noted that the brightness enhancement coefficient can be set according to the actual situation, and the specific embodiments of this application are not limited.
[0043] To better implement the embodiments of this application, in one embodiment, the image information to be processed is subjected to level correction processing to obtain first processed image information, including:
[0044] The image information to be processed is subjected to a first level correction process to obtain candidate first processed image information; the candidate first processed image information is subjected to a second level correction process to obtain first processed image information.
[0045] The above embodiments provide a level correction scheme. However, due to some characteristics of the sensor itself, such as electronic noise and offset, the black level may not be truly zero. Therefore, to ensure image accuracy and contrast, black level correction is necessary. Thus, after completing level correction according to the above embodiments and obtaining the first processed image information, this first processed image information can be considered as candidate first processed image information. Then, black level correction is performed on this candidate first processed image information.
[0046] In this embodiment of the application, the scheme for performing black level correction may include, assuming that the black level correction value obtained on the display panel is 64, subtracting 64 from each level value in the candidate first processed image information after bad pixel correction to obtain the first processed image information.
[0047] To better implement the embodiments of this application, in one embodiment, a first level correction process is performed on the image information to be processed to obtain candidate first processed image information, including:
[0048] Taking each pixel in the image information to be processed as the first target pixel, the first target pixel value is compared with the corresponding neighboring pixel values of the adjacent array of the first target pixel to obtain the pixel value difference between the first target pixel value and each neighboring pixel value; the pixel value difference is compared with the first target pixel value to obtain comparison result information; if the comparison result information indicates that the first target pixel needs to undergo level correction processing, then the largest pixel value among each neighboring pixel value is determined as the pixel value of the first target pixel to obtain candidate first processed image information.
[0049] The above embodiments provide a scheme for performing a first level correction on the image to be processed to obtain candidate first processed image information. In this application embodiment, a scheme for performing the first level correction is also provided.
[0050] First, the pixels in the display device are arranged in a square array, and each pixel has specific positional information within the array. For example, the eight positions of a pixel—top left, front, top right, left, right, bottom left, back, and bottom right—form its adjacent array. Specifically, each pixel in the image information to be processed is taken as the first target pixel. The pixel values of the eight pixels adjacent to the first target pixel in the same filter array are compared with the pixel value of the first target pixel. For example, the average pixel value of the eight adjacent pixels can be calculated first, and then the pixel value of the first target pixel is compared with this average pixel value. If the difference between the two is greater than or equal to the target pixel difference, then the pixel value of the first target pixel is replaced by the largest pixel value among the eight pixels. The target pixel difference can be 80, or other values, which can be set according to the actual situation. This application embodiment does not limit this.
[0051] To better implement the embodiments of this application, in one embodiment, the candidate first processed image information is subjected to a second level correction process to obtain the first processed image information, including:
[0052] Subtract the correction pixel value from the pixel value corresponding to each pixel in the candidate first processed image information to obtain candidate image information; determine the second target pixel from the candidate image information; update the second target pixel value corresponding to the second target pixel in the candidate image information, and determine the updated candidate image information as the first processed image information.
[0053] The above embodiments provide a black level correction method, namely a second level correction processing method. In this embodiment, to further improve the black level correction effect, pixels with pixel values less than 0 can be selected, namely second target pixels. After selecting second target pixels with pixel values less than 0, the pixel values of the pixels with pixel values less than 0 can be set to 0, that is, the second target pixel value corresponding to the second target pixel is updated to 0. At this time, black level correction can be completed, and the final first processed image information is obtained.
[0054] To better implement the embodiments of this application, in one embodiment, the image information to be processed includes first color component information and second color component information. The first processed image information is subjected to balance correction processing to obtain the second processed image information, including:
[0055] Obtain a first balance correction factor and a second balance correction factor; based on the first balance correction factor and the second balance correction factor, perform correction processing on the first color component information and the second color component information respectively to obtain the second processed image information.
[0056] The above embodiments provide a balance correction scheme, and this application also provides other balance correction schemes. Specifically, since image information is usually an RGB image, the R and B components in the image can be enhanced, specifically by obtaining the enhancement coefficients of the R component and the B component. Then, the first processed image information is balanced using these two enhancement coefficients to obtain the second processed image information.
[0057] It should be noted that the first balance correction factor and the second balance correction factor in this application embodiment can be understood as the aforementioned enhancement coefficients, i.e., pre-set coefficient values, such as those set at the factory by relevant personnel and configured in the program. When balance correction is required, the pre-set enhancement coefficients are invoked, and the first and second balance correction factors are multiplied by the corresponding color components. The enhancement coefficients for the R component and the B component can be set according to actual conditions; for example, coefficients greater than 1 are acceptable. Specific embodiments in this application do not impose limitations.
[0058] To better implement the embodiments of this application, in one embodiment, the first image pixel representation includes a first feature information representation and a second feature information representation; the image to be processed also includes third color component information; the image to be processed is calculated to obtain the first image pixel representation, including:
[0059] Based on the third color component information, determine the first component information and the second component information of the third color component; convert the first component information and the second component information into first target format information and second target format information respectively; determine the first feature information representation based on the luminance component in the first target format information and the second target format information; determine the second feature information representation based on the target luminance component in the first target format information and the second target format information.
[0060] The above embodiments provide a scheme for determining first luminance information and second luminance information. This application also provides a scheme for determining first luminance information and second luminance information. Specifically, according to the above embodiments, the RG1B group, i.e., the first component information, can be converted into Y1U1V1, and the RG2B group, the second component information, can be converted into Y2U2V2. Therefore, the G component is the third color component, Y1U1V1 is the first target format information, and Y2U2V2 is the second target format information. At this time, Y1Y2 is the combined luminance component, and this combined luminance component is the first luminance information. Furthermore, the maximum value of Y1 and Y2 is taken to obtain the total luminance component Y as the second luminance information. It should be noted that in any embodiment of this application, the first luminance information is equivalent to the representation of the first feature information, and the second luminance information is equivalent to the representation of the second feature information.
[0061] As described above, the format information conversion involves converting an RGB image to a YUV image. Therefore, it can be understood that in this embodiment, the format information refers to the image's format information. Furthermore, the conversion method for transforming an RGB image to a YUV image can refer to any technique, and this embodiment does not limit the scope of the conversion.
[0062] To better implement the embodiments of this application, in one embodiment, target image information is determined based on the first image pixel representation, including:
[0063] Based on the first image pixel representation, an image illumination representation is determined; based on the image illumination representation, a second image pixel representation is determined; based on the image illumination representation, the first image pixel representation, and the second image pixel representation, target image information is determined.
[0064] The above embodiments provide a scheme for enhancing the brightness of an image based on first brightness information and second brightness information. In this embodiment, the first image pixel representation can characterize the brightness information of image pixels; therefore, it can be understood that the first image pixel representation includes the first brightness information and the second brightness information described in the above embodiments. Furthermore, it should be noted that the image illuminance representation characterizes the illuminance map of an image, and the illuminance map is a diagram used to represent the distribution of light intensity in a specific area or surface. It is usually displayed in the form of a two-dimensional graphic, showing the illuminance (light intensity) values at different locations. Therefore, after knowing the first image pixel representation of the image, the brightness information included in the first image pixel representation can be directly converted into the image illuminance representation according to the arrangement. For example, the overall brightness information of the image can be set as a candidate estimate of the illuminance map, the candidate estimate can be stretched to match the true brightness seen by the human eye, and finally the illuminance map can be obtained using the Retinex algorithm.
[0065] After calculating the illuminance map, the brightness information can be optimized. Specifically, the brightness can be corrected based on the darker areas in the illuminance map to obtain optimized brightness information. This optimized brightness information can be understood as the second image pixel representation in this embodiment.
[0066] At the same time, after the illuminance map is calculated, the locations with smaller illuminance values in the image can be identified and marked as dark areas, i.e., target area information.
[0067] In addition, an enhancement coefficient range can be set to optimize the brightness of darker areas. For example, each enhancement coefficient can be obtained through iteration, and then the brightness of the dark areas can be increased based on each enhancement coefficient, resulting in multiple brightness-enhanced results. At this point, a suitable result can be determined from these results. For example, the result that does not result in overexposure after brightness enhancement can be selected. The enhancement coefficient corresponding to the result that does not result in overexposure is then used as the target enhancement factor. Overexposure refers to excessive exposure in photography or video recording, causing the loss of detail in bright areas of the image, resulting in a pure white or extremely bright effect.
[0068] Finally, the target enhancement factor is multiplied by the illuminance in the illuminance map to obtain the actual illuminance map. Based on the illuminance in the illuminance map, the brightness of the image to be processed can be enhanced.
[0069] To better implement the embodiments of this application, in one embodiment, the first image pixel representation includes a second feature information representation; based on the first image pixel representation, an image illumination representation is determined, including:
[0070] Based on the second feature information, candidate illuminance information is determined; the candidate illuminance information is downsampled to obtain downsampled image information; the downsampled image information is scaled to obtain scaled image information; and the scaled image information is upsampled to obtain the image illuminance representation.
[0071] The above embodiments provide a scheme for obtaining an illuminance map using the Retinex algorithm. Specifically, this application also provides a method for calculating an illuminance map. Specifically, the candidate illuminance map estimate obtained based on the second luminance information can be used as candidate illuminance information. Then, to accelerate the calculation, the candidate illuminance map estimate is downsampled by a factor of 8, which is equivalent to the downsampling processing in this application embodiment. Then, to match the actual luminance seen by the human eye, the downsampled data is multiplied by 4 and stretched, which is equivalent to the scaling processing in this application. Finally, the illuminance map is obtained using the Retinex algorithm, which is equivalent to the candidate illuminance information in this application. Finally, the candidate illuminance information is upsampled by a factor of 8 to obtain the final illuminance map.
[0072] It should be noted that, in the embodiments of this application, illuminance information refers to the luminous flux received by the image per unit area. It measures the degree of illumination of a surface area by a light source and is a measure of light intensity. Illuminance is usually expressed in "lux" (symbol lx), where 1 lux equals 1 lumen per square meter.
[0073] Furthermore, after obtaining the illuminance map, areas with values less than 0.5 can be marked as dark areas. The specific values can be defined according to the situation, and this embodiment does not impose any limitations.
[0074] To better implement the embodiments of this application, in one embodiment, determining the target enhancement factor based on the first brightness information and the target area information includes:
[0075] Obtain the enhancement factor interval; determine the corresponding enhancement result information for each enhancement factor in the enhancement factor interval that enhances the first brightness information; determine the target entropy of each enhancement result information at the corresponding position of the target region information; determine the enhancement factor corresponding to the target candidate entropy value in each target entropy as the target enhancement factor.
[0076] The above embodiments provide a scheme for determining the target enhancement factor. In this application embodiment, another scheme for determining the target enhancement factor is provided. Specifically, the target enhancement factor range can be set to [1, 7], where a larger value results in greater image brightening, and 1 represents no image brightening.
[0077] Calculate the entropy of each enhanced combined luminance component, where the k corresponding to the maximum entropy is the optimal enhancement coefficient required. In this embodiment, to accelerate computation, the combined luminance component is reduced to a size of 50*50. Then, the data at the same position in the two channels of the combined luminance component are multiplied and squared, compressed into one channel. Similarly, to match the true luminance seen by the human eye, all values are multiplied by 4 and stretched. Next, by traversing the enhancement coefficient interval, each enhancement coefficient k is processed by the following brightening algorithm G(X, k) to obtain an enhancement result G. The histogram B corresponding to the dark area position in G is calculated, and then the entropy value is calculated using the following formula E(B). Finally, the entropy corresponding to all enhancement coefficients is compared, and the enhancement coefficient with the highest entropy is the optimal enhancement coefficient. As shown in formula (1):
[0078] (1):
[0079]
[0080] Where X is the input data, k is the enhancement coefficient, α = -0.3293, b = 1.1258, N is the number of histograms (256), and p i It represents the percentage of each interval in the histogram.
[0081] To better implement the embodiments of this application, in one embodiment, target image information is obtained based on the target enhancement factor and illumination information, including:
[0082] Based on the target enhancement factor, the third brightness information is determined; the first brightness information and the third brightness information are fused based on the illuminance information to obtain the target fusion information; based on the target fusion information, the target image information is obtained.
[0083] In this embodiment, the enhanced combined brightness component, i.e., the third brightness information, can be obtained by using a brightening algorithm based on the target enhancement factor and the first brightness information. Then, the third brightness information can be fused with the first brightness information to obtain fused brightness information. Specifically, the illuminance map can be considered as a candidate fusion weight map. Based on this candidate fusion weight map, a linear fusion method is used to fuse the first brightness information and the third brightness information to obtain the target fusion information. Afterward, the contrast of the image to be processed is adjusted based on the target fusion information to obtain the target image information. Here, contrast is defined as the measurement of different brightness levels between the brightest white and the darkest black in an image; a larger difference range indicates greater contrast, and a smaller difference range indicates less contrast.
[0084] To better implement the embodiments of this application, in one embodiment, the first luminance information and the third luminance information are fused based on illuminance information to obtain target fused information, including:
[0085] The contrast information is filtered to obtain candidate fused image information; the fusion weights of each image region in the candidate fused image information are adjusted to obtain target fused image information; the first brightness information and the third brightness information are fused according to the target fused image information to obtain target fused information.
[0086] This application provides a specific scheme for obtaining target fusion information. For example, the intensity of the candidate fusion weight map can be adjusted by an exponential operation, with the exponent coefficient set to 0.25. A larger exponent coefficient indicates a greater enhancement intensity. Next, the illumination map is smoothed by performing fast guided filtering with the total luminance component. While smoothing the illumination map, the human image region can be obtained through human image segmentation technology. The candidate fusion weight map value of the human image region is reduced by a factor of 0.8 to prevent over-enhancement of the human image. Finally, based on the adjusted fusion weights and the filtered candidate fusion image information, the first luminance information and the third luminance information are linearly fused.
[0087] To better implement the embodiments of this application, in one embodiment, target image information is obtained based on target fusion information, including:
[0088] The target fusion information is locally contrast adjusted to obtain local contrast information; reconstruction processing is performed based on the local contrast information to obtain candidate enhanced image information; global contrast adjustment is performed on the candidate enhanced image information to obtain the target image information.
[0089] This application also provides a scheme for obtaining target image information based on target fusion information. Specifically, the target fusion information is locally contrast adjusted to obtain local contrast information, which can be calculated using formula (2), as shown below:
[0090] (2):
[0091]
[0092] In formula (2), X is the target fusion information after fusion; T is the total luminance component, i.e., the second luminance component; F is the fast guided filtering algorithm; α is the enhancement coefficient set to 1.0; S and L are the radii of the fast guided filtering, where S is smaller than L. In this embodiment, S can be set to 5 and L to 11. Of course, the parameters can also be customized according to the local contrast effect requirements, where the units of S and L are the number of pixels. It can be seen that in this embodiment, "local" in local contrast adjustment refers to the image area where the contrast is adjusted, and the size of the local area to be adjusted is obtained from S and L. When local contrast adjustment is required, the entire image is divided into multiple sub-regions according to the image area formed by S and L, and the contrast of multiple sub-regions is adjusted.
[0093] Furthermore, the reconstruction process can obtain candidate enhanced image information by inverting local contrast information. In this embodiment, the reconstruction process can be a process of converting YUV back to RGBG based on the inversion operation of RGBG to YUV. For example, the original image can be an RGBG format image, which is converted to Y1U1V1 and Y2U2V2, then subjected to a series of operations and enhancements, and finally converted back to RGBG format.
[0094] Finally, global contrast adjustment is performed on the candidate enhanced image information, and the target image information can be calculated using formula (3), which is shown below:
[0095] (3):
[0096]
[0097] In formula (3), X represents the candidate enhanced image information, M represents half of the maximum bit depth value in the candidate enhanced image information, and C represents the global contrast enhancement coefficient, for example, 30. In this embodiment, the parameters can also be customized according to the global contrast effect requirements. Based on this, after adjusting the local contrast of the image, the above formula is the process of adjusting the global contrast after adjusting the local contrast. Substituting X obtained from the local contrast into the above formula (3), the image with global contrast adjustment can be obtained by iteration.
[0098] To better implement the image processing method in the embodiments of this application, an image processing system is also provided in the embodiments of this application, as shown in FIG3. The system 300 includes:
[0099] The acquisition module 301 is used to acquire image information to be processed;
[0100] Processing module 302 is used to perform calculations on the image information to be processed to obtain a first image pixel representation;
[0101] The processing module is also used to determine the target image information based on the pixel representation of the first image.
[0102] The image processing system provided in this application can acquire image information to be processed through the acquisition module 301, and then the processing module 302 can correct parameters such as brightness and contrast of the image information to be processed, thereby improving the display effect of the image.
[0103] In some embodiments of this application, the acquisition module 301 is specifically used for:
[0104] Obtain candidate image information;
[0105] The candidate image information is subjected to level correction processing to obtain the first processed image information;
[0106] The first image information is subjected to balance correction to obtain the image information to be processed.
[0107] In some embodiments of this application, the processing module 302 is specifically used for:
[0108] The candidate image information is subjected to a first level correction process to obtain the candidate first processed image information;
[0109] The candidate first processed image information is subjected to second level correction processing to obtain the first processed image information.
[0110] In some embodiments of this application, the processing module 302 is further configured to:
[0111] Taking each pixel in the candidate image information as the first target pixel, the first target pixel value of the first target pixel is compared with the adjacent pixel values of the pixels in the adjacent array of the first target pixel to obtain the pixel value difference between the first target pixel value and each adjacent pixel value.
[0112] The difference between each pixel value is compared with the value of the first target pixel to obtain the comparison result information;
[0113] If the comparison result indicates that the difference between the first target pixel value and the difference between each pixel value is less than the target threshold, then the largest pixel value among all adjacent pixel values is determined as the pixel value of the first target pixel, and candidate first processed image information is obtained.
[0114] In some embodiments of this application, the processing module 302 is further configured to:
[0115] Subtract the correction pixel value from the pixel value corresponding to each pixel in the candidate first processed image information to obtain the candidate image information;
[0116] Determine the second target pixel from the candidate image information;
[0117] The value of the second target pixel corresponding to the second target pixel in the candidate image information is updated, and the updated candidate image information is determined as the first processed image information.
[0118] In some embodiments of this application, the candidate image information includes first color component information and second color component information, and the processing module 302 is further used for:
[0119] Obtain the first balance correction factor and the second balance correction factor;
[0120] Based on the first balance correction factor and the second balance correction factor, the first color component information and the second color component information are corrected respectively to obtain the image information to be processed.
[0121] In some embodiments of this application, the first image pixel representation includes a first feature information representation and a second feature information representation; the image to be processed also includes third color component information; the processing module 302 is further specifically used for:
[0122] Based on the third color component information, determine the first component information and the second component information of the third color component;
[0123] The first component information and the second component information are respectively converted into first target format information and second target format information;
[0124] The first feature information representation is determined based on the first target format information and the luminance component in the second target format information;
[0125] The second feature information representation is determined based on the target brightness component in the first target format information and the second target format information.
[0126] In some embodiments of this application, the processing module 302 is further configured to:
[0127] Based on the pixel representation of the first image, the image illumination representation is determined;
[0128] The second image pixel representation is determined based on the image illumination representation;
[0129] The target image information is determined based on the image illumination representation, the first image pixel representation, and the second image pixel representation.
[0130] In some embodiments of this application, the first image pixel representation includes a second feature information representation; the processing module 302 is further specifically used for:
[0131] Based on the second feature information, candidate illuminance information is determined;
[0132] The candidate illumination information is downsampled to obtain downsampled image information;
[0133] The downsampled image information is scaled to obtain scaled image information;
[0134] Upsampling is performed on the scaled image information to obtain an image illumination representation.
[0135] In some embodiments of this application, the first image pixel representation includes a first feature information representation; the processing module 302 is further specifically used for:
[0136] Obtain the illuminance value corresponding to each location point in the image illuminance representation;
[0137] The location points corresponding to illuminance values that are less than the target illuminance threshold are identified as target area information.
[0138] Based on the target region information and the first feature information, the target enhancement factor is determined;
[0139] The second image pixel representation is determined based on the target enhancement factor.
[0140] In some embodiments of this application, the processing module 302 is further configured to:
[0141] Obtain the enhancement factor interval;
[0142] Determine the corresponding enhancement result information for each enhancement factor in the enhancement factor interval to enhance the representation of the first feature information;
[0143] Determine the target entropy of each enhancement result information at the corresponding location in the target region information;
[0144] The enhancement factor corresponding to the candidate entropy value of each target entropy is determined as the target enhancement factor.
[0145] In some embodiments of this application, the first image pixel representation includes a first feature information representation; the processing module 302 is further specifically used for:
[0146] Based on the image illumination representation, the first feature information representation and the second image pixel representation are fused to obtain the target fusion information;
[0147] Target image information is obtained based on target fusion information.
[0148] In some embodiments of this application, the processing module 302 is further configured to:
[0149] The image illumination representation is filtered to obtain the image information to be fused;
[0150] Adjust the fusion weights of each image region in the image information to be fused to obtain the target image information to be fused;
[0151] Based on the target image information to be fused, the first feature information representation and the second image pixel representation are fused to obtain the target fusion information.
[0152] In some embodiments of this application, the processing module 302 is further configured to:
[0153] Local contrast information is obtained by adjusting the local contrast of the target fusion information;
[0154] Reconstruction is performed based on local contrast information to obtain candidate enhanced image information;
[0155] Global contrast adjustment is performed on the candidate enhanced image information to obtain the target image information.
[0156] This application also provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the steps of the image processing method according to any one of the embodiments of this application. This terminal device integrates any one of the image processing methods provided in the embodiments of this application. As shown in Figure 4, which illustrates a schematic diagram of the structure of the terminal device involved in the embodiments of this application, specifically:
[0157] The terminal device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that the terminal device structure shown in FIG4 does not constitute a limitation on the terminal device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0158] The processor 401 is the control center of the terminal device. It connects various parts of the terminal device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402, thereby providing overall monitoring of the terminal device. Optionally, the processor 401 may include one or more processing cores; the processor 401 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. Preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and application programs, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may not be integrated into the processor 401.
[0159] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0160] The terminal device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0161] The terminal device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0162] Although not shown, the terminal device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the terminal device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, such as:
[0163] Obtain the image information to be processed;
[0164] The image information to be processed is calculated to obtain the first image pixel representation;
[0165] The target image information is determined based on the pixel representation of the first image.
[0166] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0167] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the image processing methods provided in embodiments of this application. For example, the computer program loaded by the processor can execute the following steps:
[0168] Obtain the image information to be processed;
[0169] The image information to be processed is calculated to obtain the first image pixel representation;
[0170] The target image information is determined based on the pixel representation of the first image.
[0171] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0172] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0173] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0174] The above provides a detailed description of an image processing method and system provided by the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method, characterized in that, The method includes: acquiring image information to be processed; performing calculations on the image information to be processed to obtain a first image pixel representation; and determining target image information based on the first image pixel representation.
2. The method according to claim 1, characterized in that, The step of obtaining the image information to be processed includes: obtaining candidate image information; performing level correction processing on the candidate image information to obtain first processed image information; and performing balance correction processing on the first processed image information to obtain the image information to be processed.
3. The method according to claim 2, characterized in that, The step of performing level correction processing on the candidate image information to obtain first processed image information includes: performing first level correction processing on the candidate image information to obtain candidate first processed image information; and performing second level correction processing on the candidate first processed image information to obtain first processed image information.
4. The method according to claim 3, characterized in that, The step of performing a first level correction process on the candidate image information to obtain candidate first processed image information includes: taking each pixel in the candidate image information as a first target pixel, comparing the first target pixel value of the first target pixel with the adjacent pixel values of the pixels in the adjacent array of the first target pixel to obtain the pixel value difference between the first target pixel value and each of the adjacent pixel values; comparing each of the pixel value differences with the first target pixel value to obtain comparison result information; if the comparison result information indicates that the difference between the first target pixel value and each of the pixel value differences is less than a target threshold, then determining the largest pixel value among the adjacent pixel values as the pixel value of the first target pixel to obtain candidate first processed image information.
5. The method according to claim 3, characterized in that, The step of performing a second level correction process on the candidate first processed image information to obtain the first processed image information includes: subtracting the correction pixel value from the pixel value corresponding to each pixel point in the candidate first processed image information to obtain candidate image information; determining a second target pixel point from the candidate image information; updating the second target pixel value corresponding to the second target pixel point in the candidate image information; and determining the updated candidate image information as the first processed image information.
6. The method according to claim 2, characterized in that, The candidate image information includes first color component information and second color component information. The step of performing balance correction processing on the first processed image information to obtain the image information to be processed includes: obtaining a first balance correction factor and a second balance correction factor; and performing correction processing on the first color component information and the second color component information according to the first balance correction factor and the second balance correction factor to obtain the image information to be processed.
7. The method according to claim 1, characterized in that, The first image pixel representation includes a first feature information representation and a second feature information representation; The image to be processed further includes third color component information; the step of calculating and processing the image information to obtain a first image pixel representation includes: determining first component information and second component information of the third color component based on the third color component information; converting the first component information and the second component information into first target format information and second target format information, respectively; determining a first feature information representation based on the luminance component in the first target format information and the second target format information; and determining a second feature information representation based on the target luminance component in the first target format information and the second target format information.
8. The method according to claim 1, characterized in that, The step of determining the target image information based on the first image pixel representation includes: determining an image illumination representation based on the first image pixel representation; determining a second image pixel representation based on the image illumination representation; and determining the target image information based on the image illumination representation, the first image pixel representation, and the second image pixel representation.
9. The method according to claim 8, characterized in that, The first image pixel representation includes a second feature information representation; determining the image illumination representation based on the first image pixel representation includes: determining candidate illumination information according to the second feature information representation; performing downsampling processing on the candidate illumination information to obtain downsampled image information; performing scaling processing on the downsampled image information to obtain scaled image information; and performing upsampling processing on the scaled image information to obtain the image illumination representation.
10. The method according to claim 9, characterized in that, The first image pixel representation includes a first feature information representation; The step of determining the second image pixel representation based on the image illumination representation includes: obtaining the illumination value corresponding to each location point in the image illumination representation; determining the location points corresponding to illumination values less than the target illumination threshold as target region information; determining the target enhancement factor based on the target region information and the first feature information representation; and determining the second image pixel representation based on the target enhancement factor.
11. The method according to claim 10, characterized in that, The step of determining the target enhancement factor based on the target region information and the first feature information representation includes: obtaining an enhancement factor interval; determining the corresponding enhancement result information for each enhancement factor in the enhancement factor interval that enhances the first feature information representation; determining the target entropy of each enhancement result information at the position corresponding to the target region information; and determining the enhancement factor corresponding to the target candidate entropy value in each target entropy as the target enhancement factor.
12. The method according to claim 8, characterized in that, The first image pixel representation includes a first feature information representation; Determining target image information based on the image illumination representation, the first image pixel representation, and the second image pixel representation includes: fusing the first feature information representation and the second image pixel representation based on the image illumination representation to obtain target fusion information; Based on the target fusion information, target image information is obtained.
13. The method according to claim 12, characterized in that, The step of fusing the first feature information representation and the second image pixel representation based on the image illumination representation to obtain target fusion information includes: filtering the image illumination representation to obtain image information to be fused; adjusting the fusion weights of each image region in the image information to be fused to obtain target image information to be fused; and fusing the first feature information representation and the second image pixel representation according to the target image information to be fused to obtain target fusion information.
14. The method according to claim 13, characterized in that, The step of obtaining target image information based on the target fusion information includes: adjusting the local contrast of the target fusion information to obtain local contrast information; performing reconstruction processing based on the local contrast information to obtain candidate enhanced image information; and adjusting the global contrast of the candidate enhanced image information to obtain target image information.
15. A system, characterized in that, The system includes: an acquisition module for acquiring image information to be processed; a processing module for performing calculations on the image information to be processed to obtain a first image pixel representation; the processing module is further configured to determine target image information based on the first image pixel representation; optionally, the acquisition module acquiring the image information to be processed includes: acquiring candidate image information; performing level correction processing on the candidate image information to obtain first processed image information; performing balance correction processing on the first processed image information to obtain the image information to be processed; optionally, the processing module performing level correction processing on the candidate image information to obtain the first processed image information includes: performing level correction processing on the candidate image information... A first level correction process is performed to obtain candidate first processed image information; a second level correction process is then performed on the candidate first processed image information to obtain first processed image information; optionally, the processing module performs the first level correction process on the candidate image information to obtain candidate first processed image information, including: taking each pixel in the candidate image information as a first target pixel, comparing the first target pixel value of the first target pixel with the adjacent pixel values corresponding to the pixels in the adjacent array of the first target pixel to obtain the pixel value difference between the first target pixel value and each of the adjacent pixel values; comparing each of the pixel value differences with the first target pixel value to obtain comparison result information; If the comparison result information indicates that the difference between the first target pixel value and the differences between each of the pixel values is less than the target threshold, then the largest pixel value among the adjacent pixel values is determined as the pixel value of the first target pixel, thus obtaining candidate first processed image information; optionally, the processing module performs a second level correction processing on the candidate first processed image information to obtain first processed image information, including: subtracting the correction pixel value from the pixel value corresponding to each pixel in the candidate first processed image information to obtain candidate image information; determining a second target pixel from the candidate image information; updating the second target pixel value corresponding to the second target pixel in the candidate image information, and updating the value of the second target pixel. The candidate image information is determined as the first processed image information; optionally, the candidate image information includes first color component information and second color component information, and the processing module performs balance correction processing on the first processed image information to obtain the image information to be processed, including: obtaining a first balance correction factor and a second balance correction factor; and performing correction processing on the first color component information and the second color component information according to the first balance correction factor and the second balance correction factor to obtain the image information to be processed; optionally, the first image pixel representation includes a first feature information representation and a second feature information representation; the image to be processed also includes third color component information;The processing module performs calculations on the image information to be processed to obtain a first image pixel representation, including: determining the first component information and the second component information of the third color component based on the third color component information; converting the first component information and the second component information into first target format information and second target format information, respectively; determining a first feature information representation based on the luminance component in the first target format information and the second target format information; and determining a second feature information representation based on the target luminance component in the first target format information and the second target format information. Optionally, the processing module determines the target image information based on the first image pixel representation, including: Based on the first image pixel representation, an image illumination representation is determined; based on the image illumination representation, a second image pixel representation is determined; based on the image illumination representation, the first image pixel representation, and the second image pixel representation, target image information is determined; optionally, the first image pixel representation of the processing module includes a second feature information representation; determining the image illumination representation based on the first image pixel representation includes: determining candidate illumination information according to the second feature information representation; performing downsampling processing on the candidate illumination information to obtain downsampled image information; performing scaling processing on the downsampled image information to obtain scaled image information; performing upsampling processing on the scaled image information to obtain... The first image pixel representation includes a first feature information representation. The processing module determines a second image pixel representation based on the image illumination representation, including: acquiring the illumination value corresponding to each location point in the image illumination representation; determining the location points among the illumination values that are less than a target illumination threshold as target region information; determining a target enhancement factor based on the target region information and the first feature information representation; and determining a second image pixel representation based on the target enhancement factor. Optionally, the processing module determines a target enhancement factor based on the target region information and the first feature information representation, including: acquiring an enhancement factor interval; and determining the enhancement factor. The enhancement result information corresponding to the enhancement of the first feature information representation by each enhancement factor in the interval; the target entropy of each enhancement result information at the corresponding position in the target region information; the enhancement factor corresponding to the target candidate entropy value in each target entropy is determined as the target enhancement factor; optionally, the first image pixel representation includes the first feature information representation; the processing module determines the target image information based on the image illumination representation, the first image pixel representation, and the second image pixel representation, including: fusing the first feature information representation and the second image pixel representation based on the image illumination representation to obtain target fusion information; and obtaining the target image information according to the target fusion information;Optionally, the processing module fuses the first feature information representation and the second image pixel representation based on the image illumination representation to obtain target fusion information, including: filtering the image illumination representation to obtain image information to be fused; adjusting the fusion weights of each image region in the image information to be fused to obtain target image information to be fused; and fusing the first feature information representation and the second image pixel representation according to the target image information to be fused to obtain target fusion information. Optionally, the processing module obtains target image information based on the target fusion information, including: adjusting the local contrast of the target fusion information to obtain local contrast information; performing reconstruction processing based on the local contrast information to obtain candidate enhanced image information; and adjusting the global contrast of the candidate enhanced image information to obtain target image information.
16. A terminal device, characterized in that, The terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to perform the steps of the method according to any one of claims 1 to 14.