Image processing method, electronic equipment and computer readable storage medium

By detecting and correcting the colors of dark pixels in the 3D game scene image, the problem of low object recognition is solved, the game experience is improved, and the risks of terminal equipment heating and game account ban are avoided.

CN120114829APending Publication Date: 2025-06-10ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311690540.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

When optimizing 3D game scenes, the prior art fails to effectively solve the problem of low object recognition caused by dark parts of the image, and may lead to the risk of terminal equipment being hot and game account bans.

Method used

By detecting whether the grayscale value of each pixel point in the image output by the target application is within the preset range, if so, the color of the pixel point is corrected according to the correction color determination rule corresponding to the grayscale value, and the color brightening is achieved.

Benefits of technology

It improves the recognition of dark objects in the image, improves players' recognition ability of dark scene objects, improves the gaming experience, and avoids the risks of terminal devices getting hot and game account bans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120114829A_ABST
    Figure CN120114829A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method, electronic equipment and a computer readable storage medium. The image processing method comprises the steps of obtaining an image output by a target application when it is detected that a preset key is triggered; obtaining the original color of each pixel point in the image; obtaining a gray value corresponding to the original color of each pixel point; detecting whether the gray value is within a first preset range; and when the gray value is within the first preset range, correcting the original color of the pixel point corresponding to the gray value according to a correction color determination rule corresponding to a second preset range satisfied by the gray value. According to the scheme of the embodiment, the color of the dark pixel point can be brightened, the problem that the object identification degree in the dark part of the image synthesized by the target application is not high is solved, and the hot phenomenon of terminal equipment and the risk of game number sealing can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and particularly to an image processing method, an electronic device, and a computer-readable storage medium. Background Art

[0002] Currently, for the optimization of 3D game scenes in an app, the main calculations are for the rendering color tone, saturation, and clarity of pixels, without addressing from the user's perspective the problem that the synthesized images in the game scene have dark areas, resulting in low object recognition. Summary of the Invention

[0003] Embodiments of the present disclosure provide an image processing method, an electronic device, and a computer-readable storage medium.

[0004] In a first aspect, embodiments of the present disclosure provide an image processing method, which may include:

[0005] When it is detected that a preset key is triggered, obtain an image output by a target application;

[0006] Obtain the original color of each pixel point in the image;

[0007] Obtain the gray value corresponding to the original color of each pixel point;

[0008] Detect whether the gray value is within a first preset range;

[0009] When the gray value is within the first preset range, correct the original color of the pixel point corresponding to the gray value according to the correction color determination rule corresponding to the second preset range satisfied by the gray value.

[0010] In a second aspect, embodiments of the present disclosure provide an electronic device, which includes:

[0011] One or more processors;

[0012] A memory having one or more programs stored thereon, and when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method;

[0013] One or more input / output I / O interfaces connected between the processor and the memory and configured to implement information interaction between the processor and the memory.

[0014] In a third aspect, embodiments of the present disclosure provide a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the image processing method is implemented.

[0015] In an embodiment of the present disclosure, an image output by a target application is obtained, and whether the color of any pixel point in the image is too dark is determined according to whether the gray value of the color of any pixel point is within a first preset range. Thus, when the gray value of the color of any pixel point in the image is within the first preset range (i.e., the color is too dark), the color of the pixel point is corrected, so that the color of the pixel point can be brightened, solving the problem that the objects in the dark part of the image synthesized by the target application have low recognition, and avoiding the phenomenon of overheating of the terminal device and the risk of game account suspension. In addition, the original color of the pixel point corresponding to the gray value is corrected according to the correction color determination rule corresponding to the second preset range satisfied by the gray value, realizing corresponding color correction for the original color according to different gray value ranges, thereby improving the color correction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In the drawings of the embodiments of the present disclosure:

[0017] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure;

[0018] Figure 2 is a schematic diagram of an image processing method provided by an embodiment of the present disclosure;

[0019] Figure 3 is a schematic diagram of a surfaceflinger processing method provided by an embodiment of the present disclosure;

[0020] Figure 4 is a flowchart of a method for correcting the original color of a pixel point corresponding to a gray value according to a correction color determination rule corresponding to a second preset range satisfied by the gray value provided by an embodiment of the present disclosure;

[0021] Figure 5 is a block diagram of an electronic device provided by an embodiment of the present disclosure;

