An image processing method, apparatus and electronic device

By creating a shoe cover model in AR image processing and completing the background, the problem of mishaps when drawing shoes with special structures was solved, achieving a more natural try-on effect.

CN114742978BActive Publication Date: 2025-11-04BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
CN202210369250.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2025-11-04
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

Existing augmented reality (AR) shoe try-on technology may cause foot features to be missed in areas not covered by the shoe when mapping shoes with special structures, resulting in mishaps.

Method used

By acquiring the original image, identifying the foot feature area, creating a foot cover model, completing the background, and then rendering the shoe model to avoid revealing any flaws.

Benefits of technology

When drawing shoes, the background of the foot feature area is filled in in advance to ensure that the shoe model covers all necessary parts, avoiding any mishaps and obtaining a more realistic image effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114742978B_ABST
    Figure CN114742978B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method, and particularly relates to the technical field of image processing. The method comprises: obtaining an original image; in a case where a foot feature region exists in the original image, determining a foot cover model according to the foot feature region of the original image, the foot cover model being used to mark a to-be-optimized region of the foot feature region; performing background completion on the to-be-optimized region of the original image to obtain a completed image; determining a shoe model according to the foot feature region in the completed image; and rendering the shoe model in the foot feature region in the completed image to obtain a target image. The embodiments of the present disclosure are used to solve the problem of the shoe appearing in the video when the shoe is worn into the foot.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of image processing, and in particular to an image processing method, device and electronic equipment. BACKGROUND

[0002] The existing augmented reality (AR) shoe fitting technology can draw a shoe to a foot in a video through image processing. However, for some shoes with special structures, when the shoe is drawn to the foot in the video, some features of the foot may be exposed and missed in the position not covered by the shoe, and there is an urgent need for an image processing method without exposure. SUMMARY

[0003] To solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image processing method, device and electronic equipment, which can avoid the exposure problem of some shoes with special structures when the shoe is drawn to the foot in a video through image processing.

[0004] To achieve the above purpose, the technical scheme provided by the embodiments of the present disclosure is as follows:

[0005] In a first aspect, an image processing method is provided, comprising:

[0006] obtaining an original image; in a case where it is determined that a foot feature region exists in the original image, determining a foot cover model according to the foot feature region of the original image, the foot cover model being used to indicate a to-be-optimized region of the foot feature region; performing background completion on the to-be-optimized region of the original image to obtain a completed image; determining a shoe model according to the foot feature region in the completed image; and rendering the shoe model in the foot feature region in the completed image to obtain a target image.

[0007] As an optional implementation manner of the embodiments of the present disclosure, the background completion on the to-be-optimized region of the original image comprises: calculating an offset screen coordinate corresponding to a target pixel point of the to-be-optimized region of the original image according to an initial screen coordinate of the target pixel point, a width of the foot feature region on the screen and a length of the foot feature region on the screen, the target pixel point being any pixel point in at least part of the pixel points in the to-be-optimized region; and replacing a color value of the target pixel point with a color value of a pixel point corresponding to the offset screen coordinate, so as to implement the background completion on the to-be-optimized region.

[0008] As an optional implementation manner of the embodiments of the present disclosure, the background completion on the to-be-optimized region of the original image comprises:

[0009] According to the initial color value of the target pixel point in the to-be-optimized region of the original image and the initial color value of the adjacent pixel point of the target pixel point, a final color value corresponding to the target pixel point is determined, the target pixel point being any pixel point in at least part of the pixel points in the to-be-optimized region;

[0010] The initial color value of the target pixel point is replaced by the final color value corresponding to the target pixel point, so as to realize background completion on the to-be-optimized region.

[0011] As an optional implementation of an embodiment of the present disclosure, after the shoe model is rendered in the foot feature region in the completed image to obtain a target image, the method further includes:

[0012] An initial color value of a first pixel point is obtained, the first pixel point being any pixel point corresponding to the shoe model in the completed image;

[0013] According to a first coordinate corresponding to the first pixel point, sampling is performed from a target effect picture to obtain a first color value;

[0014] According to the initial color value of the first pixel point and the first color value, a final color value of the first pixel point is calculated;

[0015] The initial color value of the first pixel point is replaced by the final color value.

[0016] As an optional implementation of an embodiment of the present disclosure, the first coordinate includes any one of the following:

[0017] A two-dimensional space coordinate, a world space coordinate, and a screen control coordinate.

