Image processing method and related device

By performing data processing in the two-dimensional image dimension, three-dimensional shape information of the image display part is constructed to generate the initial preview image, which solves the problem that users find it difficult to efficiently preview the personalized effects of customized products, and achieves a simplified image preview process and efficient preview efficiency.

CN119788830APending Publication Date: 2025-04-08腾安基金销售(深圳)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411758994.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, it is difficult for users to efficiently preview the personalized effects of customized products, and the preview process is expensive and cannot be promoted.

Method used

By performing data processing in the two-dimensional image dimension, three-dimensional shape information of the image display part is constructed to generate an initial preview image, and a preview of the addition effect to the three-dimensional object image is achieved.

Benefits of technology

Simplifies the image preview process, reduces the difficulty of technical implementation, improves preview efficiency, and makes this function suitable for more low-processing application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788830A_ABST
    Figure CN119788830A_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses an image processing method and related devices. By analyzing the three-dimensional shape corresponding to the image display part on the preview object, a position correspondence relationship for changing the position of pixels in a basic image can be constructed. The basic image can be deformed by changing the pixel position in the basic image through the position correspondence relationship, thereby simulating the deformation effect caused by the three-dimensional shape of the image display part when the basic image is added to the image display part, and an initial preview image for previewing the preview effect corresponding to the basic image when the basic image is displayed through the image display part is obtained. Furthermore, by adding the initial preview image to the first image area used to display the image display part, a preview image for previewing the display effect of adding the basic image to the image display part can be generated. The entire process only requires image processing in the image dimension, which can provide an efficient preview function while ensuring the accuracy of the image display effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an image processing method and related devices. Background Art

[0002] With the continuous development of network technology, more and more users choose to buy the goods they need through online shopping. Among them, in order to cater to the diverse demand for goods, many goods provide users with customization functions. Users can add the information they need to the goods to generate personalized goods.

[0003] In related technologies, in order to enable users to preview the effects of customized products, online shopping platforms need to combine the personalized information provided by users to build a three-dimensional model corresponding to the product, and render the three-dimensional model to obtain a product image for displaying personalized products, so that users can know the product image after adding personalized information.

[0004] Since 3D modeling technology is relatively complex, each 3D modeling requires relevant personnel to spend a lot of time and energy to analyze the 3D structure of the product. Therefore, it is difficult to provide users with efficient product preview functions in related technologies, and the cost of product preview is high and cannot be effectively promoted. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides an image processing method, which can complete the image adding effect preview of a three-dimensional object by processing data in the two-dimensional image dimension, thereby improving the convenience of image preview.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In a first aspect, an embodiment of the present application discloses an image processing method, the method comprising:

[0008] Acquire a basic image and a display image for displaying a preview object, wherein the preview object has an image display portion, and the basic image is composed of a plurality of pixels;

[0009] Establishing a position correspondence relationship based on shape information corresponding to the image display part, wherein the shape information is used to characterize the three-dimensional shape of the image display part;

[0010] generating an initial preview image based on the position correspondence and pixel positions corresponding to the plurality of pixels in the basic image, the initial preview image being used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part, the initial preview image being composed of the plurality of pixels, a first pixel being any one of the plurality of pixels, the first pixel corresponding to a first pixel position in the basic image, and corresponding to a second pixel position in the initial preview image, and the first pixel position and the second pixel position satisfying the position correspondence;

[0011] The initial preview image is added to a first image area in the display image to generate a first preview image corresponding to the preview object, the first preview image is used to display the preview object after the basic image is added to the image display part, and the first image area is used to display the image display part.

[0012] In a second aspect, an embodiment of the present application discloses an image processing device, the device comprising a first acquisition unit, a construction unit, a first generation unit, and a second generation unit:

[0013] The first acquisition unit is used to acquire a basic image and a display image for displaying a preview object, the preview object has an image display part, and the basic image is composed of a plurality of pixels;

[0014] The construction unit is used to construct a position correspondence relationship based on shape information corresponding to the image display part, wherein the shape information is used to characterize a three-dimensional shape of the image display part;

[0015] The first generating unit is used to generate an initial preview image based on the position correspondence relationship and pixel positions corresponding to the plurality of pixels in the basic image, the initial preview image being used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part, the initial preview image being composed of the plurality of pixels, a first pixel being any one of the plurality of pixels, the first pixel corresponding to a first pixel position in the basic image, and corresponding to a second pixel position in the initial preview image, and the first pixel position and the second pixel position satisfying the position correspondence relationship;

[0016] The second generating unit is used to add the initial preview image in the first image area in the display image to generate a first preview image corresponding to the preview object, the first preview image is used to display the preview object after the basic image is added to the image display part, and the first image area is used to display the image display part.

[0017] In a possible implementation, the position correspondence includes a first position correspondence, a second position correspondence, and a third position correspondence, the three-dimensional shape corresponding to the image display part is a cylindrical surface shape, the shape information corresponding to the image display part includes the cylinder radius corresponding to the image display part, and the construction unit is specifically used to:

[0018] Construct a first coordinate system according to the basic image, wherein the first coordinate system takes a reference pixel in the basic image as the origin, the reference pixel is used to be added to the pixel position corresponding to the center point of the cylinder corresponding to the image display part in the first image area, and the pixels in the basic image located on the vertical axis of the first coordinate system are used to be added to the pixel position of the axis corresponding to the image display part;

[0019] constructing the first position correspondence relationship according to the first coordinate system, where the first position correspondence relationship is a correspondence relationship between pixel positions of the plurality of pixels in the basic image and corresponding initial coordinate positions in the first coordinate system;

[0020] constructing a second position correspondence relationship according to the cylinder radius, the second position correspondence relationship being used to change the initial coordinate positions corresponding to the plurality of pixels in the first coordinate system to obtain the coordinate positions of the plurality of pixels in the first coordinate system, and the initial coordinate position and the coordinate position corresponding to the first pixel in the first coordinate system satisfy the second position correspondence relationship;

[0021] The third position correspondence relationship is constructed according to the first coordinate system, and the third position correspondence relationship is a correspondence relationship between the coordinate positions corresponding to the multiple pixels in the first coordinate system and the pixel positions of the multiple pixels in the initial preview image.

[0022] In a possible implementation, the device further includes a first analyzing unit:

[0023] The first analyzing unit is used to analyze a first direction corresponding to the axis in the first image area according to the displayed image;

[0024] The building blocks are specifically used for:

[0025] Based on the first direction being consistent with the longitudinal axis direction of the first coordinate system, constructing the third position correspondence relationship according to the first coordinate system;

[0026] Based on the inconsistency between the first direction and the longitudinal axis direction of the first coordinate system, the first coordinate system is rotated to make the longitudinal axis direction of the first coordinate system consistent with the first direction, so as to obtain a second coordinate system, wherein the coordinate positions of the plurality of pixels in the second coordinate system are the same as the coordinate positions of the plurality of pixels in the first coordinate system;

[0027] The third position correspondence is constructed according to the second coordinate system.

[0028] In a possible implementation, the device further includes a second analyzing unit:

[0029] The second analyzing unit is used to analyze a first direction corresponding to the axis in the first image area according to the displayed image;

[0030] The second generating unit is specifically used for:

[0031] Based on the consistency between the first direction and the longitudinal axis direction of the first coordinate system, adding the initial preview image in the first image area in the display image to generate a first preview image corresponding to the preview object;

[0032] Based on the inconsistency between the first direction and the longitudinal axis direction of the first coordinate system, rotating the initial preview image so that the direction of a straight line formed by a plurality of pixels on the longitudinal axis in the initial preview image is consistent with the first direction;

[0033] The rotated initial preview image is added to the first image area in the display image to generate a first preview image corresponding to the preview object.

[0034] In a possible implementation manner, the device further includes a second acquiring unit:

[0035] The second acquisition unit is used to acquire a setting instruction input by an input party, wherein the setting instruction includes identification information, and the identification information is used to identify the reference pixel in the basic image and the longitudinal axis direction corresponding to the first coordinate system;

[0036] The building blocks are specifically used for:

[0037] The first coordinate system is constructed based on the identification information and the basic image.

[0038] In a possible implementation manner, the second generating unit is specifically configured to:

[0039] Determine a reference pixel position corresponding to the center point of the cylinder in the first image area;

[0040] adding the reference pixel in the initial preview image to the reference pixel position;

[0041] According to the relative positional relationship between the second pixel position and the third pixel position of the reference pixel in the initial preview image, the first pixel is added to the fourth pixel position corresponding to the first image area to generate the first preview image, and the positional relationship between the fourth pixel position and the reference pixel position corresponds to the relative positional relationship.

[0042] In a possible implementation manner, the second generating unit is specifically configured to:

[0043] determining the fourth pixel position according to a relative position relationship between the second pixel position and a third pixel position of the reference pixel in the initial preview image and the reference pixel position;

[0044] Based on the fourth pixel position not exceeding the first image area, adding the first pixel to the fourth pixel position to generate the first preview image;

[0045] The device also includes an adding unit:

[0046] The adding unit is configured to not add the first pixel in the first image area based on the fact that the fourth pixel position exceeds the first image area.

[0047] In a possible implementation manner, the device further includes a third analysis unit:

[0048] The third analysis unit is used to analyze the posture information corresponding to the image display part according to the area shape corresponding to the first image area, and the posture information is used to represent the posture of the three-dimensional shape corresponding to the image display part in the three-dimensional space corresponding to the display image;

[0049] The second generating unit is specifically used for:

[0050] According to the posture information, pixel positions corresponding to the plurality of pixels in the initial preview image are adjusted, so that the adjusted initial preview image is used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part in the first posture;

[0051] The adjusted initial preview image is added to a first image area in the display image to generate the first preview image.

[0052] In a possible implementation, the three-dimensional shape corresponding to the image display part is a cylindrical surface shape, the posture information is the shape information of the upper boundary of the region corresponding to the first image region in the axial direction of the cylindrical surface shape, the upper boundary information of the region is used to identify the boundary shape of the upper boundary of the region of the first image region, and the second generating unit is specifically used to:

[0053] According to the upper boundary shape information, pixel positions corresponding to a plurality of pixels in the initial preview image are adjusted along the axial direction, so that the image upper boundary corresponding to the adjusted initial preview image along the axial direction is consistent with the boundary shape of the upper boundary of the region;

[0054] The adjusted initial preview image is added to the first image area in the display image so that the upper boundary of the image fits the upper boundary of the area, thereby generating the first preview image.

[0055] In a possible implementation, the first pixel is located at a fifth pixel position in the first preview image, the fifth pixel position in the display image is used to display a first object part of the preview object, the first pixel is used to display a first image part in the initial preview image, and the device further includes a first adjustment unit:

[0056] The first adjustment unit is used to adjust the pixel value corresponding to the first pixel in the first preview image based on material information corresponding to the first object part, the material information is used to identify the material corresponding to the first object part, and the adjusted pixel value corresponding to the first pixel is used to characterize the influence of the material on the display effect of the first image part.

[0057] In a possible implementation, the device further includes a second adjusting unit:

[0058] The second adjustment unit is used to adjust pixel values ​​corresponding to pixels in the initial preview image in the first preview image, so that the initial preview image presents a first image style in the first preview image.

[0059] In a possible implementation manner, the device further includes a fourth analyzing unit:

[0060] The fourth analyzing unit is used to analyze a first object style corresponding to the preview object based on the display image;

[0061] The second adjusting unit is specifically used for:

[0062] Based on the first object style being aligned with the first image style, pixel values ​​corresponding to pixels in the initial preview image in the first preview image are adjusted so that the initial preview image presents the first image style in the first preview image.

[0063] In a possible implementation manner, the second adjusting unit is specifically configured to:

[0064] Based on obtaining a style adjustment instruction input by an input party, pixel values ​​corresponding to pixels in the initial preview image in the first preview image are adjusted so that the initial preview image presents a first image style in the first preview image, and the style adjustment instruction is used to instruct to adjust the image style corresponding to the initial preview image to the first image style.

[0065] In a possible implementation manner, the preview object has a plurality of image display parts, the plurality of image display parts include the image display part, and the construction unit is specifically used to:

[0066] Based on obtaining a part selection instruction input by an input party, a position correspondence is constructed according to shape information corresponding to the image display part, and the part selection instruction is used to select the image display part.

[0067] In a possible implementation manner, the device further includes a third acquiring unit, an intercepting unit, and a third generating unit:

[0068] The third acquisition unit is used to acquire an image capture instruction input by the input party, wherein the image capture instruction is used to represent a capture method of the initial preview image;

[0069] The interception unit is used to intercept a basic image portion from the initial preview image based on the image interception instruction, where pixels included in the basic image portion are pixels included in the second image portion in the basic image;

[0070] The third generating unit is used to add the basic image part in the first image area to generate a second preview image corresponding to the preview object, and the second preview image is used to display the preview object after the second image part is added to the image display part.

[0071] In a possible implementation manner, the second generating unit is specifically configured to:

[0072] Obtaining an object display ratio corresponding to the preview object in the display image;