[0022] Figure 6 is a block diagram of a computer-readable storage medium provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] To enable those skilled in the art to better understand the technical solutions of the present disclosure, the communication perception data processing method and the computer-readable storage medium provided by the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0024] The present disclosure will be described more fully hereinafter with reference to the accompanying drawings. However, the disclosed embodiments may be embodied in different forms and the present disclosure should not be construed as limited to the embodiments set forth below. On the contrary, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0025] The accompanying drawings of the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure, and constitute a part of the specification. Together with the detailed embodiments, they are used to explain the present disclosure and do not constitute a limitation to the present disclosure. By describing the detailed embodiments with reference to the accompanying drawings, the above and other features and advantages will become more obvious to those skilled in the art.

[0026] The present disclosure can be described with reference to plan views and / or cross-sectional views by means of the ideal schematic diagrams of the present disclosure. Therefore, the example illustrations can be modified according to manufacturing techniques and / or tolerances.

[0027] Without conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.

[0028] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure. As used in the present disclosure, the term "and / or" includes any and all combinations of one or more of the related listed items. As used in the present disclosure, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. As used in the present disclosure, the terms "comprising", "made of", specify the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their groups.

[0029] Unless otherwise defined, the meanings of all terms (including technical and scientific terms) used in the present disclosure are the same as those commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the related art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless the present disclosure clearly defines so.

[0030] The present disclosure is not limited to the embodiments shown in the accompanying drawings, but includes modifications to the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the accompanying drawings have schematic properties, and the shapes of the regions shown in the figures illustrate the specific shapes of the regions of the elements, but are not intended to be restrictive.

[0031] Currently, for the optimization of 3D (three-dimensional) game scenes in an app (application), the main calculation is on the rendering color tone, saturation, and clarity of pixels, without addressing from the user's perspective the problem that the synthesized images of the game scenes have dark parts, resulting in low object recognition. Therefore, when playing games, some scenes of the game are dim, making it difficult for players to identify the objects in the game. They need to observe carefully with the naked eye to identify the objects in the game and the paths to pass levels in the game, which will seriously affect the players' gaming experience.

[0032] Currently, game terminals on the market do not have corresponding plug-in processing for this scenario. Although users can adjust the display color mode and color temperature through the settings interface to adjust the screen display color to achieve a clearer view of the scene, the effect is not very satisfactory.

[0033] The current technology runs on the game program side. The picture quality assistants on the market modify the parameters in the game app, making the game app mistakenly think that the configuration of the mobile phone is very high, resulting in the app opening high-frame-rate and high-quality texture maps, causing the terminal such as the mobile phone to get hot when playing games and there is a risk of game account suspension.

[0034] The solution of the embodiment of the present disclosure runs on the system service side and is applied to the post-processing of game application images. By reprocessing the images that have been processed by the game app, it will not modify any parameters of the game app, nor will it affect the power consumption, heat generation and smoothness of the game. The solution of the embodiment of the present disclosure focuses on improving the recognition of objects in dim scenes, which is beneficial for players to recognize objects in dim scenes, improves the user experience of playing games, and solves the problem that the recognition of objects in the dark part of the images synthesized by the app is not high.

[0035] The embodiment of the present disclosure determines whether the color of any pixel point in the image is too dark by obtaining the image output by the target application according to whether the gray value of the color of any pixel point in the image is within the first preset range. Thus, when the gray value of the color of any pixel point in the image is within the first preset range (that is, the color is too dark), the color of the pixel point is corrected, so that the color of the pixel point can be brightened, solving the problem that the recognition of objects in the dark part of the images synthesized by the target application is not high, and avoiding the phenomenon of the terminal device getting hot and the risk of game account suspension. In addition, the original color of the pixel point corresponding to the gray value is corrected according to the correction color determination rule corresponding to the second preset range satisfied by the gray value, realizing corresponding color correction of the original color according to different gray value ranges, thereby improving the color correction accuracy.

[0036] The image processing method of the embodiment of the present disclosure can be executed by any electronic device that needs to perform dark part brightening of images, such as a terminal device or a server. The terminal device may include, but is not limited to: in-vehicle devices, user equipment (UE), mobile devices, computing devices, wearable devices, etc. For example, it includes, but is not limited to, cellular phones, cordless phones, personal digital assistants (PDAs), portable computers, etc. This image processing method can be implemented by the processor calling the computer-readable program instructions stored in the memory, or can be implemented by the server.

