WO2022227547A1 - Method and apparatus for image processing, electronic device, and storage medium - Google Patents
Method and apparatus for image processing, electronic device, and storage medium Download PDFInfo
- Publication number
- WO2022227547A1 WO2022227547A1 PCT/CN2021/133400 CN2021133400W WO2022227547A1 WO 2022227547 A1 WO2022227547 A1 WO 2022227547A1 CN 2021133400 W CN2021133400 W CN 2021133400W WO 2022227547 A1 WO2022227547 A1 WO 2022227547A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- pixel point
- target
- pixels
- value
- pixel
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000012545 processing Methods 0.000 title claims abstract description 14
- 230000004927 fusion Effects 0.000 claims abstract description 53
- 238000011156 evaluation Methods 0.000 claims description 90
- 238000012937 correction Methods 0.000 claims description 71
- 238000003672 processing method Methods 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 10
- 230000003190 augmentative effect Effects 0.000 claims description 6
- 238000013528 artificial neural network Methods 0.000 description 13
- 238000012986 modification Methods 0.000 description 11
- 230000004048 modification Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000008859 change Effects 0.000 description 6
- 230000007704 transition Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 241001465754 Metazoa Species 0.000 description 2
- 239000011521 glass Substances 0.000 description 1
- 230000037308 hair color Effects 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/047—Probabilistic or stochastic networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Definitions
- the present disclosure relates to the technical field of image processing, and in particular, to a method, an apparatus, an electronic device, and a storage medium for image processing.
- images are widely used in various scenarios such as work and life.
- the picture in the image can be modified. For example, you can change the color value of an object in the picture by replacing the color value of the pixels in the image.
- the color of the picture is usually more complicated. If the color value of the pixel of an object in the picture is directly replaced with a certain value, the part of the object connected with other parts in the picture will lose the transition color, which will make the There is a big difference between the effect of the object after the color change and the original image.
- Embodiments of the present disclosure provide at least an image processing method, an apparatus, an electronic device, and a storage medium.
- an embodiment of the present disclosure provides an image processing method, including: acquiring a probability value that at least some pixels in an original image are target pixels, wherein the target pixels are in the original image and belong to a target object The pixel point; for any pixel point in the at least part of the pixel point, based on the probability value that the pixel point is the target pixel point and the preselected target color value, determine the fusion color value corresponding to the pixel point ; Adjust the color values of the at least part of the pixel points in the original image by using the fusion color values corresponding to the at least part of the pixel points respectively, to obtain a target image.
- the target object whose color needs to be replaced can be identified from the original image.
- the target image there is a certain difference between the pixels near and inside the target object to form a transition color, so that the characteristics of the target object after color replacement are more in line with the original image.
- the obtaining the probability value that at least some of the pixels in the original image are target pixels includes: extracting image feature information in the original image; determining the image feature information based on the image feature information At least some of the pixels in the original image are the initial probability values of the target pixels; based on the initial probability values of the at least some of the pixels as the target pixels and the color values of the at least some of the pixels, the standard color value is determined ; For any pixel point in the at least part of the pixel points, based on the standard color value and the color value of the pixel point, the initial probability value that the pixel point is the target pixel point is calibrated to obtain the The pixel point is the probability value of the target pixel point.
- a standard color value is determined based on the initial probability value and color value of at least some of the pixels for the target pixel, and then the initial probability value is corrected by using the color values and standard color values corresponding to at least some of the pixels, so that at least The probability value that some of the pixels are the target pixels is more in line with the real situation, and the accuracy of identifying the target object is improved.
- the determining, based on the image feature information corresponding to the original image, that at least some of the pixels in the original image are the initial probability values of the target pixel points includes: based on the image features information, determine that at least some of the pixels in the original image are the evaluation scores of the target pixels; for any pixel in the at least some of the pixels, based on the preset evaluation score correction threshold and the pixel are The evaluation score of the target pixel point determines that the pixel point is the initial probability value of the target pixel point.
- the evaluation scores of at least some of the pixels are modified by using the evaluation score correction threshold to obtain the initial probability value, so that the initial probability value is more accurate.
- the evaluation score correction threshold includes a first correction threshold and a second correction threshold, and the first correction threshold is greater than the second correction threshold.
- the determining that the pixel point is an initial probability value of the target pixel point based on the preset evaluation score correction threshold and the pixel point being the evaluation score of the target pixel point includes: when the pixel point is the target pixel point.
- the evaluation score of the target pixel is greater than or equal to the first correction threshold, determine that the pixel is the initial probability value of the target pixel.
- the initial probability value is the first preset probability value; In the case where the evaluation score of the target pixel is less than or equal to the second correction threshold, determine that the pixel is the initial probability value of the target pixel as the second preset probability value; In the case where the evaluation score of the target pixel is less than the first correction threshold and greater than the second correction threshold, the pixel is based on the evaluation score of the target pixel, the first correction threshold and the second correction threshold.
- the modified threshold determines the initial probability value that the pixel point is the target pixel point.
- the eligible pixels can be directly determined as the initial probability value of the target pixel, which can reduce the amount of calculation for calculating the initial probability value and improve the calculation efficiency.
- the pixel point is determined as the target pixel point based on the evaluation score of the pixel point as the target pixel point, the first correction threshold and the second correction threshold
- the initial probability value of including: determining the first difference between the first correction threshold and the second correction threshold; determining that the pixel point is the evaluation score of the target pixel point and the second correction threshold
- the second difference between the two based on the ratio between the second difference and the first difference, determine that the pixel is an initial probability value of the target pixel.
- the initial probability value is determined by using the ratio between the second difference value and the first difference value, which can improve the accuracy of the initial probability value.
- the determining a standard color value based on the initial probability value that the at least part of the pixel points are the target pixel point and the color value of the at least part of the pixel point includes: determining the at least part of the pixel point.
- the initial probability value is higher than or equal to the first pixel point with a preset probability threshold; the average value of the color values of all the first pixel points is used as the standard color value.
- the initial probability value that the pixel point is the target pixel point is calibrated based on the standard color value and the color value of the pixel point, and the pixel point is obtained as
- the probability value of the target pixel point includes: determining the similarity between the color value of the pixel point and the standard color value; based on the similarity, determining the initial probability that the pixel point is the target pixel point The value is calibrated to obtain the probability value that the pixel point is the target pixel point.
- the initial probability is corrected by using the similarity between the color value of the pixel point and the standard color value, so as to further improve the accuracy of the probability value.
- the determining the fusion color value corresponding to the pixel point based on the probability value that the pixel point is the target pixel point and the preselected target color value includes: based on the pixel point The point is the probability value of the target pixel point, and the color fusion weight corresponding to the pixel point is determined; based on the color value of the pixel point, the target color value and the color fusion weight corresponding to the pixel point, the color fusion weight corresponding to the pixel point is determined The fusion color value corresponding to the pixel point.
- the color fusion weight corresponding to the pixel point is determined based on the probability value that the pixel point is the target pixel point, and then the color value of the pixel point and the target color value are fused based on the color fusion weight to obtain the corresponding pixel point. Fusion color value, so that the fusion color value can reflect the original color value of the pixel and the target color value according to the color fusion weight, so that the boundary of the target object forms a transition color, so that the characteristics of the target object after color replacement are more in line with the original image. .
- the method further includes: for the at least part of the pixel points any pixel point of the original image, determine the target gray-scale value corresponding to the pixel point based on the gray-scale value of the pixel point in the original image and/or the preset gray-scale value corresponding to the pixel point; The grayscale value of the pixel point corresponding to the pixel point in the target image is adjusted to the target grayscale value corresponding to the pixel point.
- the target gray-scale value of at least some pixels in the target image is determined by using the gray-scale values of at least some pixels in the original image and/or the preset gray-scale values of at least some pixels.
- the brightness of the target object is adjusted so that the characteristics of the target object after color replacement are more in line with user expectations.
- the extracting image feature information in the original image includes: extracting image feature information of the original image at multiple preset resolutions.
- the determining, based on the image feature information, that at least some of the pixels in the original image are the evaluation scores of the target pixels includes: using a preset classifier to determine the lowest resolution among the multiple preset resolutions At least some of the pixels in the original image are the initial evaluation scores of the target pixels under the preset resolution of At least some of the pixels in the original image are the initial evaluation scores of the target pixels and the image feature information of the original image at the current preset resolution, and determine the original image at the current preset resolution.
- At least some of the pixels in the image are the intermediate evaluation scores of the target pixels; at least some of the pixels in the original image will be the target pixels at the highest preset resolution among the multiple preset resolutions
- the intermediate evaluation score of as the evaluation score of at least some of the pixels in the original image being the target pixel.
- the accuracy of calculating the probability value can be improved.
- the original image includes a live image captured by an augmented reality AR device, and the AR device displays the target image.
- the original image is acquired by the AR device, and the target image is displayed by the AR device, so that the real-time color change of the target object in the AR scene can be realized.
- the original image includes: an image of a target person, wherein the target object includes at least one of a human hair area, a human skin area, and at least part of a clothing area in the target person image or a target object image, wherein the target object is at least part of the object area in the target object image.
- the target person image or the target object image is used as the original image, so as to realize the color adjustment of the human hair area, the human skin area, the clothing area or the object area.
- an embodiment of the present disclosure further provides an image processing apparatus, including: an acquisition module configured to acquire a probability value that at least some of the pixels in the original image are target pixels, wherein the target pixels are the original A pixel point belonging to the target object in the image; a determination module, configured to determine, for any pixel point in the at least part of the pixel point, based on the probability value that the pixel point is the target pixel point and the preselected target color value The fusion color value corresponding to the pixel point; the generating module is configured to adjust the color value of the at least part of the pixel point in the original image by using the fusion color value corresponding to the at least part of the pixel point respectively, to obtain the target image.
- embodiments of the present disclosure further provide an electronic device, including: a processor, a memory, and a bus, where the memory stores machine-readable instructions; the processor is configured to execute the machine-readable instructions stored in the memory , wherein, when the electronic device is running, the processor and the memory communicate through a bus, and the machine-readable instructions are executed by the processor to execute the first aspect or any one of the first aspects. steps in a possible implementation.
- embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to execute the first aspect, or any one of the first aspect. steps in one possible implementation.
- FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present disclosure
- FIG. 2 shows a schematic diagram of a confidence map provided by an embodiment of the present disclosure
- FIG. 3 shows a schematic diagram of a neural network provided by an embodiment of the present disclosure
- FIG. 4 shows a schematic diagram of an image processing apparatus provided by an embodiment of the present disclosure
- FIG. 5 shows a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
- the present disclosure provides a method, an apparatus, an electronic device and a storage medium for image processing.
- the probability value that at least some of the pixels in the original image are target pixels it is possible to identify the color that needs to be replaced from the original image.
- the target object, the fusion color value corresponding to at least part of the pixel points is determined based on the probability value of at least part of the pixel points for the target pixel point and the preselected target color value, and then the target image is generated based on the fusion color value.
- the target image there is a certain difference between the pixels near and inside the target object, forming a transition color, so that the characteristics of the target object after color replacement are more in line with the original image.
- an embodiment of the present disclosure discloses an image processing method, which can be applied to an electronic device with computing capability, such as a server.
- the image processing method may include the following steps:
- the target pixel point is a pixel point belonging to the target object in the original image.
- the above-mentioned original image may be a live image captured by an augmented reality (AR) (Augmented Reality) device.
- AR augmented reality
- the original image can be acquired in real time, and the probability value that at least some of the pixels in the original image are target pixels can be determined.
- the AR device may be a smart terminal with AR function held by the user, and may include, but is not limited to, electronic devices such as mobile phones, tablet computers, and AR glasses that can present augmented reality effects.
- the above-mentioned at least some of the pixels may be all pixels in the original image, or may be pixels in a preset area, and the preset area may be an area pre-selected by a user.
- the target pixel can be a pixel belonging to the target object in the original image, and the target object can be the area where the object that needs to be replaced by color is located.
- the original image may be an image containing hair
- the hair may specifically be human hair, animal hair, or the like.
- the area that needs to be replaced by color is, for example, the hair area of a human body, or the hair area of an animal.
- the original image may be a target person image
- the target object may include, but is not limited to, at least one of a human hair area, a human skin area, a human eye area, and at least part of a clothing area in the target person image.
- the original image may also be an image of a target object, and the target object image may include one or more object objects.
- the target object may be at least part of the object area in the target object image.
- the object may be a tree area in the target object image, and the tree area may be a trunk area of a tree, a leaf area, or an entire area of the tree.
- the probability value that at least some of the pixels in the original image are target pixels may be determined by the following steps: extracting image feature information in the original image; determining the original image based on the image feature information At least some of the pixels in the image are the initial probability values of the target pixels; based on the initial probability values of the at least some of the pixels as the target pixels and the color values of the at least some of the pixels, a standard color value is determined; Based on the standard color value and the color value of the at least part of the pixel points, the initial probability value of the at least part of the pixel points being the target pixel point is calibrated, and the calibrated initial probability value is used as the The probability value that at least some of the pixels in the original image are the target pixels.
- the above-mentioned determining that at least some of the pixels in the original image are the initial probability values of the target pixels may include: determining, based on the image feature information, that at least some of the pixels in the original image are the evaluation scores of the target pixels; For any pixel in the at least part of the pixels, based on the preset evaluation score correction threshold and the evaluation score of the pixel as the target pixel, determine the initial probability value of the pixel as the target pixel.
- the above image feature information may be feature parameters of at least some pixels in the original image, such as color value, saturation, brightness, and the like.
- the trained neural network can be used to process the image feature information to obtain the evaluation score that at least some of the pixels are the target pixel, and then use the evaluation score to correct the threshold and the evaluation score to determine that at least some of the pixels in the original image are the target pixel. initial probability value.
- image feature information of the original image at various preset resolutions may be extracted, and then the trained neural network may be used to determine the evaluation scores of at least some of the pixels as target pixels.
- the neural network may use a feature extractor to extract image feature information of an original image at multiple preset resolutions. Specifically, the image feature information of the original image at the highest preset resolution can be extracted first, and then the obtained image feature information can be down-sampled to obtain the image feature information of the original image at each preset resolution.
- the neural network can use the preset classifier to determine the initial evaluation score that at least some of the pixels in the original image are target pixels at the lowest preset resolution . Then, in the order of the preset resolution from low to high, based on the initial evaluation score of at least some of the pixels in the original image at the previous preset resolution as target pixels, and the image features of the original image at the current preset resolution information and a classifier to determine that at least some of the pixels in the original image at the current preset resolution are the intermediate evaluation scores of the target pixels. Finally, at the highest preset resolution, at least some of the pixels in the original image are the intermediate evaluation scores of the target pixels, and output as the evaluation scores of at least some of the pixels in the original image as the target pixels.
- the initial evaluation score under the previous preset resolution may be up-sampled, so that the resolution of the evaluation score under the previous preset resolution is the same as that of the previous preset resolution.
- the resolutions of the evaluation scores under the current preset resolution are the same, and then the evaluation scores under the two preset resolutions are spliced to obtain the spliced evaluation scores under the current preset resolution.
- the above neural network can be trained by using a pre-prepared data set.
- the data set can include a large number of images and labels corresponding to the images.
- the images contain target objects, and the labels can be marked with pixels corresponding to the target objects.
- the output of different preset resolutions can be supervised, and the small-resolution output can be fused with the features of the low-level large-resolution output, so that the small-resolution output can learn more Good semantic categories, while the large-resolution output learns finer details, thereby improving the accuracy of the neural network.
- the loss can be calculated according to the output results of the neural network and the labeling results.
- the target object Compared with other backgrounds, the target object often has a color jump at the boundary, so it has a clear gradient. Therefore, a refine loss loss function that can better preserve the boundary gradient can be used, so that the boundary of the target object in the image output by the neural network has a similar gradient to the image input to the neural network, so as to obtain a more refined edge prediction result.
- the pixel points can be classified by using the evaluation score correction threshold, so that different initial probability value calculation methods can be adopted for different types of pixel points, so as to facilitate calculation optimization.
- the evaluation score modification threshold includes a first modification threshold and a second modification threshold; the first modification threshold is greater than the second modification threshold.
- determining the pixel point as the initial probability value of the target pixel point based on the preset evaluation score correction threshold and the pixel point as the evaluation score of the target pixel point including: evaluating the pixel point When the score is greater than or equal to the first correction threshold, the initial probability value of the pixel as the target pixel is determined to be the first preset probability value; the evaluation score of the pixel is less than or equal to the second In the case of correcting the threshold, the initial probability value of determining that the pixel is the target pixel is a second preset probability value; the evaluation score of the pixel is less than the first correction threshold and greater than the second correction threshold In the case of , the initial probability value that the pixel is the target pixel is determined based on the evaluation score of the pixel being the target pixel, the first correction threshold and the second correction threshold.
- the first correction threshold may be set to 0.7
- the second correction threshold may be set to 0.4.
- the probability of the pixel being the target pixel is low and can be ignored, so the initial probability value of the pixel being the target pixel can be directly set to 0, that is The second preset probability value.
- the probability of the pixel being the target pixel is relatively high, so the initial probability value of the pixel being the target pixel can be set to 1, that is, the first Preset probability value.
- the above-mentioned determining that the pixel is the initial probability value of the target pixel based on the evaluation score of the pixel as the target pixel, the first correction threshold and the second correction threshold may include: determining the first correction threshold. a first difference between a modified threshold and the second modified threshold; determining a second difference between the evaluation score and the second modified threshold; based on the second difference and the first The ratio between the differences determines the initial probability value.
- the ratio between the second difference and the first difference may be used as the initial probability value.
- the pixel For a pixel whose initial probability value is higher than or equal to the preset probability threshold, the pixel can be considered as a target pixel.
- the average value of the color values of the plurality of pixel points whose initial probability value is higher than or equal to the preset probability threshold value can be used as the standard color value, and the initial probability value can be corrected by using the standard color value, so as to obtain at least some of the pixel points as the target The probability value of the pixel point.
- the preset probability threshold may be the same as the first correction threshold, and the mean value of the color values of the pixels whose initial probability value is higher than or equal to the preset probability threshold may be determined, and the mean value may be used as the standard color value. In this way, since the standard color value is relatively close to the color value of the target pixel point, the standard color value can be used to correct the initial probability value of each pixel point being the target pixel point.
- the similarity between the color value of the pixel and the standard color value may be determined for any of the above at least some of the pixels;
- the point is the initial probability value of the target pixel for calibration.
- the initial probability value may be weighted by using the similarity between the color value of the pixel point and the standard color value, and the weighted probability value may be used as the probability value that the pixel point is the target pixel point.
- FIG. 2 it is a schematic diagram of a confidence map provided by an embodiment of the present disclosure.
- the above confidence map can represent the probability value that at least some of the pixels in the original image are target pixels.
- the original image corresponding to the confidence map shown in FIG. 2 is a human image
- the target object is the area where human hair is located.
- the probability value of the target pixel corresponding to the hair in Figure 2 is close to 1, which tends to be white in the confidence map, while the probability value of the pixels corresponding to other parts is close to 0, which tends to be in the confidence map. black.
- the above-mentioned target color value may be a color value preset by a user. For example, if the user wishes to replace the hair color in Figure 2 with brown, the color value corresponding to brown can be set as the target color value.
- determining the corresponding fusion color value based on the probability value that the pixel point is the target pixel point and the preselected target color value may include: based on the probability that the pixel point is the target pixel point. value, and determine the color fusion weight corresponding to the pixel point; based on the color value of the pixel point, the target color value, and the color fusion weight corresponding to the pixel point, determine the fusion color value corresponding to the pixel point.
- the original color value of the pixel point (that is, the color value of the pixel point in the original image, which may also be referred to as the color value of the pixel point) and the fusion weight of the target color value can be determined based on the above probability value, and According to the ratio of the fusion weight, the original color value of the pixel point and the target color value are fused to obtain the fusion color value corresponding to the pixel point.
- the original color value of the pixel point and the target color value can be fused by means of alpha fusion.
- the result is obtained.
- the fusion color value corresponding to the pixel point so that the fusion color value can reflect the original color value of the pixel point and the target color value according to the color fusion weight, so that the boundary of the target object can form a transition color, so that the target object can be replaced after color replacement.
- the features are more in line with the original image.
- the color values of at least some of the pixels in the original image may be replaced according to the fusion color values corresponding to the above at least some of the pixels to obtain the target image.
- the target image is generated, based on the grayscale values of the at least part of the pixels in the original image, and/or the preset grayscale values of the at least part of the pixels, it is possible to determine, respectively, corresponding to the at least part of the pixels. target grayscale value, and then adjust the grayscale value of the at least part of the pixel points in the target image to the corresponding target grayscale value.
- the brightness of the target object after the color change can be adjusted, so that the target object can keep the original texture and brightness after the color replacement is performed, and the characteristics are more in line with the user's expectation.
- an AR device can also be used to display the obtained target image, so as to realize the real-time color change of the target object in the AR scene.
- the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its function and possible Internal logic is determined.
- the embodiment of the present disclosure also provides an image processing apparatus corresponding to the image processing method. Reference can be made to the implementation of the method, and repeated details will not be repeated.
- the apparatus includes: an acquisition module 410 for acquiring a probability value that at least some of the pixels in the original image are target pixels.
- the target pixel point is a pixel point belonging to the target object in the original image.
- the determining module 420 is configured to, for any pixel point in the at least part of the pixel points, determine the fusion color value corresponding to the pixel point based on the probability value that the pixel point is the target pixel point and the preselected target color value.
- the generating module 430 is configured to adjust the color values of the at least part of the pixel points in the original image by using the fusion color values corresponding to the at least part of the pixel points respectively, to obtain a target image.
- the obtaining module 410 is specifically configured to: extract image feature information in the original image; determine at least some of the pixels in the original image as the target based on the image feature information the initial probability value of the pixel point; based on the initial probability value of the at least part of the pixel point being the target pixel point and the color value of the at least part of the pixel point, determine a standard color value; based on the standard color value and the at least color values of some pixels, calibrate the initial probability value that at least some of the pixels are the target pixel, and use the calibrated initial probability value as at least some of the pixels in the original image.
- the probability value of the target pixel point is specifically configured to: extract image feature information in the original image; determine at least some of the pixels in the original image as the target based on the image feature information the initial probability value of the pixel point; based on the initial probability value of the at least part of the pixel point being the target pixel point and the color value of the at least part of the pixel point, determine a standard color value;
- the obtaining module 410 when determining, based on the image feature information, that at least some of the pixels in the original image are the initial probability values of the target pixels, is specifically configured to: the image feature information, determine that at least some of the pixels in the original image are the evaluation scores of the target pixels; for any pixel in the at least part of the pixels, based on the preset evaluation score correction threshold and the pixel are The evaluation score of the target pixel point determines that the pixel point is the initial probability value of the target pixel point.
- the evaluation score modification threshold includes a first modification threshold and a second modification threshold; the first modification threshold is greater than the second modification threshold.
- the acquisition module 410 determines that the pixel is the initial probability value of the target pixel based on the preset evaluation score correction threshold and the pixel is the evaluation score of the target pixel, it is specifically used for: In the case that the evaluation score of the pixel point is greater than or equal to the first correction threshold, determine that the pixel point is the initial probability value of the target pixel point as the first preset probability value; when the evaluation score of the pixel point is less than or equal to the second correction threshold, determine that the initial probability value of the pixel point as the target pixel point is a second preset probability value; the evaluation score of the pixel point is less than the first correction threshold value and In the case of being greater than the second correction threshold, based on the evaluation score of the pixel point being the target pixel point, the first correction threshold value and the second correction threshold value, it is determined that the pixel point is a part of the target pixel point. initial probability value.
- the obtaining module 410 determines that the pixel is the target based on the evaluation score of the pixel as the target pixel, the first correction threshold and the second correction threshold
- the initial probability value of the pixel point is specifically used to: determine the first difference between the first correction threshold and the second correction threshold; determine the first difference between the evaluation score and the second correction threshold Two difference values; the initial probability value is determined based on the ratio between the second difference value and the first difference value.
- the obtaining module 410 determines the standard color value based on the initial probability value that the at least part of the pixel points are the target pixel point and the color value of the at least part of the pixel point
- the specific It is used for: determining the mean value of the color values of a plurality of pixel points whose initial probability value is higher than or equal to a preset probability threshold value, and using the mean value as the standard color value.
- the obtaining module 410 is specifically configured to: any pixel point in the at least part of the pixel points, to determine the similarity between the color value of the pixel point and the standard color value; based on the similarity, the initial probability that the pixel point is the target pixel point value to calibrate.
- the determining module 420 determines the corresponding fusion color value based on the probability value that the at least part of the pixel points are the target pixel point and the preselected target color value, it is specifically used for : Determine the color fusion weight corresponding to the pixel point based on the probability value that the pixel point is the target pixel point; based on the color value of the pixel point, the target color value and the color fusion corresponding to the pixel point Weight, to determine the fusion color value corresponding to the pixel point.
- the generating module 430 is further configured to: based on the grayscale values of the at least part of the pixels in the original image and/or the preset grayscale values of the at least part of the pixels , determine the target grayscale values corresponding to the at least part of the pixel points respectively; adjust the grayscale values of the pixel points corresponding to the at least part of the pixel points in the target image to the target grayscale value corresponding to the pixel points order value.
- the obtaining module 410 when extracting the image feature information in the original image, is specifically configured to: extract image feature information of the original image under multiple preset resolutions.
- the obtaining module is specifically configured to: use a preset classifier to determine, by using a preset classifier, that in the original image at the lowest preset resolution. At least some of the pixels are the initial evaluation scores of the target pixels; according to the preset resolution from low to high, based on the previous preset resolution, at least some of the pixels in the original image are the initial evaluation scores of the target pixels and the original.
- the image feature information of the image at the current preset resolution determining that at least some of the pixels in the original image under the current preset resolution are the intermediate evaluation scores of the target pixel; the original image at the highest preset resolution is determined.
- the intermediate evaluation scores of at least some of the pixels in the original image are taken as the evaluation scores of at least some of the pixels in the original image being the target pixels.
- the acquiring module 410 when acquiring the probability value that at least some of the pixels in the original image are target pixels, is specifically configured to: take the live image captured by the augmented reality AR device as the original image, and acquire The probability value that at least some of the pixels in the original image are the target pixels.
- the generating module 430 is further configured to: display the target image by using the AR device.
- the acquiring module 410 when acquiring the probability value that at least some of the pixels in the original image are target pixels, is specifically configured to: take the target person image as the original image, wherein the target object Including at least one of the human hair area, human skin area, and at least part of the clothing area in the target person image; or, using the target object image as the original image, wherein the target object is in the target object image. at least part of the object area. Obtain a probability value that at least some of the pixels in the original image are target pixels.
- an embodiment of the present disclosure further provides an electronic device 500 .
- a schematic structural diagram of the electronic device 500 provided by the embodiment of the present disclosure includes: a processor 51 and a memory 52 , and bus 53.
- the memory 52 is used to store execution instructions, including a memory 521 and an external memory 522, where the memory 521 is also called an internal memory, and is used to temporarily store operation data in the processor 51 and data exchanged with an external memory 522 such as a hard disk.
- the processor 51 exchanges data with the external memory 522 through the memory 521.
- the processor 51 communicates with the memory 52 through the bus 53, so that the processor 51 can execute the following instructions :
- the probability value that at least some of the pixels in the original image are target pixels, where the target pixels are pixels belonging to the target object in the original image; for any pixel in the at least some of the pixels, Based on the probability value that the pixel point is the target pixel point and the preselected target color value, determine the fusion color value corresponding to the pixel point; use the fusion color value corresponding to the at least part of the pixel points to compare the original The color values of the at least part of the pixels in the image are adjusted to obtain the target image.
- Embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the steps of the image processing method described in the foregoing method embodiments are executed.
- the storage medium may be a volatile or non-volatile computer-readable storage medium.
- Embodiments of the present disclosure further provide a computer program product, including a computer-readable storage medium storing program codes, wherein the instructions included in the program codes can be used to execute the steps of the image processing methods in the above method embodiments, specifically Refer to the above method embodiments, which are not repeated here.
- the computer program product can be specifically implemented by means of hardware, software or a combination thereof.
- the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
- the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the functions, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a processor-executable non-volatile computer-readable storage medium.
- the computer software products are stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Health & Medical Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Probability & Statistics with Applications (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Evolutionary Biology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
- Color Image Communication Systems (AREA)
Abstract
Provided in the present disclosure are a method and an apparatus for image processing, an electronic device, and a storage medium. According to an example of the method: after acquiring an original image, determining a probability value of at least some of the pixel points in the original image being target pixel points, the target pixel points being pixel points belonging to a target object in the original image; then, for any one pixel point amongst the at least some pixel points, on the basis of the probability value of the pixel point being a target pixel point and a pre-selected target colour value, determining a fusion colour value corresponding to the pixel point; and finally, using the fusion colour values corresponding to the at least some pixel points to adjust the colour values of the at least some pixel points in the original image in order to obtain a target image.
Description
相关申请交叉引用Cross-reference to related applications
本公开要求于2021年4月29日提交的、申请号为202110473454.0、发明名称为“图像处理方法、装置、电子设备及存储介质”的中国专利申请的优先权,该中国专利申请公开的全部内容以引用的方式并入本文中。This disclosure claims the priority of the Chinese patent application filed on April 29, 2021 with the application number 202110473454.0 and the invention titled "image processing method, device, electronic device and storage medium", the entire content of which is disclosed in the Chinese patent application Incorporated herein by reference.
本公开涉及图像处理技术领域,具体而言,涉及用于图像处理的方法、装置、电子设备及存储介质。The present disclosure relates to the technical field of image processing, and in particular, to a method, an apparatus, an electronic device, and a storage medium for image processing.
图像作为一种常规的信息承载媒介,在工作、生活等各个场景都被广泛应用。通过修改图像中像素点的图像参数,可以对图像中的画面进行修改。比如,可以通过替换图像中像素点的颜色值,改变画面中某个对象的颜色值。然而,画面的颜色通常是较为复杂的,若直接将画面中某个对象的像素点的颜色值替换为某个特定值,画面中的该对象与其他部分连接的部分会失去过渡色,使进行换色后的对象所呈现出来的效果与原图像之间存在较大的差异。As a conventional information-bearing medium, images are widely used in various scenarios such as work and life. By modifying the image parameters of the pixels in the image, the picture in the image can be modified. For example, you can change the color value of an object in the picture by replacing the color value of the pixels in the image. However, the color of the picture is usually more complicated. If the color value of the pixel of an object in the picture is directly replaced with a certain value, the part of the object connected with other parts in the picture will lose the transition color, which will make the There is a big difference between the effect of the object after the color change and the original image.
发明内容SUMMARY OF THE INVENTION
本公开实施例至少提供一种图像处理方法、装置、电子设备及存储介质。Embodiments of the present disclosure provide at least an image processing method, an apparatus, an electronic device, and a storage medium.
第一方面,本公开实施例提供了一种图像处理方法,包括:获取原始图像中至少部分像素点为目标像素点的概率值,其中,所述目标像素点为所述原始图像中属于目标对象的像素点;针对所述至少部分像素点中的任一像素点,基于所述像素点为所述目标像素点的概率值和预先选择的目标颜色值,确定所述像素点对应的融合颜色值;利用所述至少部分像素点分别对应的所述融合颜色值对所述原始图像中所述至少部分像素点的颜色值进行调整,得到目标图像。In a first aspect, an embodiment of the present disclosure provides an image processing method, including: acquiring a probability value that at least some pixels in an original image are target pixels, wherein the target pixels are in the original image and belong to a target object The pixel point; for any pixel point in the at least part of the pixel point, based on the probability value that the pixel point is the target pixel point and the preselected target color value, determine the fusion color value corresponding to the pixel point ; Adjust the color values of the at least part of the pixel points in the original image by using the fusion color values corresponding to the at least part of the pixel points respectively, to obtain a target image.
该方面,通过确定原始图像至少部分像素点为目标像素点的概率值,能够从原始图像中识别出需要替换颜色的目标对象。基于至少部分像素点为所述目标像素点的概率值和预先选择的目标颜色值确定至少部分像素点对应的融合颜色值,再利用融合颜色值 调整至少部分像素点的颜色值,得到目标图像,使得目标图像中,目标对象附近与内部的像素点之间产生一定的区别,形成过渡色,从而使目标对象在进行颜色替换后的特征更符合原始图像。In this aspect, by determining the probability value that at least some of the pixels in the original image are target pixels, the target object whose color needs to be replaced can be identified from the original image. Determine the fusion color value corresponding to at least part of the pixel points based on the probability value that at least part of the pixel points are the target pixel point and the preselected target color value, and then use the fusion color value to adjust the color value of at least part of the pixel points to obtain the target image, In the target image, there is a certain difference between the pixels near and inside the target object to form a transition color, so that the characteristics of the target object after color replacement are more in line with the original image.
在一种可能的实施方式中,所述获取原始图像中至少部分像素点为目标像素点的概率值,包括:提取所述原始图像中的图像特征信息;基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的初始概率值;基于所述至少部分像素点为所述目标像素点的初始概率值及所述至少部分像素点的颜色值,确定标准颜色值;针对所述至少部分像素点中任一像素点,基于所述标准颜色值以及所述像素点的颜色值,对所述像素点为所述目标像素点的初始概率值进行校准,得到所述像素点为所述目标像素点的概率值。In a possible implementation manner, the obtaining the probability value that at least some of the pixels in the original image are target pixels includes: extracting image feature information in the original image; determining the image feature information based on the image feature information At least some of the pixels in the original image are the initial probability values of the target pixels; based on the initial probability values of the at least some of the pixels as the target pixels and the color values of the at least some of the pixels, the standard color value is determined ; For any pixel point in the at least part of the pixel points, based on the standard color value and the color value of the pixel point, the initial probability value that the pixel point is the target pixel point is calibrated to obtain the The pixel point is the probability value of the target pixel point.
该实施方式,基于至少部分像素点为所述目标像素点的初始概率值及颜色值确定标准颜色值,再利用至少部分像素点对应的颜色值和标准颜色值对初始概率值进行修正,使得至少部分像素点为所述目标像素点的概率值更符合真实情况,提高识别目标对象的精度。In this embodiment, a standard color value is determined based on the initial probability value and color value of at least some of the pixels for the target pixel, and then the initial probability value is corrected by using the color values and standard color values corresponding to at least some of the pixels, so that at least The probability value that some of the pixels are the target pixels is more in line with the real situation, and the accuracy of identifying the target object is improved.
在一种可能的实施方式中,所述基于所述原始图像对应的图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的初始概率值,包括:基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的评价分数;针对所述至少部分像素点中的任一像素点,基于预设的评价分数修正阈值和所述像素点为所述目标像素点的评价分数,确定所述像素点为所述目标像素点的初始概率值。In a possible implementation manner, the determining, based on the image feature information corresponding to the original image, that at least some of the pixels in the original image are the initial probability values of the target pixel points includes: based on the image features information, determine that at least some of the pixels in the original image are the evaluation scores of the target pixels; for any pixel in the at least some of the pixels, based on the preset evaluation score correction threshold and the pixel are The evaluation score of the target pixel point determines that the pixel point is the initial probability value of the target pixel point.
该实施方式,利用评价分数修正阈值对至少部分像素点的评价分数进行修正,得到初始概率值,使初始概率值更加准确。In this embodiment, the evaluation scores of at least some of the pixels are modified by using the evaluation score correction threshold to obtain the initial probability value, so that the initial probability value is more accurate.
在一种可能的实施方式中,所述评价分数修正阈值包括第一修正阈值和第二修正阈值,所述第一修正阈值大于所述第二修正阈值。所述基于预设的评价分数修正阈值和所述像素点为所述目标像素点的评价分数,确定所述像素点为所述目标像素点的初始概率值,包括:在所述像素点为所述目标像素点的评价分数大于或等于所述第一修正阈值的情况下,确定所述像素点为所述目标像素点的初始概率值为第一预设概率值;在所述像素点为所述目标像素点的评价分数小于或等于所述第二修正阈值的情况下,确定所述像素点为所述目标像素点的初始概率值为第二预设概率值;在所述像素点为所述目标像素点的评价分数小于第一修正阈值且大于所述第二修正阈值的情况下,基于所述像素点为所述目标像素点的评价分数、所述第一修正阈值以及所述第二修正阈值确定所述像素 点为所述目标像素点的初始概率值。In a possible implementation manner, the evaluation score correction threshold includes a first correction threshold and a second correction threshold, and the first correction threshold is greater than the second correction threshold. The determining that the pixel point is an initial probability value of the target pixel point based on the preset evaluation score correction threshold and the pixel point being the evaluation score of the target pixel point includes: when the pixel point is the target pixel point. When the evaluation score of the target pixel is greater than or equal to the first correction threshold, determine that the pixel is the initial probability value of the target pixel. The initial probability value is the first preset probability value; In the case where the evaluation score of the target pixel is less than or equal to the second correction threshold, determine that the pixel is the initial probability value of the target pixel as the second preset probability value; In the case where the evaluation score of the target pixel is less than the first correction threshold and greater than the second correction threshold, the pixel is based on the evaluation score of the target pixel, the first correction threshold and the second correction threshold. The modified threshold determines the initial probability value that the pixel point is the target pixel point.
该实施方式,通过设置第一修正阈值和第二修正阈值,可直接确定符合条件的像素点为所述目标像素点的初始概率值,能够降低计算初始概率值的计算量,提高计算效率。In this embodiment, by setting the first correction threshold and the second correction threshold, the eligible pixels can be directly determined as the initial probability value of the target pixel, which can reduce the amount of calculation for calculating the initial probability value and improve the calculation efficiency.
在一种可能的实施方式中,所述基于所述像素点为所述目标像素点的评价分数、所述第一修正阈值以及所述第二修正阈值确定所述像素点为所述目标像素点的初始概率值,包括:确定所述第一修正阈值与所述第二修正阈值之间的第一差值;确定所述像素点为所述目标像素点的评价分数与所述第二修正阈值之间的第二差值;基于所述第二差值与所述第一差值之间的比值,确定所述像素点为所述目标像素点的初始概率值。In a possible implementation manner, the pixel point is determined as the target pixel point based on the evaluation score of the pixel point as the target pixel point, the first correction threshold and the second correction threshold The initial probability value of , including: determining the first difference between the first correction threshold and the second correction threshold; determining that the pixel point is the evaluation score of the target pixel point and the second correction threshold The second difference between the two; based on the ratio between the second difference and the first difference, determine that the pixel is an initial probability value of the target pixel.
该实施方式,利用第二差值与第一差值之间的比值确定初始概率值,能够提高初始概率值的精确度。In this embodiment, the initial probability value is determined by using the ratio between the second difference value and the first difference value, which can improve the accuracy of the initial probability value.
在一种可能的实施方式中,所述基于所述至少部分像素点为所述目标像素点的初始概率值及所述至少部分像素点的颜色值,确定标准颜色值,包括:确定所述至少部分像素点中所述初始概率值高于或等于预设概率阈值的第一像素点;将所有所述第一像素点的颜色值的均值,作为所述标准颜色值。In a possible implementation manner, the determining a standard color value based on the initial probability value that the at least part of the pixel points are the target pixel point and the color value of the at least part of the pixel point includes: determining the at least part of the pixel point. In some pixel points, the initial probability value is higher than or equal to the first pixel point with a preset probability threshold; the average value of the color values of all the first pixel points is used as the standard color value.
在一种可能的实施方式中,所述基于所述标准颜色值以及所述像素点的颜色值,对所述像素点为所述目标像素点的初始概率值进行校准,得到所述像素点为所述目标像素点的概率值,包括:确定所述像素点的颜色值与所述标准颜色值之间的相似度;基于所述相似度对所述像素点为所述目标像素点的初始概率值进行校准,得到所述像素点为所述目标像素点的概率值。In a possible implementation manner, the initial probability value that the pixel point is the target pixel point is calibrated based on the standard color value and the color value of the pixel point, and the pixel point is obtained as The probability value of the target pixel point includes: determining the similarity between the color value of the pixel point and the standard color value; based on the similarity, determining the initial probability that the pixel point is the target pixel point The value is calibrated to obtain the probability value that the pixel point is the target pixel point.
该实施方式,利用像素点的颜色值与标准颜色值之间的相似度对初始概率进行修正,进一步提升概率值的精确度。In this embodiment, the initial probability is corrected by using the similarity between the color value of the pixel point and the standard color value, so as to further improve the accuracy of the probability value.
在一种可能的实施方式中,所述基于所述像素点为所述目标像素点的概率值和预先选择的目标颜色值,确定所述像素点对应的融合颜色值,包括:基于所述像素点为所述目标像素点的概率值,确定所述像素点对应的颜色融合权重;基于所述像素点的颜色值、所述目标颜色值以及所述像素点对应的颜色融合权重,确定所述像素点对应的融合颜色值。In a possible implementation manner, the determining the fusion color value corresponding to the pixel point based on the probability value that the pixel point is the target pixel point and the preselected target color value includes: based on the pixel point The point is the probability value of the target pixel point, and the color fusion weight corresponding to the pixel point is determined; based on the color value of the pixel point, the target color value and the color fusion weight corresponding to the pixel point, the color fusion weight corresponding to the pixel point is determined The fusion color value corresponding to the pixel point.
该实施方式,通过先基于像素点为所述目标像素点的概率值确定像素点对应的颜色融合权重,再基于颜色融合权重将像素点的颜色值和目标颜色值进行融合,得到像素 点对应的融合颜色值,使得融合颜色值能够按照颜色融合权重反映出像素点原本的颜色值和目标颜色值,从而使目标对象的边界形成过渡色,使目标对象在进行颜色替换后的特征更符合原始图像。In this embodiment, the color fusion weight corresponding to the pixel point is determined based on the probability value that the pixel point is the target pixel point, and then the color value of the pixel point and the target color value are fused based on the color fusion weight to obtain the corresponding pixel point. Fusion color value, so that the fusion color value can reflect the original color value of the pixel and the target color value according to the color fusion weight, so that the boundary of the target object forms a transition color, so that the characteristics of the target object after color replacement are more in line with the original image. .
在一种可能的实施方式中,在利用确定的所述融合颜色值对所述至少部分像素点的颜色值进行调整,得到目标图像之后,所述方法还包括:针对所述至少部分像素点中的任一像素点,基于所述原始图像中所述像素点的灰阶值、和/或所述像素点对应的预设灰阶值,确定所述像素点对应的目标灰阶值;将所述目标图像中与所述像素点对应的像素点的灰阶值,调整为所述像素点对应的所述目标灰阶值。In a possible implementation manner, after adjusting the color values of the at least part of the pixel points by using the determined fusion color value to obtain the target image, the method further includes: for the at least part of the pixel points any pixel point of the original image, determine the target gray-scale value corresponding to the pixel point based on the gray-scale value of the pixel point in the original image and/or the preset gray-scale value corresponding to the pixel point; The grayscale value of the pixel point corresponding to the pixel point in the target image is adjusted to the target grayscale value corresponding to the pixel point.
在该实施方式,利用原始图像中至少部分像素点的灰阶值和/或至少部分像素点的预设灰阶值确定目标图像中至少部分像素点的目标灰阶值,可以对换色后的目标对象的亮度进行调整,使目标对象在进行颜色替换后的特征更符合用户期望。In this embodiment, the target gray-scale value of at least some pixels in the target image is determined by using the gray-scale values of at least some pixels in the original image and/or the preset gray-scale values of at least some pixels. The brightness of the target object is adjusted so that the characteristics of the target object after color replacement are more in line with user expectations.
在一种可能的实施方式中,所述提取所述原始图像中的图像特征信息包括:提取所述原始图像在多种预设分辨率下的图像特征信息。所述基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的评价分数,包括:利用预设的分类器,确定在所述多种预设分辨率中最低的预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的初始评价分数;按照所述多种预设分辨率从低到高的顺序,基于前一所述预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的所述初始评价分数以及所述原始图像在当前预设分辨率下的图像特征信息,确定当前预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的中间评价分数;将在所述多种预设分辨率中最高的预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的中间评价分数,作为所述原始图像中至少部分像素点为所述目标像素点的评价分数。In a possible implementation manner, the extracting image feature information in the original image includes: extracting image feature information of the original image at multiple preset resolutions. The determining, based on the image feature information, that at least some of the pixels in the original image are the evaluation scores of the target pixels, includes: using a preset classifier to determine the lowest resolution among the multiple preset resolutions At least some of the pixels in the original image are the initial evaluation scores of the target pixels under the preset resolution of At least some of the pixels in the original image are the initial evaluation scores of the target pixels and the image feature information of the original image at the current preset resolution, and determine the original image at the current preset resolution. At least some of the pixels in the image are the intermediate evaluation scores of the target pixels; at least some of the pixels in the original image will be the target pixels at the highest preset resolution among the multiple preset resolutions The intermediate evaluation score of , as the evaluation score of at least some of the pixels in the original image being the target pixel.
该实施方式,通过确定原始图像在多个预设分辨率下的初始评价分数,再基于初始评价分数确定至少部分像素点为目标像素点的评价分数,能够提高计算概率值的精确度。In this embodiment, by determining the initial evaluation scores of the original image at multiple preset resolutions, and then determining the evaluation scores of at least some of the pixels as target pixels based on the initial evaluation scores, the accuracy of calculating the probability value can be improved.
在一种可能的实施方式中,所述原始图像包括:增强现实AR设备拍摄的现场图像,并且所述AR设备展示所述目标图像。In a possible implementation manner, the original image includes a live image captured by an augmented reality AR device, and the AR device displays the target image.
该实施方式,通过AR设备获取原始图像,并通过AR设备展示目标图像,能够实现在AR场景下对目标对象的实时换色。In this embodiment, the original image is acquired by the AR device, and the target image is displayed by the AR device, so that the real-time color change of the target object in the AR scene can be realized.
在一种可能的实施方式中,所述原始图像,包括:目标人物图像,其中,所述目 标对象包括所述目标人物图像中的人体头发区域、人体皮肤区域、至少部分服饰区域中的至少一种;或者,目标物体图像,其中,所述目标对象为所述目标物体图像中的至少部分物体区域。In a possible implementation manner, the original image includes: an image of a target person, wherein the target object includes at least one of a human hair area, a human skin area, and at least part of a clothing area in the target person image or a target object image, wherein the target object is at least part of the object area in the target object image.
该实施方式,将目标人物图像或目标物体图像作为原始图像,从而实现对人体头发区域、人体皮肤区域、服饰区域或物体区域进行颜色调整。In this embodiment, the target person image or the target object image is used as the original image, so as to realize the color adjustment of the human hair area, the human skin area, the clothing area or the object area.
第二方面,本公开实施例还提供一种图像处理装置,包括:获取模块,用于获取原始图像中至少部分像素点为目标像素点的概率值,其中,所述目标像素点为所述原始图像中属于目标对象的像素点;确定模块,用于针对所述至少部分像素点中任一像素点,基于所述像素点为所述目标像素点的概率值和预先选择的目标颜色值,确定所述像素点对应的融合颜色值;生成模块,用于利用所述至少部分像素点分别对应的所述融合颜色值对所述原始图像中所述至少部分像素点的颜色值进行调整,得到目标图像。In a second aspect, an embodiment of the present disclosure further provides an image processing apparatus, including: an acquisition module configured to acquire a probability value that at least some of the pixels in the original image are target pixels, wherein the target pixels are the original A pixel point belonging to the target object in the image; a determination module, configured to determine, for any pixel point in the at least part of the pixel point, based on the probability value that the pixel point is the target pixel point and the preselected target color value The fusion color value corresponding to the pixel point; the generating module is configured to adjust the color value of the at least part of the pixel point in the original image by using the fusion color value corresponding to the at least part of the pixel point respectively, to obtain the target image.
第三方面,本公开实施例还提供一种电子设备,包括:处理器、存储器和总线,所述存储器存储有机器可读指令;所述处理器用于执行所述存储器中存储的机器可读指令,其中,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。In a third aspect, embodiments of the present disclosure further provide an electronic device, including: a processor, a memory, and a bus, where the memory stores machine-readable instructions; the processor is configured to execute the machine-readable instructions stored in the memory , wherein, when the electronic device is running, the processor and the memory communicate through a bus, and the machine-readable instructions are executed by the processor to execute the first aspect or any one of the first aspects. steps in a possible implementation.
第四方面,本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述第一方面,或第一方面中任一种可能的实施方式中的步骤。In a fourth aspect, embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to execute the first aspect, or any one of the first aspect. steps in one possible implementation.
关于上述图像处理装置、电子设备、及计算机可读存储介质的效果描述参见上述图像处理方法的说明,这里不再赘述。For a description of the effects of the above image processing apparatus, electronic equipment, and computer-readable storage medium, reference may be made to the description of the above image processing method, and details are not repeated here.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more obvious and easy to understand, the preferred embodiments are exemplified below, and are described in detail as follows in conjunction with the accompanying drawings.
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍。这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the accompanying drawings required in the embodiments will be briefly introduced below. These drawings illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. Other related figures are obtained from these figures.
图1示出了本公开实施例所提供的一种图像处理方法的流程图;FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present disclosure;
图2示出了本公开实施例所提供的置信度图的示意图;FIG. 2 shows a schematic diagram of a confidence map provided by an embodiment of the present disclosure;
图3示出了本公开实施例所提供的神经网络的示意图;FIG. 3 shows a schematic diagram of a neural network provided by an embodiment of the present disclosure;
图4示出了本公开实施例所提供的一种图像处理装置的示意图;FIG. 4 shows a schematic diagram of an image processing apparatus provided by an embodiment of the present disclosure;
图5示出了本公开实施例所提供的一种电子设备的示意图。FIG. 5 shows a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述。所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. The described embodiments are only some, but not all, embodiments of the present disclosure. The components of the disclosed embodiments generally described and illustrated herein may be arranged and designed in a variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the disclosure as claimed, but is merely representative of selected embodiments of the disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters refer to like items in the following figures, so once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
本文中术语“和/或”,仅仅是描述一种关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this paper only describes an association relationship, which means that there can be three kinds of relationships, for example, A and/or B, which can mean: the existence of A alone, the existence of A and B at the same time, the existence of B alone. a situation. In addition, the term "at least one" herein refers to any combination of any one of the plurality or at least two of the plurality, for example, including at least one of A, B, and C, and may mean including from A, B, and C. Any one or more elements selected from the set of B and C.
经研究发现,在针对图像中的一些对象进行换色处理时,若直接将画面中某个对象的像素点的颜色值替换为某个特定值,画面中的该对象与其他部分连接的部分会失去过渡色,使进行换色后的对象所呈现出来的效果与原图像之间存在较大的差异。After research, it is found that when performing color-changing processing on some objects in the image, if the color value of the pixel of an object in the picture is directly replaced with a specific value, the part of the object connected to other parts in the picture will be changed. Losing the transition color makes the effect of the object after the color change appear quite different from the original image.
基于上述研究,本公开提供了用于图像处理的方法、装置、电子设备及存储介质,通过确定原始图像中至少部分像素点为目标像素点的概率值,能够从原始图像中识别出需要替换颜色的目标对象,基于至少部分像素点为所述目标像素点的概率值和预先选择的目标颜色值确定至少部分像素点对应的融合颜色值,再基于融合颜色值生成目标图像。这样,使得目标图像中,目标对象附近与内部的像素点之间产生一定的区别,形成过渡 色,从而使目标对象在进行颜色替换后的特征更符合原始图像。Based on the above research, the present disclosure provides a method, an apparatus, an electronic device and a storage medium for image processing. By determining the probability value that at least some of the pixels in the original image are target pixels, it is possible to identify the color that needs to be replaced from the original image. The target object, the fusion color value corresponding to at least part of the pixel points is determined based on the probability value of at least part of the pixel points for the target pixel point and the preselected target color value, and then the target image is generated based on the fusion color value. In this way, in the target image, there is a certain difference between the pixels near and inside the target object, forming a transition color, so that the characteristics of the target object after color replacement are more in line with the original image.
以上均是发明人在经过实践并仔细研究后得出的,因此,上述问题的发现过程以及下文中本公开针对上述问题所提出的解决方案,都应该是发明人在本公开过程中对本公开做出的贡献。The above are all obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions to the above problems proposed by the present disclosure below should be made by the inventor in the process of the present disclosure. contribution.
下面通过具体的实施例,对本公开中所公开的用于图像处理的方法、装置、电子设备及计算机可读存储介质进行说明。The method, apparatus, electronic device, and computer-readable storage medium for image processing disclosed in the present disclosure will be described below through specific embodiments.
如图1所示,本公开实施例公开了一种图像处理方法,该方法可以应用于具有计算能力的电子设备上,例如服务器等。具体地,该图像处理方法可以包括如下步骤:As shown in FIG. 1 , an embodiment of the present disclosure discloses an image processing method, which can be applied to an electronic device with computing capability, such as a server. Specifically, the image processing method may include the following steps:
S110、获取原始图像中至少部分像素点为目标像素点的概率值。其中,所述目标像素点为所述原始图像中属于目标对象的像素点。S110. Obtain a probability value that at least some of the pixels in the original image are target pixels. Wherein, the target pixel point is a pixel point belonging to the target object in the original image.
在一些可能的实施方式中,上述原始图像可以是增强现实AR(Augmented Reality)设备拍摄的现场图像。在AR设备拍摄到现场图像时,可以实时获取原始图像,并确定原始图像中至少部分像素点为目标像素点的概率值。其中,AR设备可以是用户持有的具有AR功能的智能终端,可以包括但不限于手机、平板电脑、AR眼镜等能够呈现增强现实效果的电子设备。上述至少部分像素点可以为原始图像中的全部像素点,也可以是预设区域中的像素点,预设区域可以为用户预先选取的区域。In some possible implementations, the above-mentioned original image may be a live image captured by an augmented reality (AR) (Augmented Reality) device. When the AR device captures a live image, the original image can be acquired in real time, and the probability value that at least some of the pixels in the original image are target pixels can be determined. The AR device may be a smart terminal with AR function held by the user, and may include, but is not limited to, electronic devices such as mobile phones, tablet computers, and AR glasses that can present augmented reality effects. The above-mentioned at least some of the pixels may be all pixels in the original image, or may be pixels in a preset area, and the preset area may be an area pre-selected by a user.
其中,目标像素点可以是原始图像中属于目标对象的像素点,目标对象可以是需要进行颜色替换的对象所在的区域,该对象可以是物体、人物的整体或一部分,如头发、服装等。The target pixel can be a pixel belonging to the target object in the original image, and the target object can be the area where the object that needs to be replaced by color is located.
示例性的,原始图像可以为包含毛发的图像,毛发具体可以是人体的头发,也可以是动物的毛发等。需要进行颜色替换的区域例如为人体的头发区域,或者动物的毛发区域等。Exemplarily, the original image may be an image containing hair, and the hair may specifically be human hair, animal hair, or the like. The area that needs to be replaced by color is, for example, the hair area of a human body, or the hair area of an animal.
示例性的,原始图像可以为目标人物图像,此时目标对象可以包括但不限于:目标人物图像中的人体头发区域、人体皮肤区域、人体眼睛区域、以及至少部分服饰区域中的至少一种。Exemplarily, the original image may be a target person image, and the target object may include, but is not limited to, at least one of a human hair area, a human skin area, a human eye area, and at least part of a clothing area in the target person image.
进一步的,原始图像还可以为目标物体图像,所述目标物体图像中可以包括一个或多个物体对象,此时目标对象可以为所述目标物体图像中的至少部分物体区域,示例性的,目标对象可以为目标物体图像中的树木区域,该树木区域可以为树木的树干区域、树叶区域、或树木整体区域。Further, the original image may also be an image of a target object, and the target object image may include one or more object objects. At this time, the target object may be at least part of the object area in the target object image. The object may be a tree area in the target object image, and the tree area may be a trunk area of a tree, a leaf area, or an entire area of the tree.
在一些可能的实施例中,可以通过以下步骤确定原始图像中至少部分像素点为目标像素点的概率值:提取所述原始图像中的图像特征信息;基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的初始概率值;基于所述至少部分像素点为所述目标像素点的初始概率值及所述至少部分像素点的颜色值,确定标准颜色值;基于所述标准颜色值以及所述至少部分像素点的颜色值,对所述至少部分像素点为所述目标像素点的初始概率值进行校准,并将校准后的所述初始概率值作为所述原始图像中至少部分像素点为所述目标像素点的概率值。In some possible embodiments, the probability value that at least some of the pixels in the original image are target pixels may be determined by the following steps: extracting image feature information in the original image; determining the original image based on the image feature information At least some of the pixels in the image are the initial probability values of the target pixels; based on the initial probability values of the at least some of the pixels as the target pixels and the color values of the at least some of the pixels, a standard color value is determined; Based on the standard color value and the color value of the at least part of the pixel points, the initial probability value of the at least part of the pixel points being the target pixel point is calibrated, and the calibrated initial probability value is used as the The probability value that at least some of the pixels in the original image are the target pixels.
上述确定所述原始图像中至少部分像素点为所述目标像素点的初始概率值,可以包括:基于所述图像特征信息,确定所述原始图像中至少部分像素点为目标像素点的评价分数;针对所述至少部分像素点中的任一像素点,基于预设的评价分数修正阈值和该像素点为目标像素点的评价分数,确定该像素点为所述目标像素点的初始概率值。The above-mentioned determining that at least some of the pixels in the original image are the initial probability values of the target pixels may include: determining, based on the image feature information, that at least some of the pixels in the original image are the evaluation scores of the target pixels; For any pixel in the at least part of the pixels, based on the preset evaluation score correction threshold and the evaluation score of the pixel as the target pixel, determine the initial probability value of the pixel as the target pixel.
上述图像特征信息可以是原始图像中至少部分像素点的特征参数,如颜色值、饱和度、亮度等。可以利用训练好的神经网络对图像特征信息进行处理,得到至少部分像素点为目标像素点的评价分数,再利用评价分数修正阈值和评价分数,确定原始图像中至少部分像素点为目标像素点的初始概率值。The above image feature information may be feature parameters of at least some pixels in the original image, such as color value, saturation, brightness, and the like. The trained neural network can be used to process the image feature information to obtain the evaluation score that at least some of the pixels are the target pixel, and then use the evaluation score to correct the threshold and the evaluation score to determine that at least some of the pixels in the original image are the target pixel. initial probability value.
在一些可能的实施例中,可以提取原始图像在多种预设分辨率下的图像特征信息,再利用训练好的神经网络确定至少部分像素点为目标像素点的评价分数。In some possible embodiments, image feature information of the original image at various preset resolutions may be extracted, and then the trained neural network may be used to determine the evaluation scores of at least some of the pixels as target pixels.
示例性的,如图3所示,为本公开实施例提供的神经网络的示意图,神经网络可以利用特征提取器,提取原始图像在多个预设分辨率下的图像特征信息。具体的,可以先提取原始图像在最高预设分辨率下的图像特征信息,再对得到的图像特征信息进行下采样处理,得到原始图像在各个预设分辨率下的图像特征信息。Exemplarily, as shown in FIG. 3 , which is a schematic diagram of a neural network provided by an embodiment of the present disclosure, the neural network may use a feature extractor to extract image feature information of an original image at multiple preset resolutions. Specifically, the image feature information of the original image at the highest preset resolution can be extracted first, and then the obtained image feature information can be down-sampled to obtain the image feature information of the original image at each preset resolution.
在得到原始图像在各个预设分辨率下的图像特征信息后,神经网络可以利用预设的分类器,确定在最低预设分辨率下原始图像中至少部分像素点为目标像素点的初始评价分数。然后,按照预设分辨率从低到高的顺序,基于前一预设分辨率下原始图像中至少部分像素点为目标像素点的初始评价分数、原始图像在当前预设分辨率下的图像特征信息以及分类器,确定当前预设分辨率下原始图像中至少部分像素点为所述目标像素点的中间评价分数。最后将在最高预设分辨率下原始图像中至少部分像素点为目标像素点的中间评价分数,作为所述原始图像至少部分像素点为目标像素点的评价分数并输出。After obtaining the image feature information of the original image at each preset resolution, the neural network can use the preset classifier to determine the initial evaluation score that at least some of the pixels in the original image are target pixels at the lowest preset resolution . Then, in the order of the preset resolution from low to high, based on the initial evaluation score of at least some of the pixels in the original image at the previous preset resolution as target pixels, and the image features of the original image at the current preset resolution information and a classifier to determine that at least some of the pixels in the original image at the current preset resolution are the intermediate evaluation scores of the target pixels. Finally, at the highest preset resolution, at least some of the pixels in the original image are the intermediate evaluation scores of the target pixels, and output as the evaluation scores of at least some of the pixels in the original image as the target pixels.
示例性的,在得到当前预设分辨率下的初始评价分数后,可以对前一预设分辨率 下的初始评价分数进行上采样,使前一预设分辨率下的评价分数的分辨率与当前预设分辨率下的评价分数的分辨率相同,再将两个预设分辨率下的评价分数进行拼接,得到当前预设分辨率下的拼接后评价分数。Exemplarily, after the initial evaluation score under the current preset resolution is obtained, the initial evaluation score under the previous preset resolution may be up-sampled, so that the resolution of the evaluation score under the previous preset resolution is the same as that of the previous preset resolution. The resolutions of the evaluation scores under the current preset resolution are the same, and then the evaluation scores under the two preset resolutions are spliced to obtain the spliced evaluation scores under the current preset resolution.
上述神经网络可以通过利用预先准备好的数据集训练得到,数据集可以包括大量的图像及图像对应的标签,图像中包含有目标对象,标签可以标注有目标对象对应的像素点。利用如图3所示的神经网络,可以从不同的预设分辨率的输出上进行监督,并将小分辨率输出与低层的大分辨率输出的特征进行融合,使得小分辨率输出学习到更好的语义类别,而大分辨率输出学习到更精细的细节,进而提升神经网络的精确度。在将数据集输入至神经网络后,可以根据神经网络的输出结果及标注结果计算损失。由于目标对象相较于其它背景往往在边界处会有颜色的跳变,从而拥有明显的梯度。因此,可以采用更能保持边界梯度的refine loss损失函数,使得神经网络输出的图像中目标对象的边界处与输入神经网络的图像拥有相近的梯度,从而获得更精细的边缘预测结果。The above neural network can be trained by using a pre-prepared data set. The data set can include a large number of images and labels corresponding to the images. The images contain target objects, and the labels can be marked with pixels corresponding to the target objects. Using the neural network shown in Figure 3, the output of different preset resolutions can be supervised, and the small-resolution output can be fused with the features of the low-level large-resolution output, so that the small-resolution output can learn more Good semantic categories, while the large-resolution output learns finer details, thereby improving the accuracy of the neural network. After the dataset is input to the neural network, the loss can be calculated according to the output results of the neural network and the labeling results. Compared with other backgrounds, the target object often has a color jump at the boundary, so it has a clear gradient. Therefore, a refine loss loss function that can better preserve the boundary gradient can be used, so that the boundary of the target object in the image output by the neural network has a similar gradient to the image input to the neural network, so as to obtain a more refined edge prediction result.
该实施方式,可以通过利用评价分数修正阈值对像素点进行分类,从而能够针对不同类型的像素点采取不同的初始概率值计算方式,以便于进行计算优化。In this embodiment, the pixel points can be classified by using the evaluation score correction threshold, so that different initial probability value calculation methods can be adopted for different types of pixel points, so as to facilitate calculation optimization.
在一些可能的实施例中,所述评价分数修正阈值包括第一修正阈值和第二修正阈值;所述第一修正阈值大于所述第二修正阈值。相应地,所述基于预设的评价分数修正阈值和该像素点为所述目标像素点的评价分数,确定该像素点为所述目标像素点的初始概率值,包括:在该像素点的评价分数大于或等于所述第一修正阈值的情况下,确定该像素点为所述目标像素点的初始概率值为第一预设概率值;在该像素点的评价分数小于或等于所述第二修正阈值的情况下,确定该像素点为所述目标像素点的初始概率值为第二预设概率值;在该像素点的评价分数小于所述第一修正阈值且大于所述第二修正阈值的情况下,基于该像素点为所述目标像素点的评价分数、所述第一修正阈值以及所述第二修正阈值确定该像素点为所述目标像素点的初始概率值。In some possible embodiments, the evaluation score modification threshold includes a first modification threshold and a second modification threshold; the first modification threshold is greater than the second modification threshold. Correspondingly, determining the pixel point as the initial probability value of the target pixel point based on the preset evaluation score correction threshold and the pixel point as the evaluation score of the target pixel point, including: evaluating the pixel point When the score is greater than or equal to the first correction threshold, the initial probability value of the pixel as the target pixel is determined to be the first preset probability value; the evaluation score of the pixel is less than or equal to the second In the case of correcting the threshold, the initial probability value of determining that the pixel is the target pixel is a second preset probability value; the evaluation score of the pixel is less than the first correction threshold and greater than the second correction threshold In the case of , the initial probability value that the pixel is the target pixel is determined based on the evaluation score of the pixel being the target pixel, the first correction threshold and the second correction threshold.
示例性的,第一修正阈值可以设置为0.7,第二修正阈值可以设置为0.4。对于评价分数小于或等于第二修正阈值的像素点,该像素点为目标像素点的概率较低,可以忽略不计,因此可以直接将该像素点为目标像素点的初始概率值设置为0,即第二预设概率值。相应的,对于评价分数大于或等于第一修正阈值的像素点,该像素点为目标像素点的概率较高,因此可以将该像素点为目标像素点的初始概率值设置为1,即第一预设概率值。Exemplarily, the first correction threshold may be set to 0.7, and the second correction threshold may be set to 0.4. For a pixel whose evaluation score is less than or equal to the second correction threshold, the probability of the pixel being the target pixel is low and can be ignored, so the initial probability value of the pixel being the target pixel can be directly set to 0, that is The second preset probability value. Correspondingly, for a pixel whose evaluation score is greater than or equal to the first correction threshold, the probability of the pixel being the target pixel is relatively high, so the initial probability value of the pixel being the target pixel can be set to 1, that is, the first Preset probability value.
这样,通过先将评价分数足够高(大于第一修正阈值)和足够低(小于第二修正 阈值)的像素点为目标像素点的初始概率值直接设定为对应的预设概率值,然后针对评价分数大于第二修正阈值且小于第一修正阈值的像素点进行初始概率值计算,可以大幅度降低计算时间,提高计算效率。In this way, by first setting the initial probability value of the pixel point with the evaluation score high enough (greater than the first correction threshold) and low enough (less than the second correction threshold) as the target pixel point as the corresponding preset probability value, and then for The initial probability value calculation is performed on the pixel points whose evaluation score is greater than the second correction threshold and less than the first correction threshold, which can greatly reduce the calculation time and improve the calculation efficiency.
上述基于该像素点为所述目标像素点的评价分数、所述第一修正阈值以及所述第二修正阈值确定该像素点为所述目标像素点的初始概率值,可以包括:确定所述第一修正阈值与所述第二修正阈值之间的第一差值;确定所述评价分数与所述第二修正阈值之间的第二差值;基于所述第二差值与所述第一差值之间的比值,确定所述初始概率值。The above-mentioned determining that the pixel is the initial probability value of the target pixel based on the evaluation score of the pixel as the target pixel, the first correction threshold and the second correction threshold may include: determining the first correction threshold. a first difference between a modified threshold and the second modified threshold; determining a second difference between the evaluation score and the second modified threshold; based on the second difference and the first The ratio between the differences determines the initial probability value.
具体的,可以将第二差值与第一差值之间的比值作为初始概率值。Specifically, the ratio between the second difference and the first difference may be used as the initial probability value.
对于上述初始概率值高于或等于预设概率阈值的像素点,可以认为该像素点为目标像素点。此外,可以将上述初始概率值高于或等于预设概率阈值的多个像素点的颜色值的均值作为标准颜色值,并利用标准颜色值对初始概率值进行修正,得到至少部分像素点为目标像素点的概率值。For a pixel whose initial probability value is higher than or equal to the preset probability threshold, the pixel can be considered as a target pixel. In addition, the average value of the color values of the plurality of pixel points whose initial probability value is higher than or equal to the preset probability threshold value can be used as the standard color value, and the initial probability value can be corrected by using the standard color value, so as to obtain at least some of the pixel points as the target The probability value of the pixel point.
上述预设概率阈值可以与第一修正阈值相同,可以确定初始概率值高于或等于预设概率阈值的像素点的颜色值的均值,并将上述均值作为标准颜色值。这样,由于标准颜色值与目标像素点的颜色值较为接近,因此可以利用标准颜色值对各像素点为所述目标像素点的初始概率值进行修正。The preset probability threshold may be the same as the first correction threshold, and the mean value of the color values of the pixels whose initial probability value is higher than or equal to the preset probability threshold may be determined, and the mean value may be used as the standard color value. In this way, since the standard color value is relatively close to the color value of the target pixel point, the standard color value can be used to correct the initial probability value of each pixel point being the target pixel point.
一些可能的实施例中,可以针对上述至少部分像素点中的任一像素点,确定所述像素点的颜色值与所述标准颜色值之间的相似度;基于所述相似度对所述像素点为所述目标像素点的初始概率值进行校准。示例性的,可以利用所述像素点的颜色值与所述标准颜色值之间的相似度对初始概率值进行加权,将加权后的概率值作为上述像素点为目标像素点的概率值。In some possible embodiments, the similarity between the color value of the pixel and the standard color value may be determined for any of the above at least some of the pixels; The point is the initial probability value of the target pixel for calibration. Exemplarily, the initial probability value may be weighted by using the similarity between the color value of the pixel point and the standard color value, and the weighted probability value may be used as the probability value that the pixel point is the target pixel point.
示例性的,如图2所示,为本公开实施例提供的置信度图的示意图。上述置信度图可以表示原始图像中至少部分像素点为目标像素点的概率值,如图2所示的置信度图对应的原始图像为人物图像,目标对象为人体头发所在的区域。明显可见,图2中头发对应的目标像素点的概率值趋近于1,在置信度图中趋于白色,而其他部分对应的像素点的概率值趋近0,在置信度图中趋于黑色。Exemplarily, as shown in FIG. 2 , it is a schematic diagram of a confidence map provided by an embodiment of the present disclosure. The above confidence map can represent the probability value that at least some of the pixels in the original image are target pixels. The original image corresponding to the confidence map shown in FIG. 2 is a human image, and the target object is the area where human hair is located. Obviously, the probability value of the target pixel corresponding to the hair in Figure 2 is close to 1, which tends to be white in the confidence map, while the probability value of the pixels corresponding to other parts is close to 0, which tends to be in the confidence map. black.
S120、针对所述至少部分像素点中的任一像素点,基于该像素点为所述目标像素点的概率值和预先选择的目标颜色值,确定该像素点对应的融合颜色值。S120. For any pixel point in the at least part of the pixel points, based on the probability value that the pixel point is the target pixel point and the preselected target color value, determine the fusion color value corresponding to the pixel point.
上述目标颜色值可以是用户预设的颜色值。比如,若用户期望将图2中的头发颜 色替换为棕色,则可以将棕色对应的颜色值设置为目标颜色值。The above-mentioned target color value may be a color value preset by a user. For example, if the user wishes to replace the hair color in Figure 2 with brown, the color value corresponding to brown can be set as the target color value.
一些可能的实施例中,基于像素点为目标像素点的概率值和预先选择的目标颜色值,确定所述对应的融合颜色值,可以包括:基于所述像素点为所述目标像素点的概率值,确定所述像素点对应的颜色融合权重;基于所述像素点的颜色值、所述目标颜色值以及所述像素点对应的颜色融合权重,确定所述像素点对应的融合颜色值。In some possible embodiments, determining the corresponding fusion color value based on the probability value that the pixel point is the target pixel point and the preselected target color value may include: based on the probability that the pixel point is the target pixel point. value, and determine the color fusion weight corresponding to the pixel point; based on the color value of the pixel point, the target color value, and the color fusion weight corresponding to the pixel point, determine the fusion color value corresponding to the pixel point.
示例性的,可以基于上述概率值确定像素点原有的颜色值(即该像素点在原始图像中的颜色值,也可称为该像素点的颜色值)和目标颜色值的融合权重,并按照融合权重的比例将像素点原有的颜色值和目标颜色值融合,得到像素点对应的融合颜色值。Exemplarily, the original color value of the pixel point (that is, the color value of the pixel point in the original image, which may also be referred to as the color value of the pixel point) and the fusion weight of the target color value can be determined based on the above probability value, and According to the ratio of the fusion weight, the original color value of the pixel point and the target color value are fused to obtain the fusion color value corresponding to the pixel point.
具体的,可以利用alpha融合的方式将像素点原有的颜色值和目标颜色值融合。Specifically, the original color value of the pixel point and the target color value can be fused by means of alpha fusion.
在该实施方式,通过先基于像素点为所述目标像素点的概率值确定该像素点对应的颜色融合权重,再基于颜色融合权重将该像素点的颜色值和目标颜色值进行融合,得到该像素点对应的融合颜色值,使得融合颜色值能够按照颜色融合权重反映出像素点原本的颜色值和目标颜色值,从而可以使目标对象的边界形成过渡色,使目标对象在进行颜色替换后的特征更符合原始图像。In this embodiment, by first determining the color fusion weight corresponding to the pixel point based on the probability value that the pixel point is the target pixel point, and then fusing the color value of the pixel point and the target color value based on the color fusion weight, the result is obtained. The fusion color value corresponding to the pixel point, so that the fusion color value can reflect the original color value of the pixel point and the target color value according to the color fusion weight, so that the boundary of the target object can form a transition color, so that the target object can be replaced after color replacement. The features are more in line with the original image.
S130、利用所述至少部分像素点分别对应的所述融合颜色值对所述原始图像中所述至少部分像素点的颜色值进行调整,得到目标图像。S130. Adjust the color values of the at least some of the pixels in the original image by using the fusion color values corresponding to the at least some of the pixels to obtain a target image.
该步骤中,可以按照上述至少部分像素点分别对应的融合颜色值,对原始图像中的至少部分像素点的颜色值进行替换,得到目标图像。In this step, the color values of at least some of the pixels in the original image may be replaced according to the fusion color values corresponding to the above at least some of the pixels to obtain the target image.
在生成目标图像之后,可以基于所述原始图像中所述至少部分像素点的灰阶值、和/或所述至少部分像素点的预设灰阶值,确定所述至少部分像素点分别对应的目标灰阶值,再将所述目标图像中所述至少部分像素点的灰阶值调整为对应的所述目标灰阶值。After the target image is generated, based on the grayscale values of the at least part of the pixels in the original image, and/or the preset grayscale values of the at least part of the pixels, it is possible to determine, respectively, corresponding to the at least part of the pixels. target grayscale value, and then adjust the grayscale value of the at least part of the pixel points in the target image to the corresponding target grayscale value.
这样,可以对换色后的目标对象的亮度进行调整,使目标对象在进行颜色替换后能够保有原来的纹理和亮度,特征更符合用户期望。In this way, the brightness of the target object after the color change can be adjusted, so that the target object can keep the original texture and brightness after the color replacement is performed, and the characteristics are more in line with the user's expectation.
在得到目标图像之后,还可以利用AR设备展示得到的目标图像,以能够实现在AR场景下对目标对象的实时换色。After the target image is obtained, an AR device can also be used to display the obtained target image, so as to realize the real-time color change of the target object in the AR scene.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of the specific implementation, the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its function and possible Internal logic is determined.
基于同一发明构思,本公开实施例中还提供了与图像处理方法对应的图像处理装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述图像处理方法相似,因此装置的实施可以参见方法的实施,重复之处不多赘述。Based on the same inventive concept, the embodiment of the present disclosure also provides an image processing apparatus corresponding to the image processing method. Reference can be made to the implementation of the method, and repeated details will not be repeated.
参照图4所示,为本公开实施例提供的一种图像处理装置的示意图,所述装置包括:获取模块410,用于获取原始图像中至少部分像素点为目标像素点的概率值。其中,所述目标像素点为所述原始图像中属于目标对象的像素点。Referring to FIG. 4 , which is a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure, the apparatus includes: an acquisition module 410 for acquiring a probability value that at least some of the pixels in the original image are target pixels. Wherein, the target pixel point is a pixel point belonging to the target object in the original image.
确定模块420,用于针对所述至少部分像素点中任一像素点,基于该像素点为所述目标像素点的概率值和预先选择的目标颜色值,确定该像素点对应的融合颜色值。The determining module 420 is configured to, for any pixel point in the at least part of the pixel points, determine the fusion color value corresponding to the pixel point based on the probability value that the pixel point is the target pixel point and the preselected target color value.
生成模块430,用于利用所述至少部分像素点分别对应的融合颜色值对所述原始图像中所述至少部分像素点的颜色值进行调整,得到目标图像。The generating module 430 is configured to adjust the color values of the at least part of the pixel points in the original image by using the fusion color values corresponding to the at least part of the pixel points respectively, to obtain a target image.
在一种可能的实施方式中,所述获取模块410具体用于:提取所述原始图像中的图像特征信息;基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的初始概率值;基于所述至少部分像素点为所述目标像素点的初始概率值及所述至少部分像素点的颜色值,确定标准颜色值;基于所述标准颜色值以及所述至少部分像素点的颜色值,对所述至少部分像素点为所述目标像素点的初始概率值进行校准,并将校准后的所述初始概率值作为所述原始图像中至少部分像素点为所述目标像素点的概率值。In a possible implementation manner, the obtaining module 410 is specifically configured to: extract image feature information in the original image; determine at least some of the pixels in the original image as the target based on the image feature information the initial probability value of the pixel point; based on the initial probability value of the at least part of the pixel point being the target pixel point and the color value of the at least part of the pixel point, determine a standard color value; based on the standard color value and the at least color values of some pixels, calibrate the initial probability value that at least some of the pixels are the target pixel, and use the calibrated initial probability value as at least some of the pixels in the original image. The probability value of the target pixel point.
在一种可能的实施方式中,所述获取模块410在基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的初始概率值时,具体用于:基于所述图像特征信息,确定所述原始图像中至少部分像素点为目标像素点的评价分数;针对所述至少部分像素点中的任一像素点,基于预设的评价分数修正阈值和该像素点为所述目标像素点的评价分数,确定该像素点为所述目标像素点的初始概率值。In a possible implementation manner, when determining, based on the image feature information, that at least some of the pixels in the original image are the initial probability values of the target pixels, the obtaining module 410 is specifically configured to: the image feature information, determine that at least some of the pixels in the original image are the evaluation scores of the target pixels; for any pixel in the at least part of the pixels, based on the preset evaluation score correction threshold and the pixel are The evaluation score of the target pixel point determines that the pixel point is the initial probability value of the target pixel point.
在一种可能的实施方式中,所述评价分数修正阈值包括第一修正阈值和第二修正阈值;所述第一修正阈值大于所述第二修正阈值。In a possible implementation, the evaluation score modification threshold includes a first modification threshold and a second modification threshold; the first modification threshold is greater than the second modification threshold.
所述获取模块410在所述基于预设的评价分数修正阈值和该像素点为所述目标像素点的评价分数,确定该像素点为所述目标像素点的初始概率值时,具体用于:在该像素点的评价分数大于或等于所述第一修正阈值的情况下,确定该像素点为所述目标像素点的初始概率值为第一预设概率值;在该像素点的评价分数小于或等于所述第二修正阈值的情况下,确定所述像素点为所述目标像素点的初始概率值为第二预设概率值;在该 像素点的评价分数小于所述第一修正阈值且大于所述第二修正阈值的情况下,基于该像素点为所述目标像素点的评价分数、所述第一修正阈值以及所述第二修正阈值确定所述像素点为所述目标像素点的初始概率值。When the acquisition module 410 determines that the pixel is the initial probability value of the target pixel based on the preset evaluation score correction threshold and the pixel is the evaluation score of the target pixel, it is specifically used for: In the case that the evaluation score of the pixel point is greater than or equal to the first correction threshold, determine that the pixel point is the initial probability value of the target pixel point as the first preset probability value; when the evaluation score of the pixel point is less than or equal to the second correction threshold, determine that the initial probability value of the pixel point as the target pixel point is a second preset probability value; the evaluation score of the pixel point is less than the first correction threshold value and In the case of being greater than the second correction threshold, based on the evaluation score of the pixel point being the target pixel point, the first correction threshold value and the second correction threshold value, it is determined that the pixel point is a part of the target pixel point. initial probability value.
在一种可能的实施方式中,所述获取模块410在基于该像素点为所述目标像素点的评价分数、所述第一修正阈值以及所述第二修正阈值确定该像素点为所述目标像素点的初始概率值时,具体用于:确定所述第一修正阈值与所述第二修正阈值之间的第一差值;确定所述评价分数与所述第二修正阈值之间的第二差值;基于所述第二差值与所述第一差值之间的比值,确定所述初始概率值。In a possible implementation manner, the obtaining module 410 determines that the pixel is the target based on the evaluation score of the pixel as the target pixel, the first correction threshold and the second correction threshold When the initial probability value of the pixel point is used, it is specifically used to: determine the first difference between the first correction threshold and the second correction threshold; determine the first difference between the evaluation score and the second correction threshold Two difference values; the initial probability value is determined based on the ratio between the second difference value and the first difference value.
在一种可能的实施方式中,所述获取模块410在基于所述至少部分像素点为所述目标像素点的初始概率值及所述至少部分像素点的颜色值,确定标准颜色值时,具体用于:确定所述初始概率值高于或等于预设概率阈值的多个像素点的颜色值的均值,并将所述均值作为所述标准颜色值。In a possible implementation manner, when the obtaining module 410 determines the standard color value based on the initial probability value that the at least part of the pixel points are the target pixel point and the color value of the at least part of the pixel point, the specific It is used for: determining the mean value of the color values of a plurality of pixel points whose initial probability value is higher than or equal to a preset probability threshold value, and using the mean value as the standard color value.
所述获取模块410在基于所述标准颜色值以及所述至少部分像素点的颜色值,对所述至少部分像素点为所述目标像素点的初始概率值进行校准时,具体用于:针对所述至少部分像素点中任一像素点,确定所述像素点的颜色值与所述标准颜色值之间的相似度;基于所述相似度对所述像素点为所述目标像素点的初始概率值进行校准。When calibrating the initial probability value that the at least part of the pixel points are the target pixel point based on the standard color value and the color value of the at least part of the pixel points, the obtaining module 410 is specifically configured to: any pixel point in the at least part of the pixel points, to determine the similarity between the color value of the pixel point and the standard color value; based on the similarity, the initial probability that the pixel point is the target pixel point value to calibrate.
在一种可能的实施方式中,所述确定模块420在基于所述至少部分像素点为目标像素点的概率值和预先选择的目标颜色值,确定所述对应的融合颜色值时,具体用于:基于所述像素点为所述目标像素点的概率值,确定所述像素点对应的颜色融合权重;基于所述像素点的颜色值、所述目标颜色值以及所述像素点对应的颜色融合权重,确定所述像素点对应的融合颜色值。In a possible implementation manner, when the determining module 420 determines the corresponding fusion color value based on the probability value that the at least part of the pixel points are the target pixel point and the preselected target color value, it is specifically used for : Determine the color fusion weight corresponding to the pixel point based on the probability value that the pixel point is the target pixel point; based on the color value of the pixel point, the target color value and the color fusion corresponding to the pixel point Weight, to determine the fusion color value corresponding to the pixel point.
在一种可能的实施方式中,所述生成模块430还用于:基于所述原始图像中所述至少部分像素点的灰阶值、和/或所述至少部分像素点的预设灰阶值,确定所述至少部分像素点分别对应的目标灰阶值;将所述目标图像中与所述至少部分像素点对应的像素点的灰阶值,调整为所述像素点对应的所述目标灰阶值。In a possible implementation manner, the generating module 430 is further configured to: based on the grayscale values of the at least part of the pixels in the original image and/or the preset grayscale values of the at least part of the pixels , determine the target grayscale values corresponding to the at least part of the pixel points respectively; adjust the grayscale values of the pixel points corresponding to the at least part of the pixel points in the target image to the target grayscale value corresponding to the pixel points order value.
在一种可能的实施方式中,所述获取模块410在提取所述原始图像中的图像特征信息时,具体用于:提取所述原始图像在多种预设分辨率下的图像特征信息。In a possible implementation manner, when extracting the image feature information in the original image, the obtaining module 410 is specifically configured to: extract image feature information of the original image under multiple preset resolutions.
所述获取模块在基于所述图像特征信息,确定所述至少部分像素点为目标像素点的评价分数时,具体用于:利用预设的分类器,确定在最低预设分辨率下原始图像中至 少部分像素点为目标像素点的初始评价分数;按照预设分辨率从低到高的顺序,基于前一预设分辨率下原始图像中至少部分像素点为目标像素点的初始评价分数以及原始图像在当前预设分辨率下的图像特征信息,确定当前预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的中间评价分数;将在最高预设分辨率下原始图像中至少部分像素点的中间评价分数,作为所述原始图像中至少部分像素点为目标像素点的评价分数。When determining, based on the image feature information, that the at least some of the pixels are the evaluation scores of the target pixels, the obtaining module is specifically configured to: use a preset classifier to determine, by using a preset classifier, that in the original image at the lowest preset resolution. At least some of the pixels are the initial evaluation scores of the target pixels; according to the preset resolution from low to high, based on the previous preset resolution, at least some of the pixels in the original image are the initial evaluation scores of the target pixels and the original The image feature information of the image at the current preset resolution, determining that at least some of the pixels in the original image under the current preset resolution are the intermediate evaluation scores of the target pixel; the original image at the highest preset resolution is determined. The intermediate evaluation scores of at least some of the pixels in the original image are taken as the evaluation scores of at least some of the pixels in the original image being the target pixels.
在一种可能的实施方式中,所述获取模块410在获取原始图像中至少部分像素点为目标像素点的概率值时,具体用于:将增强现实AR设备拍摄的现场图像作为原始图像,获取所述原始图像中至少部分像素点为目标像素点的概率值。In a possible implementation manner, when acquiring the probability value that at least some of the pixels in the original image are target pixels, the acquiring module 410 is specifically configured to: take the live image captured by the augmented reality AR device as the original image, and acquire The probability value that at least some of the pixels in the original image are the target pixels.
所述生成模块430还用于:利用所述AR设备展示所述目标图像。The generating module 430 is further configured to: display the target image by using the AR device.
在一种可能的实施方式中,所述获取模块410在获取原始图像中至少部分像素点为目标像素点的概率值时,具体用于:将目标人物图像作为原始图像,其中,所述目标对象包括所述目标人物图像中的人体头发区域、人体皮肤区域、以及至少部分服饰区域中的至少一种;或者,将目标物体图像作为原始图像,其中,所述目标对象为所述目标物体图像中的至少部分物体区域。获取所述原始图像中至少部分像素点为目标像素点的概率值。In a possible implementation manner, when acquiring the probability value that at least some of the pixels in the original image are target pixels, the acquiring module 410 is specifically configured to: take the target person image as the original image, wherein the target object Including at least one of the human hair area, human skin area, and at least part of the clothing area in the target person image; or, using the target object image as the original image, wherein the target object is in the target object image. at least part of the object area. Obtain a probability value that at least some of the pixels in the original image are target pixels.
对应于图1中的图像处理方法,本公开实施例还提供了一种电子设备500,如图5所示,为本公开实施例提供的电子设备500结构示意图,包括:处理器51、存储器52、和总线53。存储器52用于存储执行指令,包括内存521和外部存储器522,这里的内存521也称内存储器,用于暂时存放处理器51中的运算数据,以及与硬盘等外部存储器522交换的数据。处理器51通过内存521与外部存储器522进行数据交换,当所述电子设备500运行时,所述处理器51与所述存储器52之间通过总线53通信,使得所述处理器51可以执行以下指令:Corresponding to the image processing method in FIG. 1 , an embodiment of the present disclosure further provides an electronic device 500 . As shown in FIG. 5 , a schematic structural diagram of the electronic device 500 provided by the embodiment of the present disclosure includes: a processor 51 and a memory 52 , and bus 53. The memory 52 is used to store execution instructions, including a memory 521 and an external memory 522, where the memory 521 is also called an internal memory, and is used to temporarily store operation data in the processor 51 and data exchanged with an external memory 522 such as a hard disk. The processor 51 exchanges data with the external memory 522 through the memory 521. When the electronic device 500 is running, the processor 51 communicates with the memory 52 through the bus 53, so that the processor 51 can execute the following instructions :
获取原始图像中至少部分像素点为目标像素点的概率值,其中,所述目标像素点为所述原始图像中属于目标对象的像素点;针对所述至少部分像素点中的任一像素点,基于该像素点为所述目标像素点的概率值和预先选择的目标颜色值,确定该像素点对应的融合颜色值;利用所述至少部分像素点分别对应的所述融合颜色值对所述原始图像中所述至少部分像素点的颜色值进行调整,得到目标图像。Obtain the probability value that at least some of the pixels in the original image are target pixels, where the target pixels are pixels belonging to the target object in the original image; for any pixel in the at least some of the pixels, Based on the probability value that the pixel point is the target pixel point and the preselected target color value, determine the fusion color value corresponding to the pixel point; use the fusion color value corresponding to the at least part of the pixel points to compare the original The color values of the at least part of the pixels in the image are adjusted to obtain the target image.
上述指令的具体执行过程可以参考本公开实施例中所述的图像处理方法的步骤, 此处不再赘述。For the specific execution process of the above instruction, reference may be made to the steps of the image processing method described in the embodiments of the present disclosure, and details are not described herein again.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述图像处理方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。Embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the steps of the image processing method described in the foregoing method embodiments are executed. Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
本公开实施例还提供了一种计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行上述方法实施例中所述图像处理方法的步骤,具体可参见上述方法实施例,在此不再赘述。Embodiments of the present disclosure further provide a computer program product, including a computer-readable storage medium storing program codes, wherein the instructions included in the program codes can be used to execute the steps of the image processing methods in the above method embodiments, specifically Refer to the above method embodiments, which are not repeated here.
其中,该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。Wherein, the computer program product can be specifically implemented by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the system and device described above, reference may be made to the corresponding process in the foregoing method embodiments, which will not be repeated here. In the several embodiments provided by the present disclosure, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. The apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用 以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a processor-executable non-volatile computer-readable storage medium. Based on such understanding, the technical solutions of the present disclosure can be embodied in the form of software products in essence, or the parts that contribute to the prior art or the parts of the technical solutions. The computer software products are stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that the above-mentioned embodiments are only specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, but not to limit them. The protection scope of the present disclosure is not limited to this, although the aforementioned The embodiments describe the present disclosure in detail, and those skilled in the art should understand that: any person skilled in the art can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed by the present disclosure. Or can easily think of changes, or equivalently replace some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be covered in the present disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims (15)
- 一种图像处理方法,其特征在于,包括:An image processing method, comprising:获取原始图像中至少部分像素点为目标像素点的概率值,其中,所述目标像素点为所述原始图像中属于目标对象的像素点;Obtain the probability value that at least some of the pixels in the original image are target pixels, wherein the target pixels are pixels belonging to the target object in the original image;针对所述至少部分像素点中的任一像素点,基于所述像素点为所述目标像素点的概率值和预先选择的目标颜色值,确定所述像素点对应的融合颜色值;For any pixel point in the at least part of the pixel points, based on the probability value that the pixel point is the target pixel point and the pre-selected target color value, determine the fusion color value corresponding to the pixel point;利用所述至少部分像素点分别对应的所述融合颜色值对所述原始图像中所述至少部分像素点的颜色值进行调整,得到目标图像。A target image is obtained by adjusting the color values of the at least part of the pixel points in the original image by using the fusion color values corresponding to the at least part of the pixel points respectively.
- 根据权利要求1所述的方法,其特征在于,所述获取原始图像中至少部分像素点为目标像素点的概率值,包括:The method according to claim 1, wherein the acquiring the probability value that at least some of the pixels in the original image are the target pixels comprises:提取所述原始图像中的图像特征信息;extracting image feature information in the original image;基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的初始概率值;Based on the image feature information, determining that at least some of the pixels in the original image are the initial probability values of the target pixels;基于所述至少部分像素点为所述目标像素点的初始概率值及所述至少部分像素点的颜色值,确定标准颜色值;determining a standard color value based on the initial probability value of the at least part of the pixel points being the target pixel point and the color value of the at least part of the pixel point;针对所述至少部分像素点中任一像素点,基于所述标准颜色值以及所述像素点的颜色值,对所述像素点为所述目标像素点的初始概率值进行校准,得到所述像素点为所述目标像素点的概率值。For any pixel point in the at least part of the pixel points, based on the standard color value and the color value of the pixel point, the initial probability value that the pixel point is the target pixel point is calibrated to obtain the pixel point The point is the probability value of the target pixel point.
- 根据权利要求2所述的方法,其特征在于,所述基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的初始概率值,包括:The method according to claim 2, wherein the determining, based on the image feature information, that at least some of the pixels in the original image are the initial probability values of the target pixels, comprising:基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的评价分数;Based on the image feature information, determining that at least some of the pixels in the original image are the evaluation scores of the target pixels;针对所述至少部分像素点中任一像素点,基于预设的评价分数修正阈值和所述像素点为所述目标像素点的评价分数,确定所述像素点为所述目标像素点的初始概率值。For any pixel point in the at least some of the pixel points, based on the preset evaluation score correction threshold and the evaluation score of the pixel point as the target pixel point, determine the initial probability that the pixel point is the target pixel point value.
- 根据权利要求3所述的方法,其特征在于,所述评价分数修正阈值包括第一修正阈值和第二修正阈值,所述第一修正阈值大于所述第二修正阈值;所述基于预设的评价分数修正阈值和所述像素点为所述目标像素点的评价分数,确定所述像素点为所述目标像素点的初始概率值,包括:The method according to claim 3, wherein the evaluation score correction threshold comprises a first correction threshold and a second correction threshold, the first correction threshold is greater than the second correction threshold; The evaluation score correction threshold and the evaluation score of the pixel point as the target pixel point, and determining that the pixel point is the initial probability value of the target pixel point, including:在所述像素点为所述目标像素点的评价分数大于或等于所述第一修正阈值的情况下,确定所述像素点为所述目标像素点的初始概率值为第一预设概率值;In the case where the evaluation score of the pixel point being the target pixel point is greater than or equal to the first correction threshold, determining that the pixel point is the initial probability value of the target pixel point as a first preset probability value;在所述像素点为所述目标像素点的评价分数小于或等于所述第二修正阈值的情况下,确定所述像素点为所述目标像素点的初始概率值为第二预设概率值;In the case that the evaluation score of the pixel point being the target pixel point is less than or equal to the second correction threshold, determining the initial probability value of the pixel point being the target pixel point as a second preset probability value;在所述像素点为所述目标像素点的评价分数小于第一修正阈值且大于所述第二修正阈值的情况下,基于所述像素点为所述目标像素点的评价分数、所述第一修正阈值以及所述第二修正阈值确定所述像素点为所述目标像素点的初始概率值。In the case where the evaluation score of the pixel point being the target pixel point is less than the first correction threshold and greater than the second correction threshold, based on the evaluation score of the pixel point being the target pixel point, the first correction threshold The correction threshold and the second correction threshold determine the initial probability value that the pixel point is the target pixel point.
- 根据权利要求4所述的方法,其特征在于,所述基于所述像素点为所述目标像素点的评价分数、所述第一修正阈值以及所述第二修正阈值确定所述像素点为所述目标像素点的初始概率值,包括:The method according to claim 4, wherein the pixel is determined to be the target pixel based on the evaluation score of the pixel as the target pixel, the first correction threshold and the second correction threshold. Describe the initial probability value of the target pixel, including:确定所述第一修正阈值与所述第二修正阈值之间的第一差值;determining a first difference between the first modified threshold and the second modified threshold;确定所述像素点为所述目标像素点的评价分数与所述第二修正阈值之间的第二差值;determining that the pixel point is the second difference between the evaluation score of the target pixel point and the second correction threshold;基于所述第二差值与所述第一差值之间的比值,确定所述像素点为所述目标像素点的初始概率值。Based on the ratio between the second difference value and the first difference value, the initial probability value of the pixel point as the target pixel point is determined.
- 根据权利要求2至5任一所述的方法,其特征在于,所述基于所述至少部分像素点为所述目标像素点的初始概率值及所述至少部分像素点的颜色值,确定标准颜色值,包括:The method according to any one of claims 2 to 5, wherein the standard color is determined based on an initial probability value that the at least part of the pixel points are the target pixel point and a color value of the at least part of the pixel point values, including:确定所述至少部分像素点中所述初始概率值高于或等于预设概率阈值的第一像素点;determining a first pixel whose initial probability value is higher than or equal to a preset probability threshold in the at least part of the pixel points;将所有所述第一像素点的颜色值的均值作为所述标准颜色值。The average value of the color values of all the first pixel points is used as the standard color value.
- 根据权利要求2至6任一所述的方法,其特征在于,所述基于所述标准颜色值以及所述像素点的颜色值,对所述像素点为所述目标像素点的初始概率值进行校准,得到所述像素点为所述目标像素点的概率值,包括:The method according to any one of claims 2 to 6, characterized in that, based on the standard color value and the color value of the pixel point, performing an initial probability value on the pixel point being the target pixel point. Calibration to obtain the probability value that the pixel point is the target pixel point, including:确定所述像素点的颜色值与所述标准颜色值之间的相似度;determining the similarity between the color value of the pixel and the standard color value;基于所述相似度对所述像素点为所述目标像素点的初始概率值进行校准,得到所述像素点为所述目标像素点的概率值。The initial probability value that the pixel point is the target pixel point is calibrated based on the similarity, to obtain the probability value that the pixel point is the target pixel point.
- 根据权利要求1至7任一所述的方法,其特征在于,所述基于所述像素点为所 述目标像素点的概率值和预先选择的目标颜色值,确定所述像素点对应的融合颜色值,包括:The method according to any one of claims 1 to 7, wherein the fusion color corresponding to the pixel point is determined based on a probability value that the pixel point is the target pixel point and a preselected target color value values, including:基于所述像素点为所述目标像素点的概率值,确定所述像素点对应的颜色融合权重;Determine the color fusion weight corresponding to the pixel point based on the probability value that the pixel point is the target pixel point;基于所述像素点的颜色值、所述目标颜色值以及所述像素点对应的颜色融合权重,确定所述像素点对应的融合颜色值。Based on the color value of the pixel point, the target color value and the color fusion weight corresponding to the pixel point, the fusion color value corresponding to the pixel point is determined.
- 根据权利要求1至8任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 8, wherein the method further comprises:针对所述至少部分像素点中的任一像素点,For any pixel point in the at least part of the pixel points,基于所述原始图像中所述像素点的灰阶值、和/或所述像素点对应的预设灰阶值,确定所述像素点对应的目标灰阶值;Determine the target grayscale value corresponding to the pixel point based on the grayscale value of the pixel point in the original image and/or the preset grayscale value corresponding to the pixel point;将所述目标图像中与所述像素点对应的像素点的灰阶值,调整为所述像素点对应的所述目标灰阶值。Adjust the grayscale value of the pixel point corresponding to the pixel point in the target image to the target grayscale value corresponding to the pixel point.
- 根据权利要求3所述的方法,其特征在于,The method of claim 3, wherein:所述提取所述原始图像中的图像特征信息包括:The extracting image feature information in the original image includes:提取所述原始图像在多种预设分辨率下的图像特征信息;extracting image feature information of the original image at multiple preset resolutions;所述基于所述图像特征信息,确定所述原始图像中至少部分像素点为所述目标像素点的评价分数,包括:The determining, based on the image feature information, that at least some of the pixels in the original image are the evaluation scores of the target pixels, including:利用预设的分类器,确定在所述多种预设分辨率中最低的预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的初始评价分数;Using a preset classifier, determining that at least some of the pixels in the original image at the lowest preset resolution among the multiple preset resolutions are the initial evaluation scores of the target pixels;按照所述多种预设分辨率从低到高的顺序,基于前一所述预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的所述初始评价分数以及所述原始图像在当前预设分辨率下的图像特征信息,确定当前预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的中间评价分数;According to the order of the plurality of preset resolutions from low to high, based on the initial evaluation score and the Image feature information of the original image at the current preset resolution, determining that at least some of the pixels in the original image under the current preset resolution are the intermediate evaluation scores of the target pixels;将在所述多种预设分辨率中最高的预设分辨率下所述原始图像中至少部分像素点为所述目标像素点的中间评价分数,作为所述原始图像中至少部分像素点为所述目标像素点的评价分数。Taking at least some of the pixels in the original image at the highest preset resolution among the multiple preset resolutions as the intermediate evaluation score of the target pixel, as at least some of the pixels in the original image Describe the evaluation score of the target pixel.
- 根据权利要求1至10任一所述的方法,其特征在于,The method according to any one of claims 1 to 10, wherein,所述原始图像包括增强现实AR设备拍摄的现场图像,并且the original image includes a live image captured by an augmented reality AR device, and所述AR设备展示所述目标图像。The AR device displays the target image.
- 根据权利要求1至10任一所述的方法,其特征在于,所述原始图像,包括:The method according to any one of claims 1 to 10, wherein the original image comprises:目标人物图像,其中,所述目标对象包括所述目标人物图像中的人体头发区域、人体皮肤区域、至少部分服饰区域中的至少一种;或者,an image of a target person, wherein the target object includes at least one of a human hair area, a human skin area, and at least part of a clothing area in the target person image; or,目标物体图像,其中,所述目标对象为所述目标物体图像中的至少部分物体区域。A target object image, wherein the target object is at least a part of the object area in the target object image.
- 一种图像处理装置,其特征在于,包括:An image processing device, comprising:获取模块,用于获取原始图像中至少部分像素点为目标像素点的概率值,其中,所述目标像素点为所述原始图像中属于目标对象的像素点;an acquisition module, configured to acquire a probability value that at least part of the pixels in the original image are target pixels, wherein the target pixels are pixels belonging to the target object in the original image;确定模块,用于针对所述至少部分像素点中任一像素点,基于所述像素点为所述目标像素点的概率值和预先选择的目标颜色值,确定所述像素点对应的融合颜色值;A determination module, configured to determine the fusion color value corresponding to the pixel point based on the probability value that the pixel point is the target pixel point and the pre-selected target color value for any pixel point in the at least part of the pixel point ;生成模块,用于利用所述至少部分像素点分别对应的所述融合颜色值对所述原始图像中所述至少部分像素点的颜色值进行调整,得到目标图像。A generating module, configured to adjust the color values of the at least part of the pixel points in the original image by using the fusion color values corresponding to the at least part of the pixel points respectively, to obtain a target image.
- 一种电子设备,其特征在于,包括:An electronic device, comprising:存储器,存储有机器可读指令,a memory storing machine-readable instructions,处理器,用于执行所述存储器中存储的机器可读指令,a processor for executing machine-readable instructions stored in the memory,其中,所述机器可读指令被所述处理器执行时,所述处理器执行如权利要求1至12任一项所述的图像处理方法中的步骤。Wherein, when the machine-readable instructions are executed by the processor, the processor executes the steps in the image processing method according to any one of claims 1 to 12.
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被计算机设备运行时,所述计算机设备执行如权利要求1至12任意一项所述的图像处理方法的步骤。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is run by a computer device, the computer device executes the image processing method according to any one of claims 1 to 12. step.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110473454.0 | 2021-04-29 | ||
CN202110473454.0A CN113191938B (en) | 2021-04-29 | 2021-04-29 | Image processing method, image processing device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022227547A1 true WO2022227547A1 (en) | 2022-11-03 |
Family
ID=76980903
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/133400 WO2022227547A1 (en) | 2021-04-29 | 2021-11-26 | Method and apparatus for image processing, electronic device, and storage medium |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN113191938B (en) |
TW (1) | TW202242804A (en) |
WO (1) | WO2022227547A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113191938B (en) * | 2021-04-29 | 2022-11-15 | 北京市商汤科技开发有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
CN113763270B (en) * | 2021-08-30 | 2024-05-07 | 青岛信芯微电子科技股份有限公司 | Mosquito noise removing method and electronic equipment |
CN114022395B (en) * | 2022-01-06 | 2022-04-12 | 广州卓腾科技有限公司 | Method, device and medium for correcting hair color of certificate photo |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170270679A1 (en) * | 2016-03-21 | 2017-09-21 | The Dial Corporation | Determining a hair color treatment option |
CN110930296A (en) * | 2019-11-20 | 2020-03-27 | Oppo广东移动通信有限公司 | Image processing method, device, equipment and storage medium |
CN111145086A (en) * | 2019-12-27 | 2020-05-12 | 北京奇艺世纪科技有限公司 | Image processing method and device and electronic equipment |
CN112614060A (en) * | 2020-12-09 | 2021-04-06 | 深圳数联天下智能科技有限公司 | Method and device for rendering human face image hair, electronic equipment and medium |
CN113191938A (en) * | 2021-04-29 | 2021-07-30 | 北京市商汤科技开发有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9262684B2 (en) * | 2013-06-06 | 2016-02-16 | Apple Inc. | Methods of image fusion for image stabilization |
CN108921810A (en) * | 2018-06-20 | 2018-11-30 | 厦门美图之家科技有限公司 | A kind of color transfer method and calculate equipment |
CN112204608A (en) * | 2019-08-27 | 2021-01-08 | 深圳市大疆创新科技有限公司 | Image processing method and device |
CN110971839B (en) * | 2019-11-18 | 2022-10-04 | 咪咕动漫有限公司 | Video fusion method, electronic device and storage medium |
CN112233154B (en) * | 2020-11-02 | 2024-08-30 | 影石创新科技股份有限公司 | Color difference eliminating method, device and equipment for spliced image and readable storage medium |
CN112235520B (en) * | 2020-12-07 | 2021-05-04 | 腾讯科技(深圳)有限公司 | Image processing method and device, electronic equipment and storage medium |
-
2021
- 2021-04-29 CN CN202110473454.0A patent/CN113191938B/en active Active
- 2021-11-26 WO PCT/CN2021/133400 patent/WO2022227547A1/en active Application Filing
- 2021-12-09 TW TW110146140A patent/TW202242804A/en unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170270679A1 (en) * | 2016-03-21 | 2017-09-21 | The Dial Corporation | Determining a hair color treatment option |
CN110930296A (en) * | 2019-11-20 | 2020-03-27 | Oppo广东移动通信有限公司 | Image processing method, device, equipment and storage medium |
CN111145086A (en) * | 2019-12-27 | 2020-05-12 | 北京奇艺世纪科技有限公司 | Image processing method and device and electronic equipment |
CN112614060A (en) * | 2020-12-09 | 2021-04-06 | 深圳数联天下智能科技有限公司 | Method and device for rendering human face image hair, electronic equipment and medium |
CN113191938A (en) * | 2021-04-29 | 2021-07-30 | 北京市商汤科技开发有限公司 | Image processing method, image processing device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113191938B (en) | 2022-11-15 |
CN113191938A (en) | 2021-07-30 |
TW202242804A (en) | 2022-11-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022227547A1 (en) | Method and apparatus for image processing, electronic device, and storage medium | |
US11222222B2 (en) | Methods and apparatuses for liveness detection, electronic devices, and computer readable storage media | |
Gijsenij et al. | Computational color constancy: Survey and experiments | |
CN112614060B (en) | Face image hair rendering method and device, electronic equipment and medium | |
WO2017193906A1 (en) | Image processing method and processing system | |
US8638993B2 (en) | Segmenting human hairs and faces | |
EP3542347B1 (en) | Fast fourier color constancy | |
WO2018036462A1 (en) | Image segmentation method, computer apparatus, and computer storage medium | |
Hwang et al. | Context-based automatic local image enhancement | |
CN112328345B (en) | Method, apparatus, electronic device and readable storage medium for determining theme colors | |
WO2023273111A1 (en) | Image processing method and apparatus, and computer device and storage medium | |
CN111553838A (en) | Model parameter updating method, device, equipment and storage medium | |
CN109300170B (en) | Method for transmitting shadow of portrait photo | |
US20190304152A1 (en) | Method and device for processing image | |
Sharma et al. | Single-image camera response function using prediction consistency and gradual refinement | |
Smiatacz | Normalization of face illumination using basic knowledge and information extracted from a single image | |
KR102334030B1 (en) | Method for dyeing hair by using computer device | |
WO2023272495A1 (en) | Badging method and apparatus, badge detection model update method and system, and storage medium | |
CN112822393B (en) | Image processing method and device and electronic equipment | |
Yuan et al. | Full convolutional color constancy with adding pooling | |
US9251567B1 (en) | Providing color corrections to photos | |
CN113781330A (en) | Image processing method, device and electronic system | |
CN114565506B (en) | Image color migration method, device, equipment and storage medium | |
CN110351542A (en) | A kind of color correcting method and device for video frame | |
WO2024055676A1 (en) | Image compression method and apparatus, computer device, and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21939006 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21939006 Country of ref document: EP Kind code of ref document: A1 |