[0073] Scaling the initial preview image so that the image display ratio corresponding to the scaled initial preview image is consistent with the object display ratio;

[0074] The initial preview image after scaling is added to the first image area in the display image to generate a first preview image corresponding to the preview object.

[0075] In a third aspect, an embodiment of the present application discloses a computer device, wherein the computer device includes a processor and a memory:

[0076] The memory is used to store a computer program and transmit the computer program to the processor;

[0077] The processor is used to execute the image processing method according to any one of the instructions in the computer program;

[0078] In a fourth aspect, an embodiment of the present application discloses a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the image processing method described in any one of the first aspects;

[0079] In a fifth aspect, an embodiment of the present application discloses a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the image processing method described in any one of the first aspects.

[0080] It can be seen from the above technical solution that when previewing the image display effect of adding the basic image to the three-dimensional preview object, the present application does not need to construct a three-dimensional model corresponding to the preview object, and only needs to perform image processing in the two-dimensional image dimension. First, based on the shape information corresponding to the image display part used to add the basic image in the preview object, the three-dimensional shape corresponding to the image display part is analyzed, so that the image deformation that may occur when the basic image is added to the image display part can be analyzed to construct a position correspondence relationship based on which the basic image is deformed. The initial preview image can be obtained by adjusting the pixel positions corresponding to multiple pixels in the basic image through the position correspondence relationship. The initial preview image is used to preview the preview effect corresponding to the basic image when the basic image is displayed through the image display part. Therefore, by adding the initial preview image to the first image area used to display the image display part in the display image, the preview object after the basic image is added to the image display part can be previewed, thereby realizing a preview of the basic image display effect. Since the entire process does not require the construction process of constructing a three-dimensional model of the preview object, the rendering process of rendering an image based on the three-dimensional model of the preview object, and other relatively complex processing procedures, only the position transformation of the pixels in the base image is required, thereby reducing the difficulty of technical implementation and simplifying the processing procedures required for effect preview, which helps to improve the efficiency of effect preview. At the same time, it can also enable the effect preview function to be applied in more application scenarios with low processing performance, thereby increasing the breadth of functional application. In addition, since the present application constructs a position correspondence relationship based on the three-dimensional shape of the image display part, when the base image is deformed based on the position correspondence relationship, it can accurately restore the display effect of the deformation of the base image caused by the three-dimensional shape of the image display part, thereby ensuring the accuracy and authenticity of the image preview. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0082] Figure 1 A schematic diagram of an image processing method in a practical application scenario provided by an embodiment of the present application;

[0083] Figure 2 A flowchart of an image processing method provided in an embodiment of the present application;

[0084] Figure 3 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0085] Figure 4 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0086] Figure 5 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0087] Figure 6 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0088] Figure 7 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0089] Figure 8 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0090] Fig. 9 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0091] Fig.10 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0092] Fig.11 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0093] Fig.12 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0094] Fig.13 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0095] Fig.14 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0096] Fig.15 A schematic diagram of an image processing method provided in an embodiment of the present application;

[0097] Fig.16 A flowchart of an image processing method in a practical application scenario provided by an embodiment of the present application;

[0098] Fig.17 A structural block diagram of an image processing device provided in an embodiment of the present application;

[0099] Fig.18 A structural diagram of a terminal provided in an embodiment of the present application;

[0100] Fig.19 A structural diagram of a server provided in an embodiment of the present application;

[0101] Fig. 20 A flowchart of an image processing method provided in an embodiment of the present application;

[0102] Fig.21 A flowchart of an image processing method provided in an embodiment of the present application;

[0103] Fig. 22 A flowchart of an image processing method provided in an embodiment of the present application;

[0104] Fig.23 A flowchart of an image processing method provided in an embodiment of the present application;

[0105] Fig.24 A flowchart of an image processing method provided in an embodiment of the present application;

[0106] Fig.25 A flowchart of an image processing method provided in an embodiment of the present application;

[0107] Fig.26 A flowchart of an image processing method provided in an embodiment of the present application;

[0108] Fig. 27 A flowchart of an image processing method provided in an embodiment of the present application;

[0109] Fig.28 A flowchart of an image processing method provided in an embodiment of the present application;

[0110] Fig.29 A flowchart of an image processing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0111] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0112] Previewing the image display effect after adding an image to a three-dimensional object is one of the common functional requirements in various technical scenarios. For example, when designers design new items, they need to preview the image display effects of adding multiple images to the items to measure the pros and cons of different designs; when customers purchase customized products, they also need to preview the corresponding image display effects after the images they want to add to the products are added to the products.

[0113] In the related art, for previewing the image display effect, it is necessary to first build a three-dimensional model corresponding to the three-dimensional object, then project the image to be added into the three-dimensional model, and obtain the three-dimensional model corresponding to the three-dimensional object with the image added, and finally, render the three-dimensional model back into a two-dimensional plane to obtain a two-dimensional image for previewing the image display effect after adding the image to the three-dimensional object.

[0114] It can be seen that the preview method in the related art requires the computer equipment to have complex processing functions such as three-dimensional model building function, image projection function in three-dimensional space and image rendering function, which requires the computer equipment to have relatively powerful processing performance and processing resources. Therefore, there are few application scenarios in which the preview method in the related art can be used, and it is difficult to promote the preview function; at the same time, the complex preview process also causes the relevant personnel to wait for a long time to obtain the preview image, and the preview efficiency is low, which is not conducive to the relevant personnel to adjust the image adding method in real time to achieve the image adding effect they need.

[0115] In order to solve the above technical problems, the present application provides an image processing method. By analyzing the three-dimensional shape corresponding to the image display part on the preview object, a position correspondence relationship for changing the position of pixels in the basic image to be added can be constructed. By changing the pixel position in the basic image through the position correspondence relationship, the basic image can be deformed, thereby simulating the deformation effect caused by the three-dimensional shape of the image display part when the basic image is added to the image display part, and an initial preview image corresponding to the basic image when the basic image is displayed through the image display part is obtained. Then, by adding the initial preview image to the first image area used to display the image display part, a preview image for previewing the image display effect of adding the basic image to the image display part of the preview object can be generated. The whole process only needs to perform image processing in the image dimension. Therefore, the technical implementation difficulty is low and the processing flow is relatively convenient. It can provide a convenient and efficient image preview function while ensuring the accuracy of the image display effect, making it suitable for a wider range of application scenarios.

[0116] It is understandable that the method can be applied to a computer device, which is a computer device capable of image processing, such as a terminal device or a server. The method can be executed independently by a terminal device or a server, and can also be applied to a network scenario in which a terminal device and a server communicate, and is executed by the cooperation of a terminal device and a server. Among them, the terminal device can be a mobile phone, a tablet computer, a laptop computer, a desktop computer and other devices. The terminal device can also include a variety of virtual reality devices, such as augmented reality (AR) devices, such as AR glasses, AR screens and other devices, and virtual reality (VR) technology (VR) devices, such as head-mounted VR glasses and other devices. The server can be understood as an application server, or a Web server. In actual deployment, the server can be an independent server, a cluster server, or a cloud server.

[0117] In order to facilitate understanding of the technical solution provided by the present application, the image processing method provided by the present application will be introduced below in combination with a practical application scenario.

[0118] See also Figure 1 , Figure 1 This is a schematic diagram of an image processing method in an actual application scenario provided by an embodiment of the present application. In this actual application scenario, the computer device may be a server 101 with an image processing function.

[0119] like Figure 1 As shown, in this actual application scenario, the preview object is a cup, the display image is an image for displaying the cup, the basic image is a landscape image including hills and the sun, and the image display part is the cup surface of the cup facing the image plane of the display image, that is, the cup surface that can be seen through the display image. The server 101 needs to generate a preview of the image display effect after adding the basic image to the image display part.

[0120] The server 101 first obtains shape information corresponding to the image display part, and the shape information is used to represent the three-dimensional shape of the image display part. Figure 1 The image display part is a cylindrical surface shape, that is, a three-dimensional shape corresponding to the surface of a cylinder, so the cylinder radius corresponding to the cylindrical surface shape can be selected as the shape information. Based on the shape information, the server 101 can analyze the three-dimensional shape of the image display part, and then analyze how the basic image will be deformed due to the three-dimensional shape of the image display part after being added to the image display part, so as to construct a position correspondence relationship for simulating such image deformation.

[0121] Based on the position correspondence, the server 101 can adjust the pixel positions corresponding to the multiple pixels constituting the basic image to generate an initial preview image. Taking the first pixel among the multiple pixels as an example, the first pixel position corresponding to the first pixel in the basic image and the second pixel position corresponding to the first pixel in the initial preview image satisfy the position correspondence. Thus, by adjusting the pixel positions of the multiple pixels in this way, the initial preview image can produce the above-mentioned image deformation, and then the initial preview image can be used to preview the preview effect corresponding to the basic image when the basic image is displayed through the image display part. For example, Figure 1 In the example, since the image display part is a cylindrical surface, the position correspondence can be constructed by combining the cylindrical radius with the cylindrical projection algorithm. The cylindrical projection algorithm is an algorithm used to simulate the image display effect after the image is added to the cylindrical surface. Figure 1As shown, through the cylindrical projection algorithm, the image can be converted from the image plane GHEF to the cylindrical surface LCKJIF, so that the initial preview image generated based on the position correspondence can characterize the image display effect when the base image is added to the cylindrical surface. For example, by comparing the initial preview image and the base image, it can be seen that the initial preview image is narrower than the base image, so that the visual effect of the base image being narrowed due to being complete can be simulated. At the same time, because the part closer to the middle of the base image has a smaller bending angle when added to the cylindrical surface, and the part closer to the two sides has a larger bending angle when added to the cylindrical surface, when the deformation reaches the initial preview image, the degree of narrowing on both sides of the base image is greater than the degree of narrowing in the middle. In addition, the horizontal lines in the rectangular base image will also bend in visual effect because they fit on the cylindrical surface.

[0122] Based on this, the server 101 can add the initial preview image to the first image area in the display image for displaying the image display part, and generate the first preview image. Through the first preview image, the preview object after the basic image is added to the image display part can be accurately displayed, that is, the cup after the basic image is added to the cup surface. In this way, there is no need to perform three-dimensional modeling and image rendering on the cup. It is only necessary to build a position correspondence and adjust the pixel position of the image to complete the preview of the cup after the basic image is added to the cup surface, which greatly reduces the processing operation difficulty and processing flow complexity required for the preview, thereby ensuring the preview accuracy while improving the preview speed of the cup, and also making the preview function applicable to more application scenarios with lower processing performance.

[0123] Next, the technical solution provided by this application will be introduced in conjunction with the accompanying drawings.

[0124] See also Figure 2 , Figure 2 A flowchart of an image processing method provided in an embodiment of the present application. In this embodiment, the computer device may be any of the above-mentioned computer devices with image processing functions. The method includes:

[0125] S201: Acquire a basic image and a display image for displaying a preview object.

[0126] The preview object is a three-dimensional object that needs to be previewed, and the three-dimensional object can be any three-dimensional object, such as clothes, cups and other items. The basic image is an image that needs to be added to the preview object for preview, and can be any image. The basic image is composed of multiple pixels. The preview object has an image display part, and the image display part is the part of the preview object used to add the basic image.

[0127] S202: Constructing a position correspondence relationship based on shape information corresponding to the image display part.

[0128] It is understandable that in real scenarios, when paper with an image printed on it is pasted onto a non-planar three-dimensional structure, the image will be deformed due to the three-dimensional structure. Therefore, in order to truly restore the image display effect of adding the image to a three-dimensional object, the computer equipment needs to analyze the deformation of the image due to the three-dimensional structure of the three-dimensional object.

[0129] The computer device may first obtain shape information corresponding to the image display part, and the shape information is used to characterize the three-dimensional shape of the image display part. The image display part may correspond to a variety of three-dimensional shapes, such as cylindrical surface shape, angular shape, spherical surface shape, cubic shape, etc. The shape information corresponding to different three-dimensional shapes may be different. For example, when the three-dimensional shape is a cylindrical surface shape, the corresponding shape information may be information such as the cylinder radius, the cylinder axis direction, and the cylinder center point position. When the three-dimensional shape is a spherical surface shape, the corresponding shape information may be the sphere center position, sphere radius, etc.

[0130] Through this shape information, the computer device can understand the three-dimensional shape corresponding to the image display part, so as to analyze what kind of image deformation will occur in the basic image when the basic image is added to the image display part. It can be understood that from the perspective of two-dimensional images, image deformation is essentially a change in the pixel position corresponding to the pixel in the image. The pixel position is position information composed of the number of rows and columns corresponding to the pixel. Therefore, the computer device can construct a position correspondence relationship based on the shape information. The position correspondence relationship is used to adjust the pixel positions corresponding to the multiple pixels constituting the basic image, so that the basic image produces the above-mentioned image deformation. Among them, for different three-dimensional shapes, the way in which the computer device constructs the position correspondence relationship may also be different, which will be introduced in detail below and will not be repeated here.

[0131] S203: Generate an initial preview image based on the position correspondence relationship and pixel positions corresponding to the plurality of pixels in the basic image.