[0037] The solution of the embodiments of the present disclosure can be based on the Android open-source system, and the final generated image of the game app can be processed again in the SurfaceFlinger (Android display system service) image synthesis service of the Android system, and the native code of the system framework needs to be modified. The solution of the embodiments of the present disclosure can be applied to the usage scenarios of mobile phones, tablets, VR (virtual reality) and other devices of Android devices. For example, it can include but is not limited to game scenarios.

[0038] The following provides a detailed introduction to the solution of the embodiments of the present disclosure.

[0039] The embodiments of the present disclosure provide an image processing method, as Figure 1 、 Figure 2 shown, the method may include steps S11-S15:

[0040] S11. When it is detected that a preset key is triggered, obtain the image output by the target application;

[0041] S12. Obtain the original color of each pixel point in the image;

[0042] S13. Obtain the gray value corresponding to the original color of each pixel point;

[0043] S14. Detect whether the gray value is within a first preset range;

[0044] S15. When the gray value is within the first preset range, correct the original color of the pixel point corresponding to the gray value according to the correction color determination rule corresponding to the second preset range satisfied by the gray value.

[0045] In the embodiments of the present disclosure, this correction operation can be used to brighten the original color of the pixel point corresponding to the gray value.

[0046] In the embodiments of the present disclosure, the solution of the embodiments of the present disclosure is mainly applied to the terminal system. When combining the surfaceflinger of the open-source Android system to synthesize the layers of the game app, the recognition of the dark objects in the game image can be improved by optimizing the image of the game app layer.

[0047] After Android 13, Google added support for programmable RuntimeShader objects, whose behavior is defined by the Android Graphics Shading Language (AGSL), and can be used in the Android rendering engine to control the drawing behavior and filter or modify the drawn content according to user-defined programming.

[0048] Surfaceflinger belongs to the system display service of the Android platform and can synthesize the display images of various applications into one image and send it to the screen display driver.

[0049] In the embodiments of the present disclosure, a plugin can be made in the game scene. This plugin can hijack the rendered image when rendering the layer of surfaceflinger, perform local color conversion adjustment on the dark part of the image, so that the dark part of the displayed image can also be clearly displayed, achieving that users can easily recognize the objects in the game scene and improving the user's gaming experience. The solution of the embodiments of the present disclosure is more targeted than adjusting the display color mode and color temperature, and the effect will be better, which is more conducive to improving the gaming experience.

[0050] In the embodiments of the present disclosure, a preset button can be set in advance. This preset button can be a physical button or a virtual button. The image viewer (such as a game player) can trigger this preset button when they need to brighten the dark part of the image. After this preset button is triggered, the solution of the embodiments of the present disclosure is implemented. As Figure 3 shown, after the target application outputs the image to be displayed, this image will be sent to the system's surfaceflinger. Surfaceflinger optimizes the pixel points in the dark part of the image output by the target application, and sends the optimized image of the target application to the screen for display.

[0051] In the embodiments of the present disclosure, the function implemented by the solution of the embodiments of the present disclosure can also be turned on or off in combination with a preset game assistant.

[0052] In the embodiments of the present disclosure, a RuntimeShader object A can be created. This object A receives the image P to be processed. The image P represents the image output by the app. RuntimeShader represents the algorithm for optimizing the image.

[0053] In the embodiments of the present disclosure, the original color C of each coordinate (x, y) pixel point is obtained from the image P (that is, the color of the image output by the app, the color before image optimization). The original color C is a 4D vector of type half4 composed of rgba. Among them, r represents red, g represents green, b represents blue, and a represents transparency.

[0054] In an embodiment of the present disclosure, the rgb vector of the original color C (which can be denoted as C.rgb) is dot-multiplied by a preset second three-dimensional vector D to obtain the grayscale value Gray corresponding to the original color C. The second three-dimensional vector D can be represented as (a1, b1, c1), where the value of a1 + b1 + c1 is approximately equal to 1, which can be expressed as a1 + 1b + c1 ≈ 1. The grayscale value Gray can be expressed as: Gray = C.rgb · D = C.r × a1 + C.g × b1 + C.b × c1.

[0055] In an embodiment of the present disclosure, the second three-dimensional vector D may include, but is not limited to, (0.299, 0.587, 0.114). The vector C.rgb of the original color C can be dot-multiplied by the second three-dimensional vector D to obtain the grayscale value Gray; the grayscale value Gray can be expressed as: Gray = C.r × 0.299 + C.G × 0.587 + C.B × 0.114.

