Image processing optimization method, device, electronic device and readable storage medium
By determining whether the image to be processed is a solid color screen or a skin color screen exists, and turning off the dynamic contrast processing, the problem of unnatural transition between the character's skin color and other colors in the image processing is solved, and the image display effect is improved.
Patent Information
- Application Number
- CN202210343967.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-04-02
AI Technical Summary
In the prior art In image processing, dynamic contrast processing causes unnatural transitions between the character's skin color and other colors of the image, affecting the image display effect.
By determining whether the image to be processed is a solid color screen or a preset skin color screen exists, if the conditions are met, the dynamic contrast processing is turned off to avoid unnatural color transitions.
Improve the display effect of the image and avoid unnatural color transition problems caused by dynamic contrast processing.
Smart Images

Figure CN114693559B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to an image processing optimization method, device, electronic device and readable storage medium. Background Art
[0002] With the rapid development of science and technology, image processing optimization technology has become more and more mature. At present, image processing optimization technology uses automatic dynamic contrast processing of images to make the difference in light and dark of the image obvious. However, when the subject of the image is a person, the transition between the person's skin color and other colors of the image is easy to be unnatural, resulting in poor image display effect. Summary of the invention
[0003] The main purpose of the present application is to provide an image processing optimization method, device, electronic device and readable storage medium, aiming to solve the technical problem of poor image display effect in the prior art.
[0004] To achieve the above objectives, the present application provides an image processing optimization method, which is applied to an image processing optimization device. The image processing optimization method includes:
[0005] Acquire an image to be processed, and determine whether the image to be processed is a pure color image;
[0006] If the image to be processed is a pure color image, then turning off the dynamic contrast processing of the image to be processed;
[0007] If the image to be processed is not a pure color image, determining whether there is a preset skin color image in the image to be processed;
[0008] If there is a preset skin color picture in the image to be processed, the dynamic contrast processing of the image to be processed is turned off.
[0009] Optionally, the step of determining whether the image to be processed is a pure color image includes:
[0010] Obtaining the number of all pixels of the image to be processed;
[0011] According to the number of all the pixels, determining whether the image to be processed meets a preset pure color image condition;
[0012] If the image to be processed meets the preset pure color picture image condition, determining that the image to be processed is a pure color picture image;
[0013] If the image to be processed does not meet the preset pure color picture image condition, it is determined that the image to be processed is not a pure color picture image.
[0014] Optionally, the step of determining whether the image to be processed meets a preset pure color image condition comprises:
[0015] Determine a regional pixel number threshold according to the number of all pixel points;
[0016] Determine a pixel value subinterval corresponding to the image to be processed, and judge whether the sum of the number of pixel points in two adjacent pixel value subintervals is greater than the threshold value of the number of pixel points in the region;
[0017] If so, determining that the image to be processed meets the preset pure color image condition;
[0018] If not, it is determined that the image to be processed does not meet the preset pure color picture image condition.
[0019] Optionally, the step of determining a pixel value sub-interval corresponding to the image to be processed includes:
[0020] A pixel value interval of the image to be processed is obtained, and the pixel value interval is divided into a preset number of pixel value sub-intervals.
[0021] Optionally, before the step of determining whether there is a preset skin color picture in the image to be processed, the image processing optimization method further includes:
[0022] Obtaining a skin color histogram, wherein the skin color histogram is a correspondence between pixel values and the number of pixel points of various skin colors;
[0023] The preset pixel value intervals corresponding to the various skin colors are determined according to the skin color histogram and the preset pixel point quantity threshold.
[0024] Optionally, the step of determining whether there is a preset skin color picture in the image to be processed includes:
[0025] Acquire a target pixel value sub-interval that is in the pixel value sub-interval of the image to be processed and that is in accordance with the preset pixel value interval range;
[0026] Determining whether the target pixel value subinterval satisfies a preset skin color picture condition;
[0027] If yes, it is determined that the image to be processed has a preset skin color picture;
[0028] If not, it is determined that the image to be processed does not have a preset skin color picture.
[0029] Optionally, the step of determining whether the target pixel value subinterval satisfies a preset skin color picture condition comprises:
[0030] Determining a skin color pixel quantity threshold value according to the quantity of all pixel points of the image to be processed;
[0031] Determine whether within each of the target pixel value subintervals, the sum of the pixel points of two adjacent pixel value subintervals is greater than the skin color pixel point quantity threshold;
[0032] If yes, it is determined that the target pixel value subinterval satisfies the preset skin color picture condition;
[0033] If not, it is determined that the target pixel value subinterval does not meet the preset skin color picture condition.
[0034] To achieve the above-mentioned purpose, the present application further provides an image processing optimization device, which is applied to an image processing optimization device, and the image processing optimization device comprises:
[0035] An acquisition module is used to acquire an image to be processed and determine whether the image to be processed is a pure color image;
[0036] A determination module, configured to disable dynamic contrast processing of the image to be processed if the image to be processed is a pure color image;
[0037] A judging module, configured to judge whether there is a preset skin color picture in the image to be processed if the image to be processed is not a pure color picture image;
[0038] The processing module is used to turn off the dynamic contrast processing of the image to be processed if there is a preset skin color picture in the image to be processed.
[0039] Optionally, in the step of determining whether the image to be processed is a pure color image, the determination module is further configured to:
[0040] Obtaining the number of all pixels of the image to be processed;
[0041] According to the number of all the pixels, determining whether the image to be processed meets a preset pure color image condition;
[0042] If the image to be processed meets the preset pure color picture image condition, determining that the image to be processed is a pure color picture image;
[0043] If the image to be processed does not meet the preset pure color picture image condition, it is determined that the image to be processed is not a pure color picture image.
[0044] Optionally, in the step of determining whether the image to be processed meets a preset pure color image condition, the determination module is further configured to:
[0045] Determine a regional pixel number threshold according to the number of all pixel points;
[0046] Determine a pixel value subinterval corresponding to the image to be processed, and judge whether the sum of the number of pixel points in two adjacent pixel value subintervals is greater than the threshold value of the number of pixel points in the region;
[0047] If so, determining that the image to be processed meets the preset pure color image condition;
[0048] If not, it is determined that the image to be processed does not meet the preset pure color picture image condition.
[0049] Optionally, in the step of determining a pixel value subinterval corresponding to the image to be processed, the judgment module is further configured to:
[0050] A pixel value interval of the image to be processed is obtained, and the pixel value interval is divided into a preset number of pixel value sub-intervals.
[0051] Optionally, before the step of determining whether there is a preset skin color picture in the image to be processed, the determination module is further configured to:
[0052] Obtaining a skin color histogram, wherein the skin color histogram is a correspondence between pixel values and the number of pixel points of various skin colors;
[0053] The preset pixel value intervals corresponding to the various skin colors are determined according to the skin color histogram and the preset pixel point quantity threshold.
[0054] Optionally, in the step of determining whether there is a preset skin color picture in the image to be processed, the determination module is further configured to:
[0055] Acquire a target pixel value sub-interval that is in the pixel value sub-interval of the image to be processed and that is in accordance with the preset pixel value interval range;
[0056] Determining whether the target pixel value subinterval satisfies a preset skin color picture condition;
[0057] If yes, it is determined that the image to be processed has a preset skin color picture;
[0058] If not, it is determined that the image to be processed does not have a preset skin color picture.
[0059] Optionally, in the step of determining whether the target pixel value subinterval satisfies a preset skin color picture condition, the determination module is further configured to:
[0060] Determining a skin color pixel quantity threshold value according to the quantity of all pixel points of the image to be processed;
[0061] Determine whether within each of the target pixel value subintervals, the sum of the pixel points of two adjacent pixel value subintervals is greater than the skin color pixel point quantity threshold;
[0062] If yes, it is determined that the target pixel value subinterval satisfies the preset skin color picture condition;
[0063] If not, it is determined that the target pixel value subinterval does not meet the preset skin color picture condition.
[0064] The present application also provides an electronic device, comprising: a memory, a processor, and a program of the image processing optimization method stored in the memory and executable on the processor. When the program of the image processing optimization method is executed by the processor, the steps of the image processing optimization method as described above can be implemented.
[0065] The present application also provides a computer-readable storage medium, on which is stored a program for implementing the image processing optimization method. When the program of the image processing optimization method is executed by a processor, the steps of the image processing optimization method as described above are implemented.
[0066] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned image processing optimization method when executed by a processor.
[0067] The present application provides an image processing optimization method, device, electronic device and readable storage medium. Compared with the method of automatically performing dynamic contrast processing on an image adopted in the prior art, the present application obtains an image to be processed and determines whether the image to be processed is a pure color picture image; if the image to be processed is not a pure color picture image, determines whether there is a preset skin color picture in the image to be processed; if there is a preset skin color picture in the image to be processed, turns off the dynamic contrast processing of the image to be processed, and realizes turning off the dynamic contrast processing of the image to be processed or maintaining the dynamic contrast processing for the image to be processed by determining whether there is a preset skin color picture in the image to be processed, thereby avoiding the technical defect of unnatural transition between the skin color of the person and other colors of the image when the subject of the image is a person when the method of automatically performing dynamic contrast processing on the image is adopted, thereby improving the display effect of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0069] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0070] Figure 1 This is a flow chart of the first embodiment of the image processing optimization method of the present application;
[0071] Figure 2 Schematic diagram of the device structure of the hardware operating environment involved in the image processing optimization method in the embodiment of the present application.
[0072] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0073] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0074] Embodiment 1
[0075] The present application embodiment provides an image processing optimization method. In the first embodiment of the image processing optimization method of the present application, refer to Figure 1 , the image processing optimization method comprises:
[0076] Step S10, obtaining an image to be processed, and determining whether the image to be processed is a pure color image;
[0077] Step S20, if the image to be processed is a pure color image, turning off the dynamic contrast processing of the image to be processed;
[0078] Exemplarily, step S10 to step S20 include: acquiring an image to be processed, obtaining pixel points of the image to be processed and pixel values corresponding to the pixel points, and judging whether the image to be processed is a pure color image based on an RGB histogram; if the image to be processed is a pure color image, turning off dynamic contrast processing of the image to be processed; if the image to be processed is not a pure color image, keeping dynamic contrast processing of the image to be processed.
[0079] Furthermore, the step of obtaining the pixel value corresponding to the pixel point may be: obtaining the RGB channel value corresponding to the pixel point, and obtaining the pixel value corresponding to the pixel point by obtaining the average value of the RGB channel value.
[0080] Furthermore, the step of obtaining the pixel value corresponding to the pixel point can also be: obtaining the RGB channel values corresponding to the pixel point, respectively obtaining the pixel value coefficients of the R channel, the pixel value coefficients of the B channel, and the pixel value coefficients of the G channel, and obtaining the pixel value corresponding to the pixel point by calculating the sum of the products of the RGB channel values and the corresponding pixel value coefficients.
[0081] Wherein, in step S10, the step of determining whether the image to be processed is a pure color image includes:
[0082] Step S11, obtaining the number of all pixels of the image to be processed;
[0083] Step S12, judging whether the image to be processed meets a preset pure color image condition according to the number of all the pixels;
[0084] Step S13, if the image to be processed meets the preset pure color picture image condition, then determine that the image to be processed is a pure color picture image;
[0085] Step S14: if the image to be processed does not meet the preset pure color picture image condition, it is determined that the image to be processed is not a pure color picture image.
[0086] In this embodiment, it should be noted that the preset pure color picture image condition is a pre-set condition for determining whether an image is a pure color picture image.
[0087] Exemplarily, steps S11 to S14 include: obtaining the number of all pixels of the image to be processed; judging whether the image to be processed satisfies a preset pure color image condition based on the number of all pixels; if the image to be processed satisfies the preset pure color image condition, judging that the image to be processed is a pure color image; if the image to be processed does not satisfy the preset pure color image condition, judging that the image to be processed is not a pure color image, and executing the step of judging whether there is a preset skin color image in the image to be processed.
[0088] Wherein, in step S12, the step of judging whether the image to be processed meets the preset pure color image condition includes:
[0089] Step A10, determining a regional pixel number threshold according to the number of all pixel points;
[0090] Step A20, determining the pixel value sub-interval corresponding to the image to be processed, and judging whether the sum of the number of pixel points in two adjacent pixel value sub-intervals is greater than the threshold value of the number of pixel points in the region;
[0091] Step A30, if it exists, determining that the image to be processed meets the preset pure color image condition;
[0092] Step A40: If not, it is determined that the image to be processed does not meet the preset pure color picture image condition.
[0093] In this embodiment, it should be noted that the regional pixel point quantity threshold is a pixel point critical value for determining whether an image is a pure color image.
[0094] Exemplarily, steps A10 to A40 include: based on the first pixel ratio of the pure color screen image, calculating the product of the first pixel ratio and the number of all pixels to obtain a regional pixel number threshold; obtaining the pixel value sub-interval corresponding to the image to be processed and the number of pixels corresponding to the pixel value sub-interval, and judging whether the sum of the number of pixels of two adjacent pixel value sub-intervals is greater than the regional pixel number threshold; if the sum of the number of pixels of the two adjacent pixel value sub-intervals is greater than the regional pixel number threshold, then judging that the image to be processed meets the preset pure color screen image condition; if the sum of the number of pixels of the two adjacent pixel value sub-intervals is not greater than the regional pixel number threshold, then judging that the image to be processed does not meet the preset pure color screen image condition, for example, when the number of all pixels is 100 and the first pixel ratio is 80%, then the regional pixel number threshold is 100*80%, i.e., 80.
[0095] Wherein, in step A20, the step of determining the pixel value sub-interval corresponding to the image to be processed includes:
[0096] Step A21, obtaining a pixel value interval of the image to be processed, and dividing the pixel value interval into a preset number of pixel value sub-intervals.
[0097] In this embodiment, it should be noted that the preset number is the number of sub-intervals into which the pixel value interval is divided in advance.
[0098] Exemplarily, step A21 includes: obtaining a pixel value interval of the image to be processed; determining a preset number based on a set byte size; dividing the pixel value interval into a preset number of pixel value sub-intervals, for example, when the set byte size is 10 bits, dividing the image to be processed into 32 pixel value sub-intervals.
[0099] Step S30, if the image to be processed is not a pure color image, determining whether there is a preset skin color image in the image to be processed;
[0100] Exemplarily, step S30 includes: if the image to be processed is not a solid color image, determining whether there is a preset skin color image in the image to be processed; if the image to be processed is a solid color image, turning off the dynamic contrast processing of the image to be processed to complete the processing of the image to be processed.
[0101] Wherein, in step S30, before the step of determining whether there is a preset skin color picture in the image to be processed, the image processing optimization method further includes:
[0102] Step B10, obtaining a skin color histogram, wherein the skin color histogram is a correspondence between grayscale values of various skin colors and the number of pixel points;
[0103] Step B20, determining the preset pixel value intervals corresponding to the various skin colors according to the skin color histogram and the preset pixel point quantity threshold.
[0104] In this embodiment, it should be noted that the preset pixel point quantity threshold is a critical value of the pixel point quantity corresponding to the pixel value interval obtained by the user.
[0105] Exemplarily, step C20 includes: obtaining a preset pixel number threshold value corresponding to various skin colors of the user based on the histogram image distribution of various skin colors in the skin color histogram; querying the pixel value interval corresponding to the number of pixels exceeding the preset pixel number threshold value in the skin color histogram to obtain the preset pixel value interval.
[0106] Wherein, in step S30, the step of determining whether there is a preset skin color picture in the image to be processed includes:
[0107] Step S31, obtaining a target pixel value sub-interval in the pixel value sub-interval of the image to be processed that meets the preset pixel value interval range;
[0108] Step S32, determining whether the target pixel value subinterval satisfies a preset skin color picture condition;
[0109] Step S33: if yes, determining that the image to be processed has a preset skin color picture;
[0110] Step S34: if not, it is determined that the image to be processed does not have a preset skin color picture.
[0111] Exemplarily, steps S31 to S34 include: extracting a target pixel value subinterval in the pixel value subinterval of the image to be processed that meets a preset pixel value interval range; determining whether the target pixel value subinterval satisfies a preset skin color picture condition, and if the target pixel value subinterval satisfies the preset skin color picture condition, determining that the image to be processed has a preset skin color picture; if the target pixel value subinterval does not satisfy the preset skin color picture condition, determining that the image to be processed does not have a preset skin color picture.
[0112] Wherein, in step S32, the step of determining whether the target pixel value subinterval satisfies the preset skin color picture condition comprises:
[0113] Step C10, determining a skin color pixel number threshold value according to the number of all pixel points of the image to be processed;
[0114] Step C20, determining whether within each of the target pixel value sub-intervals there are two adjacent pixel value sub-intervals whose sum of pixel points is greater than the skin color pixel point quantity threshold;
[0115] Step C30, if yes, determining that the target pixel value subinterval satisfies a preset skin color picture condition;
[0116] Step C40: If not, it is determined that the target pixel value sub-interval does not meet the preset skin color picture condition.
[0117] In this embodiment, it should be noted that the skin color pixel number threshold is a preset pixel point critical value for determining whether a preset skin color picture exists in the image to be processed.
[0118] Exemplarily, steps C10 to C40 include: obtaining a second pixel ratio of the skin color picture image, calculating the product of the second pixel ratio and the number of all pixels of the image to be processed, and obtaining a skin color pixel number threshold; obtaining the number of pixels corresponding to the target pixel value sub-interval, and determining whether there is a sum of pixels of two adjacent pixel value sub-intervals within each of the target pixel value sub-intervals that is greater than the skin color pixel number threshold; if there is a sum of pixels of adjacent pixel value sub-intervals within each of the target pixel value sub-intervals that is greater than the skin color pixel number threshold, then determining that the target pixel value sub-interval satisfies the preset skin color picture condition; if there is no sum of pixels of adjacent pixel value sub-intervals within each of the target pixel value sub-intervals that is greater than the skin color pixel number threshold, then determining that the target pixel value sub-interval does not satisfy the preset skin color picture condition.
[0119] Step S40: If there is a preset skin color picture in the image to be processed, the dynamic contrast processing of the image to be processed is turned off.
[0120] Exemplarily, step S40 includes: if there is a preset skin color picture in the image to be processed, turning off the dynamic contrast processing of the image to be processed; if there is no preset skin color picture in the image to be processed, keeping the dynamic contrast processing for the image to be processed.
[0121] Furthermore, the step of maintaining dynamic contrast processing for the image to be processed may be: obtaining the contrast of the image judgment area of the image to be processed, obtaining a preset contrast value of the image to be processed by obtaining the contrast value corresponding to the image judgment area with the largest contrast, and setting the contrast value of each image judgment area to the preset contrast value to complete the dynamic contrast processing.
[0122] Furthermore, the step of dynamically maintaining the dynamic contrast processing for the image to be processed can also be: based on the pixels of the image to be processed and the grayscale values corresponding to the pixels, drawing a correlation image between the number of pixels and the grayscale values of the image to be processed to obtain an image histogram; based on the image histogram, reallocating the pixel values of the image to be processed so that the number of pixels within a certain grayscale range is roughly the same, so as to complete the dynamic contrast processing.
[0123] The embodiment of the present application provides an image processing optimization method. Compared with the method of automatically performing dynamic contrast processing on an image adopted in the prior art, the embodiment of the present application obtains an image to be processed and determines whether the image to be processed is a pure color picture image; if the image to be processed is not a pure color picture image, it is determined whether there is a preset skin color picture in the image to be processed; if there is a preset skin color picture in the image to be processed, the dynamic contrast processing of the image to be processed is turned off, thereby realizing that by determining whether the image to be processed has a preset skin color picture, the dynamic contrast processing of the image to be processed is turned off or the dynamic contrast processing for the image to be processed is maintained, thereby avoiding the technical defect of unnatural transition between the skin color of the person and other colors of the image when the subject of the image is a person when the method of automatically performing dynamic contrast processing on the image is adopted, thereby improving the display effect of the image.
[0124] Embodiment 2
[0125] The embodiment of the present application further provides an image processing optimization device, which is applied to an image processing optimization device, and the image processing optimization device includes:
[0126] An acquisition module is used to acquire an image to be processed and determine whether the image to be processed is a pure color image;
[0127] A determination module, configured to disable dynamic contrast processing of the image to be processed if the image to be processed is a pure color image;
[0128] A judging module, configured to judge whether there is a preset skin color picture in the image to be processed if the image to be processed is not a pure color picture image;
[0129] The processing module is used to turn off the dynamic contrast processing of the image to be processed if there is a preset skin color picture in the image to be processed.
[0130] Optionally, in the step of determining whether the image to be processed is a pure color image, the determination module is further configured to:
[0131] Determining whether the image to be processed meets a preset pure color image condition;
[0132] If the image to be processed meets the preset pure color picture image condition, determining that the image to be processed is a pure color picture image;
[0133] If the image to be processed does not meet the preset pure color picture image condition, it is determined that the image to be processed is not a pure color picture image.
[0134] Optionally, in the step of determining whether the image to be processed meets a preset pure color image condition, the determination module is further configured to:
[0135] Obtaining the number of all pixels of the image to be processed, and determining a regional pixel number threshold according to the number of all pixels;
[0136] Determine a pixel value subinterval corresponding to the image to be processed, and judge whether the sum of the number of pixel points in two adjacent pixel value subintervals is greater than the threshold value of the number of pixel points in the region;
[0137] If so, determining that the image to be processed meets the preset pure color image condition;
[0138] If not, it is determined that the image to be processed does not meet the preset pure color picture image condition.
[0139] Optionally, before the step of determining whether there is a preset skin color picture in the image to be processed, the determination module is further configured to:
[0140] Obtaining a skin color histogram, wherein the skin color histogram is a correspondence between pixel values and the number of pixel points of various skin colors;
[0141] The preset pixel value intervals corresponding to the various skin colors are determined according to the skin color histogram and the preset pixel point quantity threshold.
[0142] Optionally, in the step of determining whether there is a preset skin color picture in the image to be processed, the determination module is further configured to:
[0143] Acquire a target pixel value sub-interval that is in the pixel value sub-interval of the image to be processed and that is in accordance with the preset pixel value interval range;
[0144] Determining whether the target pixel value subinterval satisfies a preset skin color picture condition;
[0145] If yes, it is determined that the image to be processed has a preset skin color picture;
[0146] If not, it is determined that the image to be processed does not have a preset skin color picture.
[0147] Optionally, in the step of determining whether the target pixel value subinterval satisfies a preset skin color picture condition, the determination module is further configured to:
[0148] Determining a skin color pixel quantity threshold value according to the quantity of all pixel points of the image to be processed;
[0149] Determine whether within each of the target pixel value subintervals, the sum of the pixel points of two adjacent pixel value subintervals is greater than the skin color pixel point quantity threshold;
[0150] If yes, it is determined that the target pixel value subinterval satisfies the preset skin color picture condition;
[0151] If not, it is determined that the target pixel value subinterval does not meet the preset skin color picture condition.
[0152] Optionally, in the step of determining a pixel value subinterval corresponding to the image to be processed, the judgment module is further configured to:
[0153] A pixel value interval of the image to be processed is obtained, and the pixel value interval is divided into a preset number of pixel value sub-intervals.
[0154] The image processing optimization device provided by the present invention adopts the image processing optimization method in the above embodiment to solve the technical problem of poor image display effect. Compared with the prior art, the beneficial effects of the image processing optimization device provided by the embodiment of the present invention are the same as the beneficial effects of the image processing optimization method provided by the above embodiment, and other technical features in the image processing optimization device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0155] Embodiment 3
[0156] An embodiment of the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image processing optimization method in the above-mentioned embodiment one.
[0157] Reference below Figure 2 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 2 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0158] like Figure 2 As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM, and RAM are connected to each other through a bus. The input / output (I / O) interface is also connected to the bus.
[0159] Typically, the following systems can be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices including, for example, a magnetic tape, a hard disk, etc.; and communication devices. The communication device can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0160] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0161] The electronic device provided by the present invention adopts the image processing optimization method in the above embodiment to solve the technical problem of poor image display effect. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present invention are the same as the beneficial effects of the image processing optimization method provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0162] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0163] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0164] Embodiment 4
[0165] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the image processing optimization method in the above embodiment.
[0166] The computer-readable storage medium provided in the embodiment of the present invention may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0167] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0168] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device: obtains an image to be processed, and determines whether the image to be processed is a pure color picture image; if the image to be processed is a pure color picture image, the dynamic contrast processing of the image to be processed is turned off; if the image to be processed is not a pure color picture image, it is determined whether there is a preset skin color picture in the image to be processed; if there is a preset skin color picture in the image to be processed, the dynamic contrast processing of the image to be processed is turned off.
[0169] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0170] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0171] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.
[0172] The computer-readable storage medium provided by the present invention stores computer-readable program instructions for executing the above-mentioned image processing optimization method, which solves the technical problem of poor image display effect. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiment of the present invention are the same as the beneficial effects of the image processing optimization method provided by the above-mentioned implementation, and will not be repeated here.
[0173] Embodiment 5
[0174] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned image processing optimization method when executed by a processor.
[0175] The computer program product provided by the present application solves the technical problem of poor image display effect. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as the beneficial effects of the image processing optimization method provided by the above embodiment, which will not be repeated here.
[0176] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. An image processing optimization method, characterized in that: The image processing optimization method comprises: Get the number of all pixels of the image to be processed; According to the number of all the pixels, determining whether the image to be processed meets a preset pure color image condition; If the image to be processed meets the preset pure color picture image condition, determining that the image to be processed is a pure color picture image; If the image to be processed does not meet the preset pure color picture image condition, determining that the image to be processed is not a pure color picture image; If the image to be processed is a pure color image, then turning off the dynamic contrast processing of the image to be processed; If the image to be processed is not a pure color image, determining whether there is a preset skin color image in the image to be processed; Wherein, the step of determining whether there is a preset skin color picture in the image to be processed comprises: Obtaining a target pixel value sub-interval that meets a preset pixel value interval range in the pixel value sub-interval of the image to be processed; Determining a skin color pixel quantity threshold value according to the quantity of all pixel points of the image to be processed; Determine whether within each of the target pixel value subintervals, the sum of the pixel points of two adjacent pixel value subintervals is greater than the skin color pixel point quantity threshold; If yes, it is determined that the target pixel value subinterval satisfies the preset skin color picture condition; If not, it is determined that the target pixel value subinterval does not meet the preset skin color picture condition; If yes, it is determined that the image to be processed has a preset skin color picture; If not, it is determined that the image to be processed does not have a preset skin color picture; If there is a preset skin color picture in the image to be processed, the dynamic contrast processing of the image to be processed is turned off.
2. The image processing optimization method according to claim 1, characterized in that: The step of judging whether the image to be processed meets the preset pure color image condition comprises: Determine a regional pixel number threshold according to the number of all pixel points; Determine a pixel value subinterval corresponding to the image to be processed, and judge whether the sum of the number of pixel points in two adjacent pixel value subintervals is greater than the threshold value of the number of pixel points in the region; If so, determining that the image to be processed meets the preset pure color image condition; If not, it is determined that the image to be processed does not meet the preset pure color picture image condition.
3. The image processing optimization method according to claim 2, characterized in that: The step of determining the pixel value sub-interval corresponding to the image to be processed comprises: A pixel value interval of the image to be processed is obtained, and the pixel value interval is divided into a preset number of pixel value sub-intervals.
4. The image processing optimization method according to claim 1, characterized in that: Before the step of determining whether there is a preset skin color picture in the image to be processed, the image processing optimization method further includes: Obtaining a skin color histogram, wherein the skin color histogram is a correspondence between pixel values and the number of pixel points of various skin colors; The preset pixel value intervals corresponding to the various skin colors are determined according to the skin color histogram and the preset pixel point quantity threshold.
5. An image processing optimization device, characterized in that: The image processing optimization device comprises: an acquisition module, used to acquire an image to be processed, and determine whether the image to be processed is a pure color picture image, wherein the acquisition module is specifically used to acquire the number of all pixel points of the image to be processed; according to the number of all pixel points, determine whether the image to be processed meets a preset pure color picture image condition; if the image to be processed meets the preset pure color picture image condition, determine that the image to be processed is a pure color picture image; if the image to be processed does not meet the preset pure color picture image condition, determine that the image to be processed is not a pure color picture image; A determination module, configured to disable dynamic contrast processing of the image to be processed if the image to be processed is a pure color image; A judgment module, for judging whether there is a preset skin color picture in the image to be processed if the image to be processed is not a pure color picture image, wherein the judgment module is specifically used to obtain a target pixel value subinterval in the pixel value subinterval of the image to be processed that meets the preset pixel value interval range; determine a skin color pixel point number threshold according to the number of all pixel points of the image to be processed; judge whether there is a sum of pixel points of two adjacent pixel value subintervals in each of the target pixel value subintervals that is greater than the skin color pixel point number threshold; if so, judge that the target pixel value subinterval satisfies the preset skin color picture condition; if not, judge that the target pixel value subinterval does not satisfy the preset skin color picture condition; if so, judge that the image to be processed has a preset skin color picture; if not, judge that the image to be processed does not have a preset skin color picture; The processing module is used to turn off the dynamic contrast processing of the image to be processed if there is a preset skin color picture in the image to be processed.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the image processing optimization method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for implementing the image processing optimization method, and the program for implementing the image processing optimization method is executed by a processor to implement the steps of the image processing optimization method as claimed in any one of claims 1 to 4.