[0132] The initial preview image is composed of the above-mentioned multiple pixels. The computer device can adjust the pixel positions corresponding to the multiple pixels based on the position correspondence and the pixel positions corresponding to the multiple pixels in the basic image (i.e., the pixel positions corresponding to the image before deformation), and determine the new pixel positions corresponding to the multiple pixels. These new pixel positions are the basic image after deformation, i.e., the pixel positions in the initial preview image, so that the initial preview image can be generated by combining these pixels at the new pixel positions. The initial preview image is used to simulate the deformation mode of the basic image when the basic image is displayed through the image display part, so it can be used to preview the preview effect corresponding to the basic image when the basic image is displayed through the image display part. For example, Figure 1 In , the initial preview image can represent the deformation mode of the basic image when the basic image is displayed through the cylindrical surface. , that is, the preview effect corresponding to the basic image.

[0133] Taking the first pixel as an example, the first pixel can be any one of a plurality of pixels, the first pixel corresponds to a first pixel position in the basic image, and corresponds to a second pixel position in the initial preview image, and there is a position correspondence between the first pixel position and the second pixel position, that is, when the basic image is deformed due to the three-dimensional shape of the image display part, the first pixel moves from the first pixel position to the second pixel position.

[0134] It is understandable that the number of pixels contained in the base image and the initial preview image may not be the same. For example, when the deformation method of the image deformation does not affect the number of pixels contained in the image, the initial preview image may only include multiple pixels in the base image; when the image deformation increases the number of pixels contained in the image (for example, the image size is enlarged due to the image deformation), the pixels at the vacant pixel positions of the image can be generated by the difference method based on the original multiple pixels; when the image deformation reduces the number of pixels contained in the image (for example, the image size is reduced due to the image deformation), one of the pixels with relatively consistent pixel positions after adjustment can be retained to generate the initial preview image, and the other pixels can be discarded.

[0135] S204: Adding an initial preview image to a first image area in the display image to generate a first preview image corresponding to the preview object.

[0136] Since the initial preview image can preview the preview effect of the basic image when the basic image is displayed through the image display part, in order to preview the effect of adding the basic image to the image display part of the preview object, the computer device can first determine the first image area in the display image, and the first image area is used to display the image display part. The computer device can add the initial preview image to the first image area to generate a first preview image, and the first preview image can be used to display the preview object after the basic image is added to the image display part.

[0137] It can be seen that the image processing method of this application has the following technical effects:

[0138] First, when previewing the image display effect of adding a basic image to a three-dimensional preview object, the present application does not need to go through relatively complicated processing procedures such as the construction process of constructing a three-dimensional model of the preview object and the rendering process of rendering the image based on the three-dimensional model of the preview object. Instead, it only needs to transform the positions of the pixels in the basic image. This reduces the difficulty of technical implementation, simplifies the processing flow required for effect preview, helps to improve the efficiency of effect preview, and also enables the effect preview function to be applied in more application scenarios with low processing performance, thereby increasing the breadth of functional application.

[0139] Secondly, since the present application constructs a position correspondence relationship based on the three-dimensional shape of the image display part, when the basic image is deformed based on the position correspondence relationship, the display effect of the basic image deformed by the three-dimensional shape of the image display part can be accurately restored, thereby ensuring the accuracy and authenticity of the image preview.

[0140] Next, the technical details involved in this application will be introduced in conjunction with the accompanying drawings.

[0141] As mentioned above, the present application can construct position correspondence relationships for a variety of three-dimensional shapes. Next, the method for constructing the position correspondence relationship will be introduced in conjunction with a specific three-dimensional shape.

[0142] In a possible implementation, the position correspondence may include a first position correspondence, a second position correspondence, and a third position correspondence. The three-dimensional shape corresponding to the image display part is a cylindrical surface shape. The cylindrical surface refers to the side elevation of a cylinder, that is, a surface rolled up from a rectangular plane, such as Figure 1 In real scenes, the cup surface of a cylindrical cup and the side of a wooden stick can be regarded as cylindrical surfaces. The shape information corresponding to the image display part includes the cylinder radius corresponding to the image display part, that is, the radius corresponding to the side elevation of the cylinder with the cylindrical surface shape, such as Figure 1The radius of the cylinder can be used to understand the curvature of the cylindrical surface, and further to analyze the corresponding deformation degree of the image when the image is added to the image display part of the cylindrical surface.

[0143] In a possible implementation, when executing step S202, the computer device may execute steps S2021-S2024 (see Fig. 20 ), steps S2021-S2024 are a possible implementation of step S202, including:

[0144] S2021: Construct a first coordinate system based on the basic image.

[0145] This application mainly uses the cylindrical projection algorithm in the relevant technical field to construct the position correspondence relationship corresponding to the cylindrical surface shape. The cylindrical projection algorithm is used to calculate the change of the pixel position corresponding to the pixel in the image when the image is fitted to the cylindrical surface shape from the two-dimensional image plane. If you want to apply the cylindrical projection algorithm, you need to first build a coordinate system suitable for the cylindrical projection algorithm to convert the pixel position corresponding to the pixel into a coordinate position that can be calculated by the cylindrical projection algorithm.

[0146] The computer device may first construct a first coordinate system, which takes the reference pixel in the base image as the origin. The reference pixel is used to add to the pixel position corresponding to the center point of the cylinder corresponding to the image display part in the first image area, that is, the pixel position of the reference pixel is the position of the center point of the cylinder perpendicular to the two-dimensional image plane of the display image. In the cylindrical projection algorithm, it is necessary to construct a coordinate system based on the reference pixel. The vertical axis of the coordinate system is the bending center line of the two-dimensional image plane corresponding to the coordinate system when it is bent to fit the cylindrical surface, such as Figure 4 As shown, Figure 4 The two-dimensional image plane where the coordinate system is located and the cylinder corresponding to the cylindrical surface are shown from a top-down perspective, where point o is the coordinate origin on the two-dimensional image plane, that is, the point where the reference pixel is located. From a top-down perspective, the point on the two-dimensional image plane overlapping point o is the point on the vertical axis of the coordinate system. In other words, the vertical axis is parallel to the axis of the central cylinder in three-dimensional space.

[0147] It can be seen that after constructing the first coordinate system in this way, the pixels in the basic image located on the vertical axis of the first coordinate system can be used to add to the pixel positions of the axis corresponding to the image display part, and the line formed by this part of the pixels is the center line of the image deformation on the cylindrical surface.

[0148] S2022: Construct a first position correspondence relationship according to the first coordinate system.

[0149] The position suitable for position conversion by the cylindrical projection algorithm is the coordinate position of the first coordinate system constructed by the above method. Therefore, the computer device needs to construct a first position correspondence relationship according to the first coordinate system. The first position correspondence relationship is the correspondence relationship between the pixel positions of multiple pixels in the basic image and the initial coordinate positions corresponding to them in the first coordinate system, that is, the pixel position corresponding to each pixel in the basic image can be converted into the initial coordinate position in the first coordinate system through the first position correspondence relationship. Figure 5 As shown, in the first coordinate system, the y-axis is the vertical axis, the x-axis is the horizontal axis, the first pixel is located at the coordinate position of (m, n), and the pixel position corresponding to the first pixel in the basic image is the pixel in the i-th row and j-th column. The correspondence between these two positions is the first position correspondence.

[0150] S2023: Construct a second position correspondence relationship according to the cylinder radius.

[0151] After determining the initial coordinate positions of multiple pixels in the basic image, the computer device can use the coordinate conversion formula corresponding to the cylindrical projection algorithm to construct a second position correspondence relationship. The second position correspondence relationship is used to change the initial coordinate positions corresponding to the multiple pixels in the first coordinate system to obtain the coordinate positions of the multiple pixels in the first coordinate system. That is, the coordinate positions of the multiple pixels in the first coordinate system after the basic image is deformed by the cylindrical projection algorithm can be obtained through the second position correspondence relationship, and the initial coordinate position and the coordinate position of the first pixel in the first coordinate system satisfy the second position correspondence relationship.

[0152] Among them, the coordinate transformation formula corresponding to the cylindrical projection algorithm is as follows:

[0153]

[0154] Among them, x is the horizontal coordinate of the initial coordinate position corresponding to the pixel, x ′ is the horizontal coordinate of the coordinate position corresponding to the pixel, y is the vertical coordinate of the initial coordinate position corresponding to the pixel, and x is ′ is the ordinate in the coordinate position corresponding to the pixel, and f is the cylinder radius corresponding to the cylindrical surface shape. It can be seen that the second position correspondence relationship can be constructed based on the cylinder radius.

[0155] S2024: Construct a third position correspondence relationship according to the first coordinate system.

[0156] The coordinate positions of the pixels in the first coordinate system determined in the above manner can determine the position distribution of multiple pixels in the two-dimensional image plane, which is the position distribution of multiple pixels in the initial preview image. Therefore, the computer device can construct a third position correspondence relationship based on the first coordinate system and the coordinate positions corresponding to the multiple pixels. The third position correspondence relationship is the correspondence relationship between the coordinate positions corresponding to the multiple pixels in the first coordinate system and the pixel positions of the multiple pixels in the initial preview image. Through the third position correspondence relationship, the coordinate positions corresponding to the multiple pixels can be converted into the pixel positions of the multiple pixels in the initial preview image, and then the initial preview image can be generated through the third position correspondence relationship.

[0157] It can be seen that, in combination with the first position correspondence, the second position correspondence and the third position correspondence, the computer device can complete the conversion from the pixel position of the pixel in the base image to the pixel position of the pixel in the initial preview image for the image display part of the cylindrical surface shape, so that the initial preview image can be generated based on these position correspondences, so that the initial preview image can accurately and truly preview the preview effect after the base image is added to the image display part, thereby ensuring that the display effect of the preview object with the base image added can be accurately previewed through the first preview image.

[0158] It is understandable that when the cylindrical projection algorithm is used to generate the initial preview image, the initial preview image previews the preview effect of the basic image when the basic image is added to the cylindrical surface whose corresponding axis is consistent with the longitudinal axis direction of the first coordinate system in the first image area. Since there are multiple display modes when displaying the preview object through the display image, that is, the preview object may have multiple postures in the display image, the axis corresponding to the image display part may have multiple corresponding directions in the first image area, so the direction of the axis may be inconsistent with the longitudinal axis direction of the first coordinate system.

[0159] like Figure 6 As shown, the longitudinal axis of the first coordinate system is in the vertical direction, so that what is previewed through the initial preview image is the preview effect corresponding to the basic image when the basic image is added to the image display part whose axis is vertical in the first image area. However, the direction of the axis corresponding to the cylindrical surface shape corresponding to the image display part in the first image area is not in the vertical direction. At this time, directly adding the initial preview image to the first image area makes it difficult to achieve an accurate preview of the preview object with the basic image added.

[0160] Based on this, in a possible implementation, in response to the above-mentioned direction inconsistency, the computer device can further adjust the image processing process in the following two ways to ensure the accuracy of the preview.

[0161] The first adjustment method: Adjust the way the initial preview image is generated

[0162] In one possible implementation, see Fig.21 The computer device may first execute step S2101 to analyze the first direction corresponding to the axis in the first image region according to the displayed image. When executing step S2024, the computer device may execute steps S20241-S20243 (see Fig.21 ), steps S20241-S20243 are a possible implementation of step S2024, including:

[0163] S20241: Based on the first direction being consistent with the longitudinal axis direction of the first coordinate system, construct a third position correspondence relationship according to the first coordinate system.

[0164] If the first direction is consistent with the longitudinal axis direction, it means that the initial preview image determined by the position distribution of multiple pixels in the first coordinate system already has an accurate effect preview function, so the computer device can directly construct the third position correspondence relationship according to the first coordinate system.

[0165] S20242: Based on the inconsistency between the first direction and the longitudinal axis direction of the first coordinate system, the first coordinate system is rotated to make the longitudinal axis direction of the first coordinate system consistent with the first direction, thereby obtaining a second coordinate system.

[0166] If the first direction is inconsistent with the longitudinal axis direction, the computer device can rotate the first coordinate system until the longitudinal axis direction is consistent with the first direction, and the rotated first coordinate system is the second coordinate system, and the coordinate positions of the multiple pixels in the second coordinate system are the same as the coordinate positions of the multiple pixels in the first coordinate system. That is, when rotating the coordinate system, the computer device rotates the multiple pixels together, thereby ensuring that the image deformation mode represented by the coordinate positions of the multiple pixels is still the deformation mode with the longitudinal axis as the center line, thereby ensuring the accuracy of the deformation mode simulation.

[0167] S20243: Construct a third position correspondence relationship according to the second coordinate system.