[0056] In an embodiment of the present disclosure, a first preset range range1 may be predefined. The value of the first preset range range1 is between 0.0 and 1.0. The detailed range of the first preset range range1 can be defined according to different requirements and different application scenarios, and will not be limited herein. For example, the first preset range range1 can be selected as 0.01 - 0.08, or can also be selected as 0.1 - 0.6.

[0057] In an embodiment of the present disclosure, for the obtained grayscale value Gray, it can be compared with the first preset range range1. When the grayscale value Gray is within the first preset range range1, the original color of the pixel point corresponding to the grayscale value Gray can be optimized, that is, the original color of the pixel point corresponding to the grayscale value Gray is corrected to achieve the purpose of brightening the original color.

[0058] In an embodiment of the present disclosure, the method may further include: in the case where the grayscale value is not within the first preset range, directly using the original color of the pixel point corresponding to the grayscale value as the target color.

[0059] In an embodiment of the present disclosure, when the grayscale value Gray is not within the first preset range range1, the original color C of the pixel point corresponding to the grayscale value Gray may not be corrected, and thus the original color C is directly output as the target color of the corresponding pixel point.

[0060] In an embodiment of the present disclosure, as Figure 4 shown, correcting the original color of the pixel point corresponding to the grayscale value according to the correction color determination rule corresponding to the second preset range satisfied by the grayscale value may include steps S21 - S24:

[0061] S21. Determine the second preset range satisfied by the gray value.

[0062] In the embodiments of the present disclosure, there may be multiple second preset ranges, and each second preset range corresponds to a correction color determination rule respectively.

[0063] In the embodiments of the present disclosure, the value of the second preset range range2 is between 0.0 and 1.0, and the detailed range of the second preset range range2 can be defined according to different requirements and different application scenarios, and is not limited herein.

[0064] In the embodiments of the present disclosure, multiple second preset ranges range2 can be defined between 0.0 and 1.0 by a preset color threshold σ. The value of the color threshold σ can be defined according to different requirements and different application scenarios, and is not limited herein, and the color threshold σ can be one or more, and the number of the color threshold σ is not limited. For example, the color threshold σ can be selected as one, such as 0.5. Correspondingly, the second preset range range2 can include the following two ranges: greater than 0.0 and less than 0.5, and greater than or equal to 0.5 and less than 1.

[0065] In the embodiments of the present disclosure, after determining the gray value Gray, for example, the gray value Gray is 0.05. First, it is compared with the first preset range range1. If the first preset range range1 is 0.01 - 0.08, then the gray value Gray is within the first preset range range1, and the original color of the pixel point corresponding to the gray value Gray can be corrected. Then, continue to obtain the second preset range range2 satisfied by the gray value Gray. If the current second preset range range2 includes the above two ranges: greater than 0.0 and less than 0.5, and greater than or equal to 0.5 and less than 1, then the gray value Gray satisfies the range greater than 0.0 and less than 0.5. Therefore, the correction color determination rule corresponding to the range greater than 0.0 and less than 0.5 can be obtained.

[0066] In an embodiment of the present disclosure, for another example, if the grayscale value Gray is 0.55, first compare it with the first preset range range1. If the first preset range range1 is 0.1 - 0.6, the grayscale value Gray is within the first preset range range1, and the original color of the pixel point corresponding to the grayscale value Gray can be corrected. Then continue to obtain the second preset range range2 satisfied by the grayscale value Gray. If the current second preset range range2 includes the following two ranges: greater than 0.0 and less than 0.5, and greater than or equal to 0.5 and less than 1, the grayscale value Gray satisfies the range greater than or equal to 0.5 and less than 1. Therefore, the correction color determination rule corresponding to the range greater than or equal to 0.5 and less than 1 can be obtained.

[0067] S22. Obtain the correction color determination rule corresponding to the second preset range satisfied by the grayscale value.

[0068] In an embodiment of the present disclosure, the method further includes:

[0069] Set a constraint coefficient; the constraint coefficient is used to constrain the correction color determination rules of different second preset ranges to determine the correction color matching the second preset range;

[0070] Create the correction color determination rule corresponding to each second preset range according to the constraint coefficient and the preset variable; the preset variable includes the intermediate color IC obtained based on the original color of the pixel point.

[0071] In an embodiment of the present disclosure, the correction color determination rule corresponding to each second preset range can be created in advance, and the correction color determination rule can include, but is not limited to, a correction color calculation formula.