[0018] As an optional implementation of an embodiment of the present disclosure, after the shoe model is rendered in the foot feature region in the completed image to obtain a target image, the method further includes:

[0019] A shoe model space is established based on the shoe model;

[0020] According to a second coordinate in the shoe model space, a target noise value is determined, the second coordinate being any model space coordinate in the shoe model space;

[0021] If the target noise value is greater than a preset value, a second pixel point corresponding to the second coordinate is rendered in the foot feature region, the preset value decreasing from large to small within a first time length.

[0022] As an optional implementation of the embodiment of the present disclosure, the determining the target noise value according to the second coordinate in the shoe model space comprises:

[0023] determining a first noise value according to a position of the second coordinate in a target axial direction in the shoe model space;

[0024] generating a random number according to the second coordinate;

[0025] calculating the target noise value according to the first noise value and the random number.

[0026] In a second aspect, an image processing apparatus is provided, comprising:

[0027] an acquisition module configured to acquire an original image;

[0028] a processing module configured to, in a case where it is determined that a foot feature region exists in the original image, determine a foot cover model according to the foot feature region of the original image, the foot cover model being used to indicate a to-be-optimized region of the foot feature region; perform background completion on the to-be-optimized region of the original image to obtain a completed image; determine a shoe model according to the foot feature region in the completed image; and render the shoe model in the foot feature region in the completed image to obtain a target image.

[0029] As an optional implementation of the embodiment of the present disclosure, the processing module is specifically configured to: calculate an offset screen coordinate corresponding to a target pixel point in the to-be-optimized region of the original image according to an initial screen coordinate of the target pixel point, a width of the foot feature region on a screen, and a length of the foot feature region on the screen, the target pixel point being any pixel point in at least part of the pixel points in the to-be-optimized region.

[0030] replace a color value of the target pixel point with a color value of a pixel point corresponding to the offset screen coordinate, so as to perform background completion on the to-be-optimized region.

[0031] As an optional implementation of the embodiment of the present disclosure, the processing module is specifically configured to:

[0032] determine a final color value corresponding to a target pixel point according to an initial color value of the target pixel point in the to-be-optimized region of the original image and initial color values of neighboring pixel points of the target pixel point, the target pixel point being any pixel point in at least part of the pixel points in the to-be-optimized region;

[0033] replace the initial color value of the target pixel point with the final color value corresponding to the target pixel point, so as to perform background completion on the to-be-optimized region.

[0034] As an optional implementation of the embodiment of the present disclosure, the processing module is further configured to:

[0035] obtain an initial color value of a first pixel point, the first pixel point being any pixel point corresponding to the shoe model in the completed image;

[0036] sample a target effect picture according to a first coordinate corresponding to the first pixel point to obtain a first color value;

[0037] calculate a final color value of the first pixel point according to the initial color value of the first pixel point and the first color value;

[0038] replace the initial color value of the first pixel point with the final color value.

[0039] As an optional implementation of the embodiment of the present disclosure, the first coordinate includes any of the following:

[0040] a two-dimensional space coordinate, a world space coordinate, and a screen control coordinate.

[0041] As an optional implementation of the embodiment of the present disclosure, the processing module is specifically configured to: establish a shoe model space based on the shoe model;

[0042] determine a target noise value according to a second coordinate in the shoe model space, the second coordinate being any model space coordinate in the shoe model space;

[0043] if the target noise value is greater than a preset value, render a second pixel point corresponding to the second coordinate in the foot feature area, the preset value decreasing from large to small within a first time length.

[0044] As an optional implementation of the embodiment of the present disclosure, the processing module is specifically configured to:

[0045] determine a first noise value according to a position of the second coordinate in a target axis direction of the shoe model space;

[0046] generate a random number according to the second coordinate;

[0047] calculate the target noise value according to the first noise value and the random number.

[0048] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the image processing method according to the first aspect or any optional implementation thereof is implemented.

[0049] In a fourth aspect, a computer-readable storage medium is provided, including: a computer program stored on the computer-readable storage medium, the computer program being executed by a processor to implement the image processing method according to the first aspect or any possible implementation thereof.

[0050] In a fifth aspect, a computer program product is provided, including: when the computer program product is run on a computer, the computer is caused to implement the image processing method according to the first aspect or any possible implementation thereof.