[0168] Although the coordinate positions are the same, since the second coordinate system is a different coordinate system from the first coordinate system, the positional partial manner of the multiple pixels in the two-dimensional image plane represented by the coordinate positions of the multiple pixels in the second coordinate system is different, and the initial preview image determined based on the positional partial manner can be used to preview the preview effect of the basic image when the basic image is added to the corresponding cylindrical surface in the first image area with the longitudinal axis direction of the second coordinate system consistent. Since the longitudinal axis direction of the second coordinate system is consistent with the first direction of the axis in the first image area by rotation, the initial preview image determined by the positional distribution manner can accurately preview the preview effect of adding the basic image to the image display part. Based on this, the computer device can generate the initial preview image by constructing the third position correspondence according to the second coordinate system, and the accurate preview of the preview object image display effect can be achieved by adding the initial preview image to the first image area.

[0169] In this way, no matter which posture the image display part corresponds to in the display image, the computer device can generate an initial preview image that accurately represents the display effect and add it to the display image, thereby achieving an accurate preview of the image display effect of the preview object, thereby further improving the flexibility and freedom of the image processing method, making it applicable to a wider range of image preview scenarios.

[0170] like Figure 7 As shown, after determining the coordinate position corresponding to the pixel through the position correspondence relationship constructed by the first coordinate system, the computer device can rotate the first coordinate system so that the longitudinal axis of the first coordinate system is consistent with the direction of the axis of the cylindrical surface shape in the first image area, thereby obtaining a second coordinate system, and generating an initial preview image based on the coordinate position of the pixel in the second coordinate system. The initial preview image can be directly added to the first image area to generate a preview image.

[0171] Second method: Adjust the way to add the initial preview image

[0172] In another possible implementation manner, the computer device may not adjust the generated image of the initial preview image, but directly adjust the adding manner of the initial preview image to the first image area.

[0173] Similarly, see Fig. 22 , the computer device may first execute step S2201, analyzing the first direction corresponding to the axis in the first image region according to the displayed image. When executing step S204, the computer device may execute steps S2041-S2043 (see Fig. 22 ), steps S2041-S2043 are a possible implementation of step S204, including:

[0174] S2041: Based on the first direction being consistent with the longitudinal axis direction of the first coordinate system, an initial preview image is added to a first image area in the display image to generate a first preview image corresponding to the preview object.

[0175] Similar to the first method, when the first direction is consistent with the longitudinal axis direction of the first coordinate system, it means that the initial preview image determined by the position distribution of multiple pixels in the first coordinate system already has an accurate effect preview function, so the computer device can directly construct the third position correspondence relationship based on the first coordinate system.

[0176] S2042: Based on the inconsistency between the first direction and the longitudinal axis direction of the first coordinate system, the initial preview image is rotated so that the direction of a straight line formed by a plurality of pixels on the longitudinal axis in the initial preview image is consistent with the first direction.

[0177] In the second method, when the first direction is inconsistent with the longitudinal axis direction of the first coordinate system, the computer device may not rotate the first coordinate system, but rotate the generated initial preview image as a whole. Similarly, the position distribution of multiple pixels on the two-dimensional image plane may be changed while keeping the image deformation method unchanged.

[0178] As mentioned above, the pixels located on the longitudinal axis of the first coordinate system will eventually be displayed at the pixel position corresponding to the axis of the image display part in the first image area, that is, the basic image needs to be deformed on the cylindrical surface with the line composed of these pixels as the center line. Therefore, in order to enable the basic image to achieve the desired deformation effect, the computer device can rotate the initial preview image so that the direction of the straight line composed of multiple pixels located on the longitudinal axis in the initial preview image is consistent with the first direction. Therefore, the rotated initial preview image can preview the preview effect of adding the basic image to the cylindrical surface with the axis direction in the first direction under the premise of maintaining the above-mentioned deformation method.

[0179] S2043: Add the rotated initial preview image to the first image area in the display image to generate a first preview image corresponding to the preview object.

[0180] Since the rotated initial preview image can preview the preview effect of adding the basic image to the cylindrical surface with the axis direction being the first direction under the premise of maintaining the above deformation mode, and the first direction is the direction of the axis of the image display part in the first image area, by adding the rotated initial preview image to the first preview image generated in the first image area, the display effect of adding the basic image to the image display part can be accurately characterized, and an accurate preview of the preview object can be achieved. In this way, the computer device does not need to perform a rotation operation on the coordinate system, and thus does not need to analyze how to move the position of the pixel in the two-dimensional image plane to keep the coordinate position of the pixel in the rotated coordinate system unchanged. It only needs to rotate the initial preview image as a whole and then add it to the first image area. The processing method is simpler and less difficult, and ultimately has a preview effect that is more consistent with the first processing method.

[0181] like Figure 8 As shown, after the initial preview image is directly generated based on the position correspondence, the computer device can rotate the initial preview image so that the direction of the straight line formed by multiple pixels located on the vertical axis of the first coordinate system is consistent with the first direction, and add the rotated initial preview image to the first image area to achieve more convenient image preview.

[0182] As mentioned above, the first coordinate system can be constructed based on the position of the reference pixel in the basic image and the longitudinal direction of the first coordinate system, and the first coordinate system determines the deformation mode of the basic image. Based on this, in a possible implementation method, the computer device can provide a user who needs to preview the image with a function of customizing the image deformation mode to meet diverse image preview needs.

[0183] In this implementation, see Fig.23 The computer device may first execute step S2301 to obtain a setting instruction input by an input party, where the input party is a party that inputs the setting instruction, such as a user who needs to preview an image. The setting instruction includes identification information, which is used to identify the reference pixel in the basic image and the longitudinal axis direction corresponding to the first coordinate system, so that the composition of the first coordinate system can be determined by the identification information, and then the line in the image is used as the center line for image deformation when the basic image is added to the image display part, and then the display effect of the basic image when it is displayed through the image display part can be determined by the identification information.

[0184] When executing step S2021, the computer device may execute step S20211 (see Fig.23 ), step S20211 is a possible implementation of step S2021, including:

[0185] S20211: Construct a first coordinate system based on the identification information and the basic image.

[0186] The origin position of the first coordinate system can be determined based on the reference pixel identified by the identification information, and the longitudinal axis direction in the first coordinate system can be determined by the longitudinal axis direction identified by the identification information, so that the first coordinate system can be constructed.

[0187] In combination with the above scheme, it can be seen that the input party can freely set the deformation direction of the basic image when it is added to the image display part, that is, the adding direction to the image display part, by inputting the setting instruction. Therefore, when the initial preview image is generated based on different first coordinate systems, the initial preview image can represent different display effects of the same basic image, so as to meet the input party's diverse image adding needs for the preview object, and further improve the freedom and diversity of the image preview function.

[0188] like Fig. 9 As shown, the input party can input different setting instructions for the same basic image to input different setting information, thereby obtaining basic images corresponding to different identification information. These two basic images need to be added to the image display part of the preview object in the display image. Different coordinate systems can be constructed based on different identification information, so that the basic image can present different deformation methods to obtain different initial preview images and finally obtain different preview images.

[0189] Through the above process, it can be seen that the initial preview image obtained by the cylindrical projection algorithm in the present application is a preview of the basic image when the reference pixel in the basic image is fitted to the pixel position corresponding to the center point of the cylinder corresponding to the image display part. Therefore, in a possible implementation, in order to make the preview effect previewed by the initial preview image accurately fit the three-dimensional shape of the image display part, when executing step S204, the computer device can execute steps S2044-S2046 (see Fig.24 ), steps S2044-S2046 are a possible implementation of step S204, including:

[0190] S2044: Determine a reference pixel position corresponding to the center point of the cylinder in the first image area.

[0191] The reference pixel position is the pixel position corresponding to the center point of the cylinder in the first image area.

[0192] S2045: Add the reference pixel in the initial preview image to the reference pixel position.

[0193] S2046: adding the first pixel to a fourth pixel position corresponding to the first image region according to a relative position relationship between the second pixel position and a third pixel position of the reference pixel in the initial preview image, to generate a first preview image.

[0194] Among them, the second pixel position is the pixel position of the above-mentioned first pixel in the initial preview image, and the relative position relationship is the position distribution relationship between the first pixel and the reference pixel in the initial preview image. Based on the relative position relationship and the reference pixel position, a fourth pixel position whose position relationship with the reference pixel position satisfies the relative position relationship can be determined in the first image area, that is, the position relationship between the fourth pixel position and the reference pixel position corresponds to the relative position relationship.

[0195] By adding the first pixel to the fourth pixel position, the first pixel and the reference pixel can still have the positional relationship in the initial preview image after being added to the first image area, so that when multiple pixels in the initial preview image are added to the first image area in this way, the position distribution of the multiple pixels in the first image area can be consistent with that in the initial preview image, and thus the initial preview image will not be deformed when the initial preview image is added to the first image area. Combined with the above-mentioned method of positioning the adding process of the initial preview image by matching the reference pixel and the reference pixel position, the deformation effect of the basic image represented by the initial preview image can be accurately fitted to the three-dimensional shape of the image display part, so that the first preview image can accurately and truly display the preview object after the basic image is added to the image display part.

[0196] Among them, since the size of the basic image may exceed the image size that can be displayed by the image display part, in a real scene, when the basic image is added to the image display part, not all parts of the basic image can be displayed on the image display part. Based on this, in order to make the preview effect of the preview function provided by the present application more realistic, the computer device can decide whether to add pixels in the initial preview image based on the image display range of the image display part in the display image.

[0197] When executing step S2046, the computer device may execute steps S20461-S20462 (see Fig.25 ), steps S20461-S20462 are a possible implementation of step S2046, including:

[0198] S20461: Determine a fourth pixel position according to a relative position relationship between the second pixel position and a third pixel position of the reference pixel in the initial preview image and the reference pixel position.

[0199] The method for determining the fourth pixel position is as described above and will not be elaborated here.

[0200] S20462: Based on the fact that the fourth pixel position does not exceed the first image area, the first pixel is added to the fourth pixel position to generate a first preview image.

[0201] It is understandable that the first image area is an image area in the display image used to display the image display part. In other words, in a real scene, the image displayed by the image display part must be in the first image area. Therefore, in order to achieve a real preview effect, the computer device can only add the initial preview image in the first image area.

[0202] Taking the first pixel as an example, when the first pixel is added to the display image, the computer device can determine whether the fourth pixel position exceeds the first image area. If not, it means that in the real scene, when the basic image is added to the image display part, the first pixel can be seen through the display method of the display image to the image display part, so that the first pixel can be added to the fourth pixel position to generate a first preview image.

[0203] On the contrary, based on the fourth pixel position exceeding the first image area, it means that in the real scene, when the basic image is added to the image display part, the first pixel cannot be seen through the display method of the image display part by the display image, so the computer device can execute step 2501 and not add the first pixel to the first image area. In this way, the computer device can further restore the display effect of displaying the basic image through the image display part in the real scene, accurately analyze the visible part and the invisible part in the basic image, and then generate a more realistic and accurate first preview image.

[0204] It can be seen from the above process that based on the shape information corresponding to the image display part, the deformation effect of the basic image on the image display part can be analyzed, so as to determine the preview effect required for the initial preview image. In real scenes, in addition to the three-dimensional shape of the three-dimensional object affecting the image display effect, the object posture of the three-dimensional object will also affect the image display effect. After adding a two-dimensional image to a three-dimensional object, when the three-dimensional object is in different object postures, the display effect of the two-dimensional image on the three-dimensional object will also be different. For example Fig.10 As shown, the three-dimensional object may be a cup, and the two-dimensional image is added to the surface of the cup. When the cup is in a vertical posture and an inclined posture in the three-dimensional space, the two-dimensional image will present different display effects due to different perspective relationships.

[0205] Based on this, in a possible implementation, in order to more accurately preview the display effect of adding a basic image on the preview object, the computer device can further adjust the preview effect previewed through the initial preview image in combination with the posture of the image display part in the display image.

[0206] It is understandable that for the same 3D shape, when the corresponding posture is different, the corresponding image area shape in the 2D image will also be different. Fig.10 In the figure, when the 3D object is in a vertical posture, in the main view, the cup surface of the 3D object corresponds to a rectangular graphic area; when the 3D object is in an inclined posture, in the main view, the cup surface of the 3D object corresponds to a curved rectangular area, which can be approximately regarded as an area with elliptical curves as upper and lower boundaries. It can be seen that by analyzing the shape of the 2D area corresponding to the 3D shape, the posture of the 3D shape in the 3D space can be analyzed.

[0207] Based on this, see Fig.26 , the computer device may first execute step S2601, and analyze the posture information corresponding to the image display part according to the area shape corresponding to the first image area, and the posture information is used to characterize the posture of the three-dimensional shape corresponding to the image display part in the three-dimensional space corresponding to the display image. The posture refers to the posture of the three-dimensional object in the three-dimensional space, and may include various tilt angles, various rotation directions, etc. When executing step S204, the computer device may execute steps S2047-S2048 (see Fig.26 ), steps S2047-S2048 are a possible implementation of step S204, including:

[0208] S2047: According to the posture information, pixel positions corresponding to a plurality of pixels in the initial preview image are adjusted so that the adjusted initial preview image is used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part in the first posture.