[0072] In an embodiment of the present disclosure, in order to enable the correction color determination rules corresponding to different second preset ranges to calculate appropriate correction colors, a constraint coefficient can be set in advance, and the preset variable is calculated in the correction color determination rules corresponding to different second preset ranges based on the constraint coefficient, so as to obtain the correction color corresponding to the second preset range.

[0073] In an embodiment of the present disclosure, setting the constraint coefficient may include: setting a first three-dimensional vector F(h, i, j); the first three-dimensional vector F(h, i, j) may include: a first vector value F.h, a second vector value F.i, and a third vector value F.j;

[0074] Among them, the first vector value F.h, the second vector value F.i, and the third vector value F.j satisfy the following relationship:

[0075] The first vector value F.h > 1;

[0076] The first vector value F.h × the second vector value F.i = 1; and,

[0077] The third vector value F.j × 2 = the second vector value F.i.

[0078] In an embodiment of the present disclosure, for example, the first three-dimensional vector F(h, i, j) can be (2, 0.5, 0.25).

[0079] In an embodiment of the present disclosure, the second preset range can be two, which can be respectively referred to as the first range and the second range; for example, the first range can be greater than 0.0 and less than 0.5, and the second range can be greater than or equal to 0.5 and less than 1.

[0080] In an embodiment of the present disclosure, when the correction color determination rule is a preset correction color calculation formula, if the second preset range is the first range, the correction color calculation formula is the first correction color calculation formula;

[0081] The first correction calculation formula can include: SLC = F.h × ((C × F.i) + F.j) × IC;

[0082] Wherein, SLC is the correction color, C is the original color of the pixel point, IC is the intermediate color, F.h is the first vector value, F.i is the second vector value, and F.j is the third vector value;

[0083] If the second preset range is the second range, the correction color calculation formula is the second correction color calculation formula;

[0084] The second correction calculation formula can include: SLC = 1 - (F.h × (1 - (C × F.i + F.i)) × (1 - IC)).

[0085] In an embodiment of the present disclosure, when the first range is greater than 0.0 and less than 0.5, the second range is greater than or equal to 0.5 and less than 1, and the first three-dimensional vector F(h, i, j) is (2, 0.5, 0.25):

[0086] The first correction calculation formula can be: SLC = 2 × ((C × 0.5) + 0.25) × IC;

[0087] The second correction calculation formula can be: SLC = 1 - (2 × (1 - (C × 0.5 + 0.5)) × (1 - IC)).

[0088] In an embodiment of the present disclosure, based on the correction color determination rules respectively corresponding to multiple second preset ranges determined in advance according to the above solutions, after determining the second preset range range2 that the gray value Gray satisfies, the correction color determination rule corresponding to the corresponding second preset range range2 can be obtained.

[0089] In an embodiment of the present disclosure, for example, if the grayscale value Gray satisfies the range greater than 0.0 and less than 0.5, the correction color determination rule corresponding to the range greater than 0.0 and less than 0.5 can be obtained, that is: SLC = 2×((C×0.5)+0.25)×IC; if the grayscale value Gray satisfies the range greater than or equal to 0.5 and less than 1, the correction color determination rule corresponding to the range greater than or equal to 0.5 and less than 1 can be obtained, that is: SLC = 1-(2×(1-(C×0.5+0.5))×(1-IC)).

[0090] S23. Determine the correction color corresponding to the grayscale value according to the correction color determination rule.

[0091] In an embodiment of the present disclosure, according to the correction color determination rule selected in step S22, the corresponding preset variable can be obtained, and the correction color of the pixel point corresponding to the grayscale value Gray is calculated according to the correction color determination rule.

[0092] In an embodiment of the present disclosure, the preset variable may include, but is not limited to, an intermediate color IC obtained based on the original color of the pixel point.

[0093] In an embodiment of the present disclosure, determining the correction color corresponding to the grayscale value according to the correction color determination rule includes:

[0094] Performing a preset process on the original color C of the pixel point corresponding to the grayscale value Gray to obtain an intermediate color IC;

[0095] Based on the correction color determination rule, the correction color SLC of the pixel point corresponding to the grayscale value Gray is obtained according to the intermediate color IC and the original color C.

[0096] In an embodiment of the present disclosure, performing a preset process on the original color C of the pixel point corresponding to the grayscale value Gray to obtain an intermediate color IC includes:

[0097] Taking the inverse of the vector of the original color C and then adding a unit vector to obtain the intermediate color IC; or,

[0098] Multiplying the vector of the original color C by a first preset coefficient to obtain the intermediate color IC.

[0099] In an embodiment of the present disclosure, in the first scheme: taking the inverse of the rgb vector C.rgb of the original color C and then adding a unit vector can be expressed as: IC = (1-C.r, 1-C.g, 1-C.b, C.a), where C.r is the red vector value of the rgb vector, C.g is the green vector value of the rgb vector, and C.b is the blue vector value of the rgb vector.

[0100] In an embodiment of the present disclosure, for the second solution: multiply the rgb vector C.rgb of the original color C by a first preset coefficient λ, which can be expressed as: IC = (C.rgb × λ, C.a).

[0101] In an embodiment of the present disclosure, based on the intermediate color IC calculated according to the above solution and the selected correction color determination rule, the correction color SLC corresponding to the gray value Gray can be calculated.

[0102] S24. Correct the original color of the pixel point corresponding to the gray value according to the correction color.

[0103] In an embodiment of the present disclosure, correcting the original color of the pixel point corresponding to the gray value according to the correction color includes:

[0104] Calculate the target color RC according to the correction color SLC, the original color C, and a preset color calculation formula;

[0105] Replace the original color C of the pixel point corresponding to the gray value Gray with the target color RC to complete the color correction of the pixel point corresponding to the gray value Gray.

[0106] In an embodiment of the present disclosure, the color calculation formula may include but is not limited to:

[0107] RC = C + T - C × T;

[0108] where RC is the target color, T = SLC × β × (1 - Gray); β is a second preset coefficient, 0 < β < 1 (for example, β = 0.1), and Gray is the gray value.

[0109] In an embodiment of the present disclosure, the correction color SLC and the original color C obtained in the foregoing steps may be input into the above color calculation formula to obtain the target color RC.

[0110] In an embodiment of the present disclosure, the currently calculated color RC value is the color value after optimization processing, and this color value will be used as the final return value of the RuntimeShader object A. When rendering a graphic by Sufracefinger, assign the return value of this object A (i.e., the target color RC) to the rendering property of the drawn brush, and when rendering, the brush uses the target color RC to replace the corresponding original color C in the original image.

[0111] In an embodiment of the present disclosure, it has at least the following advantages:

[0112] 1. The solution of the embodiment of the present disclosure processes images faster compared to other screenshot processing methods. Since the RuntimeShader method is used to call the GPU (Graphics Processing Unit) to run, the color calculation is faster and there is almost no delay in the image.

[0113] 2. It realizes the effect of brightening the dark part of the image output by the app, and solves the problem that the objects in the dark part of the image synthesized by the target application have low recognition. After image processing, users can play games in dark scenes more smoothly, improving the user experience of playing games on mobile terminals.

[0114] The embodiment of the present disclosure also provides an electronic device 100, as Figure 5 shown, the electronic device 100 includes:

[0115] One or more processors 101;

[0116] A memory 102, on which one or more programs are stored. When the one or more programs are executed by the one or more processors 101, the one or more processors 101 implement the image processing method;

[0117] One or more input / output I / O interfaces 103, connected between the processor 101 and the memory 102, configured to implement the information interaction between the processor 101 and the memory 102.

[0118] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 102 is a device with data storage capabilities, including but not limited to a random access memory (RAM, more specifically such as SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory (FLASH); the I / O interface (read / write interface) 103 is connected between the processor 101 and the memory 102 and can realize the information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus), etc.

[0119] In some embodiments, the processor 101, the memory 102, and the I / O interface 103 are interconnected through a bus 104 and then connected to other components of the computing device.

[0120] The embodiment of the present disclosure also provides a computer-readable storage medium 200, as Figure 6 shown. A computer program is stored on the computer-readable storage medium 200, and when the computer program is executed by a processor, the image processing method is implemented.

[0121] Those of ordinary skill in the art will understand that all or some of the functional modules / units disclosed above can be implemented as software, firmware, hardware, and their appropriate combinations.

[0122] In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component can have multiple functions, or a function or step can be executed by several physical components in cooperation.

[0123] Some or all physical components can be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH), or other disk memories; compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical disc memories; magnetic cassettes, tapes, magnetic disk storage, or other magnetic memories; any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.