[0051] The image processing method provided by the embodiments of the present disclosure can acquire an original image; in a case where it is determined that a foot feature region exists in the original image, a foot cover model is determined according to the foot feature region of the original image, the foot cover model being used to mark a to-be-optimized region of the foot feature region; the to-be-optimized region of the original image is subjected to background completion to obtain a completed image; a shoe model is determined according to the foot feature region in the completed image; and the shoe model is rendered in the foot feature region in the completed image to obtain a target image. Through the scheme, before the shoe is drawn in the foot in the image in the image processing, the to-be-optimized region in the foot feature region in the original image can be determined through the foot cover model in advance, and the background completion is performed, so that after the shoe model is rendered on the original image subsequently, even if the shoe is a special structure, because the background completion is performed on the foot feature in advance, the foot feature will not be leaked out of the rendered shoe model, and the target image obtained is more consistent with the picture of the foot wearing the shoe in reality, thereby avoiding the situation of wearing a mistake. BRIEF DESCRIPTION OF DRAWINGS

[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure together with the specification.

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, hereinafter, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced, and obviously, other drawings can also be obtained by those skilled in the art without any creative labor under the premise of not paying any creative labor.

[0054] Figure 1 A schematic diagram of a situation of wearing a mistake when a shoe is drawn to a foot in a video provided by the embodiments of the present disclosure;

[0055] Figure 2 A flowchart of an image processing method provided by the embodiments of the present disclosure;

[0056] Figure 3 A schematic diagram of a foot cover model provided by the embodiments of the present disclosure;

[0057] Figure 4 A schematic diagram of completing an image provided by an embodiment of the present disclosure;

[0058] Figure 5A A schematic diagram of a background completion method provided by an embodiment of the present disclosure;

[0059] Figure 5B A schematic diagram of another background completion method provided by an embodiment of the present disclosure;

[0060] Figure 6 A schematic diagram of obtaining a target image provided by an embodiment of the present disclosure;

[0061] Figure 7 A structural block diagram of an image processing device provided by an embodiment of the present disclosure;

[0062] Figure 8 A structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0063] In order to more clearly understand the above-mentioned purposes, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0064] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other ways different from those described herein; obviously, the embodiments in the description are only some of the embodiments of the present disclosure, not all the embodiments.

[0065] In the embodiments of the present disclosure, the words such as "exemplary" or "for example" are used to mean serving as an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present disclosure should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words such as "exemplary" or "for example" are intended to present the relevant concept in a specific manner. In addition, in the description of the embodiments of the present disclosure, the meaning of "plurality" is two or more, unless otherwise specified.

[0066] In the related art, in order to realize the special effect of trying on shoes, the shoes can be drawn to the feet in the video through processing of the image, but for some shoes with special structure, when the shoes are drawn to the feet in the video, part of the features of the feet may be exposed in the position not covered by the shoes.

[0067] For example, assuming that the shoe is a high-heeled shoe with a special structure, when the shoe is drawn to the foot in the video, part of the toe or heel part will have part of the feature that will be worn out, exposed in the position not covered by the shoe. As shown in Figure 1 , a schematic diagram of a worn-out case when a shoe is drawn to a foot in a video is provided in an embodiment of the present disclosure, as shown in Figure 1 , after the shoe model 12 is drawn to the foot feature area 11 in the video, there will be a worn-out area 13 in the obtained image, as shown in Figure 1 .

[0068] To solve the above problems, an image processing method is provided in an embodiment of the present disclosure, which can determine the to-be-optimized area in the foot feature area in the original image through a foot cover model before image processing is performed to put the shoe on the foot in the image, and perform background completion. In this way, after the shoe model is rendered on the original image, even if the shoe is a special structure, because the foot feature has been completed in advance, the foot feature will not be exposed outside the rendered shoe model, and the obtained target image is more consistent with the actual picture of the foot wearing the shoe, thereby avoiding the worn-out case.

[0069] The image processing method provided in the embodiment of the present disclosure can be implemented by an image processing device or an electronic device. The image processing device can be a functional module or a functional entity in the electronic device. The electronic device can include a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), a personal computer (PC), etc., which are not limited in the embodiment of the present disclosure.

[0070] As shown in Figure 2 , a flowchart of an image processing method is provided in an embodiment of the present disclosure, and the method includes the following steps 201 to 205:

[0071] 201, obtaining an original image.

[0072] The original image can be a frame of image in a real-time obtained video image.

[0073] 202, in a case where it is determined that there is a foot feature area in the original image, determining a foot cover model according to the foot feature area of the original image, the foot cover model being used to indicate a to-be-optimized area of the foot feature area.