[0209] The computer device can analyze the influence of the posture on the preview effect of the initial preview image based on the posture of the image display part represented by the posture information. For example, the perspective effect when displaying a two-dimensional image through the image display part can be analyzed based on the posture information. By analyzing the influence of the display effect, the computer device can know what display effect the basic image should present after being added to the image display part, so that on the basis of the initial preview image, by adjusting the pixel positions corresponding to multiple pixels in the initial preview image, the adjusted initial preview image can present the preview effect corresponding to the posture of the image display part.

[0210] S2048: Add the adjusted initial preview image to the first image area in the display image to generate a first preview image.

[0211] Since the initial preview image before adjustment is generated by a position correspondence relationship constructed based on the three-dimensional shape of the image display part, the initial preview image before adjustment can characterize the influence of the three-dimensional shape of the image display part on the image display effect, and the adjusted initial preview image can further integrate the influence of the posture of the image display part in the three-dimensional space on the image display effect. Therefore, the adjusted initial preview image can combine the influence of the two dimensions to preview the display effect of the basic image added to the image display part more accurately and realistically, so that by adding the adjusted initial preview image to the display image, a more accurate and realistic first preview image can be generated, and the preview object can be previewed more accurately through the first preview image.

[0212] See also Fig.11 After acquiring the basic image, the computer device can first construct a position correspondence according to the shape information corresponding to the image display part to generate an initial preview image, and the initial preview image is used to preview the corresponding preview effect when the basic image is added to the cylindrical surface of the cup. Then, the computer device can adjust the initial preview image based on the posture of the cup surface in the three-dimensional space represented by the posture information to obtain the adjusted initial preview image, and the adjusted initial preview image is used to preview the preview effect of the basic image added to the cylindrical surface of the cup with the posture, so that after adding the adjusted initial preview image to the image area corresponding to the cup surface in the display image, the obtained first preview image can accurately represent the preview object (i.e., the cup) of adding the basic image to the inclined cup surface in the three-dimensional space.

[0213] Specifically, in a possible implementation, the three-dimensional shape corresponding to the image display part may be a cylindrical surface shape, and the posture information is the shape information of the upper boundary of the region corresponding to the axial direction of the cylindrical surface shape of the first image region. The axial direction here is used to distinguish the upper, lower, left and right boundaries of the first image region. When the axial direction is different, the upper boundary of the first image region is also different. For example Fig.12 shown.

[0214] like Fig.11 As shown, the more the upper half of the axis of the cylindrical surface shape is tilted forward, the larger the arc corresponding to the boundary shape of the upper boundary of the image area corresponding to the cylindrical surface shape is, and the closer it is to a circular edge. It can be seen that by analyzing the boundary shape of the upper boundary of the first image area, the forward tilt angle of the axis corresponding to the image display part of the cylindrical surface shape can be analyzed, that is, the posture of the image display part of the cylindrical surface shape in three-dimensional space can be analyzed.

[0215] When executing step S2047, the computer device may execute step S20471 (see Fig. 27 ), step S20471 is a possible implementation of step S2047, including:

[0216] S20471: According to the upper boundary shape information, pixel positions corresponding to a plurality of pixels in the initial preview image are adjusted along the axial direction so that the image upper boundary corresponding to the adjusted initial preview image in the axial direction is consistent with the boundary shape of the region upper boundary.

[0217] In this implementation, the upper boundary of the base image can be used to add to the upper boundary of the image display part in the axial direction. Through the analysis of the cylindrical surface, it can be seen that in real scenes, when the upper boundary of the image coincides with the upper boundary of the cylindrical surface, no matter how the shape of the upper boundary of the cylindrical surface changes in the image, the upper boundary of the image should change accordingly, such as Fig.13 Therefore, no matter how the posture of the image display part changes, the upper boundary of the initial preview image in the axial direction should be aligned with the upper boundary of the first image area in the axial direction.

[0218] Based on this, the computer device can adjust the pixel positions corresponding to multiple pixels in the image along the axial direction, that is, adjust the pixel positions corresponding to the pixels up and down in the axial direction, so that the boundary shape of the upper boundary of the image is consistent with the upper boundary of the region. The advantage of adjusting along the axial direction is that the upper boundary of the image can be adjusted in the simplest and most direct way, which minimizes the change of the pixel position in the initial preview image, thereby reducing the impact on the deformation mode of the initial preview image, and maximizing the retention of the representation effect of the initial preview image on the image display mode.

[0219] When executing step S2048, the computer device may execute step S20481 (see Fig. 27 ), step S20481 is a possible implementation of step S2048, including:

[0220] S20481: Adding the adjusted initial preview image to the first image region in the display image so that the upper boundary of the image fits the upper boundary of the region, thereby generating a first preview image.

[0221] By fitting the upper boundary of the initial preview image to the upper boundary of the region of the first image area, the computer device can simulate the display effect of the basic image that fits the upper boundary of the image display part in the axial direction through the initial preview image, so that the display effect is more consistent with the posture of the image display part in three-dimensional space. Of course, the image boundary that can be fitted in this application may not only include the upper boundary of the image, for example, it may also include the lower boundary of the image, the left and right boundaries of the image, etc., as long as the adjustment method corresponding to this application is selected for adjustment, for example, when fitting the lower boundary of the image, pixel adjustment can also be performed in the axial direction, and when fitting the left and right boundaries of the image, pixel adjustment can be performed in the vertical and axial directions, which are all technologies involved in this application.

[0222] For example, in Fig.14 In the embodiment, since the image plane of the axial display image corresponding to the cylindrical surface of the cup is tilted, the upper boundary and the lower boundary of the first image area corresponding to the cup surface are both ellipses, so the computer device can obtain the lengths of the major axis and the minor axis of the ellipse by measuring the display image, and then construct the position equation corresponding to the ellipse. The computer device can construct a coordinate system with the upper left corner of the first image area corresponding to the cup surface as the coordinate origin, the horizontal direction as the horizontal axis (x axis), and the vertical direction as the vertical axis (y axis). Through the position method corresponding to the ellipse, the corresponding vertical coordinates of each horizontal coordinate on the upper and lower ellipse boundaries can be determined. For example, the vertical coordinate corresponding to the horizontal coordinate x1 on the upper boundary of the area is y1, and the vertical coordinate corresponding to the horizontal coordinate x1 on the lower boundary of the area is y2, and the length between y1 and y2 is the first length.

[0223] Then, the computer device can find a column of pixel positions corresponding to the horizontal coordinate x1 on the initial preview image, and determine a number of pixels within the first length from the upper boundary of the image. These pixels will be added to the pixel position interval (x1, y1)-(x, 1, y2) in the display image according to the arrangement order in the initial preview image, so that the starting point of this column of pixels on the initial preview image, that is, the pixels located on the upper boundary of the image, can be located on the upper boundary of the region of the first image region. Furthermore, by adding the pixels in the initial preview image to the display image in this way, the upper boundary of the image of the initial preview image can be aligned with the upper boundary of the region, and the pixel arrangement method in the initial preview image can be retained to a certain extent, so that the adjusted initial preview image can still preview a relatively accurate preview effect.

[0224] The above method mainly enhances the realism of the image preview by adjusting the pixel position of the initial preview image. In another possible implementation method, the computer device can also adjust the pixel value to more realistically simulate the display effect of adding the basic image to the image display part.

[0225] For example, in real-life scenarios, after adding an image to an object surface, the displayed image effect is usually affected by the material of the object surface. For example, when the object surface is an opaque material, after adding the image, the image color may become lighter due to light exposure. Based on this, when adding the initial preview image to the display image, the computer device can adjust the pixel value based on the preview object material corresponding to the pixel addition position to simulate a more realistic image display effect.

[0226] In this implementation, the first pixel is located at the fifth pixel position in the first preview image, that is, the first pixel is used to be added to the fifth pixel position in the display image, the fifth pixel position in the display image is used to display the first object part of the preview object, and the first pixel is used to display the first image part in the initial preview image. The computer device can obtain material information corresponding to the first object part, and the material information is used to identify the material corresponding to the first object part, for example, it can identify the transparency, color, texture and other information of the first object part.

[0227] Based on the material information corresponding to the first object part, the computer device can adjust the pixel value corresponding to the first pixel in the first preview image, and the adjusted pixel value corresponding to the first pixel is used to represent the impact of the material of the first object part on the preview effect of the first image part. Therefore, in this way, the pixel value of the pixel added to the display image in the initial preview image can be adjusted, so that the effect represented in the first preview image is more in line with the material characteristics of the image display part. For example, when the material of the first object part is transparent glass, the color of the first pixel can be lighter by adjusting the pixel value of the first pixel. Furthermore, in this way, the preview effect represented by the first preview image can be made more realistic, and the preview experience of the user previewing through the first preview image can be further optimized.

[0228] In addition to improving the authenticity of the preview of the display effect through the preview image in the above-mentioned various ways, the computer device can also provide users with more diverse and customized image display effect options in the following various ways.

[0229] It is understandable that by adjusting the pixel values ​​corresponding to the pixels in the image, the image can present different image styles, commonly known as adding a "filter" to the image. For example, by adjusting the pixel values ​​of multiple pixels according to the light and dark relationship between multiple pixels in the image, the image can be adjusted to a black and white style to represent a more retro image display effect; by adjusting the pixel values ​​of multiple pixels, the contrast of the image can also be improved to present a more vivid image style.

[0230] Based on this, in a possible implementation, in order to provide a richer image preview effect, the computer device can also adjust the pixel values ​​corresponding to the pixels in the initial preview image in the first preview image, so that the initial preview image presents a first image style in the first preview image. The first image style can be any image style different from the original initial preview image, and then the first preview image can be used to display the display effects of images of different styles after being added to the preview object, thereby bringing a more diverse and richer image preview experience.

[0231] The computer device may analyze how to adjust the pixel value of the initial preview image in a variety of ways so that the initial preview image presents a more reasonable image style in the first preview image. Two analysis methods are mainly introduced below.

[0232] The first method: Analysis based on the object style of the preview object

[0233] In a possible implementation, the computer device may first analyze the first object style corresponding to the preview object based on the display image. Generally, when the image style of the added image on the three-dimensional object is relatively matched with the style of the three-dimensional object itself, the added image can bring a better display effect to the three-dimensional object. Based on this, when adjusting the pixel values ​​corresponding to the pixels in the initial preview image in the first preview image so that the initial preview image presents the first image style in the first preview image, the computer device may determine the image style that matches the first object style. Based on the first object style matching the first image style, the pixel values ​​corresponding to the pixels in the initial preview image in the first preview image are adjusted so that the initial preview image presents the first image style in the first preview image.

[0234] In this way, the computer device can enable the addition of basic images to bring better display effects to the preview object, and can also provide users with a new idea for adding images, so that users can understand how to add images to the preview object to optimize the display effect of the preview object, thereby allowing users to select a basic image that is more suitable for the preview object for preview.

[0235] For example, when the overall color of the preview object is black and white, the computer device can adjust the pixel value to adjust the original brightly colored initial preview image to a dark-toned initial preview image, so that the color of the initial preview image is more harmonious with the color of the preview object, thereby enabling the preview object with the initial preview image added to present a more reasonable object style.

[0236] The second method: analysis based on the instructions entered by the input party

[0237] In another possible implementation, in order to further improve the degree of freedom of previewing the image display effect, the computer device may also support the user to adjust the image style of the image added to the preview object.

[0238] When adjusting the pixel values ​​corresponding to the pixels in the initial preview image in the first preview image so that the initial preview image presents a first image style in the first preview image, the computer device can first obtain a style adjustment instruction input by an input party, where the input party is the party that inputs the instruction, for example, a user who needs to preview the image, and the style adjustment instruction is used to instruct to adjust the image style corresponding to the initial preview image to the first image style, and the first image style is the image style that the input party needs to display through the first preview image.

[0239] Based on the style adjustment instruction input by the input party, the computer device can adjust the pixel values ​​corresponding to the pixels in the initial preview image in the first preview image, so that the initial preview image presents the first image style in the first preview image, thereby making the image style presented by the initial preview image meet the image style requirements of the input party. In this way, it is possible to support users to adjust the image style presented by the initial preview image in the first preview image by inputting style adjustment instructions, thereby further meeting the user's diverse image display effect preview requirements, helping users to select the image style that best suits the preview object, and providing users with more effective help in multiple fields such as product involvement and commodity customization.

[0240] In addition, it is understandable that there may be multiple object parts on a preview object that can be used to add images. For example, when the preview object is a cup, the user can add an image on the cup surface or on the handle, etc. In order to provide users with a more free preview function and further meet diverse preview needs, in a possible implementation, the computer device can also support users to select the object part to which they want to add an image.

[0241] In this implementation, the preview object may have multiple image display locations, and the multiple image display locations include the above-mentioned image display location. When executing step S202, the computer device may execute step S2025 (see Fig.28 ), step S2025 is a possible implementation of step S202, including:

[0242] S2025: Based on the part selection instruction input by the input party, a position correspondence relationship is established according to shape information corresponding to the part displayed in the image.