[0124] The present disclosure has disclosed exemplary embodiments, and although specific terms have been used, they are used only and should be construed only as general illustrative meanings and not for the purpose of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, the features, characteristics, and / or elements described in connection with a particular embodiment can be used alone or in combination with the features, characteristics, and / or elements described in connection with other embodiments. Therefore, those skilled in the art will understand that various forms and details can be changed without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. An image processing method, characterized in that, the method includes: When it is detected that a preset key is triggered, obtain the image output by the target application; Obtain the original color of each pixel in the image; Obtain the gray value corresponding to the original color of each pixel; Detect whether the gray value is within a first preset range; When the gray value is within the first preset range, correct the original color of the pixel corresponding to the gray value according to the correction color determination rule corresponding to the second preset range satisfied by the gray value.

2. The image processing method according to claim 1, characterized in that, There are multiple second preset ranges, and each second preset range corresponds to a correction color determination rule respectively; The step of correcting the original color of the pixel corresponding to the gray value according to the correction color determination rule corresponding to the second preset range satisfied by the gray value includes: Determine the second preset range satisfied by the gray value; Obtain the correction color determination rule corresponding to the second preset range satisfied by the gray value; Determine the correction color corresponding to the gray value according to the correction color determination rule; Correct the original color of the pixel corresponding to the gray value according to the correction color.

3. The image processing method according to claim 2, characterized in that, The method further includes: Set a constraint coefficient; the constraint coefficient is used to constrain the correction color determination rules of different second preset ranges to determine the correction color that matches the second preset range; Create the correction color determination rule corresponding to each second preset range according to the constraint coefficient and a preset variable; the preset variable includes an intermediate color obtained based on the original color of the pixel.

4. The image processing method according to claim 3, characterized in that, The step of setting the constraint coefficient includes: setting a first three-dimensional vector; the first three-dimensional vector includes: a first vector value, a second vector value, and a third vector value; Wherein, the first vector value, the second vector value, and the third vector value satisfy the following relationships: The first vector value > 1; The first vector value × the second vector value = 1; and, The third vector value × 2 = the second vector value.

5. The image processing method according to claim 4, characterized in that, The correction color determination rule includes a preset correction color calculation formula; the multiple second preset ranges include a first range and a second range; When the second preset range is the first range, the correction color calculation formula is a first correction color calculation formula; The first correction calculation formula includes: SLC = F.h × ((C × F.i) + F.j) × I C; Wherein, SLC is the correction color, C is the original color of the pixel, I C is the intermediate color, F.h is the first vector value, F.i is the second vector value, and F.j is the third vector value; When the second preset range is the second range, the correction color calculation formula is a second correction color calculation formula; The second correction calculation formula includes: SLC = 1 - (F.h × (1 - (C × F.i + F.i)) × (1 - IC)).

6. The image processing method according to claim 2, wherein, determining the corrected color corresponding to the gray value according to the corrected color determination rule includes: performing a preset process on the original color of the pixel point corresponding to the gray value to obtain an intermediate color; based on the corrected color determination rule, obtaining the corrected color of the pixel point corresponding to the gray value according to the intermediate color and the original color.

7. The image processing method according to claim 6, wherein, performing a preset process on the original color of the pixel point corresponding to the gray value to obtain an intermediate color includes: taking the inverse of the vector of the original color and then adding a unit vector to obtain the intermediate color; or, multiplying the vector of the original color by a first preset coefficient to obtain the intermediate color.

8. The image processing method according to claim 2, wherein, correcting the original color of the pixel point corresponding to the gray value according to the corrected color includes: calculating a target color according to the corrected color, the original color, and a preset color calculation formula; using the target color to replace the original color of the pixel point corresponding to the gray value to complete the color correction of the pixel point corresponding to the gray value.

9. The image processing method according to claim 8, wherein, the color calculation formula includes: RC = C + T - C × T; where RC is the target color, T = SLC × β × (1 - Gray); β is a second preset coefficient, 0 < β < 1, and Gray is the gray value.

10. The image processing method according to claim 1, wherein, the method further includes: when the gray value is not within the first preset range, directly using the original color of the pixel point corresponding to the gray value as the target color.

11. An electronic device, wherein, the electronic device includes: one or more processors; a memory having one or more programs stored thereon, and when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement the image processing method according to any one of claims 1 - 10; one or more input / output I / O interfaces connected between the processor and the memory and configured to implement information interaction between the processor and the memory.

12. A computer-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the image processing method according to any one of claims 1 - 10.