[0074] The foot cover model can be a model that covers the heel and forefoot. The area covered by the foot cover model is the area where drawing the shoe on the foot's feature area might cause it to look unnatural. The foot cover model can be a pre-set model.

[0075] In some embodiments, for shoe models with very special structures, it may be necessary to set corresponding foot cover models. That is, different shoe models may correspond to different foot cover models. For example, shoes with a triangular outline correspond to one type of foot cover model, while shoes with a rhombus outline correspond to another type of foot cover model.

[0076] For example, such as Figure 3 The diagram shown is a schematic representation of a foot cover model provided in an embodiment of this disclosure, based on... Figure 3 The foot feature region 31 in the image is identified, and the foot cover model 32 is determined. The area indicated by the foot cover model 32 is the area to be optimized of the foot feature region.

[0077] 203. Perform background completion on the region to be optimized in the original image to obtain the completed image.

[0078] like Figure 4 As shown, this is a schematic diagram of an image completion provided in an embodiment of the present disclosure. Further, the area to be optimized in the foot feature region can be determined according to the foot cover model, and then the background can be completed in the area to obtain the completed image 41.

[0079] In this embodiment of the disclosure, the specific background completion method may include a variety of methods. The following are examples of several possible implementation methods:

[0080] In some embodiments, background completion of the region to be optimized in the original image is performed as follows: Based on the initial screen coordinates of the target pixel in the region to be optimized, the width of the foot feature region on the screen, and the length of the foot feature region on the screen, the offset screen coordinates corresponding to the target pixel are calculated; the color value of the target pixel is replaced with the color value of the pixel corresponding to the offset screen coordinates to achieve background completion of the region to be optimized. The target pixel is any pixel among at least some pixels in the region to be optimized, and at least some pixels in the region to be optimized include: all pixels in the region to be optimized, or some pixels in the region to be optimized.

[0081] In this embodiment of the disclosure, the color values ​​refer to the values ​​of the three channels: R (red), G (green), and B (blue).

[0082] In the above embodiment, a mapping method is used. The initial screen coordinates of the target pixels in the region to be optimized of the original image, the width of the foot feature region on the screen, and the length of the foot feature region on the screen are used to sample the color values ​​of the pixels in the non-foot feature region. The color values ​​of the pixels in the non-foot feature region are then used to replace the color values ​​of the pixels in the region to be optimized. This method determines the pixels in the non-foot feature region as the background and replaces the color values ​​of the region to be optimized with the color values ​​of the non-foot region, thereby achieving background completion of the region to be optimized.

[0083] Optionally, the color values ​​of pixels in the area to be optimized can be replaced by the color values ​​of pixels within a preset range that are at a distance from the foot feature area. This method determines the pixels within a preset range that are at a distance from the foot feature area as the background, thereby achieving background completion of the area to be optimized.

[0084] For example, the color value of the pixels in the area to be optimized after background completion can be calculated using the following formula (1):

[0085] Color=texture2D(u_inputTex,g_vary_sp_uv-u_widthVector+u_heightVector) (1)

[0086] Wherein, color represents the color value of a pixel in the area to be optimized after background completion, texture2D represents 2D texture mapping, u_inputTex is the input texture of the image corresponding to the video, that is, the initial color value of the pixel, g_vary_sp_uv is the screen coordinate of the currently rendered pixel, that is, the screen coordinate corresponding to the pixel, u_widthVector is the width of the foot feature area on the screen, and u_heightVector is the length of the foot feature area on the screen.

[0087] like Figure 5A The diagram shown is a schematic of a background completion method provided in an embodiment of this disclosure. Based on the initial screen coordinates of pixel 52 in the area to be optimized, the width of the foot feature region on the screen, and the length of the foot feature region on the screen, the offset screen coordinates corresponding to pixel 52 can be calculated. The corresponding pixel 51 is then determined based on these offset screen coordinates, and the color value of pixel 52 is replaced with the color value of pixel 51. Figure 5A Each pixel in the region to be optimized indicated by the mid-foot cover model can have its color value replaced in the manner described above, thereby completing the background of the pixels in the region to be optimized.

[0088] In some embodiments, the manner of performing background completion on the to-be-optimized region of the original image is: determining a final color value corresponding to a target pixel point in the to-be-optimized region of the original image according to an initial color value of the target pixel point and initial color values of neighboring pixel points of the target pixel point; and replacing the initial color value of the target pixel point with the final color value corresponding to the target pixel point to implement the background completion on the to-be-optimized region. The target pixel point is any pixel point in at least part of the pixel points in the to-be-optimized region, and the at least part of the pixel points in the to-be-optimized region includes all the pixel points in the to-be-optimized region or part of the pixel points in the to-be-optimized region.

