Image processing method and device, storage medium, electronic equipment and program product
By identifying color spots in image blocks before encoding and processing them with quantization tables of different color quantization steps, and using a smaller step size quantization table for color spots, the problem of obvious color spots in mobile phone images is solved, achieving the effects of color spot reduction and storage space saving.
Patent Information
- Application Number
- CN202410733416.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2025-12-09
AI Technical Summary
Large areas of color spots appear in images taken with mobile phones, affecting the imaging effect. Existing technologies have failed to effectively reduce the color spot problem during the encoding process.
Before encoding, it is determined whether there are color spots in the image blocks, and color quantization tables with different color quantization steps are used to quantize image blocks with and without color spots. A quantization table with a smaller step size is used to process the color spot blocks.
It reduces color spots in the image, saves storage space, and maintains the image compression rate.
Smart Images

Figure CN121099205A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to an image processing method, apparatus, storage medium, electronic device, and program product. Background Technology
[0002] With the significant improvement in mobile phone pixels and image quality, more and more users are getting used to taking pictures with their mobile phones. Mobile phones have gradually replaced ordinary cameras in daily life. However, some areas of images taken with mobile phones have large color spots, which affect the image quality. Summary of the Invention
[0003] In view of the above, this disclosure provides an image processing method, apparatus, storage medium, electronic device, and program product.
[0004] According to a first aspect of the present disclosure, an image processing method is provided, the method comprising:
[0005] Obtain an image to be processed in a first format, wherein the image to be processed includes multiple image blocks;
[0006] Determine whether color spots exist in the plurality of image blocks;
[0007] If there are color spots in the image block, the image block with color spots is chromaticized using the first color metric table to obtain the first image block in the second format;
[0008] If there are no color spots in the image block, the image block without color spots is chromaticized using the second chromaticity table to obtain a second image block in the second format. The chromaticity step size of the first chromaticity table is smaller than the chromaticity step size of the second chromaticity table.
[0009] In some embodiments, determining whether color spots exist in the plurality of image blocks includes: determining a target chromaticity weight of the image block based on the relationship between the chromaticity of the image block and a preset chromaticity threshold; determining a target luminance weight of the image block based on the relationship between the luminance of the image block and a luminance threshold; determining the degree of color spots in the image block based on the target chromaticity weight and the target luminance weight; and determining whether color spots exist in the image block based on the relationship between the degree of color spots and a color spot threshold.
[0010] In some embodiments, the preset chromaticity threshold includes a first chromaticity threshold and a second chromaticity threshold. Determining the target chromaticity weight of the image block based on the relationship between the chromaticity of the image block and the preset chromaticity threshold includes: determining the first chromaticity threshold and the second chromaticity threshold based on the luminance and chromaticity variation curves of the image block with luminance; and determining the target chromaticity weight of the image block based on the relationship between the chromaticity of the image block and the first chromaticity threshold and the second chromaticity threshold.
[0011] In some embodiments, determining the target chromaticity weight of the image patch based on the relationship between the chromaticity of the image patch and the first chromaticity threshold and the second chromaticity threshold includes:
[0012] When the chromaticity value of the image block is less than or equal to the first chromaticity threshold, the target chromaticity weight of the image block is a first value;
[0013] If the chromaticity value of the image block is greater than or equal to the second chromaticity threshold, the target chromaticity weight of the image block is the second value;
[0014] When the chromaticity value of the image block is greater than the first chromaticity threshold and the chromaticity value is less than the second chromaticity threshold, the target chromaticity weight of the image block is a third value, which is obtained by linear interpolation of the first value and the second value.
[0015] In some embodiments, determining whether a color spot exists in the image patch based on the relationship between the color spot degree and the color spot threshold includes: if the color spot degree is greater than or equal to the color spot threshold, then determining that a color spot exists in the image patch; if the color spot degree is less than the color spot threshold, then determining that a color spot does not exist in the image patch.
[0016] In some embodiments, the colorimetric step size of the first colorimetric table is determined based on a preset quality factor.
[0017] According to a second aspect of the present disclosure, an image processing apparatus is provided, the apparatus comprising:
[0018] An acquisition unit is used to acquire an image to be processed in a first format, wherein the image to be processed includes multiple image blocks;
[0019] A determining unit is used to determine whether color spots exist in multiple image patches;
[0020] The processing unit is configured to, when color spots exist in the image block, perform color measurement on the image block with color spots using a first color measurement table to obtain a first image block of a second format, and when there are no color spots in the image block, perform color measurement on the image block without color spots using a second color measurement table to obtain a second image block of a second format, wherein the color measurement step size of the first color measurement table is smaller than the color measurement step size of the second color measurement table.
[0021] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of any of the methods described in the first aspect above.
[0022] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising:
[0023] processor;
[0024] Memory used to store processor-executable instructions;
[0025] The processor is configured as follows:
[0026] Obtain an image to be processed in a first format, wherein the image to be processed includes multiple image blocks;
[0027] Determine whether color spots exist in the plurality of image blocks;
[0028] If color spots exist in the image block, the image block with color spots is color-quantized using a first color quantization table to obtain a first image block in a second format. If there are no color spots in the image block, the image block without color spots is color-quantized using a second color quantization table to obtain a second image block in a second format. The color quantization step size of the first color quantization table is smaller than the color quantization step size of the second color quantization table.
[0029] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program and instructions that, when executed by a processor, implement any of the methods described above.
[0030] The technical solutions provided in this disclosure may have the following beneficial effects:
[0031] A first-format image to be processed is acquired, and it is determined whether color spots exist in the image blocks of the image to be processed. If color spots exist in the image blocks, the image blocks with color spots are color-quantized using a first color quantization table to obtain a first image block in a second format. If color spots do not exist in the image blocks, the image blocks without color spots are color-quantized using a second color quantization table to obtain a second image block in a second format. The color quantization step size of the first color quantization table is smaller than the color quantization step size of the second color quantization table. This disclosure uses different color quantization tables for image blocks with and without color spots, which makes the color spots in the processed image less noticeable compared to using the same color quantization table.
[0032] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0033] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0034] Figure 1a This disclosure illustrates an image processing flowchart according to an exemplary embodiment;
[0035] Figure 1b This disclosure is a flowchart illustrating a processing procedure in a decoder according to an exemplary embodiment;
[0036] Figure 2 A flowchart of an image processing method provided as an exemplary embodiment of this disclosure;
[0037] Figure 3 A chromaticity weighting curve is provided as an exemplary embodiment of this disclosure;
[0038] Figure 4 A chromaticity variation curve as a function of brightness is provided for an exemplary embodiment of this disclosure;
[0039] Figure 5 A luminance weighting curve is provided for an exemplary embodiment of this disclosure;
[0040] Figure 6 This is a comparison chart of the standard colorimetric table and the first colorimetric table provided in this embodiment;
[0041] Figure 7 This is a schematic diagram of the structure of an image processing apparatus in an exemplary embodiment of the present disclosure;
[0042] Figure 8 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0043] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0044] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0045] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0046] Currently, users frequently use their mobile phone cameras to take photos, but some areas of the resulting images have obvious color spots.
[0047] The following will combine Figure 1a The reasons for noticeable color spots are explained below. First, the RAW image data acquired by the camera sensor contains a large amount of scattered color noise. Although noise reduction processing in Image Signal Processing (ISP) can eliminate most of the noise, a small amount of noise will still remain. This residual noise, after noise reduction, is transformed into a slight color spot. Forcibly removing these color spots can easily cause other areas to lose color. Second, the image format generated after the ISP module is BMP format. After lossy compression, a JPG format image can be obtained, but the color spots in the JPG format image will become more noticeable. BMP (Bitmap) is the standard image file format in the Windows operating system. JPG stands for JPEG (Joint Photographic Experts Group), an image file format based on the DCT (Discrete Cosine Transform) image compression standard.
[0048] An encoder is typically used to compress BMP format images into JPG format images. For details, see: [link to documentation] Figure 1b During compression, for each image block in a BMP format image, a Discrete Cosine Transform (DCT) is first performed to obtain DCT coefficients, which are then quantized. Data compression is achieved by reducing the precision of the DCT coefficients during quantization. The quantized data is further processed through entropy coding and other techniques to finally obtain the compressed JPG format image.
[0049] Based on the above analysis, it is believed that the reason for the obvious color spots in the final JPG format image is that the same color quantization table is used for quantization of image blocks with and without color spots, causing the color spots in the image blocks with color spots to stand out.
[0050] In view of this, the present disclosure provides an image processing method that first determines whether there are color spots in each image block of the image before compressing the image. Then, when quantizing using an encoder, color quantization tables with different color quantization step sizes are used for color quantization of image blocks with color spots and image blocks without color spots, so that the color spots in the image blocks with color spots are not obvious. In this way, the color spots in the final generated image can be improved.
[0051] This disclosure is applicable to electronic devices that compress images, and it solves the problem of color spot enhancement caused by the encoding process. The following embodiments, in conjunction with the accompanying drawings, will provide a detailed description of the image processing method provided by this disclosure.
[0052] Figure 2 A flowchart of an image processing method provided as an exemplary embodiment of this disclosure, such as... Figure 2 As shown, the method includes steps 201 to 203.
[0053] In step 201, an image to be processed in a first format is obtained, wherein the image to be processed includes multiple image blocks.
[0054] The first format can be BMP format, and the size of the image block can be 8*8. The image to be processed includes multiple 8*8 image blocks. Those skilled in the art should understand that the size of the image block can be set according to actual needs in addition to 8*8, and this disclosure does not limit it in this way.
[0055] In step 202, it is determined whether there are color spots in the plurality of image blocks.
[0056] In this embodiment of the disclosure, the presence of color spots in an image block can be determined based on the chroma and luminance of the image block. For example, the presence of color spots in an image block can be determined based on the relationship between the product of chroma and luminance and a preset threshold value.
[0057] In related technologies, a standard colorimetric table is typically used to colorimetrically measure image blocks. If a color patch is determined to exist in any image block, a first colorimetric table can be used to colorimetrically measure all image blocks. The colorimetric step size of the first colorimetric table is smaller than that of the standard colorimetric table.
[0058] In the above implementation, using a first colorimetric table with a small step size to quantize all image blocks will result in a lower image compression ratio, requiring more storage space for the final image. To save storage space, colorimetric quantization can be performed using the first colorimetric table when color spots exist in the image block, and using the standard colorimetric table, i.e., the second colorimetric table, when no color spots exist in the image block.
[0059] In step 203a, if there are color spots in the image block, the image block with color spots is chromaticized using the first color metric table to obtain the first image block in the second format.
[0060] In step 203b, if there are no color spots in the image block, the image block without color spots is chromaticized using the second color metric table to obtain a second image block in the second format.
[0061] In this embodiment, to facilitate differentiation, an image block with color spots obtained by colorimetrically measuring the image block with color spots using the first colorimetric table is called the first image block, and an image block with color spots not obtained by colorimetrically measuring the image block with color spots using the second colorimetric table is called the second image block. The color-measured first image block and the second image block are then concatenated to obtain a second-format image corresponding to the first-format image to be processed. The colorimetric step size of the first colorimetric table is smaller than the colorimetric step size of the second colorimetric table.
[0062] This disclosure acquires an image to be processed in a first format and determines whether color spots exist in image blocks of the image to be processed. If color spots exist in the image blocks, the image blocks with color spots are color-quantized using a first color quantization table to obtain a first image block in a second format. If color spots do not exist in the image blocks, the image blocks without color spots are color-quantized using a second color quantization table to obtain a second image block in a second format. The color quantization step size of the first color quantization table is smaller than the color quantization step size of the second color quantization table. This disclosure uses different color quantization tables for image blocks with and without color spots. Compared with using the same color quantization table, this not only makes the color spots in the processed image less noticeable but also saves storage space.
[0063] Before encoding and quantization, this embodiment first determines whether color spots exist in each image block of the image to be processed. In implementation, a color spot identifier can be used to indicate the presence of color spots in the image block. When a color spot is present in the image block, the corresponding color spot identifier is set to 1; when no color spot is present, the corresponding color spot identifier is set to 0. In the encoder, a first color quantization table is used for image blocks with a color spot identifier of 1; a second color quantization table is used for image blocks with a color spot identifier of 0. This allows for precise reduction of encoding accuracy loss in image blocks containing color spots without significantly reducing the overall compression ratio of the image.
[0064] The following embodiments will describe in detail the process of determining whether there are color spots in each image block, with reference to the accompanying drawings.
[0065] In some embodiments, determining whether there are color spots in a plurality of image patches may include steps 2021 to 2024.
[0066] In step 2021, the target chromaticity weight of the image block is determined based on the relationship between the chromaticity of the image block and a preset chromaticity threshold.
[0067] Since the chromaticity values of color spots are generally small, the preset chromaticity threshold can include a first chromaticity threshold and a second chromaticity threshold. When the chromaticity value is less than or equal to the first chromaticity threshold, the target chromaticity weight is a first value, such as 1; when the chromaticity value is greater than or equal to the second chromaticity threshold, the target chromaticity weight is a second value, such as 0; to avoid abruptness and unnatural transitions, when the chromaticity value is greater than the first chromaticity threshold and less than the second chromaticity threshold, the target chromaticity weight is a third value. The third value is obtained by linear interpolation of the first value and the second value, for example, transitioning from 1 to 0 through interpolation.
[0068] Given the chromaticity of an image patch, the target chromaticity weight of the image patch can be determined based on the relationship between the chromaticity of the image patch and the first chromaticity threshold and the second chromaticity threshold.
[0069] Figure 3 A chromaticity weighting curve is provided as an exemplary embodiment of this disclosure, such as Figure 3 As shown, if the chroma value of an image block is less than or equal to the first chroma threshold, the target chroma weight is 1; if the chroma value of an image block is greater than or equal to the second chroma threshold, the target chroma weight is 0; if the chroma value of an image block is greater than the first chroma threshold and the chroma value is less than the second chroma threshold, the target chroma weight is determined by interpolation.
[0070] In one example, the first chromaticity threshold and the second chromaticity threshold can be preset fixed values.
[0071] In another example, the first chromaticity threshold and the second chromaticity threshold can be determined based on the chromaticity versus brightness curve.
[0072] Figure 4 A chromaticity variation curve is provided as an exemplary embodiment of this disclosure, wherein the curves of the first chromaticity threshold and the second chromaticity threshold varying with luminance are as follows: Figure 4 As shown, the reason why the first and second chromaticity thresholds have different values at different brightness levels is that in a scene where the degree of color spots in dark and bright areas appears similar to the human eye, the actual chromaticity value of the bright area will be larger than that of the dark area. Therefore, adding this curve to set different first and second chromaticity thresholds for different brightness levels is more in line with the characteristics of the human eye.
[0073] That is, based on the brightness and chromaticity variation curves of the image block with brightness, a first chromaticity threshold and a second chromaticity threshold are determined; and based on the relationship between the chromaticity of the image block and the first and second chromaticity thresholds, the target chromaticity weight of the image block is determined.
[0074] Given the brightness values of the image patch, it is possible to Figure 4 The curves shown indicate the determination of a first chromaticity threshold and a second chromaticity threshold. For example, with a brightness value of 20, the first chromaticity threshold is 8, and the second chromaticity threshold is 16. Given the first and second chromaticity thresholds, the target chromaticity weight can be determined according to the relationship between the chromaticity of the image block and the first and second chromaticity thresholds, as described in the above embodiments.
[0075] In step 2022, the target brightness weight of the image block is determined based on the relationship between the brightness of the image block and the brightness threshold.
[0076] Since color spots typically occur in both dark and bright areas, we first define a brightness weight curve that varies with brightness. Figure 5 A luminance weighting curve is provided for an exemplary embodiment of this disclosure, such as Figure 5 As shown, the target brightness weight is at its maximum when the curve is in the dark and bright areas, for example, it can be 1. The target brightness weight is at its minimum in the middle brightness area, and the curve is concave.
[0077] Once the brightness values of the image blocks are obtained, the target brightness weight is determined based on the relationship between the brightness values and the preset brightness threshold.
[0078] When the brightness value is less than or equal to the first brightness threshold, the target brightness weight is 1;
[0079] When the brightness value is greater than the first brightness threshold and less than the second brightness threshold, the target brightness weight is determined by interpolation.
[0080] When the brightness value is greater than the second brightness threshold and less than the third brightness threshold, the target brightness weight is 0;
[0081] When the brightness value is greater than the third brightness threshold and less than the fourth brightness threshold, the target brightness weight is determined by interpolation.
[0082] When the brightness value is greater than or equal to the fourth brightness threshold, the target brightness weight is 1.
[0083] In step 2023, the degree of color spots in the image block is determined based on the target chromaticity weight and the target luminance weight.
[0084] For any image patch in the image to be processed, the target luminance weight and target chrominance weight can be obtained through the above steps 2021 to 2022. Therefore, the degree of color spots of the image patch can be determined according to the product of the target luminance weight and the target chrominance weight.
[0085] For example, the degree of color blemishes in an image patch can be determined using the following formula 1:
[0086] chroma_degree=y_weight*chroma_weight formula 1
[0087] In Formula 1, chroma_degree represents the degree of color spot, y_weigh represents the target luminance weight, and chroma_weight represents the target chroma weight.
[0088] In step 2024, the presence or absence of color spots in the image block is determined based on the relationship between the degree of color spots and the color spot threshold.
[0089] If the degree of the color spot is greater than or equal to the color spot threshold, it is determined that there is a color spot in the image block. In this case, the color spot identifier is set to 1.
[0090] If the degree of the color spot is less than the color spot threshold, it is determined that there are no color spots in the image block. In this case, the color spot identifier is set to 0.
[0091] like Figure 1b As shown, after the image data is converted into DCT frequency coefficients, it enters the quantization stage and then the encoding stage. Quantization involves dividing the frequency domain coefficients after DCT transformation by their respective quantization step size and rounding to the nearest integer to obtain the quantized coefficients.
[0092] In this embodiment, in order to make the color spots less noticeable in image blocks containing color spots after quantization, color quantization tables of different lengths are used for image blocks with different levels of color spots. This ensures that the image compression rate is not significantly affected without exacerbating the color spot problem during encoding.
[0093] Figure 6 This is a comparison diagram of the standard colorimetric table and the first colorimetric table provided in this embodiment, as shown below. Figure 6 As shown, the colorimetric step size of the first colorimetric table is smaller than that of the standard colorimetric table.
[0094] In this embodiment, the colorimetric step size of the first colorimetric table is determined according to a preset quality factor. By using a pre-set quality factor, various images can be adaptively processed with low computational complexity, making it very suitable for practical application development and significantly reducing power consumption.
[0095] In other words, this embodiment identifies the image blocks containing color spots in the BMP lossless image. For image blocks containing color spots, a first color metric table with a shorter step size is used, while a standard color metric table is used for image blocks without color spots. This disclosure uses a first color metric table with a shorter step size for image blocks containing color spots, without changing the overall color metric table of the image. Therefore, while improving the color spot problem, the image compression rate is not significantly affected. Furthermore, this disclosure processes the color spot problem only during the encoding stage, without changing the front-end noise reduction efforts, thus avoiding color loss issues.
[0096] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should know that this disclosure is not limited to the described order of actions, because according to this disclosure, some steps may be performed in other orders or simultaneously.
[0097] Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by this disclosure.
[0098] Corresponding to the aforementioned application function implementation method embodiments, this disclosure also provides embodiments of application function implementation apparatus and corresponding terminals.
[0099] Figure 7 This is a schematic diagram of the structure of an image processing apparatus in an exemplary embodiment of the present disclosure, as shown below. Figure 7 As shown, the device may include:
[0100] The acquisition unit 701 is used to acquire a first-format image to be processed, wherein the image to be processed includes multiple image blocks;
[0101] Determining unit 702 is used to determine whether there are color spots in the plurality of image blocks;
[0102] The processing unit 703 is configured to, when there are color spots in the image block, perform color measurement on the image block with color spots using a first color measurement table to obtain a first image block of a second format, and when there are no color spots in the image block, perform color measurement on the image block without color spots using a second color measurement table to obtain a second image block of a second format, wherein the color measurement step size of the first color measurement table is smaller than the color measurement step size of the second color measurement table.
[0103] In some embodiments, the determining unit is specifically configured to: determine the target chromaticity weight of the image block based on the relationship between the chromaticity of the image block and a preset chromaticity threshold; determine the target luminance weight of the image block based on the relationship between the luminance of the image block and a luminance threshold; determine the degree of color spots in the image block based on the target chromaticity weight and the target luminance weight; and determine whether there are color spots in the image block based on the relationship between the degree of color spots and a color spot threshold.
[0104] In some embodiments, the preset chromaticity threshold includes a first chromaticity threshold and a second chromaticity threshold, and the determining unit is specifically used to: determine the first chromaticity threshold and the second chromaticity threshold according to the luminance and chromaticity variation curves of the image block with luminance; and determine the target chromaticity weight of the image block according to the relationship between the chromaticity of the image block and the first chromaticity threshold and the second chromaticity threshold.
[0105] The determining unit is specifically used to: when the chromaticity value of the image block is less than or equal to the first chromaticity threshold, the target chromaticity weight of the image block is a first value;
[0106] If the chromaticity value of the image block is greater than or equal to the second chromaticity threshold, the target chromaticity weight of the image block is the second value;
[0107] When the chromaticity value of the image block is greater than the first chromaticity threshold and the chromaticity value is less than the second chromaticity threshold, the target chromaticity weight of the image block is a third value, which is obtained by linear interpolation of the first value and the second value.
[0108] In some embodiments, the determining unit is specifically used to: determine that there is a color spot in the image block if the color spot degree is greater than or equal to the color spot threshold; and determine that there is no color spot in the image block if the color spot degree is less than the color spot threshold.
[0109] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0110] Accordingly, this disclosure provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to:
[0111] Obtain an image to be processed in a first format, wherein the image to be processed includes multiple image blocks;
[0112] Determine whether color spots exist in the plurality of image blocks;
[0113] If there are color spots in the image block, the image block with color spots is chromaticized using the first color metric table to obtain the first image block in the second format;
[0114] If there are no color spots in the image block, the image block without color spots is chromaticized using the second chromaticity table to obtain a second image block in the second format. The chromaticity step size of the first chromaticity table is smaller than the chromaticity step size of the second chromaticity table.
[0115] Figure 8This is a schematic diagram illustrating the structure of an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a user device, specifically a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, wearable device such as smartwatch, smart glasses, smart bracelet, smart running shoes, etc.
[0116] Reference Figure 8 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0117] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0118] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0119] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0120] Multimedia component 808 includes a screen that provides an output interface between the aforementioned electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0121] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0122] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0123] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0124] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, 4G or 5G, 4G LTE, 5G NR, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the aforementioned communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0125] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0126] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 804 including instructions, which, when executed by a processor 820 of an electronic device 800, enables the electronic device 800 to perform an image processing method, the method including:
[0127] Obtain an image to be processed in a first format, wherein the image to be processed includes multiple image blocks;
[0128] Determine whether color spots exist in the plurality of image blocks;
[0129] If there are color spots in the image block, the image block with color spots is chromaticized using the first color metric table to obtain the first image block in the second format;
[0130] If there are no color spots in the image block, the image block without color spots is chromaticized using the second chromaticity table to obtain a second image block in the second format. The chromaticity step size of the first chromaticity table is smaller than the chromaticity step size of the second chromaticity table.
[0131] The non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0132] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0133] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An image processing method, characterized in that, The method includes: Obtain an image to be processed in a first format, wherein the image to be processed includes multiple image blocks; Determine whether color spots exist in the plurality of image blocks; If there are color spots in the image block, the image block with color spots is chromaticized using the first color metric table to obtain the first image block in the second format; If there are no color spots in the image block, the image block without color spots is chromaticized using the second chromaticity table to obtain a second image block in the second format. The chromaticity step size of the first chromaticity table is smaller than the chromaticity step size of the second chromaticity table.
2. The method according to claim 1, characterized in that, Determining whether color spots exist in the plurality of image blocks includes: The target chromaticity weight of the image block is determined based on the relationship between the chromaticity of the image block and a preset chromaticity threshold. The target brightness weight of the image block is determined based on the relationship between the brightness of the image block and the brightness threshold. The degree of color spots in the image block is determined based on the target chromaticity weight and the target luminance weight; Based on the relationship between the degree of color spots and the color spot threshold, it is determined whether there are color spots in the image block.
3. The method according to claim 2, characterized in that, The preset chromaticity threshold includes a first chromaticity threshold and a second chromaticity threshold; determining the target chromaticity weight of the image patch based on the relationship between the chromaticity of the image patch and the preset chromaticity threshold includes: The first chromaticity threshold and the second chromaticity threshold are determined based on the brightness and chromaticity variation curves of the image block with brightness. The target chromaticity weight of the image block is determined based on the relationship between the chromaticity of the image block and the first chromaticity threshold and the second chromaticity threshold.
4. The method according to claim 3, characterized in that, Determining the target chromaticity weight of the image patch based on the relationship between the chromaticity of the image patch and the first chromaticity threshold and the second chromaticity threshold includes: When the chromaticity value of the image block is less than or equal to the first chromaticity threshold, the target chromaticity weight of the image block is a first value; If the chromaticity value of the image block is greater than or equal to the second chromaticity threshold, the target chromaticity weight of the image block is the second value; When the chromaticity value of the image block is greater than the first chromaticity threshold and the chromaticity value is less than the second chromaticity threshold, the target chromaticity weight of the image block is a third value, which is obtained by linear interpolation of the first value and the second value.
5. The method according to claim 2, characterized in that, The step of determining whether there are color spots in the image patch based on the relationship between the color spot intensity and the color spot threshold includes: If the degree of the color spot is greater than or equal to the color spot threshold, then it is determined that there is a color spot in the image block; If the degree of color spot is less than the color spot threshold, then it is determined that there are no color spots in the image block.
6. The method according to claim 1, characterized in that, The colorimetric step size of the first colorimetric table is determined according to a preset quality factor.
7. An image processing apparatus, characterized in that, The device includes: An acquisition unit is used to acquire an image to be processed in a first format, wherein the image to be processed includes multiple image blocks; The determining unit is used to determine whether there are color spots in the plurality of image blocks; The processing unit is configured to, when color spots exist in the image block, perform color measurement on the image block with color spots using a first color measurement table to obtain a first image block of a second format, and when there are no color spots in the image block, perform color measurement on the image block without color spots using a second color measurement table to obtain a second image block of a second format, wherein the color measurement step size of the first color measurement table is smaller than the color measurement step size of the second color measurement table.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to perform the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program and instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the method described in any one of claims 1 to 6.