[0243] The input party is the party that inputs the part selection instruction, for example, it can be a user who is previewing the image. The part selection instruction is used to select the image display part, and the computer device can construct a position correspondence relationship according to the shape information corresponding to the image display part selected by the part selection instruction, and execute the subsequent process. That is, the computer device will add the image to the image display part selected by the part selection selection, and display the corresponding image display effect when the basic image is added to the image display part selected by the part selection instruction. In this way, the user can freely select the object part on the preview object for adding the basic image, so that the display effect of adding the basic image to different parts can be previewed, thereby meeting more diverse image preview needs and bringing users a better preview experience.

[0244] As mentioned above, the initial preview image can represent the display effect of the deformation of the basic image after it is added to the image display part. Among them, part of the basic image may be greatly different from the original image due to the deformation. This part of the image may not have a good image display effect after being added to the preview object. Therefore, in order to improve the display effect when the basic image is added to the preview object, the user may choose to crop this part of the image and not display it.

[0245] Based on this, in a possible implementation, the computer device may also support the user to crop the initial preview image added to the display image, so that the display effect after adding the basic image can better meet the user's needs.

[0246] The computer device obtains an image capture instruction input by an input party, the input party is the party that inputs the image capture instruction, for example, it can be a user, and the image capture instruction is used to characterize the capture method of the initial preview image. Based on the image capture instruction, the computer device can analyze how the input party needs to capture the initial preview image, so as to capture the basic image part from the initial preview image, and the pixels included in the basic image part are the pixels included in the second image part in the basic image, that is, the basic image part is the image part obtained by deforming the second image part in the basic image. The advantage of directly capturing the initial preview image is that, since the initial preview image can already preview the preview effect of the basic image added to the image display part, the user only needs to keep the image part with a better preview effect in the initial preview image, and does not need to understand which image parts in the basic image are deformed to obtain these image parts, which improves the image capture efficiency and ensures the image capture effect. If the basic image is captured, the computer device also needs to generate an initial preview image corresponding to the captured basic image, so that the user can understand the preview effect corresponding to the captured basic image, and the capture efficiency is poor.

[0247] The computer device can add the basic image part to the first image area to generate a second preview image corresponding to the preview object, and the second preview image is used to display the preview object after the second image part is added to the image display part. In this way, the user can choose the effect image part actually added to the display image for preview, so that the final preview effect is more in line with their own needs. At the same time, the efficiency of image capture can be improved based on the capture of the initial preview image, bringing users a more flexible and efficient image preview experience. For example Fig.15 As shown, after the initial preview image is generated based on the basic image, the lower image portion of the initial preview image can be captured based on the image capture instruction to obtain the basic image portion, and finally the basic image portion is added to the first image area to generate a second preview image.

[0248] It is understandable that when obtaining the shape information corresponding to the image display part, the computer device may obtain the information in a variety of ways, such as directly obtaining the real size information corresponding to the image display part in the real scene. When displaying the preview object through the display image, since the size of the display image may not match the actual size of the preview object, the size of the preview object displayed through the display image may be inconsistent with the size of the three-dimensional shape identified by the shape information. For example, when displaying a car through an image, the proportion of the car is usually smaller than the proportion of the car in the real scene.

[0249] Based on this, in a possible implementation, in order to enable the initial preview image to more accurately preview the preview effect after the basic image is added to the image display part, the computer device can adjust the ratio of the initial preview image based on the display ratio of the display image to the image display part.

[0250] When executing step S204, the computer device may execute steps S2049-S20411 (see Fig.29 ), steps S2049-S20411 are a possible implementation of step S204, including:

[0251] S2049: Obtaining the object display ratio corresponding to the preview object in the display image.

[0252] The object display ratio refers to the size ratio of the preview object in the display image to the preview object in the real scene, for example, it can be 1:10, 1:100, etc.

[0253] S20410: Scaling the initial preview image so that the image display ratio corresponding to the scaled initial preview image is consistent with the object display ratio.

[0254] Since the shape information represents the real three-dimensional shape of the image display part, the preview effect previewed by the initial preview image should be the preview effect corresponding to the basic image after being added to the image display part of the original proportion. Therefore, in order to accurately represent the display effect of the basic image added to the image display part after adding the initial preview image to the display image, the computer device can scale the initial preview image, for example, it can enlarge or reduce the initial preview image so that the image display ratio corresponding to the scaled initial preview image is consistent with the object display ratio.

[0255] S20411: Adding the initial preview image after scaling processing to the first image area in the display image to generate a first preview image corresponding to the preview object.

[0256] From the above analysis, it can be seen that since the display ratio corresponding to the scaled initial preview image is consistent with the display ratio corresponding to the preview object in the display image, by adding the scaled initial preview image to the display image, the generated first preview image can accurately represent the image display effect corresponding to the basic image when the basic image of the original size is added to the image display part of the original ratio. Therefore, no matter which display ratio the preview object corresponds to in the display image, the computer device can generate a relatively accurate first preview image, so that the user can accurately preview the effect of adding the basic image to the image display part in the real scene through the first preview image, further improving the accuracy of the preview function.

[0257] In order to facilitate understanding of the technical solution provided by the present application, the image processing method provided by the present application will be introduced in detail below in combination with an actual application scenario.

[0258] See also Fig.16 , Fig.16 A flowchart of an image processing method in an actual application scenario provided by an embodiment of the present application. In the actual application scenario, the computer device can be any computer device with an image processing function, such as a terminal device or a server. The three-dimensional shape of the image display part on the preview object is a cylindrical surface shape. For example, the preview object can be a cup, and the image display part can be the cup surface. When the basic image is added to the first image area corresponding to the image display part in the display image, the upper boundary of the image in the axial direction needs to fit the upper boundary of the image display part in the axial direction. The method includes:

[0259] S1601: Acquire a basic image and a display image.

[0260] The basic image is the image that needs to be added, and the display image is the image used to display the preview object.

[0261] S1602: Construct a first coordinate system according to the basic image.

[0262] The computer device may establish a first coordinate system according to a reference pixel in the basic image and a set longitudinal axis direction of the first coordinate system, wherein the reference pixel is located at the coordinate origin of the first coordinate system.

[0263] S1603: Construct a first position correspondence relationship according to the first coordinate system.

[0264] The computer device can construct a first position correspondence relationship based on the pixel positions corresponding to each pixel on the basic image and the coordinate positions of each pixel on the basic image in the first coordinate system. The first position correspondence relationship is a correspondence relationship between the pixel positions of multiple pixels in the basic image and the corresponding initial coordinate positions in the first coordinate system.

[0265] S1604: Construct a second position correspondence relationship according to the cylinder radius corresponding to the image display part and the cylindrical projection algorithm.

[0266] The coordinate transformation formula corresponding to the cylindrical projection algorithm can be determined by the radius of the cylinder, so as to construct a second position correspondence relationship. The second position correspondence relationship is the correspondence between the initial coordinate positions and the coordinate positions of multiple pixels in the first coordinate system. The position distribution method represented by the coordinate positions of multiple pixels is the position distribution method of multiple pixels in the initial preview image. The deformation processing of the basic image can be completed through the second position correspondence relationship.

[0267] S1605: Determine whether a first direction corresponding to an axis corresponding to the image display part in the first image area is consistent with a longitudinal axis direction of the first coordinate system.

[0268] If they are consistent, it means that the axial direction (i.e., the center line of the deformation) of the cylindrical surface shape represented by the initial preview image directly generated based on the first coordinate system is consistent with the axial direction corresponding to the image display part in the display image. Therefore, by adding the initial preview image, the preview effect of adding the basic image to the image display part can be accurately previewed, and the computer device can execute step S1606 to directly construct the third position correspondence based on the first coordinate system. Initial preview image Basic image Initial preview image

[0269] On the contrary, if they are inconsistent, it means that directly generating the initial preview image based on the first coordinate system will cause the axis represented by the initial preview image to be inconsistent with the axis actually corresponding to the image display part in the display image. At this time, the computer device can execute step S1607 to rotate the first coordinate system so that the longitudinal axis direction is consistent with the first direction, and then the initial preview image base image computer device can execute step S1608 to construct a third position correspondence relationship based on the second coordinate system. Combining the three-part position correspondence relationship can convert the pixel position of the pixel in the base image to the pixel position in the initial preview image.

[0270] Basic image initial preview image S1606: constructing a third position correspondence relationship based on the first coordinate system.

[0271] The third position correspondence is a correspondence between the coordinate positions of multiple pixels in the first coordinate system and the corresponding pixel positions in the initial preview image. Therefore, combining the above three parts of the position correspondence can convert the pixel position of the pixel in the basic image into the pixel position in the initial preview image.

[0272] S1607: Rotate the first coordinate system so that the longitudinal axis direction is consistent with the first direction.

[0273] The rotation of the coordinate system does not affect the coordinate positions of the multiple pixels, that is, the coordinate positions of the multiple pixels in the first coordinate system are consistent with the coordinate positions of the multiple pixels in the second coordinate system. Since the longitudinal direction of the rotated second coordinate system is consistent with the first direction, the initial preview image generated based on the second coordinate system can accurately preview the preview effect of the basic image added to the image display part, so that the computer device can execute step S1608 based on the second coordinate system to generate the initial preview image.

[0274] S1608: Construct a third position correspondence relationship based on the second coordinate system.

[0275] The computer device can construct the third position correspondence relationship based on the position part of the multiple pixels in the second coordinate system. The third position correspondence relationship is essentially a correspondence relationship between the coordinate positions corresponding to the multiple pixels in the second coordinate system and the corresponding pixel positions in the initial preview image. Since the coordinate positions of the multiple pixels in the first coordinate system are consistent with the coordinate positions of the multiple pixels in the second coordinate system, the third position correspondence relationship can be regarded as a correspondence relationship between the coordinate positions corresponding to the multiple pixels in the first coordinate system and the corresponding pixel positions in the initial preview image.

[0276] S1609: Generate an initial preview image based on the first position correspondence, the second position correspondence, the third position correspondence, and the pixel positions of the plurality of pixels in the basic image.

[0277] The computer device may determine pixel positions in the initial preview image corresponding to a plurality of pixels in the basic image based on the position correspondence relationship of the three parts, thereby generating the initial preview image.

[0278] S1610: Determine whether the shape of the upper boundary of the region corresponding to the first image region in the axial direction is consistent with the shape of the upper boundary of the image corresponding to the initial preview image in the axial direction.

[0279] If they are consistent, it means that adding the initial preview image can make the upper image boundary of the initial preview image in the axial direction coincide with the upper image boundary of the region corresponding to the first image region in the axial direction, thereby representing the effect of the upper image boundary of the basic image in the circumferential direction coincide with the upper boundary of the image display part in the axial direction. At this time, the computer device can directly execute step S1612, add the initial preview image to the first image region, make the upper image boundary coincide with the upper boundary of the region, and generate a preview image.

[0280] If they are inconsistent, it means that directly adding the initial preview image at this time will cause the image upper boundary of the initial preview image to be unable to fit the region upper boundary of the first image area. It is highly likely that the posture of the image display part in the display image is inconsistent with the posture represented by the initial preview image. At this time, the computer device can first execute step S1611 to adjust the pixel position of the pixels in the initial preview image along the axial direction to make the image upper boundary consistent with the shape of the region upper boundary, so that the posture represented by the initial preview image is consistent with the posture corresponding to the image display part. Then, when executing step S1612, the image upper boundary of the initial preview image can be made to fit the region upper boundary, thereby accurately representing the display effect of fitting the image upper boundary of the basic image with the upper boundary of the image display part when adding the basic image, so as to meet the preview requirements.

[0281] S1611: Adjust the pixel positions of the pixels in the initial preview image along the axial direction so that the upper boundary of the image is consistent with the shape of the upper boundary of the region.

[0282] S1612: Add the initial preview image to the first image area so that the upper boundary of the image fits the upper boundary of the area, and generate a preview image.

[0283] When adding the initial preview image, the computer device can also adjust the pixel value of the initial preview image based on the material information of the image display part, the image style required by the basic image, etc.; and can adjust the image ratio of the initial preview image based on the corresponding display ratio of the image display part in the display image, so that the preview effect it previews matches the corresponding display ratio of the image display part in the display image.

[0284] It can be seen from the above methods that compared with the preview method in the related art, the present application has the following technical effects:

[0285] First, when previewing the image display effect of adding a basic image to a three-dimensional preview object, the present application does not need to go through relatively complicated processing procedures such as the construction process of constructing a three-dimensional model of the preview object and the rendering process of rendering the image based on the three-dimensional model of the preview object. Instead, it only needs to transform the positions of the pixels in the basic image. This reduces the difficulty of technical implementation, simplifies the processing flow required for effect preview, helps to improve the efficiency of effect preview, and also enables the effect preview function to be applied in more application scenarios with low processing performance, thereby increasing the breadth of functional application.

[0286] Secondly, since the present application constructs a position correspondence relationship based on the three-dimensional shape of the image display part, when the basic image is deformed based on the position correspondence relationship, the display effect of the basic image deformed by the three-dimensional shape of the image display part can be accurately restored, thereby ensuring the accuracy and authenticity of the image preview.