[0089] In this way, the final color value of a region closer to the background in the to-be-optimized region is closer to the real background, so that the to-be-optimized region can be integrated with the background, the boundary between the to-be-optimized region and the background is blurred, and the background completion on the to-be-optimized region is implemented.

[0090] Optionally, the weight value of the current pixel point to be optimized in the to-be-optimized region can be set to be larger, and the weight value of the neighboring pixel point of the current pixel point can be set to be smaller, so that a better display effect can be achieved.

[0091] As shown in FIG. 6, it is assumed that for a pixel point A in the original image, an initial color value of the pixel point A is obtained, and initial color values of four pixel points B1, B2, B3 and B4 adjacent to the pixel point A are obtained, then the initial color values of the five pixel points A, B1, B2, B3 and B4 are weighted and summed to calculate a final color value, and then the color value of the pixel point A is replaced with the final color value. Figure 5B

[0092] 205, rendering the shoe model on the foot feature region in the completed image to obtain a target image.

[0093] As shown in FIG. 6, it is assumed that for a pixel point A in the original image, an initial color value of the pixel point A is obtained, and initial color values of four pixel points B1, B2, B3 and B4 adjacent to the pixel point A are obtained, then the initial color values of the five pixel points A, B1, B2, B3 and B4 are weighted and summed to calculate a final color value, and then the color value of the pixel point A is replaced with the final color value. Figure 6 Figure 6

[0094] ​​​The image processing method provided in the embodiments of the present disclosure can acquire an original image; in a case where it is determined that a foot feature region exists in the original image, a foot cover model is determined according to the foot feature region of the original image, the foot cover model is used to mark a to-be-optimized region of the foot feature region; the to-be-optimized region of the original image is subjected to background completion to obtain a completed image; a shoe model is determined according to the foot feature region in the completed image; and the shoe model is rendered in the foot feature region in the completed image to obtain a target image. Through the scheme, before the image processing is performed to put the shoe on the foot in the image, the to-be-optimized region in the foot feature region in the original image can be determined through the foot cover model, and the background completion is performed, so that after the shoe model is rendered on the original image, even if the shoe is a special structure, because the background completion is performed on the foot feature in advance, the foot feature will not be missed out of the rendered shoe model, and the target image obtained is more consistent with the actual picture of the foot wearing the shoe, thereby avoiding the situation of wearing a mistake.

[0095] In the image processing method provided in the embodiments of the present disclosure, after the shoe model is drawn in the foot feature region in the image according to the steps 201 to 205, some special display effects can be superimposed on the shoe model, the special effects can be superimposed based on some special effect maps, and the gradually appearing effect can be realized when the shoe model is drawn. For example, the starry sky effect can be superimposed on the shoe model, the gradually appearing effect from the heel to the toe can be realized when the shoe model is drawn, or the gradually appearing effect from the toe to the heel can be realized when the shoe model is drawn.

[0096] In some embodiments, after the shoe model is rendered in the foot feature region in the completed image in step 205 to obtain the target image, the following manner can be further included: an initial color value of a first pixel point is acquired, the first pixel point being any pixel point corresponding to the shoe model in the completed image; a first color value is obtained by sampling from a target effect map according to a first coordinate corresponding to the first pixel point; a final color value of the first pixel point is calculated according to the initial color value of the first pixel point and the first color value; and the initial color value of the first pixel point is replaced by the final color value.

[0097] The first coordinate includes any one of the following: a two-dimensional space coordinate, a world space coordinate, and a screen control coordinate.

[0098] For example, the final color value of the first pixel point can be calculated according to the initial color value of the first pixel point and the first color value according to the following formula (2).

[0099] finalRGB.xyz = refractionRGB.xyz * galaxyColor * 2.0 * (1.0 - cfg) + (1.0 - (1.0 - galaxyColor) * (1.0 - refractionRGB.xyz) * 2.0) (2)

[0100] Wherein, finalRGB.xyz represents the final color value of the first pixel point, refractionRGB.xyz represents the initial color value of the first pixel point, galaxyColor represents the first color value obtained by sampling from a target effect map according to the first coordinate corresponding to the first pixel point, the target effect map can be a starry sky effect map, and cfg is an overlay parameter of the initial color value of the first pixel point and the first color value, which is used to represent the proportion of the initial color value of the first pixel point and the first color value when they are overlaid. The overlay parameter can be set according to actual needs, and the embodiments of the present disclosure are not limited.

