Cascading type figure image green tendon removing method for simulating manual image retouching
Through the cascading image processing method, combined with hand detection, grayscale, neutral gray flattening, soft light mixing and color adjustment, the problem of unnatural treatment of hand veins is solved, and efficient and automated removal of hand veins is achieved, improving the visual effect of the image.
Patent Information
- Application Number
- CN202411796801.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-14
AI Technical Summary
The prior art is difficult to effectively remove veins from hand images, resulting in unnatural or distorted images after processing. The traditional method is cumbersome to operate, making it difficult to achieve large-scale automated processing.
The cascading character image removal method is used to simulate artificial editing. Through the steps of hand detection, grayscale, neutral gray flattening, soft light mixing and color adjustment, the pre-trained neutral gray flattening network and color adjustment network are used to accurately identify and process the blue veins of the hand.
It realizes rapid and batch-processable removal of hand veins, improves the visual effect of the image, makes the hands look healthier and more natural, and avoids loss of image details and unnatural processing effects.
Smart Images

Figure CN119624835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of local character image processing, and in particular to a cascaded character image blue vein removal method simulating manual image retouching. Background Art
[0002] Current portrait beautification algorithms focus on (1) facial blemish treatment, such as freckle and acne removal, facial skin smoothing, and wrinkle removal; (2) body blemish treatment, such as scar removal, mosquito bite removal, and stretch mark removal; and (3) body liquefaction, such as face slimming, body slimming, and height increase. As the requirements for photo editing become more and more sophisticated, the demand for hand beautification is increasing. In some scenarios, the blue veins (veins) on the hands are too obvious and directly affect the aesthetics of the image, so there is a need for a solution to remove the blue veins. Image editing software such as Photoshop can reduce or remove the blue veins on the hands through manual modification or specific tools, but the operation is cumbersome and depends on the user's Photoshop usage skills, and is not suitable for large-scale automated processing. Traditional image filtering algorithms use classic algorithms such as Gaussian blur and mean filtering to remove the blue veins on the hands by blurring the edges of the blue veins or reducing their contrast, but it is easy to cause the loss of image details, and other texture details of the hands may also be affected, causing the processed image to look unnatural or distorted. Deep learning convolutional neural networks have good effects in image denoising, wrinkle removal and detail enhancement, but existing deep learning portrait beautification algorithms are usually designed for facial or whole body beautification tasks. They are often unable to accurately identify and process detailed local processing such as blue veins on the hands, and can easily confuse the blue veins on the hands with other natural skin textures, affecting the overall processing effect. Summary of the invention
[0003] In view of this, the purpose of the present invention is to propose a cascaded method for removing blue veins from human images that simulates manual photo editing, which can provide a fast and batch-processable solution for the photo editing needs of removing blue veins from hands.
[0004] According to one aspect of the present invention, a cascaded method for removing blue veins from a human image by simulating manual photo editing is provided, comprising: Acquire a person image, input it into a hand detection network to obtain hand position information, intercept a hand area image, and obtain a first hand image; grayscale the first hand image to obtain a second hand image; Inputting the first hand image and the second hand image into a pre-trained neutral gray flattening network to generate a neutral gray layer; Softly mix the first hand image with the neutral gray layer to generate the third hand image; Inputting the neutral gray layer and the third hand image into a pre-trained color adjustment network, and outputting a third result image; the color adjustment network is used to correct the skin color of the blue vein area of the input image; The third result image is applied to the person picture to obtain a fourth result image.
[0005] In the above technical solution, it is mainly used to remove the blue veins on the hands of the person image to improve the visual effect of the image. First, obtain the original image containing the person. The original image is input into the hand detection network, which is used to obtain the hand position information to intercept the hand area in the image and generate the first hand image. This step is to focus the processing on the hand area to improve the processing efficiency and accuracy. The first hand image is grayed to generate the second hand image. Graying can remove the color information in the image, so that the subsequent neutral gray leveling network can focus more on the adjustment of brightness and contrast. The first hand image and the second hand image are input into the pre-trained neutral gray leveling network to generate a neutral gray layer. The function of the neutral gray leveling network is to generate a neutral gray layer that adjusts the brightness and contrast of the blue vein area in the image, eliminate the grayscale sudden change caused by the blue vein protrusion in the image, and thus achieve the effect of eliminating the uneven surface of the hand skin caused by the blue vein. The first hand image is mixed with the neutral gray layer by soft light to generate a third hand image. Soft light blending is an image blending mode that can adjust the brightness and contrast of an image while maintaining image details, making the hand image more natural and clear. The neutral gray layer and the third hand image are input into the pre-trained color adjustment network to output the third result image. The color adjustment network is specifically used to correct the skin color of the blue vein area of the input image to ensure that the color of the corrected area is natural and coordinated with the surrounding skin. The third result image is applied to the original person image to output the fourth result image. This step is to reintegrate the processed hand image into the original image to complete the entire image processing process. This solution is specifically targeted at processing hand images, especially the removal of blue veins on the hands. This targeting makes the processing effect more accurate and effective. Through multiple steps such as hand detection, graying, neutral gray leveling, soft light blending and color adjustment, the solution can gradually optimize the image quality. Using pre-trained neutral gray leveling networks and color adjustment networks, which have been trained on a large amount of data, can learn complex image features and adjustment strategies, thereby improving the quality and efficiency of processing. The soft light blending technique can maintain the details and texture of the image while adjusting the brightness and contrast of the image, avoiding over-smoothing or blurring. Through grayscale and neutral gray leveling, the scheme can retain the details of the hand image while adjusting the brightness and contrast. The color adjustment network is specifically used to correct the skin color of the blue vein area. It can very accurately adjust the skin color of the blue vein area to make it more coordinated with the color of the surrounding skin, thereby improving the realism of the image. The scheme can also be adjusted according to different needs. For example, it can adapt to different image processing tasks by replacing or adjusting the pre-trained network, or optimize specific types of images by modifying the processing steps. The final fourth result image is more visually attractive, and the removal of blue veins makes the hands look healthier and more natural.
[0006] In some embodiments, the neutral gray leveling network includes a preprocessing module and a Transformer network connected in sequence; wherein, A preprocessing module, configured to adjust the brightness and darkness relationship of the input second hand image using a pre-trained codebook unit; The Transformer network is configured to take the second hand image adjusted by the preprocessing module and the first hand image as data input, and output a neutral gray layer.
[0007] In the above technical solution, a pre-trained codebook is used in the neutral gray leveling network, which is used to adaptively adjust the light and dark relationship of the second hand image. This is similar to the process of neutral gray retouching, in which the light and dark relationship is highlighted by adjusting the brightness curve of the observation group. The core idea of the codebook is to compress the dynamic range of pixel values, classify close pixel values into one category, and form codewords to simulate complex backgrounds and reduce memory consumption. The codebook can not only simulate complex backgrounds, but also supervise the update frequency, eliminate low-frequency codewords, eliminate noise, and allow the background of the moving foreground to be used as learning materials. The second hand image with enhanced light and dark relationship is input into the deep learning model together with the first hand image. This step helps the neutral gray leveling network output a better quality neutral gray layer. The Transformer model performs well in processing long-distance dependencies and global information with its self-attention mechanism. The overall structure of the model includes input, encoder, decoder, and output. The input word vector is first superimposed with the positional encoding, and then input into the Transformer. Each encoder will perform a multi-head attention and fully connected feedforward network (FFN) processing flow, and then input the output into the next encoder. The output of the last encoder is retained as memory. Each decoder will also perform a similar processing flow, where the K and V of the multi-head attention come from the memory of the encoder. A deep learning model with a Transformer structure is used in the neutral gray leveling network. In the traditional neutral gray retouching technology, the final effect of the image is determined to be brighter or darker based on the brightness of the mixed color by using a soft light blending mode, thereby changing the brightness of the base color. If the mixed color is brighter than 50% medium gray, the image becomes brighter; if the mixed color is darker than 50% medium gray, the image becomes darker; if the mixed color is 50% neutral gray, the brightness of the image remains the same. Transformer's self-attention mechanism allows the model to consider all parts of the image at the same time when processing the image, which is crucial for generating a neutral gray layer because it requires global adjustments to the brightness and contrast of the entire image. In image processing, especially when adjusting brightness and contrast, blurring and artifacts are prone to occur, and Transformer's self-attention mechanism helps reduce these problems.Image data is high-dimensional, and the Transformer model can effectively process such high-dimensional data, especially when generating a neutral gray layer, which requires operations on a high-dimensional feature space. In addition, the structure of the Transformer model can be adjusted and optimized according to the needs of specific tasks; in the task of generating a neutral gray layer, the model can also be customized to better adapt to the characteristics of image processing.
[0008] In some embodiments, the soft light blending is performed as follows: For each pixel at each position, the calculation is performed according to the following formula:
[0009] in, To calculate the result, is the gray value of the original image pixel, It is the grayscale value of the pixel of the neutral gray layer.
[0010] In the above technical solution, the calculation formula of soft light blending is the implementation method of the soft light blending mode in PS, which is a public method. This solution adopts the soft light blending mode to apply the neutral gray layer to the first-hand image in order to achieve the effect of neutral gray retouching. Neutral gray retouching is a retouching technique performed on a neutral gray background, which allows the retoucher to adjust the brightness and contrast of the image without changing the color. In this way, the light and dark relationship of the image can be more finely controlled, thereby improving the overall quality of the image. This retouching technique can be simulated using the soft light blending mode, which can adjust the brightness and contrast of the image without changing the color.
[0011] In some embodiments, The color adjustment network includes a binary processing module and an adjustment network connected in sequence, wherein the adjustment network includes a plurality of branches, each branch corresponding to a type of blue veins; wherein, A binarization processing module, which is configured to perform binarization processing on the input neutral gray layer and obtain binarized images of multiple scales by scaling; The network is adjusted and configured to extract features from the input third hand image and input the features together with the binarized image into several branches, each branch outputs a processing result, and the processing results of each branch are superimposed to output a third result image.
[0012] In the above technical solution, the original hand image is input into the model. The neutral gray layer is binarized to generate a black and white image. This step is used to create a mask that can be used to distinguish different areas in the image, especially the blue vein area. Based on the binarized image, the model performs feature extraction to identify and extract key features in the image, such as the shape and location of the blue veins. The color adjustment network contains multiple branches, each responsible for a different task. For example, one branch focuses on adjusting the color of the skin in the first type of blue veins (blue veins that only show color and do not cause skin unevenness), while another branch focuses on color correction of the skin in the second type of blue veins (blue veins that are protruding and cause skin unevenness), which allows the model to fine-tune the color of the skin in the blue vein area to achieve a more natural appearance. The outputs of all branches are merged in the final stage to generate the final color adjustment result. The key to this solution is that it can distinguish different types of blue veins and apply appropriate color adjustment strategies for each type. By using multi-task learning and feature extraction, the model is able to handle complex image editing tasks more effectively, thereby improving the quality of the final image.
[0013] In some embodiments, the third result image is applied to the person picture to output a fourth result image, specifically: Calculate the difference image between the third result image and the first hand image, perform scale denormalization on the difference image, and add the difference image to the corresponding position of the character image according to [x, y, w, h] obtained by the hand detection network.
[0014] In the above technical solution, first, the difference between the third result image and the first hand image is calculated. This difference image represents the difference between the two images at the pixel level and can be used for subsequent image fusion. The difference image is scaled inverse normalized. Normalization is to scale the image data to a specific range (usually 0 to 1) for processing and calculation. Inverse normalization is to restore the data to the original scale for display or further processing. The hand detection network is used to determine the position and size of the hand in the image, and the parameters [x, y, w, h] are obtained, where x and y are the starting coordinates of the hand area, and w and h are the width and height of the hand area. The difference image is added to the corresponding position of the character image, and only the pixels in the hand area will be updated, and other areas remain unchanged. This ensures that only the visual effect of the hand area is improved without affecting other parts of the image. Compared with directly performing inverse normalization on the third result image and replacing the pixels in the [x, y, w, h] area, using the difference image to apply the effect can reduce the sense of blur. This is because the third result image will become blurred after denormalization, and direct replacement will cause the clarity of the replaced area to be different from the surrounding area, affecting the effect of the fourth result image. Using the difference image can make the transition smoother and better maintain the original high frequency. By calculating the difference image and applying it to the hand area, this solution can improve the visual effect of the hand area without sacrificing the quality of other parts of the image.
[0015] According to another aspect of the present invention, there is provided a cascaded human image vein removal device simulating manual photo editing, characterized in that it comprises: An acquisition module is used to acquire a person image, input a hand detection network to acquire hand position information, intercept a hand area image, and obtain a first hand image; A grayscale module, used for graying the first hand image to obtain a second hand image; A neutral gray module, used for inputting the first hand image and the second hand image into a pre-trained neutral gray flattening network to generate a neutral gray layer; A mixing module, used for softly mixing the first hand image with the neutral gray layer to generate a third hand image; A color adjustment module is used to input the neutral gray layer and the third hand image into a pre-trained color adjustment network, and output a third result image; the color adjustment network is used to perform skin color correction on the blue vein area of the input image; The processing module is used to apply the third result image to the character picture and output a fourth result image.
[0016] In the above technical scheme, in order to better use the above method, the present application proposes a cascaded character image blue vein removal device that simulates manual photo editing. Each module corresponds to each step of the above method. The specific principles have been described above and will not be repeated here.
[0017] According to another aspect of the present invention, there is provided a cascaded human image vein removal device simulating manual photo editing, comprising: at least one processor and a memory communicatively coupled to the at least one processor; 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 so that the at least one processor can perform the above method.
[0018] In the above technical solution, in order to better run and process the method, the above method is stored in a memory, and the stored method is executed by a processor. It should be noted that the principle and effect of each step have been described above and will not be described in detail here.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, storing a computer program, wherein the computer program implements the above method when executed by a processor.
[0020] In the above technical solution, in order to better run and use the method, the above method is stored in a computer-readable storage medium, and the above method is implemented by a processor. It should be noted that the principle and effect of each step have been described above and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention 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, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 It is a flow chart of an embodiment of a cascaded method for removing blue veins from a human image by simulating manual photo editing according to the present invention; Figure 2 It is a schematic diagram of a framework of an embodiment of a cascaded method for removing blue veins from a human image by simulating manual photo editing according to the present invention; Figure 3 It is a schematic diagram of a neutral gray leveling network of an embodiment of a cascaded method for removing blue veins from a human image simulating manual photo retouching according to the present invention; Figure 4It is a color adjustment network schematic diagram of an embodiment of a cascaded human image blue vein removal method simulating manual photo retouching according to the present invention; Figure 5 The present invention is a schematic structural diagram of an embodiment of a cascaded human image blue vein removal device that simulates manual photo editing. DETAILED DESCRIPTION
[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0024] The present invention provides a cascaded method for removing blue veins from human images that simulates manual photo editing, and can provide a fast and batch-processable solution for the photo editing needs of removing blue veins from hands. At the same time, the "cascade" method can be used for step-by-step processing, and the output of each step is passed to the next step for further processing. The cascade structure connects the steps of hand detection, neutral gray leveling, color adjustment, etc. in series to achieve high-quality image processing effects, while maintaining the clarity and efficiency of the entire process.
[0025] Embodiment 1 See also Figure 1 and Figure 2 , a cascaded method for removing blue veins from human images by simulating manual photo editing, comprising: S1, obtaining a person image, inputting a hand detection network to obtain hand position information, intercepting a hand area image, and obtaining a first hand image; S2, performing grayscale processing on the first hand image to obtain a second hand image; S3, inputting the first hand image and the second hand image into a pre-trained neutral gray flattening network to generate a neutral gray layer; S4, performing soft light mixing of the first hand image and the neutral gray layer to generate a third hand image; S5, inputting the neutral gray layer and the third hand image into a pre-trained color adjustment network, and outputting a third result image; the color adjustment network is used to perform skin color correction in the blue vein area of the input image; S6. Apply the third result image to the person picture to obtain a fourth result image.
[0026] In this embodiment, it is mainly used to remove the blue veins in the hands of the character image to improve the visual effect of the image. First, obtain the original image containing the character. The original image is input into the hand detection network, which is used to obtain the hand position information to intercept the hand area in the image and generate the first hand image. This step is to focus the processing on the hand area to improve the processing efficiency and accuracy. The first hand image is grayed to generate the second hand image. Graying can remove the color information in the image, so that the subsequent neutral gray leveling network can focus more on the adjustment of brightness and contrast. The first hand image and the second hand image are input into the pre-trained neutral gray leveling network to generate a neutral gray layer. The function of the neutral gray leveling network is to generate a neutral gray layer that adjusts the brightness and contrast of the blue vein area in the image, eliminate the grayscale sudden change caused by the blue vein protrusion in the image, and thus eliminate the uneven surface of the hand skin caused by the blue vein. The first hand image is mixed with the neutral gray layer with soft light to generate a third hand image. Soft light blending is an image blending mode that can adjust the brightness and contrast of an image while maintaining image details, making the hand image more natural and clear. The neutral gray layer and the third hand image are input into the pre-trained color adjustment network to output the third result image. The color adjustment network is specifically used to correct the skin color of the blue vein area of the input image to ensure that the skin color of the blue vein area is natural and coordinated with the surrounding skin. The third result image is applied to the original person image to output the fourth result image. This step is to reintegrate the processed hand image into the original image to complete the entire image processing process. This solution is specifically targeted at processing hand images, especially the removal of blue veins on the hands. This targeting makes the processing effect more accurate and effective. Through multiple steps such as hand detection, graying, neutral gray leveling, soft light blending and color adjustment, the solution can gradually optimize the image quality. Using pre-trained neutral gray leveling networks and color adjustment networks, these networks have been trained on a large amount of data and can learn complex image features and adjustment strategies, thereby improving the quality and efficiency of processing. The soft light mixing technology can maintain the details and texture of the image while adjusting the brightness and contrast of the image, avoiding over-smoothing or blurring. Through grayscale and neutral gray leveling, the scheme can retain the details of the hand image while adjusting the brightness and contrast. The color adjustment network is specifically used to correct the skin color in the blue vein area. It can very accurately adjust the skin color in the blue vein area to make it more coordinated with the color of the surrounding skin, thereby improving the realism of the image. The scheme can also be adjusted according to different needs. For example, it can adapt to different image processing tasks by replacing or adjusting the pre-trained network, or optimize specific types of images by modifying the processing steps. The final fourth result image is more visually attractive, and the removal of blue veins makes the hands look healthier and more natural.
[0027] In this example, see Figure 3 The neutral gray leveling network includes a preprocessing module and a Transformer network connected in sequence; wherein the preprocessing module is configured to use a pre-trained codebook unit to adjust the light and dark relationship of the input second hand image; the Transformer network is configured to use the second hand image adjusted by the preprocessing module and the first hand image as data input, and output a neutral gray layer.
[0028] Neutral gray photo retouching in PS requires creating a layer filled with 50% gray (grayscale value is 128) with a blending mode of "soft light". The retoucher uses a brush with a grayscale value greater than 128 to paint on the areas that need to be brightened, and uses a brush with a grayscale value less than 128 to paint on the areas that need to be darkened, in order to achieve the effect of smoothing the skin. In the process of performing brightening or darkening operations, it is necessary to create an observation group to assist by graying the image and enhancing the light and dark relationship of the image. The neutral gray leveling network simulates this step. Its input includes not only the RGB image of the processing area, that is, the first-hand image mentioned above, but also its grayscale image, that is, the second-hand image mentioned above. The specific structure and process of the neutral gray leveling network are as follows. Figure 3 As shown. In particular, in the neutral gray leveling network, there is a pre-trained (the pre-training process can be referred to the prior art, and will not be repeated here) code book, which is used to adaptively adjust the light and dark relationship of the second hand image, corresponding to the process of neutral gray retouching by adjusting the brightness curve of the observation group to highlight the light and dark relationship, which helps the neutral gray leveling network output a neutral gray layer with better quality. The second hand image with enhanced light and dark relationship is input into a deep learning model with a transformer structure together with the first hand image to obtain a neutral gray layer. The self-attention mechanism of the Transformer enables it to perform well in processing long-distance dependencies and global information.
[0029] In this embodiment, a pre-trained codebook is used in the neutral gray leveling network, and its function is to adaptively adjust the light and dark relationship of the second hand image. This is similar to the process of neutral gray retouching, in which the light and dark relationship is highlighted by adjusting the brightness curve of the observation group. The core idea of the codebook is to compress the dynamic range of pixel values, classify close pixel values into one category, and form codewords (CodeWord) to simulate complex backgrounds and reduce memory consumption. The codebook can not only simulate complex backgrounds, but also supervise the update frequency, eliminate low-frequency codewords, eliminate noise, and allow the background of the moving foreground to be used as learning materials. The second hand image with enhanced light and dark relationship is input into the deep learning model together with the first hand image. This step helps the neutral gray leveling network output a neutral gray layer with better quality. The Transformer model performs well in processing long-distance dependencies and global information with its self-attention mechanism. The overall structure of the model includes input, encoder, decoder, and output. The input word vector is first superimposed with positional encoding and then input into the Transformer. Each encoder performs a multi-head attention and fully connected feedforward network (FFN) process, and then inputs the output into the next encoder. The output of the last encoder is retained as memory. Each decoder also performs a similar process, where the K and V of the multi-head attention come from the encoder's memory. A deep learning model with a Transformer structure is used in the neutral gray leveling network. In the traditional neutral gray retouching technology, the final effect of the image is determined to be brighter or darker based on the brightness of the mixed color by using a soft light blending mode, thereby changing the brightness of the base color. If the mixed color is brighter than 50% neutral gray, the image becomes brighter; if the mixed color is darker than 50% neutral gray, the image becomes darker; if the mixed color is 50% neutral gray, the brightness of the image remains the same. The self-attention mechanism of the Transformer allows the model to consider all parts of the image at the same time when processing the image, which is crucial for generating a neutral gray layer because it requires global adjustments to the brightness and contrast of the entire image. In image processing, blurring and artifacts are prone to occur, especially when adjusting brightness and contrast. The Transformer's self-attention mechanism helps reduce these problems.Image data is high-dimensional, and the Transformer model can effectively process such high-dimensional data, especially when generating a neutral gray layer, which requires operations on a high-dimensional feature space. In addition, the structure of the Transformer model can be adjusted and optimized according to the needs of specific tasks; in the task of generating a neutral gray layer, the model can also be customized to better adapt to the characteristics of image processing.
[0030] In this embodiment, the soft light mixing is performed in the following manner: For each pixel at each position, the calculation is performed according to the following formula:
[0031] in, To calculate the result, is the gray value of the original image pixel, It is the grayscale value of the pixel of the neutral gray layer.
[0032] In this embodiment, the calculation formula of soft light blending is the implementation method of the soft light blending mode in PS, which is a public method. This scheme adopts the use of the soft light blending mode to apply the neutral gray layer to the first-hand image in order to achieve the effect of neutral gray retouching. Neutral gray retouching is a retouching technique performed on a neutral gray background, which allows the retoucher to adjust the brightness and contrast of the image without changing the color. In this way, the light and dark relationship of the image can be more finely controlled, thereby improving the overall quality of the image. This retouching technique can be simulated using the soft light blending mode, which can adjust the brightness and contrast of the image without changing the color.
[0033] In this example, see Figure 4 The color adjustment network includes a binary processing module and an adjustment network connected in sequence, and the adjustment network includes a plurality of branches, each branch corresponding to a type of blue veins; wherein, A binarization processing module, which is configured to perform binarization processing on the input neutral gray layer and obtain binarized images of multiple scales by scaling; The network is adjusted and configured to extract features from the input third hand image and input the features together with the binarized image into several branches, each branch outputs a processing result, and the processing results of each branch are superimposed to output a third result image.
[0034] In this embodiment, the specific structure and process of the color adjustment network are as follows: Figure 4As shown. From the simplest perspective, the blue veins on the hands can be classified into two categories: the first category is blue veins that only show color and do not cause skin unevenness; the second category is blue veins that are protruding and cause skin unevenness. Although the former has no protrusions, the color change is subtle. The latter has a stronger and more obvious blue-green color because the blood vessels are closer to the skin surface, and requires more careful processing to avoid color mutation or over-smoothing. From this perspective, the color adjustment network has two branches, one branch focuses on the color correction of the first type of blue vein area, and the other branch focuses on the color correction of the second type of blue vein area. Finally, the results of the two branches are merged. Multi-task learning ensures that the model can effectively handle the color correction problem of the skin in the two types of blue vein areas. The original hand image is input into the model. The neutral gray layer is binarized to generate a black and white image. This step is used to create a mask that can be used to distinguish different areas in the image, especially the blue vein area. Based on the binarized image, the model performs feature extraction to identify and extract key features in the image, such as the shape and position of the blue veins. The color adjustment network contains multiple branches, each responsible for a different task. For example, one branch focuses on adjusting the color of the skin in the area of the first type of blue veins (blue veins that are only colored and do not cause skin unevenness), while the other branch focuses on color correction of the skin in the area of the second type of blue veins (blue veins that are protruding and cause skin unevenness), which allows the model to fine-tune the color of the skin in the blue vein area to achieve a more natural appearance. The outputs of all branches are merged in the final stage to generate the final color adjustment result. The key to this scheme is that it can distinguish different types of blue veins and apply appropriate color adjustment strategies for each type. By using multi-task learning and feature extraction, the model is able to handle complex image editing tasks more effectively, thereby improving the quality of the final image.
[0035] In this embodiment, the third result image is applied to the person picture to output a fourth result image. Specifically: Calculate the difference image between the third result image and the first hand image, perform scale denormalization on the difference image, and add the difference image to the corresponding position of the character image according to [x, y, w, h] obtained by the hand detection network.
[0036] In this embodiment, first, the difference between the third result image and the first hand image is calculated. This difference image represents the difference between the two images at the pixel level and can be used for subsequent image fusion. The difference image is scaled inverse normalized. Normalization is to scale the image data to a specific range (usually 0 to 1) for processing and calculation. Inverse normalization is to restore the data to the original scale for display or further processing. The hand detection network is used to determine the position and size of the hand in the image, and the parameters [x, y, w, h] are obtained, where x and y are the starting coordinates of the hand area, and w and h are the width and height of the hand area. The difference image is added to the corresponding position of the character image, and only the pixels in the hand area will be updated, and other areas remain unchanged. This ensures that only the visual effect of the hand area is improved without affecting other parts of the image. Compared with directly performing inverse normalization on the third result image and replacing the pixels in the [x, y, w, h] area, using the difference image to apply the effect can reduce the sense of blur. This is because the third result image will become blurred after denormalization, and direct replacement may cause the replaced area to have a different clarity from the surrounding area, affecting the effect of the fourth result image. Using the difference image can make the transition smoother and better maintain the original high frequency. By calculating the difference image and applying it to the hand area, this solution can improve the visual effect of the hand area without sacrificing the quality of other parts of the image.
[0037] For a more intuitive understanding of the present invention, please refer to Figure 2 , the simplified steps are as follows: 1. Input the image of the hand to be de-veined into the hand detection network to obtain the bounding box of the hand area in the image. .
[0038] 2. According to Cut out the hand area.
[0039] 3. Grayscale the hand area to obtain a grayscale image.
[0040] 4. Input the hand area and the hand area grayscale image into the neutral gray smoothing network and output the neutral gray layer.
[0041] 5. Apply the Neutral Gray layer to the hand area with soft light blending to get a neutral gray smooth result.
[0042] 6. Input the neutral gray layer and the neutral gray leveling result into the color adjustment network to obtain the color adjustment result.
[0043] 7. Apply the color adjustment result to the image of the hand where the blue veins are to be removed to obtain the result image.
[0044] Embodiment 2 See also Figure 5, a cascaded human image vein removal device simulating manual photo editing, characterized in that it comprises: An acquisition module is used to acquire a person image, input a hand detection network to obtain hand position information, intercept a hand area image, and obtain a first hand image; A grayscale module, used for graying the first hand image to obtain a second hand image; A neutral gray module, used for inputting the first hand image and the second hand image into a pre-trained neutral gray flattening network to generate a neutral gray layer; A mixing module, used for softly mixing the first hand image with the neutral gray layer to generate a third hand image; A color adjustment module is used to input the neutral gray layer and the third hand image into a pre-trained color adjustment network, and output a third result image; the color adjustment network is used to perform skin color correction on the blue vein area of the input image; The processing module is used to apply the third result image to the character picture and output a fourth result image.
[0045] In this embodiment, in order to better use the method described in one of the embodiments, the present application proposes a cascaded character image blue vein removal device that simulates manual photo editing. Each module corresponds to each step of the above method. The specific principles have been described above and will not be repeated here.
[0046] Embodiment 3 A cascaded human image vein removal device simulating manual photo editing, comprising: at least one processor and a memory communicatively coupled to the at least one processor; 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 so that the at least one processor can execute the method described in one of the embodiments.
[0047] In this embodiment, in order to better run and process the method described in one of the embodiments, the above method is stored in a memory, and a processor is used to execute the stored method. It should be noted that the principle and effect of each step have been described above and will not be described in detail here.
[0048] Embodiment 4 A computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the method described in one of the embodiments is implemented.
[0049] In this embodiment, in order to better run and use the method described in one of the embodiments, the method is stored in a computer-readable storage medium and implemented by a processor. It should be noted that the principle and effect of each step have been described above and will not be described in detail here.
[0050] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A cascaded method for removing blue veins from human images by simulating manual photo editing, characterized in that: The method comprises: Acquire a person image, input it into a hand detection network to obtain hand position information, intercept a hand area image, and obtain a first hand image; grayscale the first hand image to obtain a second hand image; Inputting the first hand image and the second hand image into a pre-trained neutral gray flattening network to generate a neutral gray layer; Softly mix the first hand image with the neutral gray layer to generate the third hand image; Inputting the neutral gray layer and the third hand image into a pre-trained color adjustment network, and outputting a third result image; the color adjustment network is used to correct the skin color of the blue vein area of the input image; The third result image is applied to the person picture to obtain a fourth result image.
2. A cascaded method for removing blue veins from human images by simulating manual photo editing as claimed in claim 1, characterized in that: The neutral gray leveling network includes a preprocessing module and a Transformer network connected in sequence; wherein, A preprocessing module, configured to adjust the brightness and darkness relationship of the input second hand image using a pre-trained codebook unit; The Transformer network is configured to take the second hand image adjusted by the preprocessing module and the first hand image as data input, and output a neutral gray layer.
3. The method for removing blue veins from a cascaded human image by simulating manual photo editing as claimed in claim 1, characterized in that: The soft light blending is performed as follows: For each pixel at each position, the calculation is performed according to the following formula: in, To calculate the result, is the gray value of the original image pixel, It is the grayscale value of the pixel of the neutral gray layer.
4. The cascaded method for removing blue veins from human images by simulating manual photo editing as claimed in claim 1, characterized in that: The color adjustment network includes a binary processing module and an adjustment network connected in sequence, wherein the adjustment network includes a plurality of branches, each branch corresponding to a type of blue veins; wherein, A binarization processing module, which is configured to perform binarization processing on the input neutral gray layer and obtain binarized images of multiple scales by scaling; The network is adjusted and configured to extract features from the input third hand image and input the features together with the binarized image into several branches, each branch outputs a processing result, and the processing results of each branch are superimposed to output a third result image.
5. The cascaded method for removing blue veins from human images by simulating manual photo editing as claimed in claim 1, characterized in that: Apply the third result image to the person picture to output a fourth result image. Specifically: Calculate the difference image between the third result image and the first hand image, perform scale denormalization on the difference image, and add the difference image to the corresponding position of the character image according to [x, y, w, h] obtained by the hand detection network.
6. A cascaded human image vein removal device simulating manual photo editing, characterized in that: include: An acquisition module is used to acquire a person image, input a hand detection network to obtain hand position information, intercept a hand area image, and obtain a first hand image; A grayscale module, used for graying the first hand image to obtain a second hand image; A neutral gray module, used for inputting the first hand image and the second hand image into a pre-trained neutral gray flattening network to generate a neutral gray layer; A mixing module, used for softly mixing the first hand image with the neutral gray layer to generate a third hand image; A color adjustment module is used to input the neutral gray layer and the third hand image into a pre-trained color adjustment network, and output a third result image; the color adjustment network is used to perform skin color correction on the blue vein area of the input image; The processing module is used to apply the third result image to the character picture and output a fourth result image.
7. A cascaded human image vein removal device simulating manual photo editing, characterized in that: include: at least one processor and a memory communicatively coupled to the at least one processor; 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 so that the at least one processor can execute the method as claimed in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.