[0287] On the third aspect, the present application can support users in determining the construction method of the first coordinate system by setting the base pixel and the longitudinal axis direction for the image display part with a cylindrical surface shape, and then can choose the deformation method when the basic image is added to the image display part, so as to preview different image display effects.

[0288] Fourthly, for an image display part with a cylindrical shape, the present application can adjust the way in which the initial preview image is added to the first image area by analyzing the axis and posture of the image display part, so that the adjusted initial preview image can more accurately preview the preview effect of the basic image added to the image display part.

[0289] Fifthly, the present application can adjust the pixel value of the initial preview image after it is added to the display image based on the material information of the image display part, so that the initial preview image can more realistically preview the preview effect of the basic image added to the image display parts of various materials.

[0290] Sixthly, the present application can support free adjustment of the pixel value and the actual display part of the basic image, so that the initial preview image presents a variety of image styles and preview effects, further improving the freedom of image preview.

[0291] Based on the image processing method provided in the above embodiment, the present application also provides an image processing device, see Fig.17 , Fig.17 This is a structural block diagram of an image processing device provided in an embodiment of the present application. The device 1700 includes a first acquisition unit 1701, a construction unit 1702, a first generation unit 1703, and a second generation unit 1704:

[0292] The first acquisition unit 1701 is used to acquire a basic image and a display image for displaying a preview object, the preview object has an image display part, and the basic image is composed of a plurality of pixels;

[0293] The construction unit 1702 is used to construct a position correspondence relationship based on the shape information corresponding to the image display part, where the shape information is used to represent the three-dimensional shape of the image display part;

[0294] The first generating unit 1703 is used to generate an initial preview image based on the position correspondence and pixel positions corresponding to the plurality of pixels in the basic image, the initial preview image being used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part, the initial preview image being composed of the plurality of pixels, a first pixel being any one of the plurality of pixels, the first pixel corresponding to a first pixel position in the basic image, and corresponding to a second pixel position in the initial preview image, and the first pixel position and the second pixel position satisfying the position correspondence;

[0295] The second generating unit 1704 is used to add the initial preview image in the first image area in the display image to generate a first preview image corresponding to the preview object, the first preview image is used to display the preview object after the basic image is added to the image display part, and the first image area is used to display the image display part.

[0296] In a possible implementation, the position correspondence includes a first position correspondence, a second position correspondence, and a third position correspondence, the three-dimensional shape corresponding to the image display part is a cylindrical surface shape, the shape information corresponding to the image display part includes the cylinder radius corresponding to the image display part, and the construction unit 1702 is specifically used to:

[0297] According to the basic image, the first coordinate system takes the reference pixel in the basic image as the origin, the reference pixel is used to be added to the pixel position corresponding to the center point of the cylinder corresponding to the image display part in the first image area, and the pixels in the basic image located on the vertical axis of the first coordinate system are used to be added to the pixel position of the axis corresponding to the image display part;

[0298] constructing the first position correspondence relationship according to the first coordinate system, where the first position correspondence relationship is a correspondence relationship between pixel positions of the plurality of pixels in the basic image and corresponding initial coordinate positions in the first coordinate system;

[0299] constructing a second position correspondence relationship according to the cylinder radius, the second position correspondence relationship being used to change the initial coordinate positions corresponding to the plurality of pixels in the first coordinate system to obtain the coordinate positions of the plurality of pixels in the first coordinate system, and the initial coordinate position and the coordinate position corresponding to the first pixel in the first coordinate system satisfy the second position correspondence relationship;

[0300] The third position correspondence relationship is constructed according to the first coordinate system, and the third position correspondence relationship is a correspondence relationship between the coordinate positions corresponding to the multiple pixels in the first coordinate system and the pixel positions of the multiple pixels in the initial preview image.

[0301] In a possible implementation, the device further includes a first analyzing unit:

[0302] The first analyzing unit is used to analyze a first direction corresponding to the axis in the first image area according to the displayed image;

[0303] The construction unit 1702 is specifically used for:

[0304] Based on the first direction being consistent with the longitudinal axis direction of the first coordinate system, constructing the third position correspondence relationship according to the first coordinate system;

[0305] Based on the inconsistency between the first direction and the longitudinal axis direction of the first coordinate system, the first coordinate system is rotated to make the longitudinal axis direction of the first coordinate system consistent with the first direction, so as to obtain a second coordinate system, wherein the coordinate positions of the plurality of pixels in the second coordinate system are the same as the coordinate positions of the plurality of pixels in the first coordinate system;

[0306] The third position correspondence is constructed according to the second coordinate system.

[0307] In a possible implementation, the device further includes a second analyzing unit:

[0308] The second analyzing unit is used to analyze a first direction corresponding to the axis in the first image area according to the displayed image;

[0309] The second generating unit 1704 is specifically used for:

[0310] Based on the consistency between the first direction and the longitudinal axis direction of the first coordinate system, adding the initial preview image in the first image area in the display image to generate a first preview image corresponding to the preview object;

[0311] Based on the inconsistency between the first direction and the longitudinal axis direction of the first coordinate system, rotating the initial preview image so that the direction of a straight line formed by a plurality of pixels on the longitudinal axis in the initial preview image is consistent with the first direction;

[0312] The rotated initial preview image is added to the first image area in the display image to generate a first preview image corresponding to the preview object.

[0313] In a possible implementation manner, the device further includes a second acquiring unit:

[0314] The second acquisition unit is used to acquire a setting instruction input by an input party, wherein the setting instruction includes identification information, and the identification information is used to identify the reference pixel in the basic image and the longitudinal axis direction corresponding to the first coordinate system;

[0315] The construction unit 1702 is specifically used for:

[0316] The first coordinate system is constructed based on the identification information and the basic image.

[0317] In a possible implementation manner, the second generating unit 1704 is specifically configured to:

[0318] Determine a reference pixel position corresponding to the center point of the cylinder in the first image area;

[0319] adding the reference pixel in the initial preview image to the reference pixel position;

[0320] According to the relative positional relationship between the second pixel position and the third pixel position of the reference pixel in the initial preview image, the first pixel is added to the fourth pixel position corresponding to the first image area to generate the first preview image, and the positional relationship between the fourth pixel position and the reference pixel position corresponds to the relative positional relationship.

[0321] In a possible implementation manner, the second generating unit 1704 is specifically configured to:

[0322] determining the fourth pixel position according to a relative position relationship between the second pixel position and a third pixel position of the reference pixel in the initial preview image and the reference pixel position;

[0323] Based on the fourth pixel position not exceeding the first image area, adding the first pixel to the fourth pixel position to generate the first preview image;

[0324] The device also includes an adding unit:

[0325] The adding unit is configured to not add the first pixel in the first image area based on the fact that the fourth pixel position exceeds the first image area.

[0326] In a possible implementation manner, the device further includes a third analysis unit:

[0327] The third analysis unit is used to analyze the posture information corresponding to the image display part according to the area shape corresponding to the first image area, and the posture information is used to represent the posture of the three-dimensional shape corresponding to the image display part in the three-dimensional space corresponding to the display image;

[0328] The second generating unit 1704 is specifically used for:

[0329] According to the posture information, pixel positions corresponding to the plurality of pixels in the initial preview image are adjusted, so that the adjusted initial preview image is used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part in the first posture;

[0330] The adjusted initial preview image is added to a first image area in the display image to generate the first preview image.

[0331] In a possible implementation, the three-dimensional shape corresponding to the image display part is a cylindrical surface shape, the posture information is the region upper boundary shape information corresponding to the first image region in the axial direction of the cylindrical surface shape, the region upper boundary information is used to identify the boundary shape of the region upper boundary of the first image region, and the second generating unit 1704 is specifically used to:

[0332] According to the upper boundary shape information, pixel positions corresponding to a plurality of pixels in the initial preview image are adjusted along the axial direction, so that the image upper boundary corresponding to the adjusted initial preview image along the axial direction is consistent with the boundary shape of the upper boundary of the region;

[0333] The adjusted initial preview image is added to the first image area in the display image so that the upper boundary of the image fits the upper boundary of the area, thereby generating the first preview image.

[0334] In a possible implementation, the first pixel is located at a fifth pixel position in the first preview image, the fifth pixel position in the display image is used to display a first object part of the preview object, the first pixel is used to display a first image part in the initial preview image, and the device further includes a first adjustment unit:

[0335] The first adjustment unit is used to adjust the pixel value corresponding to the first pixel in the first preview image based on material information corresponding to the first object part, the material information is used to identify the material corresponding to the first object part, and the adjusted pixel value corresponding to the first pixel is used to characterize the influence of the material on the display effect of the first image part.

[0336] In a possible implementation, the device further includes a second adjusting unit:

[0337] The second adjustment unit is used to adjust pixel values ​​corresponding to pixels in the initial preview image in the first preview image, so that the initial preview image presents a first image style in the first preview image.

[0338] In a possible implementation manner, the device further includes a fourth analyzing unit:

[0339] The fourth analyzing unit is used to analyze a first object style corresponding to the preview object based on the display image;

[0340] The second adjusting unit is specifically used for:

[0341] Based on the first object style being aligned with the first image style, pixel values ​​corresponding to pixels in the initial preview image in the first preview image are adjusted so that the initial preview image presents the first image style in the first preview image.

[0342] In a possible implementation manner, the second adjusting unit is specifically configured to:

[0343] Based on obtaining a style adjustment instruction input by an input party, pixel values ​​corresponding to pixels in the initial preview image in the first preview image are adjusted so that the initial preview image presents a first image style in the first preview image, and the style adjustment instruction is used to instruct to adjust the image style corresponding to the initial preview image to the first image style.

[0344] In a possible implementation, the preview object has a plurality of image display parts, the plurality of image display parts include the image display part, and the constructing unit 1702 is specifically configured to:

[0345] Based on obtaining a part selection instruction input by an input party, a position correspondence is constructed according to shape information corresponding to the image display part, and the part selection instruction is used to select the image display part.

[0346] In a possible implementation manner, the device further includes a third acquiring unit, an intercepting unit, and a third generating unit:

[0347] The third acquisition unit is used to acquire an image capture instruction input by the input party, wherein the image capture instruction is used to represent a capture method of the initial preview image;

[0348] The interception unit is used to intercept a basic image portion from the initial preview image based on the image interception instruction, where pixels included in the basic image portion are pixels included in the second image portion in the basic image;

[0349] The third generating unit is used to add the basic image part in the first image area to generate a second preview image corresponding to the preview object, and the second preview image is used to display the preview object after the second image part is added to the image display part.

[0350] In a possible implementation manner, the second generating unit 1704 is specifically configured to:

[0351] Obtaining an object display ratio corresponding to the preview object in the display image;

[0352] Scaling the initial preview image so that the image display ratio corresponding to the scaled initial preview image is consistent with the object display ratio;

[0353] The initial preview image after scaling is added to the first image area in the display image to generate a first preview image corresponding to the preview object.

[0354] The present application also provides a computer device, see Fig.18 As shown, the computer device may be a terminal device, and a mobile phone is taken as an example:

[0355] Fig.18 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig.18 The mobile phone includes: a radio frequency (RF) circuit 710, a memory 720, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780, and a power supply 790. Those skilled in the art will understand that Fig.18 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0356] Combine the following Fig.18 A detailed introduction to the various components of the mobile phone:

[0357] The RF circuit 710 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 780 for processing; in addition, the designed uplink data is sent to the base station. Usually, the RF circuit 710 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, referred to as LNA), a duplexer, etc. In addition, the RF circuit 710 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0358] The memory 720 can be used to store software programs and modules. The processor 780 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 720. The memory 720 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 720 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0359] The input unit 730 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732. The touch panel 731, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 731 or near the touch panel 731 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 731 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 780, and can receive and execute commands sent by the processor 780. In addition, the touch panel 731 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 731, the input unit 730 may further include other input devices 732. Specifically, the other input devices 732 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0360] The display unit 740 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 740 may include a display panel 741. Optionally, the display panel 741 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc. Further, the touch panel 731 may cover the display panel 741. When the touch panel 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of touch event. Subsequently, the processor 780 provides a corresponding visual output on the display panel 741 according to the type of touch event. Although in Fig.18 In the embodiment, the touch panel 731 and the display panel 741 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 731 and the display panel 741 can be integrated to realize the input and output functions of the mobile phone.

[0361] The mobile phone may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 741 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0362] The audio circuit 760, the speaker 761, and the microphone 762 can provide an audio interface between the user and the mobile phone. The audio circuit 760 can transmit the received audio data to the speaker 761 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 762 converts the collected sound signal into an electrical signal, which is received by the audio circuit 760 and converted into audio data, and then the audio data is output to the processor 780 for processing, and then sent to another mobile phone through the RF circuit 710, or the audio data is output to the memory 720 for further processing.

[0363] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 770. It provides users with wireless broadband Internet access. Fig.18 A WiFi module 770 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.

[0364] The processor 780 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 720, and calling data stored in the memory 720, it executes various functions of the mobile phone and processes data, thereby performing overall detection of the mobile phone. Optionally, the processor 780 may include one or more processing units; preferably, the processor 780 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 780.