[0101] For example, assuming that the above-mentioned target effect map is a starry sky effect map, when galaxyColor is a color value obtained by sampling based on two-dimensional space coordinates (UV coordinates), the starry sky effect will be fixed on the shoe model; when galaxyColor is a color value obtained by sampling based on world space coordinates, the starry sky effect will achieve a flowing effect when the model moves; when galaxyColor is a color value obtained by sampling based on screen control coordinates, the starry sky effect will be displayed at a fixed position in the screen.

[0102] In the above-mentioned embodiments, by sampling the target effect map, the target effect can be overlaid on the shoe model, so that the display effect of the rendered shoe is better.

[0103] In some embodiments, the way of rendering the shoe model in the foot feature area of the completed image to obtain the target image is: establishing a shoe model space based on the shoe model; determining a target noise value according to a second coordinate in the shoe model space, the second coordinate being any model space coordinate in the shoe model space; and if the target noise value is greater than a preset value, rendering a second pixel point corresponding to the second coordinate in the foot feature area.

[0104] Wherein, the above-mentioned preset value decreases from large to small within a first time length. The first time length is the total time length of drawing the entire shoe model.

[0105] For example, in the above-mentioned embodiments, the axial direction of the shoe model space can be used to achieve the effect of gradual appearance of the shoe from the toe to the heel by dissolving and adding noise to increase the randomness of the edge.

[0106] First, a shoe model space is established based on a shoe model, wherein a direction from a heel to a toe can be taken as an axial direction of the shoe model space (for example, a Y axis of the shoe model space), and then for any model space coordinate in the shoe model space, a corresponding value of the model space coordinate on the Y axis is determined, and the value is taken as a corresponding target noise value. For example, assuming that the value corresponding to the toe on the Y axis is 1 and the value corresponding to the heel is 0, the target noise value is a value between 0 and 1, and the value between 0 and 1 is determined as the target noise value.

[0107] Further, the preset value is set to gradually change from 1 to 0 over a first time period, and if the target noise value is greater than the preset value, the second pixel point corresponding to the second coordinate is rendered in the foot feature area. Correspondingly, if the target noise value is less than or equal to the preset value, the second pixel point corresponding to the second coordinate is not rendered in the foot feature area. In this way, a display effect of gradually appearing from the toe to the heel can be presented.

[0108] In some embodiments, the manner of determining the target noise value according to the second coordinate in the shoe model space is: determining a first noise value according to the position of the second coordinate on the target axial direction in the shoe model space; generating a random number according to the second coordinate; and calculating the target noise value according to the first noise value and the random number.

[0109] First, a shoe model space is established based on a shoe model, wherein a direction from a heel to a toe can be taken as an axial direction of the shoe model space (for example, a Y axis of the shoe model space), and then for any model space coordinate in the shoe model space, a corresponding value of the model space coordinate on the Y axis is determined, and the value is taken as a corresponding target noise value. For example, assuming that the value corresponding to the toe on the Y axis is 1 and the value corresponding to the heel is 0, the target noise value is a value between 0 and 1, and the value between 0 and 1 is determined as the target noise value.

[0110] Further, a random number between -0.05 and 0.05 is generated according to the second coordinate, and then a result obtained by superimposing the random number on the first noise value is taken as the target noise value.

[0111] For example, the target noise value can be calculated according to the following formula (3):

[0112] noise2 = noise1 + noise2 (3)

[0113] Wherein, noise2 represents the target noise value, noise1 represents the first noise value, and noise2 represents the random number.

[0114] Further, the preset value is set to gradually change from 1 to 0 within a first time length, after the target noise value is determined, if the target noise value is greater than the preset value, the second pixel point corresponding to the second coordinate is rendered in the foot feature area, and correspondingly, if the target noise value is less than or equal to the preset value, the second pixel point corresponding to the second coordinate is not rendered in the foot feature area. In this way, a display effect of gradually appearing from the toe to the heel can be presented.

[0115] In the above embodiment, the target noise value is a random number added on the basis of the first noise value, so when drawing the shoe model, not only the display effect of gradually appearing from the toe to the heel can be presented, but also when processing the pixel points with consistent coordinates on the axis corresponding to the direction from the heel to the toe, these pixel points will not be drawn at the same time, and the process of gradually appearing from the toe to the heel is presented, avoiding unnatural and unsmooth display effect due to the appearance of the flat gradual appearance effect.

