An image processing method, system and storage medium
By using frequency grading and brightness normalized histogram processing, combined with light and shadow smoothing and spatial transformation, the problems of low efficiency and loss of texture in clothing wrinkle removal in existing technologies are solved, achieving a fast and natural clothing wrinkle removal effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN MEITUZHIJIA TECH
- Filing Date
- 2023-01-31
- Publication Date
- 2026-06-26
AI Technical Summary
Existing image processing methods are inefficient and produce low-quality results when removing clothing wrinkles, and professional image editing software has a high learning curve, resulting in processed images that lose their realistic texture.
High-frequency information is obtained through frequency grading, and combined with brightness normalized histogram and inter-class variance calculation, light and shadow flattening and spatial transformation are performed to remove wrinkles while preserving the texture of the clothing. Low-pass filtering is used to extract high-frequency information and superimpose it onto the processed image.
It enables quick and easy removal of clothing wrinkles while preserving the original texture of the garment, resulting in a natural and realistic finish, and reducing the need for labor costs and specialized knowledge.
Smart Images

Figure CN116109507B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image processing method, system and storage medium. Background Technology
[0002] In the commercial photography industry, the smoothness of clothing fabric is one of the most important factors affecting the aesthetics of the final image. Good clothing fabrics are of higher quality and more expensive. The fabric of clothing determines the texture of the garment, so while removing wrinkles from the clothing in the image, it is also necessary to preserve the original texture of the clothing (such as collars, joint bends, and layered folds on the skirt).
[0003] With the rapid development of image processing technology and the gradual increase in market demand, clothing wrinkle removal has become a frequently used technique by professional retouchers. Specifically, it includes smoothing out the clothes while preserving the outline and texture, with a focus on removing wrinkles caused by local unevenness.
[0004] However, existing image processing methods for removing wrinkles from clothing still have many drawbacks. On the one hand, traditional methods require manual pixel-level adjustments to the clothing area using professional image editing software. This not only incurs huge labor costs, but the software itself is also difficult to use, making it hard for those without professional image editing knowledge to quickly master the process. On the other hand, existing image processing algorithms typically use image filtering to process clothing wrinkle details. While this preserves edges, it treats fabric details as noise and removes them, resulting in the processed image losing the realistic texture of the clothing.
[0005] Therefore, existing image processing methods suffer from low efficiency and low quality when removing clothing wrinkles. Summary of the Invention
[0006] The main objective of this invention is to provide an image processing method system and storage medium, which aims to solve the technical problems of low processing efficiency and low quality in existing image processing methods for removing clothing wrinkles.
[0007] To achieve the above objectives, the present invention provides an image processing method comprising the following steps: acquiring an input image, preprocessing it to obtain a high-frequency information map; performing a first spatial transformation on the input image to obtain a first image; and then calculating the brightness normalized histogram of the input image in the clothing segmentation mask region to obtain each component p of the histogram. i , i is the brightness level; based on the components p of the histogram i Calculate the probability P that each pixel is assigned to each class l. l(k), the categories include bright areas, dark areas, and flat mid-area areas, where k is the brightness threshold corresponding to brightness level i; based on P l (k) and p i Calculate the average brightness value m of pixels in each category l. l (k) and global brightness mean m G Based on global brightness mean m G Calculate the inter-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold k. * Based on the optimal brightness threshold k * The threshold segmentation map and the mask region to be processed are obtained. The mask region to be processed is then subjected to light and shadow smoothing and second spatial transformation to obtain the third image. A high-frequency information map is added to the third image to obtain the fourth image.
[0008] Optionally, acquiring the input image and preprocessing it to obtain the high-frequency information map includes at least the following steps: acquiring the input image, obtaining the clothing segmentation mask region and contour point set through image segmentation processing; calculating the bounding box width w and height h of the contour point set, and calculating the radius R of the mean filter using the following formula: The input image in the clothing segmentation mask region is low-pass filtered with radius R to obtain the low-frequency information map L. m Based on the input image and low-frequency information map L m The high-frequency information map G is obtained according to the following formula. m :G m =ML m Where M is the input image.
[0009] Optionally, a high-frequency information map can be added to the third image to obtain the fourth image, specifically according to the following formula:
[0010]
[0011] Where (r3,g3,b3) are the color components of the third image, (r G ,g G ,b G ) is a high-frequency information graph G m The color components (r4, g4, b4) are the color components of the fourth image.
[0012] Optionally, the first color space conversion process involves converting the input image from the RGB color space to the HSV color space, specifically using the following formula:
[0013]
[0014] Where r, g, and b are the corresponding components of the RGB color space, and h, s, and v are the corresponding components of the HSV color space.
[0015] Calculate the normalized histogram of brightness in the clothing segmentation mask region of the input image, and obtain the individual components p of the histogram. i Specifically, let {0,1,2,…,L-1} represent L distinct integer brightness levels in the input image, let L = 255, and let n i Let represent the number of pixels at brightness level i. Then the total number of pixels is MN = n0 + n1 + ... + n L-1 Based on the total number of pixels and the number of pixels at brightness level i, the normalized histogram component p is obtained. i :p i =n i / MN.
[0016] Optionally, based on each component p of the histogram i Calculate the probability P that each pixel is assigned to each class l. l (k), specifically calculated according to the following formula: Where k is the brightness threshold corresponding to brightness level i, and its initial value is the average value between two adjacent classes.
[0017] Optional, based on P l (k) and p i Calculate the average brightness value m of pixels in each category l. l (k) and global brightness mean m G Specifically, the calculations are performed according to the following formulas:
[0018] Optionally, based on the global brightness mean m G Calculate the inter-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold k. * Specifically, the steps include: defining the variance between the i-th and j-th classes as... but Where P i For the histogram components of the i-th class, m i Let P be the average brightness value of the i-th class. j For the histogram components of class j, m j Let P be the average brightness value of the j-th class; obtain P. l (k) is a preset range, and P is selected within the preset range that maximizes the inter-class variance. l The value of (k) is used as the optimal brightness threshold k. * The optimal brightness threshold for the dark area is denoted as... The optimal brightness threshold for the flat central region is denoted as: Optimal brightness threshold for bright areas
[0019] Optionally, based on the optimal brightness threshold k * The threshold segmentation map and the mask region to be processed are obtained. Then, the mask region to be processed is subjected to light and shadow smoothing and second spatial transformation to obtain the third image. Specifically, the steps include: Let... The threshold segmentation map is obtained, and categories 1 and 3 are marked as mask areas to be processed; The color component v in the first image corresponding to the mask area to be processed is replaced to obtain the second image; the second image is then subjected to a second space transformation process according to the following formula to convert it from the Hsv color space to the RGB color space to obtain the third image.
[0020]
[0021]
[0022] (R, G, B) = ((R′+m)*255, (G′+m)*255, (B′+m)*255);
[0023] Where (R,G,B) are the corresponding components of the RGB color space, (H,S,V) are the corresponding components of the HSV color space, and ()mod2 means converting the number in parentheses to decimal, dividing it by 2, and taking the remainder as the calculation result.
[0024] Corresponding to the image processing method described above, the present invention provides an image processing system, comprising: a preprocessing module for acquiring an input image, preprocessing it to obtain a high-frequency information map; a spatial transformation module for performing a first spatial transformation on the input image to obtain a first image, and performing a second spatial transformation to obtain a third image; and a calculation module for calculating the normalized histogram of the brightness of the input image in the clothing segmentation mask region, and obtaining each component p of the histogram. i Let i be the brightness level; calculate the probability P that each pixel is assigned to each category l. l (k), where the categories include bright areas, dark areas, and flat mid-area regions, and k is the brightness threshold corresponding to brightness level i; calculate the average brightness value m of pixels in each category l. l (k) and global brightness mean m G ; Calculate the between-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold k. * Based on the optimal brightness threshold k * The threshold segmentation map and the mask region to be processed are obtained; the overlay module adds a high-frequency information map to the third image to obtain the fourth image.
[0025] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing an image processing program, which, when executed by a processor, implements the steps of the image processing method described above.
[0026] The beneficial effects of this invention are:
[0027] (1) By obtaining three different categories of information through frequency classification, it is convenient to extract high-frequency information and remove the wrinkles of medium and low frequencies. This can remove wrinkles from clothes in the image while preserving the original texture of the clothes. No training cost is required. The algorithm is simple and fast, which improves the efficiency of removing wrinkles from clothes in the image. The third image is obtained through light and shadow flattening and second space transformation. Finally, the high-frequency information image is superimposed to obtain the final wrinkle removal effect image (fourth image). The effect is more natural and realistic.
[0028] (2) The input image is processed by low-pass filtering to perform frequency division processing, which facilitates the extraction of high-frequency information and removes the wrinkles in the middle and low frequencies;
[0029] (3) The input image is converted from the RGB color space to the HSV color space through the first space conversion, which effectively avoids interference from the exclusion of color information;
[0030] (4) The average brightness value after classification is obtained by combining brightness separation with histogram accumulation. The inter-class variance is then used to obtain the thresholded mask area to be processed. The brightness component of the mask area to be processed is adjusted and restored to the original low-frequency image. Finally, the high-frequency information map is superimposed to restore the original texture information, resulting in the final wrinkle removal effect of the clothes. The effect is more natural and realistic, meeting the intelligent and simple requirements of image clothing wrinkle removal. Attached Figure Description
[0031] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0032] Figure 1 This is a simplified flowchart of the image processing method of the present invention;
[0033] Figure 2 This is a simplified schematic diagram illustrating the image processing effect of the present invention. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] like Figure 1 As shown, an image processing method of the present invention includes the following steps: acquiring an input image, preprocessing it to obtain a high-frequency information map; performing a first spatial transformation on the input image to obtain a first image; and then calculating the brightness normalized histogram of the input image in the clothing segmentation mask region F to obtain each component p of the histogram. i , i is the brightness level; based on the components p of the histogram i Calculate the probability P that each pixel is assigned to each class l. l (k), the categories include bright areas, dark areas, and flat mid-area areas, where k is the brightness threshold corresponding to brightness level i; based on P l (k) and p i Calculate the average brightness value m of pixels in each category l. l (k) and global brightness mean m G Based on global brightness mean m G Calculate the inter-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold k. * Based on the optimal brightness threshold k * The threshold segmentation map and the mask region to be processed are obtained. The mask region to be processed is then subjected to light and shadow smoothing and second spatial transformation to obtain the third image. A high-frequency information map is added to the third image to obtain the fourth image.
[0036] This invention obtains three different categories of information through frequency grading, which facilitates the extraction of high-frequency information and removes wrinkles of mid- and low-frequency frequencies. It can remove wrinkles from clothes in an image while preserving the original texture of the clothes. It requires no training cost, the algorithm is simple and fast, and improves the efficiency of wrinkle removal from clothes in images. Through light and shadow flattening processing and second spatial transformation processing, a third image is obtained. Finally, the high-frequency information image is superimposed to obtain the final wrinkle removal effect image (fourth image), which is more natural and realistic.
[0037] In this embodiment, acquiring the input image and preprocessing it to obtain a high-frequency information map includes at least the following steps: acquiring the input image, obtaining the clothing segmentation mask region F and the contour point set P through image segmentation processing; calculating the bounding box width w and height h of the contour point set P, and calculating the radius R of the mean filter using the following formula: The input image in the clothing segmentation mask region F is low-pass filtered with radius R to obtain the low-frequency information map L. m Based on the input image and low-frequency information map L m The high-frequency information map G is obtained according to the following formula. m :G m =ML m Where M is the input image.
[0038] In this embodiment, the probability P of each pixel being assigned to each category l is calculated. l (k) Three categories are defined: dark areas, flat mid-area areas, and bright areas. Assuming dark areas are category 1, the initial threshold is the average value between adjacent categories, 85 (obtained as 255 / 3). The probability of each pixel being assigned to a dark area is calculated to obtain all pixels in category 2. It should be noted that the high-frequency information map is extracted without modification to preserve high-frequency information on the clothing, such as texture and feel. Only the low-frequency information map is processed; the calculation of the three categories is entirely based on the low-frequency information map.
[0039] This invention performs frequency division processing on the input image through low-pass filtering, which facilitates the extraction of high-frequency information and removes mid- and low-frequency wrinkles.
[0040] In this embodiment, a high-frequency information map is added to the third image to obtain the fourth image, specifically according to the following formula:
[0041]
[0042] Where (r3,g3,b3) are the color components of the third image, (r G ,g G ,b G ) is a high-frequency information graph G m The color components (r4, g4, b4) are the color components of the fourth image.
[0043] In this embodiment, the first color space conversion process converts the input image from the RGB color space to the HSV color space, specifically using the following formula:
[0044]
[0045] Where r, g, and b are the corresponding components of the RGB color space, and h, s, and v are the corresponding components of the HSV color space, representing chroma, saturation, and brightness, respectively.
[0046] This invention converts the input image from the RGB color space to the HSV color space through a first space conversion, effectively avoiding interference from the exclusion of color information.
[0047] In this embodiment, the normalized histogram of the brightness of the input image in the clothing segmentation mask region F is calculated to obtain the various components p of the histogram. i Specifically, let {0,1,2,…,L-1} represent L distinct integer brightness levels in the input image, let L = 255, and let n i Let represent the number of pixels at brightness level i. Then the total number of pixels is MN = n0 + n1 + ... + n L-1 Based on the total number of pixels and the number of pixels at brightness level i, the normalized histogram component p is obtained. i :p i =n i / MN.
[0048] In this embodiment, based on each component p of the histogram i Calculate the probability P that each pixel is assigned to each class l (l≤3). l (k), specifically calculated according to the following formula: Where k is the brightness threshold corresponding to brightness level i, and its initial value is the average value between two adjacent classes.
[0049] In this embodiment, based on P l (k) and p i Calculate the average brightness value m of pixels in each category l. l (k) and global brightness mean m G Specifically, the calculations are performed according to the following formulas:
[0050] In this embodiment, based on the global average brightness m G Calculate the inter-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold k. * Specifically, the steps include: defining the variance between the i-th and j-th classes as... but Where P i For the histogram components of the i-th class, m i Let P be the average brightness value of the i-th class. j For the histogram components of class j, m j Let P be the average brightness value of the j-th class; obtain P. l(k) is a preset range, and P is selected within the preset range that maximizes the inter-class variance. l The value of (k) is used as the optimal brightness threshold k. * The optimal brightness threshold for the dark area is denoted as... The optimal brightness threshold for the flat central region is denoted as: Optimal brightness threshold for bright areas
[0051] Preferably, the preset range is: 0 <P l (k)<1.
[0052] In this embodiment, based on the optimal brightness threshold k * The threshold segmentation map and the mask region to be processed are obtained. Then, the mask region to be processed is subjected to light and shadow smoothing and second spatial transformation to obtain the third image. Specifically, the steps include: Let... The threshold segmentation map is obtained. In specific processing, the pixel values of the bright and dark areas are modified to 255 to obtain a binary image (i.e., the threshold segmentation map); and categories 1 (dark areas) and 3 (bright areas) are marked as the mask areas to be processed; The color component v in the first image corresponding to the mask area to be processed is replaced to obtain the second image; the second image is then subjected to a second space transformation process according to the following formula to convert it from the Hsv color space to the RGB color space to obtain the third image.
[0053]
[0054]
[0055] (R, G, B) = ((R′+m)*255, (G′+m)*255, (B′+m)*255);
[0056] Where (R,G,B) are the corresponding components of the RGB color space, (H,S,V) are the corresponding components of the HSV color space, ()mod2 means converting the number in parentheses to decimal, dividing by 2 and taking the remainder as the calculation result, and (C,X,m) and (R′,G′,B′) have no practical meaning and are only used to assist in the calculation.
[0057] This invention obtains the average brightness value after classification by combining brightness separation with histogram accumulation, further utilizes the inter-class variance to obtain a thresholded mask area to be processed, adjusts the brightness component of the mask area to be processed and restores it to the original low-frequency image, and finally superimposes the high-frequency information map to restore the original texture information, resulting in the final wrinkle removal effect image of clothing. The effect is more natural and realistic, meeting the needs of intelligence and simplicity in image clothing wrinkle removal.
[0058] like Figure 2The image shown is a simplified schematic diagram illustrating the image processing effect of the present invention. Wherein, Figure 2 -a is the input image. Figure 2 -b specifies the clothing segmentation mask area F. Figure 2 -c represents the high-frequency information graph G m , Figure 2 -d represents low-frequency information graph L m , Figure 2 -e represents the threshold segmentation map. Figure 2 -f represents the fourth image (the final result).
[0059] Corresponding to the image processing method described above, the present invention provides an image processing system, comprising: a preprocessing module for acquiring an input image, preprocessing it to obtain a high-frequency information map; a spatial transformation module for performing a first spatial transformation on the input image to obtain a first image, and performing a second spatial transformation to obtain a third image; and a calculation module for calculating the normalized histogram of the brightness of the input image in the clothing segmentation mask region, and obtaining each component p of the histogram. i Let i be the brightness level; calculate the probability P that each pixel is assigned to each category l. l (k), where the categories include bright areas, dark areas, and flat mid-area regions, and k is the brightness threshold corresponding to brightness level i; calculate the average brightness value m of pixels in each category l. l (k) and global brightness mean m G ; Calculate the between-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold k. * Based on the optimal brightness threshold k * The threshold segmentation map and the mask region to be processed are obtained; the overlay module adds a high-frequency information map to the third image to obtain the fourth image.
[0060] This invention also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement... Figure 1 The image processing method shown. The computer-readable storage medium may be a read-only memory, a disk, or an optical disk, etc.
[0061] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, device embodiments, and storage medium embodiments, since they are basically similar to the method embodiments, the descriptions are relatively simple, and relevant parts can be referred to the descriptions in the method embodiments.
[0062] Furthermore, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0063] The foregoing description illustrates and describes preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept by means of the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
Claims
1. An image processing method, characterized in that, Includes the following steps: The input image is acquired and preprocessed to obtain a high-frequency information map. The input image undergoes a first spatial transformation to obtain a first image. Then, the normalized histogram of brightness in the clothing segmentation mask region of the input image is calculated to obtain the individual components of the histogram. , Brightness level; Based on the components of the histogram Each pixel is calculated and assigned to each category. probability The categories include highlights, shadows, and flat mid-tone areas. Brightness level The corresponding brightness threshold; based on and Calculate each category Average brightness value of medium pixels Compared with the global average brightness ; Based on global brightness average Calculate the inter-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold. ; Based on the optimal brightness threshold The threshold segmentation map and the mask region to be processed are obtained, and the mask region to be processed is subjected to light and shadow flattening and second space transformation to obtain the third image. Add a high-frequency information map to the third image to obtain the fourth image; The process of acquiring an input image and preprocessing it to obtain a high-frequency information map includes at least the following steps: acquiring the input image, obtaining the clothing segmentation mask region and contour point set through image segmentation processing; and calculating the bounding box width of the contour point set. With height The radius R of the mean filter is calculated using the following formula: The input image within the clothing segmentation mask region is low-pass filtered with radius R to obtain the low-frequency information map L. m Based on the input image and low-frequency information map L m The high-frequency information map G is obtained according to the following formula. m : Where M is the input image; The first spatial transformation process is to transform the input image from... Converting from a color space to the HSV color space is done using the following formula: , in, They are Corresponding components of the color space, These are the corresponding components of the Hsv color space; Calculate the normalized histogram of brightness in the clothing segmentation mask region of the input image, and obtain the individual components of the histogram. Specifically: by Represents the input image Let there be three distinct integer brightness levels. and with Indicates brightness level If the number of pixels is , then the total number of pixels is ; Based on the total number of pixels and brightness level The number of pixels is used to obtain the components of the normalized histogram. : ; Based on the components of the histogram Each pixel is calculated and assigned to each category. probability Specifically, it is calculated according to the following formula: ; in, Brightness level The corresponding brightness threshold is initially set to the average value between two adjacent classes.
2. The image processing method according to claim 1, characterized in that: Adding a high-frequency information map to the third image yields the fourth image, specifically according to the following formula: ; in, For the color components of the third image, For high-frequency information graph G m Color components, For the color components of the fourth image.
3. The image processing method according to claim 1, characterized in that: based on and Calculate each category Average brightness value of medium pixels Compared with the global average brightness Specifically, the calculations are performed according to the following formulas: ; 。 4. The image processing method according to claim 3, characterized in that: Based on global brightness average Calculate the inter-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold. Specifically, it includes the following steps: Definition of the first and The variance between the two classes is ,but ,in For the first Histogram components of the class For the first The average brightness of the class For the first Histogram components of the class For the first The average brightness of the class; Get The preset range is defined, and the class variance is maximized within the preset range. The value is used as the optimal brightness threshold. ; Let the optimal brightness threshold for the dark area be denoted as... The optimal brightness threshold for the flat central region is denoted as... Optimal brightness threshold for bright areas .
5. The image processing method according to claim 4, characterized in that: Based on the optimal brightness threshold The threshold segmentation map and the mask region to be processed are obtained. Then, the mask region to be processed is subjected to light and shadow smoothing and second space transformation to obtain the third image. The specific steps include the following: Separately A threshold segmentation map is obtained, where l = (1, 2, 3); and categories 1 and 3 are marked as mask regions to be processed. by Replace the color components in the first image corresponding to the mask area to be processed. This yields the second image; The second image is transformed from the Hsv color space to the Hsv color space according to the following formula. Color space, to obtain a third image; ; ; ; in, yes Corresponding components of the color space, yes Corresponding components of the color space, This means converting the number in parentheses to decimal, dividing it by 2, and taking the remainder as the result.
6. An image processing system, using the image processing method according to any one of claims 1-5, characterized in that, include: The preprocessing module is used to acquire the input image, preprocess it, and obtain a high-frequency information map; The spatial transformation module is used to perform a first spatial transformation on the input image to obtain a first image, and to perform light and shadow smoothing and a second spatial transformation on the mask area to be processed to obtain a third image; The calculation module is used to calculate the normalized histogram of brightness in the clothing segmentation mask region of the input image, and obtain the individual components of the histogram. , For brightness levels; based on the components of the histogram. Each pixel is calculated and assigned to each category. probability The categories include highlights, shadows, and flat mid-tone areas. Brightness level The corresponding brightness threshold; based on and Calculate each category Average brightness value of medium pixels Compared with the global average brightness ; Based on global brightness average Calculate the inter-class variance The luminance value corresponding to the largest inter-class variance is taken as the optimal luminance threshold. Based on the optimal brightness threshold This yields the threshold segmentation map and the mask region to be processed. The overlay module adds a high-frequency information map to the third image to obtain the fourth image.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an image processing program, which, when executed by a processor, implements the steps of the image processing method as described in any one of claims 1 to 5.