[0365] The mobile phone also includes a power supply 790 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 780 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0366] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0367] In this embodiment, the processor 780 included in the terminal device also has the following functions:

[0368] Acquire a basic image and a display image for displaying a preview object, wherein the preview object has an image display portion, and the basic image is composed of a plurality of pixels;

[0369] Establishing a position correspondence relationship based on shape information corresponding to the image display part, wherein the shape information is used to characterize the three-dimensional shape of the image display part;

[0370] generating an initial preview image based on the position correspondence and pixel positions corresponding to the plurality of pixels in the basic image, the initial preview image being used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part, the initial preview image being composed of the plurality of pixels, a first pixel being any one of the plurality of pixels, the first pixel corresponding to a first pixel position in the basic image, and corresponding to a second pixel position in the initial preview image, and the first pixel position and the second pixel position satisfying the position correspondence;

[0371] The initial preview image is added to a first image area in the display image to generate a first preview image corresponding to the preview object, the first preview image is used to display the preview object after the basic image is added to the image display part, and the first image area is used to display the image display part.

[0372] The present application also provides a server. Fig.19 As shown, Fig.19The structural diagram of the server 800 provided in the embodiment of the present application, the server 800 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 822 (for example, one or more processors) and a memory 832, and one or more storage media 830 (for example, one or more mass storage devices) storing application programs 842 or data 844. Among them, the memory 832 and the storage medium 830 can be temporary storage or permanent storage. The program stored in the storage medium 830 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 822 can be configured to communicate with the storage medium 830 and execute a series of instruction operations in the storage medium 830 on the server 800.

[0373] The server 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input and output interfaces 858, and / or one or more operating systems 841, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.

[0374] The steps performed by the server in the above embodiment can be based on Fig.19 The server structure shown.

[0375] An embodiment of the present application further provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute any one of the image processing methods described in the aforementioned embodiments.

[0376] An embodiment of the present application further provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the image processing method described in any one of the above embodiments.

[0377] It is understandable that in the specific implementation of the present application, related data such as user information (such as base image, initial preview image) is involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0378] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.

[0379] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0380] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire a basic image and a display image for displaying a preview object, wherein the preview object has an image display portion, and the basic image includes a plurality of pixels; Establishing a position correspondence relationship based on shape information of the image display part, wherein the shape information is used to characterize a three-dimensional shape of the image display part; generating an initial preview image based on the position correspondence and the pixel positions respectively corresponding to the multiple pixels in the basic image, the initial preview image being used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part, the initial preview image being composed of the multiple pixels, a first pixel being any one of the multiple pixels, the first pixel corresponding to a first pixel position in the basic image, and corresponding to a second pixel position in the initial preview image, and the first pixel position and the second pixel position satisfying the position correspondence; The initial preview image is added to a first image area in the display image to generate a first preview image corresponding to the preview object, the first preview image is used to display the preview object after the basic image is added to the image display part, and the first image area is used to display the image display part.

2. The method according to claim 1, characterized in that The position correspondence relationship includes a first position correspondence relationship, a second position correspondence relationship and a third position correspondence relationship, the three-dimensional shape corresponding to the image display part is a cylindrical surface shape, the shape information corresponding to the image display part includes the radius of the cylinder corresponding to the image display part, and the position correspondence relationship is constructed based on the shape information corresponding to the image display part, including: Construct a first coordinate system according to the basic image, wherein the first coordinate system takes a reference pixel in the basic image as the origin, the reference pixel is used to be added to the pixel position corresponding to the center point of the cylinder corresponding to the image display part in the first image area, and the pixels in the basic image located on the vertical axis of the first coordinate system are used to be added to the pixel position of the axis corresponding to the image display part; constructing the first position correspondence relationship according to the first coordinate system, where the first position correspondence relationship is a correspondence relationship between pixel positions of the plurality of pixels in the basic image and corresponding initial coordinate positions in the first coordinate system; constructing a second position correspondence relationship according to the cylinder radius, the second position correspondence relationship being used to change the initial coordinate positions corresponding to the plurality of pixels in the first coordinate system to obtain the coordinate positions of the plurality of pixels in the first coordinate system, and the initial coordinate position and the coordinate position corresponding to the first pixel in the first coordinate system satisfy the second position correspondence relationship; The third position correspondence relationship is constructed according to the first coordinate system, and the third position correspondence relationship is a correspondence relationship between the coordinate positions corresponding to the multiple pixels in the first coordinate system and the pixel positions of the multiple pixels in the initial preview image.

3. The method according to claim 2, characterized in that The method further comprises: Analyzing a first direction corresponding to the axis in the first image region according to the displayed image; The constructing the third position correspondence relationship according to the first coordinate system includes: Based on the first direction being consistent with the longitudinal axis direction of the first coordinate system, constructing the third position correspondence relationship according to the first coordinate system; Based on the inconsistency between the first direction and the longitudinal axis direction of the first coordinate system, the first coordinate system is rotated to make the longitudinal axis direction of the first coordinate system consistent with the first direction, so as to obtain a second coordinate system, wherein the coordinate positions of the plurality of pixels in the second coordinate system are the same as the coordinate positions of the plurality of pixels in the first coordinate system; The third position correspondence is constructed according to the second coordinate system.

4. The method according to claim 2, characterized in that: The method further comprises: Analyzing a first direction corresponding to the axis in the first image region according to the displayed image; Adding the initial preview image in the first image area of ​​the display image to generate a first preview image corresponding to the preview object includes: Based on the consistency between the first direction and the longitudinal axis direction of the first coordinate system, adding the initial preview image in the first image area in the display image to generate a first preview image corresponding to the preview object; Based on the inconsistency between the first direction and the longitudinal axis direction of the first coordinate system, rotating the initial preview image so that the direction of a straight line formed by a plurality of pixels on the longitudinal axis in the initial preview image is consistent with the first direction; The rotated initial preview image is added to the first image area in the display image to generate a first preview image corresponding to the preview object.

5. The method according to claim 2, characterized in that: The method further comprises: Acquire a setting instruction input by an input party, wherein the setting instruction includes identification information, and the identification information is used to identify the reference pixel in the basic image and the longitudinal axis direction corresponding to the first coordinate system; The step of constructing a first coordinate system according to the basic image comprises: The first coordinate system is constructed based on the identification information and the basic image.

6. The method according to claim 2, characterized in that The adding the initial preview image in the first image area in the display image to generate a first preview image corresponding to the preview includes: Determine a reference pixel position corresponding to the center point of the cylinder in the first image area; adding the reference pixel in the initial preview image to the reference pixel position; According to the relative positional relationship between the second pixel position and the third pixel position of the reference pixel in the initial preview image, the first pixel is added to the fourth pixel position corresponding to the first image area to generate the first preview image, and the positional relationship between the fourth pixel position and the reference pixel position corresponds to the relative positional relationship.

7. The method according to claim 6, characterized in that The step of adding the first pixel to a fourth pixel position corresponding to the first image area according to a relative position relationship between the second pixel position and a third pixel position of the reference pixel in the initial preview image to generate the first preview image includes: determining the fourth pixel position according to a relative position relationship between the second pixel position and a third pixel position of the reference pixel in the initial preview image and the reference pixel position; Based on the fourth pixel position not exceeding the first image area, adding the first pixel to the fourth pixel position to generate the first preview image; The method further comprises: Based on the fourth pixel position being beyond the first image region, not adding the first pixel to the first image region.

8. The method according to claim 1, characterized in that The method further comprises: Analyzing the posture information corresponding to the image display part according to the area shape corresponding to the first image area, wherein the posture information is used to characterize the posture of the three-dimensional shape corresponding to the image display part in the three-dimensional space corresponding to the display image; Adding the initial preview image in the first image area of ​​the display image to generate a first preview image corresponding to the preview object includes: According to the posture information, pixel positions corresponding to the plurality of pixels in the initial preview image are adjusted, so that the adjusted initial preview image is used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part in the first posture; The adjusted initial preview image is added to a first image area in the display image to generate the first preview image.

9. The method according to claim 8, characterized in that The three-dimensional shape corresponding to the image display part is a cylindrical surface shape, the posture information is the shape information of the upper boundary of the region corresponding to the first image region in the axial direction of the cylindrical surface shape, the upper boundary information of the region is used to identify the boundary shape of the upper boundary of the region of the first image region, and adjusting the pixel positions corresponding to the multiple pixels in the initial preview image respectively according to the posture information includes: According to the upper boundary shape information, pixel positions corresponding to a plurality of pixels in the initial preview image are adjusted along the axial direction, so that the image upper boundary corresponding to the adjusted initial preview image along the axial direction is consistent with the boundary shape of the upper boundary of the region; Adding the adjusted initial preview image in the first image area in the display image to generate the first preview image includes: The adjusted initial preview image is added to the first image area in the display image so that the upper boundary of the image fits the upper boundary of the area, thereby generating the first preview image.

10. The method according to claim 1, characterized in that The first pixel is located at a fifth pixel position in the first preview image, the fifth pixel position in the display image is used to display a first object part of the preview object, and the first pixel is used to display a first image part in the initial preview image, and the method further includes: Based on material information corresponding to the first object part, a pixel value corresponding to the first pixel in the first preview image is adjusted, the material information is used to identify the material corresponding to the first object part, and the adjusted pixel value corresponding to the first pixel is used to characterize the influence of the material on the preview effect of the first image part.

11. The method according to claim 1, characterized in that: The method further comprises: The pixel values ​​corresponding to the pixels in the initial preview image in the first preview image are adjusted so that the initial preview image presents a first image style in the first preview image.

12. The method according to claim 11, characterized in that The method further comprises: analyzing a first object style corresponding to the preview object based on the display image; The step of adjusting pixel values ​​corresponding to pixels in the initial preview image in the first preview image so that the initial preview image presents a first image style in the first preview image includes: Based on the first object style being aligned with the first image style, pixel values ​​corresponding to pixels in the initial preview image in the first preview image are adjusted so that the initial preview image presents the first image style in the first preview image.

13. The method according to claim 11, characterized in that The step of adjusting pixel values ​​corresponding to pixels in the initial preview image in the first preview image so that the initial preview image presents a first image style in the first preview image includes: Based on obtaining a style adjustment instruction input by an input party, pixel values ​​corresponding to pixels in the initial preview image in the first preview image are adjusted so that the initial preview image presents a first image style in the first preview image, and the style adjustment instruction is used to instruct to adjust the image style corresponding to the initial preview image to the first image style.

14. The method according to claim 1, characterized in that The preview object has a plurality of image display parts, the plurality of image display parts include the image display part, and the step of constructing a position correspondence relationship based on shape information corresponding to the image display part includes: Based on obtaining a part selection instruction input by an input party, a position correspondence is constructed according to shape information corresponding to the image display part, and the part selection instruction is used to select the image display part.

15. The method according to claim 1, characterized in that The method further comprises: Acquire an image capture instruction input by an input party, wherein the image capture instruction is used to represent a capture method of the initial preview image; Based on the image capture instruction, a basic image portion is captured from the initial preview image, where pixels included in the basic image portion are pixels included in the second image portion in the basic image; The basic image portion is added to the first image area to generate a second preview image corresponding to the preview object, and the second preview image is used to display the preview object after the second image portion is added to the image display part.

16. The method according to claim 1, characterized in that Adding the initial preview image in the first image area of ​​the display image to generate a first preview image corresponding to the preview object includes: Obtaining an object display ratio corresponding to the preview object in the display image; Scaling the initial preview image so that the image display ratio corresponding to the scaled initial preview image is consistent with the object display ratio; The initial preview image after scaling is added to the first image area in the display image to generate a first preview image corresponding to the preview object.

17. An image processing device, characterized in that: The device comprises a first acquisition unit, a construction unit, a first generation unit and a second generation unit: The first acquisition unit is used to acquire a basic image and a display image for displaying a preview object, the preview object has an image display part, and the basic image is composed of a plurality of pixels; The construction unit is used to construct a position correspondence relationship based on shape information corresponding to the image display part, wherein the shape information is used to characterize a three-dimensional shape of the image display part; The first generating unit is used to generate an initial preview image based on the position correspondence relationship and pixel positions corresponding to the plurality of pixels in the basic image, the initial preview image being used to preview a preview effect corresponding to the basic image when the basic image is displayed through the image display part, the initial preview image being composed of the plurality of pixels, a first pixel being any one of the plurality of pixels, the first pixel corresponding to a first pixel position in the basic image, and corresponding to a second pixel position in the initial preview image, and the first pixel position and the second pixel position satisfying the position correspondence relationship; The second generating unit is used to add the initial preview image in the first image area in the display image to generate a first preview image corresponding to the preview object, the first preview image is used to display the preview object after the basic image is added to the image display part, and the first image area is used to display the image display part.

18. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute the image processing method according to any one of claims 1 to 16 according to the instructions in the computer program.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the image processing method according to any one of claims 1 to 16.

20. A computer program product comprising a computer program, which, when executed on a computer device, enables the computer device to execute the image processing method according to any one of claims 1 to 16.