[0116] As shown in Figure 7 The embodiment of the present disclosure provides a structural block diagram of an image processing device, which comprises:

[0117] The acquisition module 701 is configured to acquire an original image.

[0118] The processing module 702 is configured to, in the case that the foot feature area exists in the original image, determine a foot cover model according to the foot feature area of the original image, the foot cover model being used to mark a to-be-optimized area of the foot feature area; perform background completion on the to-be-optimized area of the original image to obtain a completed image; determine a shoe model according to the foot feature area in the completed image; and render the shoe model in the foot feature area in the completed image to obtain a target image.

[0119] As an optional implementation of the embodiment of the present disclosure, the processing module 702 is specifically configured to: calculate an offset screen coordinate corresponding to a target pixel point in the to-be-optimized area according to an initial screen coordinate of the target pixel point, a width of the foot feature area on the screen, and a length of the foot feature area on the screen, the target pixel point being any pixel point in at least part of the pixel points in the to-be-optimized area.

[0120] Replace the color value of the target pixel point with the color value of the pixel point corresponding to the offset screen coordinate to achieve the background completion of the to-be-optimized area.

[0121] As an optional implementation of the embodiment of the present disclosure, the processing module 702 is specifically configured to:

[0122] According to the initial color value of a target pixel point in the to-be-optimized region of the original image and the initial color value of a neighboring pixel point of the target pixel point, a final color value corresponding to the target pixel point is determined, the target pixel point being any pixel point in at least part of the pixel points in the to-be-optimized region.

[0123] The initial color value of the target pixel point is replaced by the final color value corresponding to the target pixel point, so as to realize background completion on the to-be-optimized region.

[0124] As an optional implementation of the embodiment of the present disclosure, the processing module 702 is further configured to:

[0125] An initial color value of a first pixel point is obtained, the first pixel point being any pixel point corresponding to the shoe model in the completed image;

[0126] According to a first coordinate corresponding to the first pixel point, sampling is performed from a target effect picture to obtain a first color value;

[0127] According to the initial color value of the first pixel point and the first color value, a final color value of the first pixel point is calculated;

[0128] The initial color value of the first pixel point is replaced by the final color value.

[0129] As an optional implementation of the embodiment of the present disclosure, the first coordinate includes any one of the following:

[0130] A two-dimensional space coordinate, a world space coordinate, and a screen control coordinate.

[0131] As an optional implementation of the embodiment of the present disclosure, the processing module 702 is specifically configured to: establish a shoe model space based on the shoe model;

[0132] According to a second coordinate in the shoe model space, a target noise value is determined, the second coordinate being any model space coordinate in the shoe model space;

[0133] If the target noise value is greater than a preset value, a second pixel point corresponding to the second coordinate is rendered in the foot feature region.

[0134] As an optional implementation of the embodiment of the present disclosure, the processing module 702 is specifically configured to:

[0135] According to a position of the second coordinate in a target axial direction of the shoe model space, a first noise value is determined;

[0136] According to the second coordinate, a random number is generated;

[0137] According to the first noise value and the random number, a target noise value is calculated.

[0138] As shown in Figure 8 The electronic device provided by the embodiment of the present disclosure includes a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801, and when the computer program is executed by the processor 801, each process of the image processing method in the method embodiment is implemented. And the same technical effect can be achieved, to avoid repetition, which will not be repeated here.

[0139] The embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and when the computer program is executed by the processor 801, each process of the image processing method in the method embodiment is implemented, and the same technical effect can be achieved, to avoid repetition, which will not be repeated here.

[0140] The computer readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0141] The embodiment of the present application provides a computer program product, the computer program product stores a computer program, and when the computer program is executed by the processor, each process of the image processing method in the method embodiment is implemented, and the same technical effect can be achieved, to avoid repetition, which will not be repeated here.

[0142] Those skilled in the art should understand that the embodiments of the present disclosure can be provided as a method, a system, or a computer program product. Therefore, the present disclosure can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure can take the form of a computer program product implemented on one or more computer usable storage media having computer usable program code contained therein.

[0143] In this disclosure, the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can be any conventional processor.

[0144] In this disclosure, the memory can include non-persistent memory in computer-readable media including, for example, random access memory (RAM) such as synchronous dynamic random access memory (SDRAM) and / or non-volatile memory such as read only memory (ROM), resistive memory, or flash memory. The memory is an example of computer-readable media.

[0145] In this disclosure, computer-readable media include non-transitory computer- readable media and transitory computer-readable media. Transitory computer-readable media, such as modulated data signals and carrier waves, include memory devices or physical media such as RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information for access by a computing device. According to the definition provided herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0146] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0147] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image processing method, characterized in that, include: Obtain the original image; If it is determined that there is a foot feature region in the original image, a foot cover model is determined based on the foot feature region of the original image. The foot cover model is used to mark the area to be optimized of the foot feature region. Background completion is performed on the region to be optimized in the original image to obtain a completed image; Based on the foot feature region in the completed image, determine the shoe model; In the foot feature region of the completed image, the shoe model is rendered to obtain the target image; The process of background completion for the region to be optimized in the original image includes: Based on the initial screen coordinates of the target pixel in the region to be optimized of the original image, the width of the foot feature region on the screen, and the length of the foot feature region on the screen, the offset screen coordinates corresponding to the target pixel are calculated, where the target pixel is any pixel among at least some pixels in the region to be optimized. The color value of the target pixel is replaced with the color value of the pixel corresponding to the offset screen coordinates to complete the background of the area to be optimized. After rendering the shoe model, special display effects are also superimposed on the shoe model.

2. The method according to claim 1, characterized in that, The process of background completion for the region to be optimized in the original image includes: Based on the initial color value of the target pixel in the region to be optimized of the original image and the initial color values ​​of the adjacent pixels of the target pixel, the final color value corresponding to the target pixel is determined, wherein the target pixel is any pixel in at least some of the pixels in the region to be optimized; The initial color value of the target pixel is replaced with the final color value corresponding to the target pixel to complete the background of the area to be optimized.

3. The method according to claim 1, characterized in that, After rendering the shoe model in the foot feature region of the completed image to obtain the target image, the method further includes: Obtain the initial color value of the first pixel, where the first pixel is any pixel in the completed image corresponding to the shoe model; Based on the first coordinates corresponding to the first pixel, a first color value is obtained by sampling from the target effect image. Calculate the final color value of the first pixel based on the initial color value and the first color value; Replace the initial color value of the first pixel with the final color value.

4. The method according to claim 3, characterized in that, The first coordinate includes any of the following: Two-dimensional spatial coordinates, world spatial coordinates, and screen control coordinates.

5. The method according to claim 1, characterized in that, Rendering the shoe model in the foot feature region of the completed image to obtain the target image includes: Based on the shoe model, a shoe model space is established; The target noise value is determined based on the second coordinate in the shoe model space, where the second coordinate is any model space coordinate in the shoe model space; If the target noise value is greater than a preset value, then the second pixel point corresponding to the second coordinate is rendered in the foot feature area, and the preset value changes from large to small within a first time period.

6. The method according to claim 5, characterized in that, Determining the target noise value based on the second coordinate in the shoe model space includes: The first noise value is determined based on the position of the second coordinate along the target axis in the shoe model space; Generate a random number based on the second coordinate; The target noise value is calculated based on the first noise value and the random number.

7. An image processing apparatus, characterized in that, include: The acquisition module is used to acquire the original image; The processing module is configured to, upon determining that a foot feature region exists in the original image, determine a foot cover model based on the foot feature region of the original image, wherein the foot cover model is used to mark the area to be optimized of the foot feature region; perform background completion on the area to be optimized in the original image to obtain a completed image; determine a shoe model based on the foot feature region in the completed image; and render the shoe model in the foot feature region of the completed image to obtain a target image. The step of performing background completion on the region to be optimized in the original image includes: Based on the initial screen coordinates of the target pixel in the region to be optimized of the original image, the width of the foot feature region on the screen, and the length of the foot feature region on the screen, the offset screen coordinates corresponding to the target pixel are calculated, where the target pixel is any pixel among at least some pixels in the region to be optimized. The color value of the target pixel is replaced with the color value of the pixel corresponding to the offset screen coordinates to complete the background of the area to be optimized. After rendering the shoe model, special display effects are also superimposed on the shoe model.

8. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the image processing method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, include: A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the image processing method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image processing apparatus, image processing method, and program

    CN102982525A

  • Face replacement method, device and electronic device

    CN107316020A

  • Face image processing method and device, electronic equipment and computer readable medium

    CN111784568A

  • Virtual trial method and device, electronic equipment and storage equipment

    CN111882408A

Cited By

  • Image processing method and apparatus, and electronic device

    WO2023193664A1