Image processing methods, apparatus, computer-readable storage media, and computer equipment

By acquiring the vertex offset intensity and transparency of the virtual model and combining it with trigonometric functions to generate a striped image, the problem of abruptness of the edge triangles of the virtual model is solved, achieving a realistic electronic interference effect while saving computational resources.

CN116188322BActive Publication Date: 2026-03-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In the game, when the number of vertices in the virtual model is insufficient, the edges of the virtual model will have an abrupt triangular shape, affecting the realism of the electronic interference effect.

Method used

By obtaining the offset intensity of each vertex in the virtual model, the offset region is determined, and combined with pixel transparency and trigonometric function processing, an image with a striped effect is generated, reducing the abruptness of the triangles in the offset region.

Benefits of technology

It achieves a realistic stretching and distortion effect on the virtual model under electronic interference, reduces the abruptness of the triangle, and reduces the consumption of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116188322B_ABST
    Figure CN116188322B_ABST
Patent Text Reader

Abstract

This application discloses an image processing method, apparatus, storage medium, and computer device. The method includes: the computer device acquiring the offset intensity corresponding to each vertex in a virtual model; determining a first image based on the offset intensity and the transparency of each pixel in the virtual model, and determining the offset region corresponding to the offset vertex of the virtual model in the first image; determining the display image corresponding to the virtual model when displayed on a screen, and performing image optimization processing on the display image to obtain a third image; and performing transparency processing on target pixels within the offset region based on the third image and the first image to obtain a target image of the virtual model. This reduces the abruptness of the triangles appearing within the offset region when achieving a distortion fault effect in the virtual model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to an image processing method and device, storage medium and computer equipment. BACKGROUND

[0002] In some scenarios, a virtual character in a game needs to realize certain special effect when being displayed on a display screen, such as the effect that a virtual model corresponding to the virtual character is distorted due to electronic interference.

[0003] In the related art, the virtual model is often rendered in real time to realize the special effect. When the number of vertices of the virtual model of the virtual character is insufficient, the edges of the virtual model will produce a triangular sense of abruptness. SUMMARY

[0004] Embodiments of the present application provide an image processing method and device, storage medium and computer equipment. The image processing method reduces or even eliminates the triangular sense of abruptness presented in the offset area of the virtual model.

[0005] In a first aspect, embodiments of the present application provide an image processing method, comprising:

[0006] obtaining offset intensities corresponding to each vertex in a virtual model;

[0007] determining a first image according to the offset intensities and the transparency of each pixel of the virtual model, and determining an offset area corresponding to the vertices of the virtual model that are offset in the first image;

[0008] determining a display image corresponding to the virtual model when displayed on a display screen, and performing image optimization processing on the display image to obtain a third image;

[0009] performing transparency processing on target pixels in the offset area according to the third image and the first image to obtain a target image of the virtual model.

[0010] In a second aspect, embodiments of the present application provide an image processing device, comprising:

[0011] an obtaining module configured to obtain offset intensities corresponding to each vertex in a virtual model;

[0012] a first determining module configured to determine a first image according to the offset intensities and the transparency of each pixel of the virtual model, and determine an offset area corresponding to the vertices of the virtual model that are offset in the first image;

[0013] a second determining module configured to determine a display image corresponding to the virtual model when displayed on a display screen, and perform image optimization processing on the display image to obtain a third image;

[0014] The processing module is configured to perform transparent processing on target pixels in the offset region according to the third image and the first image, to obtain a target image of the virtual model.

[0015] In a third aspect, a computer readable storage medium is provided, which stores a plurality of instructions. The instructions are adapted to be loaded into a processor to execute the image processing method provided in the embodiments of the present application.

[0016] In a fourth aspect, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the image processing method provided in the embodiments of the present application.

[0017] In the embodiments of the present application, the computer device obtains offset intensities corresponding to each vertex in the virtual model; determines a first image according to the offset intensities and the transparency of each pixel of the virtual model, and determines an offset region corresponding to the vertex of the virtual model in the first image; determines a display image corresponding to the virtual model when displayed on a display screen, and performs image optimization processing on the display image to obtain a third image; and performs transparent processing on target pixels in the offset region according to the third image and the first image, to obtain a target image of the virtual model. In the embodiments of the present application, the offset of the vertex is obtained to realize the effect of the distortion fault of the virtual model in the offset region, and the display image is further optimized so that part of the distorted fault region is transparent, thereby reducing the conspicuousness of the triangle in the offset region of the virtual model. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0019] Figure 1 is a first flowchart of the image processing method provided in the embodiments of the present application.

[0020] Figure 2 is a second flowchart of the image processing method provided in the embodiments of the present application.

[0021] Figure 3 is a first schematic diagram of the virtual model provided in the embodiments of the present application.

[0022] Figure 4 is a second schematic diagram of the virtual model provided in the embodiments of the present application.

[0023] Figure 5 is a third schematic view of a virtual model provided by an embodiment of the present application.

[0024] Figure 6 is a fourth schematic view of a virtual model provided by an embodiment of the present application.

[0025] Figure 7 is a structural schematic view of an image processing apparatus provided by an embodiment of the present application.

[0026] Figure 8 is a structural schematic view of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0028] In some scenarios, a virtual character in a game needs to realize certain special effect when the virtual character is displayed on a display screen, for example, a virtual model corresponding to the virtual character produces a distortion failure effect due to interference.

[0029] In the related art, real-time texture rendering is often performed on a virtual model to realize the above special effect. When the number of vertices of the virtual model of the virtual character is insufficient, the edges of the virtual model will produce a triangular sense of incongruity.

[0030] To solve the above technical problem, an image processing method, device, storage medium and computer device are provided in the embodiments of the present application. The image processing method reduces the triangular sense of incongruity presented in the offset area of the virtual model.

[0031] Please refer to Figure 1 , Figure 1 is a first flowchart of an image processing method provided by an embodiment of the present application. The image processing method can include the following steps:

[0032] 110, obtaining an offset intensity corresponding to each vertex in the virtual model.

[0033] Please refer to Figure 3 , Figure 3 is a first schematic view of a virtual model provided by an embodiment of the present application.

[0034] The virtual model can be a tail model of a virtual character (for example, the virtual character can be a small panda with a shaking tail), and when the tail needs to be shaken in the game, the tail is subjected to electronic interference to generate a tail distortion effect in at least part of the tail. However, when the number of vertices that need to be offset in the tail model is small, real-time texture rendering often causes the edges of the tail to appear triangular, making the edges of the tail look more abrupt.

[0035] As shown in Figure 3 , the shape of the edge area is triangular because the number of vertices of the virtual model is small, and then the vertices are offset, causing the edge area of the tail to be triangular, thereby causing the overall tail to look more abrupt and not achieving the desired electronic interference effect.

[0036] For the effect of electronic interference, reference can be made to an old television. When the display screen of the old television is subjected to electronic interference, due to the arrangement of the pixels of the display screen, the screen will be distorted, and some areas of the screen will appear stretched in a striped manner.

[0037] To solve the above technical problems, in the embodiments of the present application, another way is adopted to realize the electronic interference of the virtual model, so as to realize the distortion and stretching effect of the virtual model.

[0038] In some embodiments, a plurality of vertices are provided in the virtual model, and when the shape corresponding to the virtual model needs to be offset, at least part of the vertices of the virtual model are offset to change the shape of at least part of the virtual model.

[0039] The computer device can obtain the offset strength of each vertex, such as the vertices of the virtual model being offset in the vertex shader. The computer device can obtain the offset strength of the vertices in the vertex shader.

[0040] When only part of the vertices in the virtual model are offset, the computer device can record the offset strength corresponding to each of the part of the vertices, and the offset strength of the vertices that do not need to be offset can be recorded as zero.

[0041] In some embodiments, an initial electronic interference can also be applied to the virtual model to realize the offset of at least part of the vertices of the virtual model and realize the distortion and failure effect of the virtual model subjected to electronic interference.

[0042] For example, a noise map can be used to take a vertex shader as the initial strength of vertex offset, and then multiplied by a control strength to realize the offset of the vertices, thereby obtaining the offset strength. The offset strength is used to stretch at least part of the vertices of the virtual model, so that the virtual model can present a distortion and stretching effect.

[0043] 120. The computer device determines the first image according to the offset strength and the transparency of each pixel of the virtual model, and determines an offset region corresponding to the vertex of the virtual model in the first image.

[0044] The offset region can be understood as follows: after the partial vertex of the virtual model is offset, the vertex will have a certain distance relative to the original vertex position, so that the pixel corresponding to each vertex is also offset, thereby generating an offset region. For example, Figure 3 As shown in the figure, when the tail of the virtual model swings, the partial vertex of the tail is offset, thereby generating a corresponding offset region, so as to realize the effect of stretching and twisting of the tail in the offset region.

[0045] In some embodiments, the computer device can set a corresponding transparency for each pixel of the virtual model in advance, such as setting the transparency value of each pixel to 1.

[0046] The computer device can determine the vertex corresponding to each pixel, and determine the offset strength of the vertex corresponding to each pixel as the offset strength corresponding to each pixel. Then, the first image is determined according to the offset strength corresponding to each pixel and the transparency of each pixel. The transparency of each pixel can be a preset transparency set in advance.

[0047] In this case, the offset strength corresponding to each pixel is the offset strength of the vertex corresponding to the pixel.

[0048] The computer device can pass the offset strength of the vertex to the pixel shader, and record the offset strength of the vertex through the pixel shader.

[0049] In some embodiments, the computer device can multiply the offset strength corresponding to each pixel by a first preset coefficient to obtain a first result; subtract the first result from the transparency of each pixel to obtain a second result; perform value processing on the second result according to a saturation function to obtain a target transparency corresponding to each pixel; and determine the first image according to the target transparency corresponding to each pixel.

[0050] In this case, the transparency calculation code is as follows:

[0051] float EdgeOpacity=Saturate(Now_Opacity–Offset*Offset*5.0f);

[0052] In this case, Now_Opacity is the current transparency of each pixel.

[0053] Offset is the offset intensity of the pixel, and the offset intensity is set by multiplying the offset intensity by the offset intensity, so as to reduce the range of the offset area.

[0054] Saturate is a saturation function, which clips the value between 0-1, for example, the result of clipping the value 1.2 is 1, and the result of clipping the value -0.2 is 0.

[0055] Where 5.0 is the first preset coefficient, and the first preset coefficient is set to make the value subtracted from the current transparency greater.

[0056] f can be understood as a marked numerical type, which is used by the pixel shader to identify the value, for example, after marking f, the pixel shader can understand that the value is a high-precision value.

[0057] EdgeOpacity can be understood as the transparency corresponding to each pixel in the virtual model.

[0058] The result corresponding to Offset*Offset*5.0f is the first result, and the result corresponding to Now_Opacity-Offset*Offset*5.0f is the second result.

[0059] As shown in the above code, the first result is obtained by multiplying the offset intensity by the offset intensity and then multiplying the first preset coefficient. Then the second result is obtained by subtracting the first result corresponding to each pixel from the current transparency of each pixel. Finally, the second result is clipped by the saturation function, such as clipping the second result in the value range of 0-1, so as to obtain the target transparency corresponding to each pixel. Finally, after setting the target transparency for each pixel, the first image is obtained.

[0060] Wherein, the offset intensity of some pixels of the virtual model is zero, and the transparency of these pixels is still the original transparency, as shown in the above transparency calculation code, when the offset intensity is zero, the first result is zero, and the second result is the current transparency. Since the current transparency is 1, the target transparency value of the pixel obtained by the saturation function to take the value of the second result is still 1.

[0061] 130, determine the display image corresponding to the virtual model when displayed on the display screen, and perform image optimization processing on the display image to obtain a third image.

[0062] In some embodiments, the computer device can set a plane coordinate system according to the display screen, obtain the display image in the plane coordinate system, perform gray processing on the display image to obtain a second image, and perform sharpening processing on the second image to obtain a third image.

[0063] In some embodiments, the virtual model needs to be displayed on a display screen, and the conventional display screen has a striped pixel arrangement when displaying, such as an RGB pixel arrangement. Therefore, the display image corresponding to the virtual model can be processed by simulating the striping generated by the display screen when receiving electronic interference. The display image corresponding to the virtual model can be an image displayed in the display screen after an initial electronic disturbance is set to the virtual model.

[0064] In some embodiments, the computer device can set a plane coordinate system according to the display screen, obtain the display image in the plane coordinate system, determine the longitudinal axis coordinate information of each pixel in the display image in the plane coordinate system, and operate the longitudinal axis coordinate information of each pixel in the display image according to a trigonometric function to obtain a second image.

[0065] For example, a plane coordinate system can be established according to the display screen. When the display screen is rectangular, the lower left corner of the display screen is the origin of the plane coordinate system, denoted as coordinate (0, 0). The upper right corner of the display screen is denoted as coordinate (1, 1).

[0066] Then, in the plane coordinate system, each pixel in the display image corresponding to the virtual model can be interpolated to obtain the coordinate information of each pixel in the display image, including the horizontal axis coordinate information and the longitudinal axis coordinate information.

[0067] In some embodiments, the computer device can determine the period, offset speed, and second preset coefficient of the trigonometric function, operate the longitudinal axis coordinate information of each pixel in the display image according to the trigonometric function and the period, offset speed, and second preset coefficient of the trigonometric function to obtain the first gray value of each pixel in the display image, and obtain the second image according to the first gray value of each pixel in the display image.

[0068] The specific calculation code of the second image is as follows:

[0069] float line_soft=sin(ScreenUV.y*200.0f+Time*20.0f)*0.5f+0.5f;

[0070] Wherein, line_soft can be understood as the gray value of each pixel in the entire second image.

[0071] Sin is the sine function in the trigonometric function.

[0072] ScreenUV.y is the longitudinal axis coordinate information corresponding to all pixels of the display image.

[0073] 200.0 is the period of the trigonometric function. 20.0 is the custom offset speed. Time is the time.

[0074] f can be understood as a marked numerical type, which is used for the identification of the numerical value by the pixel shader. For example, after marking f, the pixel shader can understand that the numerical value is a high-precision numerical value.

[0075] 0.5 is the second preset coefficient. By setting the second preset coefficient, the gray value of each pixel is normalized to the range of 0-1. For example, in the rectangular coordinate system, the peak value of the conventional trigonometric function is 1, and the trough value is -1. After setting the second preset coefficient, the peak value can be set to 1, and the trough value can be set to 0, so that all the first gray values of the pixels calculated by the trigonometric function are in the range of 0-1.

[0076] Since the line transition calculated by the trigonometric function is smooth, the transition of the gray values between the pixels in the obtained second image is also smooth. For example, the peak value of the trigonometric function is 1, and the trough value is 0. In the range of 0-1, the gray values between the pixels on a region of the virtual model are gradually transitioned, such as from black to gray, to light gray, and to white, presenting a smooth transition process, thereby obtaining the second image. When the gray value is 1, it is white, and when the gray value is 0, it is black.

[0077] Since the trigonometric function has multiple periods, each period corresponds to an interval on the vertical axis of the plane coordinate system. In each interval, there is a smooth transition of the gray values of the pixels. In the entire second image, the color transition process of the gray values from 1 to 0, from 0 to 1, and from 1 to 0 is displayed.

[0078] After obtaining the second image, the computer device can perform sharpening processing on the second image to obtain a third image.

[0079] In some embodiments, the transition of the gray values of the pixels of the entire image in the second image is relatively smooth, and cannot produce a striped image, so it is necessary to perform sharpening processing on the second image to obtain a striped third image. For example, in the third image, there are black and white regions distributed in the vertical direction, thereby forming a striped pattern, similar to a zebra pattern.

[0080] In some embodiments, the computer device can determine a gray value adjustment interval corresponding to the pixels of the second image; adjust the first gray value of each pixel in the second image by using the smooth step function and the gray value adjustment interval to obtain a second gray value of each pixel in the second image; and obtain a third image according to the second gray value of each pixel in the second image, the third image being a striped image.

[0081] The calculation code for the third image is as follows:

[0082] float line_hard = Smoothstep(0.5f, 1.0f, line_soft)

[0083] The line_hard can be understood as the second gray value of each pixel in the third image.

[0084] Smoothstep is a smooth step function. 0.5 and 1.0 are the gray value adjustment interval, that is, the first gray value of each pixel in the second image is adjusted to the interval of 0.5-1, so as to obtain the second gray value of each pixel.

[0085] After adjusting the first gray value of each pixel in the second image by the smooth step function, the second gray value corresponding to each pixel is obtained, and the third image is obtained by the second gray value corresponding to each pixel.

[0086] In the third image, the virtual model will present a striped pattern, for example, a black and white striped pattern in the vertical direction, and the transition between the black and white stripes is relatively direct, such as from black to white. There is no black transition to gray, and then the gray transitions to white.

[0087] It should be noted that the striped pattern in the third image can be applied to the subsequent transparency setting of the offset region. Thus, in the target image of the virtual model finally obtained, the virtual model will present a stretched and distorted effect of the striped pattern.

[0088] 140. The target pixels in the offset region are transparently processed according to the third image and the first image to obtain the target image of the virtual model.

[0089] As can be seen from the above, the first image contains the target transparency of each pixel of the virtual model, and then the striped pattern needs to be superimposed on the offset region to achieve the stretched striped effect. Therefore, the first image needs to be adjusted by the striped pattern in the third image.

[0090] In some embodiments, the second gray value of each pixel in the third image is multiplied by the corresponding offset intensity of each pixel in the third image to obtain a third result; the target transparency of each pixel in the first image is subtracted from the third result of the corresponding pixel in the third image to obtain a fourth result; the fourth result is processed according to the saturation function to obtain the final transparency corresponding to each pixel of the virtual model; and the target pixel is transparently processed according to the final transparency corresponding to the target image to obtain the target image of the virtual model.

[0091] The calculation code for the target image is as follows:

[0092] float final_opacity = Saturate(EdgeOpacity - line_hard * Offset)

[0093] The final_opacity can be understood as the final transparency of each pixel in the target image.

[0094] Saturate is a saturation function. This function clips the value between 0-1, such as clipping the value 1.2 to get the result 1, and clipping the value -0.2 to get the result 0.

[0095] f can be understood as a marked numerical type, which is used by the pixel shader to identify the value, such as marking f, which can be understood by the pixel shader as a high-precision value.

[0096] EdgeOpacity can be understood as the transparency corresponding to each pixel in the virtual model.

[0097] line_hard can be understood as the second gray value of each pixel in the third image.

[0098] Offset is the offset intensity of the pixel.

[0099] The result of line_hard * Offset is the third result, and the result of EdgeOpacity - line_hard * Offset is the fourth result.

[0100] It should be noted that each pixel of the virtual model has a corresponding pixel in the third image. It can also be understood that the pixels of the virtual model and the pixels in the third image are the same, such as position, quantity, and offset intensity.

[0101] It can be understood that the second gray value of each pixel in the third image is multiplied by the corresponding offset intensity of each pixel in the third image to obtain the third result. If the offset intensity of some pixels in the third image is zero, then the third result is zero. The target transparency of these pixels is 1, then the target transparency of these pixels in the first image is reduced by the third result of the corresponding pixels in the third image, and the fourth result is 1. After the saturation function is taken on the fourth result, the final transparency of these pixels is also 1. That is, the stripe pattern in the third image will not affect the area without offset.

[0102] If the pixel to be processed in the above code is a target pixel in the offset region, the final transparency obtained is different from the target transparency of the target pixel.

[0103] For example, in the same stripe region of the stripe pattern corresponding to the third image, such as a white stripe region, the stronger the offset strength of the target pixel, the lower the transparency value of the target pixel, and the more transparent the target pixel corresponds to.

[0104] For example, in different stripe regions, two target pixels with the same offset strength have different second gray values corresponding to each target pixel, and the final transparency of the two target pixels obtained is different. In the target image of the virtual model, a stripe-shaped transparency effect is formed in the offset region. That is, the lower the offset strength of the target pixel, the more obvious the stripe effect.

[0105] It can be understood that by setting the corresponding transparency for pixels with different offset strengths, the display of the triangle region with strong offset and not meeting the offset requirement can be avoided on the display screen, which can reduce the sense of strangeness of the triangle region. The normally offset pixel has a non-zero transparency and can be normally displayed, thereby forming the stretching effect of the virtual model under the electronic disturbance.

[0106] When the virtual model is displayed on the display screen, the above method forms the interference effect of the virtual model, thereby forming the stretching and stripe-shaped electronic disturbance. Meanwhile, the pixels corresponding to the offset vertices of the virtual model can be made transparent to eliminate the sense of strangeness of the triangle presented by the triangle face.

[0107] It should be noted that the target image can be understood as an image generated by the final electronic disturbance. The image does not have the stretching texture generated by the offset of the vertices of the virtual model relative to the display image generated directly according to the initial electronic disturbance, thereby having a more realistic electronic disturbance effect, that is, the stretching and distortion effect of the virtual model under the electronic disturbance interference.

[0108] Meanwhile, by using the image processing method in the embodiment of the present application, the electronic interference effect of the virtual model generated can have a lower consumption relative to real-time texture rendering, thereby saving the computing energy consumption of the computer device.

[0109] In the embodiment of the present application, the computer device obtains the offset intensity corresponding to each vertex in the virtual model; determines the first image according to the offset intensity and the transparency of each pixel of the virtual model, and determines the offset region corresponding to the offset vertex of the virtual model in the first image; determines the display image corresponding to the virtual model when displayed on the display screen, and performs image optimization processing on the display image to obtain the third image; and performs transparency processing on the target pixel in the offset region according to the third image and the first image, to obtain the target image of the virtual model. In the embodiment of the present application, the offset of the vertex is obtained to realize the effect of the distortion fault of the virtual model in the offset region, and the display image is further optimized, so that the part of the distorted fault region is transparent, thereby reducing the conspicuousness of the triangle presented in the offset region of the virtual model.

[0110] Please refer to Figure 2 , Figure 2 FIG. 2 is a second flowchart of the image processing method provided by the embodiment of the present application. The image processing method can include the following steps:

[0111] 201. Obtain the offset intensity corresponding to each vertex in the virtual model.

[0112] In some embodiments, a plurality of vertices are provided in the virtual model, and when the shape corresponding to the virtual model needs to be offset, at least part of the vertices of the virtual model are offset to change the shape of at least part of the virtual model.

[0113] The computer device can obtain the offset intensity of each vertex, for example, the vertices of the virtual model are offset in the vertex shader, and the computer device can obtain the offset intensity of the vertices in the vertex shader.

[0114] When only part of the vertices in the virtual model are offset, the computer device can record the offset intensity corresponding to each of the part of the vertices, and the offset intensity of the vertices that do not offset can be recorded as zero.

[0115] 202. Determine the vertex corresponding to each pixel, and determine the offset intensity of the vertex corresponding to each pixel as the offset intensity corresponding to each pixel.

[0116] For example, one vertex corresponds to a plurality of pixels, and the offset intensity corresponding to each of the plurality of pixels is the offset intensity of the vertex.

[0117] The computer device can pass the offset intensity of the vertex to the pixel shader, and record the offset intensity of the vertex and the offset intensity of the vertex corresponding to each pixel through the pixel shader.

[0118] 203、determining the first image according to the offset intensity corresponding to each pixel and the transparency of each pixel.

[0119] In some embodiments, the computer device can set a corresponding transparency for each pixel of the virtual model in advance, such as setting the transparency value of each pixel to 1.

[0120] In some embodiments, the computer device can multiply the offset intensity corresponding to each pixel by a first preset coefficient to obtain a first result; subtract the first result from the transparency of each pixel to obtain a second result; perform value processing on the second result according to a saturation function to obtain a target transparency corresponding to each pixel; and determine the first image according to the target transparency corresponding to each pixel.

[0121] In some embodiments, the computer device can multiply the offset intensity corresponding to each pixel by a first preset coefficient to obtain a first result; subtract the first result from the transparency of each pixel to obtain a second result; perform value processing on the second result according to a saturation function to obtain a target transparency corresponding to each pixel; and determine the first image according to the target transparency corresponding to each pixel.

[0122] float EdgeOpacity=Saturate(Now_Opacity–Offset*Offset*5.0f);

[0123] In some embodiments, the computer device can multiply the offset intensity corresponding to each pixel by a first preset coefficient to obtain a first result; subtract the first result from the transparency of each pixel to obtain a second result; perform value processing on the second result according to a saturation function to obtain a target transparency corresponding to each pixel; and determine the first image according to the target transparency corresponding to each pixel.

[0124] offset is the offset intensity of the pixel, and the offset intensity is multiplied by the offset intensity to reduce the range of the offset area.

[0125] Saturate is a saturation function that clips values between 0 and 1, such as clipping the value 1.2 to obtain the result 1, or clipping the value -0.2 to obtain the result 0.

[0126] 5.0 is the first preset coefficient, and the first preset coefficient is set to make the value subtracted from the current transparency larger.

[0127] f can be understood as a marked numerical type for the identification of the numerical value by the pixel shader, such as marking f, and the pixel shader can understand that the numerical value is a high-precision numerical value.

[0128] EdgeOpacity can be understood as the transparency corresponding to each pixel of the virtual model.

[0129] The result corresponding to Offset*Offset*5.0f is the first result, and the result corresponding to Now_Opacity–Offset*Offset*5.0f is the second result.

[0130] As shown in the above code, the first result is obtained by multiplying the offset intensity by the offset intensity, and then multiplying the first preset coefficient. Then the second result is obtained by subtracting the first result corresponding to each pixel from the current transparency of each pixel. Finally, the target transparency corresponding to each pixel is obtained by clipping the second result by the saturation function, such as clipping the second result in the value range of 0-1. Finally, the target transparency of each pixel is set, and the first image is obtained.

[0131] As shown in the above code, the first result is obtained by multiplying the offset intensity by the offset intensity, and then multiplying the first preset coefficient. Then the second result is obtained by subtracting the first result corresponding to each pixel from the current transparency of each pixel. Finally, the target transparency corresponding to each pixel is obtained by clipping the second result by the saturation function, such as clipping the second result in the value range of 0-1. Finally, the target transparency of each pixel is set, and the first image is obtained.

[0132] Please refer to Figure 4 , Figure 4 is a second schematic diagram of the virtual model provided by the embodiment of the present application.

[0133] Among them, Figure 4 The tail model in the tail image is a virtual model, and the tail image is a first image. The first image includes an offset region and a non-offset region. For example, the color of the offset region is white, and the color gradually changes from white to black in the gray region. The non-offset region is a black region. The target transparency of the pixels in the black region is 1, and the target transparency of the pixels in the white region is 0.

[0134] 204. Establish a plane coordinate system according to the display screen, and obtain the display image in the plane coordinate system.

[0135] For example, a plane coordinate system can be established according to the display screen. When the display screen is rectangular, the point at the lower left corner of the display screen is the origin of the plane coordinate system, denoted as coordinate (0, 0). The point at the upper right corner of the display screen is denoted as coordinate (1, 1).

[0136] 205. Determine the vertical axis coordinate information of each pixel in the display image in the plane coordinate system.

[0137] Then in the plane coordinate system, interpolation processing can be performed on each pixel in the display image corresponding to the virtual model, so as to obtain the coordinate information of each pixel in the display image, which includes horizontal axis coordinate information and vertical axis coordinate information.

[0138] 206. Perform operation on the vertical axis coordinate information of each pixel in the display image according to the trigonometric function, and obtain a second image.

[0139] In some embodiments, the computer device can determine a period of the trigonometric function, an offset speed, and a second preset coefficient; perform operation on the vertical axis coordinate information of each pixel in the display image according to the trigonometric function and the period of the trigonometric function, the offset speed, and the second preset coefficient, to obtain a first gray value of each pixel in the display image; and obtain a second image according to the first gray value of each pixel in the display image.

[0140] In some embodiments, the computer device can determine a period of the trigonometric function, an offset speed, and a second preset coefficient; perform operation on the vertical axis coordinate information of each pixel in the display image according to the trigonometric function and the period of the trigonometric function, the offset speed, and the second preset coefficient, to obtain a first gray value of each pixel in the display image; and obtain a second image according to the first gray value of each pixel in the display image.

[0141] float line_soft=sin(ScreenUV.y*200.0f+Time*20.0f)*0.5f+0.5f;

[0142] In some embodiments, the computer device can determine a period of the trigonometric function, an offset speed, and a second preset coefficient; perform operation on the vertical axis coordinate information of each pixel in the display image according to the trigonometric function and the period of the trigonometric function, the offset speed, and the second preset coefficient, to obtain a first gray value of each pixel in the display image; and obtain a second image according to the first gray value of each pixel in the display image.

[0143] Sin is a sine function in the trigonometric function.

[0144] ScreenUV.y is the vertical axis coordinate information corresponding to all pixels of the display image.

[0145] 200.0 is the period of the trigonometric function. 20.0 is the offset speed. Time is the time.

[0146] f can be understood as a marked numerical type, which is used for the identification of the numerical value by the pixel shader. For example, after marking f, the pixel shader can understand that the numerical value is a high-precision numerical value.

[0147] 0.5 is the second preset coefficient. By setting the second preset coefficient, the gray value of each pixel is normalized to the range of 0-1. For example, in the conventional trigonometric function, the value corresponding to the wave crest is 1 and the value corresponding to the wave trough is -1. After setting the second preset coefficient, the value corresponding to the wave crest can be set to 1 and the value corresponding to the wave trough can be set to 0, so that the first gray value of all pixels calculated by the trigonometric function is in the range of 0-1.

[0148] Since the line calculated by the trigonometric function is smoothly transitioned, the gray value transition between pixels in the obtained second image is also smoothly transitioned. For example, the value corresponding to the wave crest of the trigonometric function is 1 and the value corresponding to the wave trough is 0. In the range of 0-1, the gray value between pixels on a region of the virtual model is gradually transitioned, such as from black to gray, to light gray, to white, presenting a smooth transition process, thereby obtaining the second image. When the gray value is 1, it is white, and when the gray value is 0, it is black.

[0149] Since the trigonometric function has multiple periods, each period corresponds to an interval on the vertical axis of the plane coordinate system, and in each interval, there is a smooth transition of the pixel gray value. Therefore, in the entire second image, the color transition process from 1 to 0, from 0 to 1, and from 1 to 0 is displayed.

[0150] 207、Determine the gray value adjustment interval corresponding to the pixel of the second image.

[0151] Since the first gray value of all pixels in the second image is in the range of 0-1, the computer device can extract a smooth gradient value to one of the gray value adjustment intervals, so that the striped image in the third image is more clear and clear.

[0152] The gray value adjustment interval can be set to 0.5-1, and can also be customized according to actual needs.

[0153] 208, adjust the first gray value of each pixel in the second image by the smooth step function and the gray value adjustment interval, to obtain the second gray value of each pixel in the second image.

[0154] The calculation code for the third image is as follows:

[0155] float line_hard=Smoothstep(0.5f,1.0f,line_soft)

[0156] Where line_hard can be understood as the second gray value of each pixel in the entire third image.

[0157] Smoothstep is a smooth step function. 0.5 and 1.0 are the gray value adjustment interval, that is, the first gray value of each pixel in the second image is adjusted to the interval of 0.5-1, so as to obtain the second gray value of each pixel.

[0158] After adjusting the first gray value of each pixel in the second image by the smooth step function, the second gray value corresponding to each pixel is obtained.

[0159] 209, according to the second gray value of each pixel in the second image, obtain the third image, the third image is a striped image.

[0160] In some embodiments, the computer device obtains the third image through the second gray value corresponding to each pixel.

[0161] In the third image, the virtual model presents a striped pattern, for example, a black and white striped pattern in the longitudinal direction, the transition between the black and white stripes is direct, such as from black to white. There is no black transition to gray, and then from gray to white.

[0162] It should be noted that the striped pattern in the third image can be applied to the subsequent transparency setting of the offset area. Thus, in the final target image of the virtual model, the virtual model presents a stretched and distorted effect of the striped pattern.

[0163] Please refer to Figure 5 , Figure 5 is a third schematic diagram of a virtual model provided by an embodiment of the present application.

[0164] Among them, the third image corresponding to the virtual model is a striped image, which contains black and white stripes, and the black and white stripes are arranged in intervals, thereby forming the third image.

[0165] 210. According to the third image and the first image, the target pixels in the offset area are transparently processed to obtain the target image of the virtual model.

[0166] From the above content, it can be seen that the first image contains the target transparency of each pixel of the virtual model, and then the striped pattern needs to be superimposed on the offset area to achieve the stretched striped effect. Therefore, the first image needs to be adjusted by the striped pattern in the third image.

[0167] In some embodiments, the second gray value of each pixel in the third image is multiplied by the corresponding offset intensity of each pixel in the third image to obtain a third result; the target transparency of each pixel in the first image is subtracted from the third result of the corresponding pixel in the third image to obtain a fourth result; the fourth result is processed according to the saturation function to obtain the final transparency of each pixel of the virtual model; the target pixel is transparently processed according to the final transparency of the target image to obtain the target image of the virtual model.

[0168] Among them, the calculation code for the target image is as follows:

[0169] float final_opacity=Saturate(EdgeOpacity-line_hard*Offset)

[0170] Among them, final_opacity can be understood as the final transparency of each pixel in the target image.

[0171] Saturate is a saturate function. The function clamps the value between 0-1, such as clamping the value 1.2 to get the result 1, and clamping the value -0.2 to get the result 0.

[0172] f can be understood as a marked numerical type, which is used by the pixel shader to identify the numerical value, such as marking f, the pixel shader can understand that the numerical value is a high-precision numerical value.

[0173] EdgeOpacity can be understood as the transparency corresponding to each pixel in the virtual model.

[0174] line_hard can be understood as the second gray value of each pixel in the third image.

[0175] Offset is the offset intensity of the pixel.

[0176] The result corresponding to line_hard*Offset is the third result, and the result corresponding to EdgeOpacity-line_hard*Offset is the fourth result.

[0177] It should be noted that each pixel of the virtual model has a corresponding pixel in the third image. It can also be understood that the pixels of the virtual model and the pixels in the third image are the same, such as position, quantity, and offset intensity.

[0178] It can be understood that the second gray value of each pixel in the third image is multiplied by the corresponding offset intensity of each pixel in the third image to obtain the third result. If the offset intensity of some pixels in the third image is zero, then the third result is zero. The target transparency of these pixels is 1, then the target transparency of these pixels in the first image is subtracted from the third result of the corresponding pixels in the third image, and the fourth result is 1. After the saturation function is taken on the fourth result, the final transparency of these pixels is also 1. That is, the stripe pattern in the third image will not affect the area without offset.

[0179] If the pixel to be processed by the above code is a target pixel in the offset area, the final transparency obtained is different from the target transparency of the target pixel.

[0180] For example, in the same stripe area of the stripe pattern corresponding to the third image, such as a white stripe area, the stronger the offset intensity of the target pixel, the lower the transparency value of the target pixel, and the more transparent the target pixel corresponds.

[0181] For example, in different stripe regions, two target pixels with the same offset strength have different second gray values corresponding to each target pixel, and the final transparency of the two target pixels is also different. In the target image of the virtual model, a stripe-shaped transparency effect is formed in the offset region. That is, the lower the offset strength of the target pixel, the more obvious the stripe effect.

[0182] When the virtual model is displayed on the display screen, the interference effect of the virtual model is formed by the above method, thereby forming a stretched and stripe-shaped electronic disturbance. At the same time, the pixels corresponding to the offset vertices of the virtual model can be made transparent to eliminate the abruptness of the triangular faces.

[0183] At the same time, the electronic interference effect of the virtual model generated by the image processing method in the embodiment of the present application can have lower consumption than real-time texture rendering, thereby saving the computing energy consumption of the computer device.

[0184] Please refer to Figure 6 , Figure 6 is a fourth schematic view of the virtual model provided by the embodiment of the present application.

[0185] In the image processing method provided by the present application, the virtual model has no regular shape of triangle and no abruptness of triangle in the offset region during display, and there are multiple lines in the offset region, so that the virtual model has a stretched and stripe-shaped feeling generated after being disturbed by the electronic interference.

[0186] In the embodiment of the present application, the computer device obtains the offset strength corresponding to each vertex in the virtual model; determines the vertex corresponding to each pixel, and determines the offset strength of the vertex corresponding to each pixel as the offset strength corresponding to each pixel; and determines the first image according to the offset strength corresponding to each pixel and the transparency of each pixel.

[0187] Then, the planar coordinate system is set according to the display screen, the display image is obtained in the planar coordinate system, the longitudinal axis coordinate information of each pixel in the display image in the planar coordinate system is determined, and the longitudinal axis coordinate information of each pixel in the display image is operated according to the trigonometric function to obtain the second image.

[0188] Finally, a gray value adjustment interval corresponding to pixels of the second image is determined; a first gray value of each pixel in the second image is adjusted by a smoothing step function and the gray value adjustment interval to obtain a second gray value of each pixel in the second image; a third image is obtained according to the second gray value of each pixel in the second image, and the third image is a stripe image; and a target pixel in the offset region is transparently processed according to the third image and the first image to obtain a target image of the virtual model. Thus, the conspicuousness of a triangle presented in the offset region of the virtual model is reduced.

[0189] Please continue to refer to Figure 7 , Figure 7 is a structural schematic diagram of an image processing apparatus provided by an embodiment of the present application. The image processing apparatus 300 can include:

[0190] The acquisition module 310 is configured to acquire an offset intensity corresponding to each vertex in the virtual model.

[0191] The first determination module 320 is configured to determine a first image according to the offset intensity and a transparency of each pixel in the virtual model, and determine an offset region corresponding to a vertex of the virtual model in which an offset occurs in the first image.

[0192] The second determination module 330 is configured to determine a display image corresponding to the virtual model when displayed on a display screen, and perform image optimization processing on the display image to obtain a third image.

[0193] The processing module 340 is configured to transparently process a target pixel in the offset region according to the third image and the first image to obtain a target image of the virtual model.

[0194] In some embodiments, the first determination module 320 is further configured to determine a vertex corresponding to each pixel, and determine the offset intensity of the vertex corresponding to each pixel as the offset intensity corresponding to each pixel.

[0195] The first image is determined according to the offset intensity corresponding to each pixel and the transparency of each pixel.

[0196] The first determination module 320 is further configured to multiply the offset intensity corresponding to each pixel by a first preset coefficient to obtain a first result.

[0197] The transparency of each pixel is subtracted by the first result to obtain a second result.

[0198] The second result is processed by a saturation function to obtain a target transparency corresponding to each pixel.

[0199] The first image is determined according to the target transparency corresponding to each pixel.

[0200] The first determining module 320 is further configured to determine, in the first image, a target pixel having a target transparency different from a preset transparency.

[0201] The region in which the target pixel is located in the first image is determined as the offset region.

[0202] In some embodiments, the second determining module 330 is further configured to set a planar coordinate system according to the display screen, and acquire the display image in the planar coordinate system.

[0203] The display image is subjected to grayscale processing to obtain a second image.

[0204] The second image is subjected to sharpening processing to obtain a third image.

[0205] In some embodiments, the second determining module 330 is further configured to determine longitudinal axis coordinate information of each pixel in the display image in the planar coordinate system.

[0206] The longitudinal axis coordinate information of each pixel in the display image is subjected to operation according to a trigonometric function to obtain the second image.

[0207] The second determining module 330 is further configured to determine a period, an offset speed and a second preset coefficient of the trigonometric function.

[0208] The longitudinal axis coordinate information of each pixel in the display image is subjected to operation according to the trigonometric function and the period, the offset speed and the second preset coefficient of the trigonometric function to obtain a first grayscale value of each pixel in the display image.

[0209] The second image is obtained according to the first grayscale value of each pixel in the display image.

[0210] In some embodiments, the second determining module 330 is further configured to determine a grayscale value adjustment interval corresponding to each pixel of the second image.

[0211] The first grayscale value of each pixel in the second image is adjusted by a smoothing step function and the grayscale value adjustment interval to obtain a second grayscale value of each pixel in the second image.

[0212] The third image is obtained according to the second grayscale value of each pixel in the second image, and the third image is a stripe image.

[0213] In some embodiments, the processing module 340 is further configured to multiply the second grayscale value of each pixel in the third image by a corresponding offset intensity of each pixel in the third image to obtain a third result.

[0214] The target transparency of each pixel in the first image is subtracted by the third result of the corresponding pixel in the third image to obtain a fourth result.

[0215] The fourth result is processed according to the saturation function to obtain the final transparency of each pixel of the virtual model.

[0216] Based on the final transparency of the target image, the target pixels are made transparent to obtain the target image of the virtual model.

[0217] In this embodiment, the image processing device acquires the offset intensity corresponding to each vertex in the virtual model; determines a first image based on the offset intensity and the transparency of each pixel in the virtual model, and determines the offset region corresponding to the vertex in the first image where the virtual model is offset; determines the display image corresponding to the virtual model when it is displayed on the screen, and performs image optimization processing on the display image to obtain a third image; and performs transparency processing on the target pixels in the offset region based on the third image and the first image to obtain the target image of the virtual model. In this embodiment, the offset of the vertices is acquired to achieve the effect of distortion faults in the offset region of the virtual model. At the same time, by further optimizing the display image, some areas of distortion faults are made transparent, thereby reducing the abruptness of the triangles presented in the offset region of the virtual model.

[0218] Accordingly, this application also provides a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 400 includes a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 and the memory 402 are electrically connected. Those skilled in the art will understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0219] The processor 401 is the control center of the computer device 400. It connects various parts of the computer device 400 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it performs various functions of the computer device 400 and processes data, thereby monitoring the computer device 400 as a whole.

[0220] In the embodiments of the present application, the processor 401 in the computer device 400 loads the instructions corresponding to the processes of one or more application programs into the memory 402 and runs the application programs stored in the memory 402 by the processor 401 to implement various functions according to the following steps:

[0221] obtain the offset strength corresponding to each vertex in the virtual model;

[0222] determine the first image according to the offset strength and the transparency of each pixel of the virtual model, and determine the offset region corresponding to the vertices of the virtual model in the first image;

[0223] determine the display image corresponding to the virtual model when displayed on the display screen, and perform image optimization processing on the display image to obtain the third image;

[0224] perform transparency processing on the target pixel in the offset region according to the third image and the first image to obtain the target image of the virtual model.

[0225] The processor 401 is further configured to perform:

[0226] determine the vertex corresponding to each pixel, and determine the offset strength of the vertex corresponding to each pixel as the offset strength corresponding to each pixel;

[0227] determine the first image according to the offset strength corresponding to each pixel and the transparency of each pixel.

[0228] The processor 401 is further configured to perform:

[0229] multiply the offset strength corresponding to each pixel by a first preset coefficient to obtain a first result;

[0230] subtract the first result from the transparency of each pixel to obtain a second result;

[0231] perform value processing on the second result according to a saturation function to obtain the target transparency corresponding to each pixel;

[0232] determine the first image according to the target transparency corresponding to each pixel.

[0233] The processor 401 is further configured to perform:

[0234] determine the target pixel in the first image whose target transparency is different from a preset transparency;

[0235] determine the region in which the target pixel is located in the first image as the offset region.

[0236] The processor 401 is further configured to perform:

[0237] A plane coordinate system is set according to the display screen, and the display image is acquired in the plane coordinate system;

[0238] The display image is subjected to gray scale processing to obtain a second image;

[0239] The second image is subjected to sharpening processing to obtain a third image.

[0240] The processor 401 is further configured to perform:

[0241] Determine the longitudinal axis coordinate information of each pixel in the display image in the plane coordinate system;

[0242] According to the trigonometric function, the longitudinal axis coordinate information of each pixel in the display image is operated to obtain a second image.

[0243] The processor 401 is further configured to perform:

[0244] Determine the period, offset speed and second preset coefficient of the trigonometric function;

[0245] According to the trigonometric function and the period, offset speed and second preset coefficient of the trigonometric function, the longitudinal axis coordinate information of each pixel in the display image is operated to obtain the first gray scale value of each pixel in the display image;

[0246] According to the first gray scale value of each pixel in the display image, a second image is obtained.

[0247] The processor 401 is further configured to perform:

[0248] Determine the gray scale value adjustment interval corresponding to the pixels of the second image;

[0249] Adjust the first gray scale value of each pixel in the second image through the smooth step function and the gray scale value adjustment interval to obtain the second gray scale value of each pixel in the second image;

[0250] According to the second gray scale value of each pixel in the second image, a third image is obtained, and the third image is a striped image.

[0251] The processor 401 is further configured to perform:

[0252] Multiply the second gray scale value of each pixel in the third image by the corresponding offset intensity of each pixel in the third image to obtain a third result;

[0253] Subtract the third result of the corresponding pixel in the third image from the target transparency of each pixel in the first image to obtain a fourth result;

[0254] According to the saturation function, the fourth result is subjected to value processing to obtain the final transparency corresponding to each pixel of the virtual model;

[0255] According to the final transparency corresponding to the target image, the target pixel is transparently processed to obtain the target image of the virtual model.

[0256] In the embodiments of the present application, the computer device obtains the offset strength corresponding to each vertex in the virtual model; determines the first image according to the offset strength and the transparency of each pixel of the virtual model, and determines the offset region corresponding to the vertex of the virtual model in the first image; determines the display image corresponding to the virtual model when displayed on the display screen, and performs image optimization processing on the display image to obtain the third image; and performs transparent processing on the target pixel in the offset region according to the third image and the first image to obtain the target image of the virtual model. In the embodiments of the present application, the offset of the vertex is obtained to realize the effect of the distortion fault of the virtual model in the offset region, and the display image is further optimized to make part of the distorted fault region transparent, thereby reducing the conspicuousness of the triangle in the offset region of the virtual model.

[0257] The specific implementation of the above operations can refer to the foregoing embodiments, which will not be described here.

[0258] Optionally, as shown in Figure 8 The computer device 400 further includes a touch display screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected with the touch display screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407, respectively. Those skilled in the art can understand that the computer device structure shown in the Figure 8 The computer device structure shown in the embodiments of the present application does not constitute a limitation on the computer device, and can include more or fewer components than the diagram, or combine certain components, or different component arrangements.

[0259] The touch display screen 403 can be used to display a graphical user interface and receive operation instructions generated by user acting on the graphical user interface. The touch display screen 403 can include a display panel and a touch panel. The display panel can be used to display information input by the user or provided to the user and various graphical user interfaces of the computer device, which can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED) or the like. The touch panel can be used to collect touch operations (such as operations of the user using a finger, a stylus or any suitable object or accessory on or near the touch panel) of the user thereon or therearound, and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel can include two parts of a touch detection device and a touch controller. The touch detection device detects the touch position of the user and detects signals generated by the touch operation, and transmits the signals to the touch controller; the touch controller receives the touch information from the touch detection device, and converts it into touch coordinates, and then sends it to the processor 401, and can also receive commands from the processor 401 and execute them. The touch panel can cover the display panel, and when the touch panel detects a touch operation thereon or therearound, it transmits to the processor 401 to determine the type of the touch event, and then the processor 401 provides corresponding visual output on the display panel according to the type of the touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 403 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can realize the input and output functions as two independent components. That is, the touch display screen 403 can also realize the input function as part of the input unit 406.

[0260] The radio frequency circuit 404 can be used to transceive radio frequency signals to establish wireless communication with network devices or other computer devices, and transceive signals between network devices or other computer devices.

[0261] The audio circuit 405 can be used to provide an audio interface between the user and the computer device through the speaker and the microphone. The audio circuit 405 can convert the received audio data into an electrical signal and transmit it to the speaker, which converts it into a sound signal output. On the other hand, the microphone collects sound signals and converts them into electrical signals, which are received by the audio circuit 405 and converted into audio data. After the audio data is output by the processor 401, it is processed by the radio frequency circuit 404 to send to another computer device, for example, or output to the memory 402 for further processing. The audio circuit 405 can also include an earphone jack to provide communication between an external earphone and the computer device.

[0262] The input unit 406 can be configured to receive inputted digital, character information or user feature information (e.g. fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0263] The power supply 407 is configured to supply power to various components of the computer device 400. Optionally, the power supply 407 can be logically connected to the processor 401 through a power management system, so as to realize functions such as management of charging, discharging and power consumption management through the power management system. The power supply 407 can also include one or more direct current or alternating current power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, etc.

[0264] Although Figure 8 The computer device 400 can also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc. which are not shown in the embodiments and will not be described herein.

[0265] In the above embodiments, the description of each embodiment focuses on different aspects, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0266] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by related hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.

[0267] To this end, the embodiments of the present application provide a computer readable storage medium, which stores a plurality of computer programs capable of being loaded by a processor to execute the steps in any of the image processing methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:

[0268] Obtaining the offset intensity corresponding to each vertex of the virtual model respectively;

[0269] Determining a first image according to the offset intensity and the transparency of each pixel of the virtual model, and determining an offset region corresponding to the vertices of the virtual model in the first image;

[0270] Determining a display image corresponding to the virtual model when displayed on a display screen, and performing image optimization processing on the display image to obtain a third image;

[0271] Performing transparency processing on a target pixel in the offset region according to the third image and the first image, to obtain a target image of the virtual model.

[0272] The computer program is further configured to execute:

[0273] determine a vertex corresponding to each pixel, and determine an offset intensity of the vertex corresponding to each pixel as an offset intensity corresponding to each pixel;

[0274] determine the first image according to the offset intensity corresponding to each pixel and the transparency of each pixel.

[0275] The computer program is further used to execute:

[0276] multiply the offset intensity corresponding to each pixel by a first preset coefficient to obtain a first result;

[0277] subtract the first result from the transparency of each pixel to obtain a second result;

[0278] value-process the second result according to a saturation function to obtain a target transparency corresponding to each pixel;

[0279] determine the first image according to the target transparency corresponding to each pixel.

[0280] The computer program is further used to execute:

[0281] determine a target pixel in the first image, where the target transparency is different from a preset transparency;

[0282] determine a region in which the target pixel is located in the first image as an offset region.

[0283] The computer program is further used to execute:

[0284] acquire a display image in a planar coordinate system according to a display screen;

[0285] perform gray scale processing on the display image to obtain a second image;

[0286] perform sharpening processing on the second image to obtain a third image.

[0287] The computer program is further used to execute:

[0288] determine longitudinal axis coordinate information of each pixel in the display image in the planar coordinate system;

[0289] perform operation on the longitudinal axis coordinate information of each pixel in the display image according to a trigonometric function to obtain the second image.

[0290] The computer program is further used to execute:

[0291] determine a period, an offset speed and a second preset coefficient of the trigonometric function;

[0292] According to the trigonometric function, the period of the trigonometric function, the offset speed, and the second preset coefficient, the vertical axis coordinate information of each pixel in the display image is operated to obtain a first gray value of each pixel in the display image;

[0293] According to the first gray value of each pixel in the display image, a second image is obtained.

[0294] The computer program is further used to execute:

[0295] Determine a gray value adjustment interval corresponding to a pixel of the second image;

[0296] Adjust the first gray value of each pixel in the second image through the smooth step function and the gray value adjustment interval to obtain a second gray value of each pixel in the second image;

[0297] According to the second gray value of each pixel in the second image, a third image is obtained, and the third image is a stripe image.

[0298] The computer program is further used to execute:

[0299] Multiply the second gray value of each pixel in the third image by the corresponding offset intensity of each pixel in the third image to obtain a third result;

[0300] Subtract the third result of the corresponding pixel in the third image from the target transparency of each pixel in the first image to obtain a fourth result;

[0301] According to the saturation function, the fourth result is processed to obtain a final transparency corresponding to each pixel of the virtual model;

[0302] According to the final transparency corresponding to the target pixel, the target pixel is transparently processed to obtain a target image of the virtual model.

[0303] In the embodiments of the application, the computer device obtains the offset intensity corresponding to each vertex of the virtual model; determines the first image according to the offset intensity and the transparency of each pixel of the virtual model, and determines the offset region corresponding to the vertex of the virtual model in the first image; determines the display image corresponding to the virtual model when displayed on the display screen, and performs image optimization processing on the display image to obtain the third image; and performs transparent processing on the target pixel in the offset region according to the third image and the first image to obtain the target image of the virtual model. In the embodiments of the application, the offset of the vertex is obtained to realize the effect of the distortion fault of the virtual model in the offset region, and the display image is further optimized to make part of the distorted fault region transparent, thereby reducing the conspicuousness of the triangle in the offset region of the virtual model.

[0304] The specific implementation of the above operations can refer to the foregoing embodiments, which will not be described here again.

[0305] The storage medium can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, or the like.

[0306] Due to the computer program stored in the storage medium, the steps of any of the image processing methods provided in the embodiments of the present application can be executed, and thus the beneficial effects of any of the image processing methods provided in the embodiments of the present application can be achieved. Details are described in the foregoing embodiments, which will not be described here again.

[0307] The foregoing describes in detail the image processing method, device, storage medium, and computer device provided in the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples in this paper. The foregoing description of the embodiments is only used to help understand the method and core idea of the present application; meanwhile, for those skilled in the art, the specific implementation manners and application ranges will be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. An image processing method, characterized by, The method comprises the following steps: obtaining the offset intensity corresponding to each vertex in the virtual model; determining the vertex corresponding to each pixel of the virtual model, and determining the offset intensity of the vertex corresponding to each pixel as the offset intensity corresponding to each pixel; multiplying the offset intensity corresponding to each pixel by a first preset coefficient to obtain a first result; subtracting the first result from the transparency of each pixel to obtain a second result; processing the second result according to a saturation function to obtain the target transparency corresponding to each pixel; determining a first image according to the target transparency corresponding to each pixel; determining a target pixel with a target transparency different from a preset transparency in the first image; determining a region in which the target pixel is located in the first image as an offset region corresponding to the vertex of the virtual model that has been offset; determining a display image corresponding to the virtual model when displayed on a display screen, and performing image optimization processing on the display image to obtain a third image; performing transparency processing on the target pixel in the offset region according to the third image and the first image to obtain a target image of the virtual model.

2. The image processing method of claim 1, wherein, The method of determining a display image corresponding to the virtual model when displayed on a display screen, and performing image optimization processing on the display image to obtain a third image comprises the following steps: setting a plane coordinate system according to the display screen, and obtaining the display image in the plane coordinate system; performing grayscale processing on the display image to obtain a second image; performing sharpening processing on the second image to obtain a third image.

3. The image processing method of claim 2, wherein, The method of performing grayscale processing on the display image to obtain a second image comprises the following steps: determining the longitudinal axis coordinate information of each pixel in the display image in the plane coordinate system; performing operation on the longitudinal axis coordinate information of each pixel in the display image according to a trigonometric function to obtain the second image.

4. The image processing method of claim 3, wherein, The method of performing operation on the longitudinal axis coordinate information of each pixel in the display image according to a trigonometric function to obtain the second image comprises the following steps: determining the period, offset speed and second preset coefficient of the trigonometric function; performing operation on the longitudinal axis coordinate information of each pixel in the display image according to the trigonometric function and the period, offset speed and second preset coefficient of the trigonometric function to obtain the first grayscale value of each pixel in the display image; obtaining the second image according to the first grayscale value of each pixel in the display image.

5. The image processing method of claim 4, wherein, The method of performing sharpening processing on the second image to obtain a third image comprises the following steps: determining the grayscale value adjustment interval corresponding to the pixel of the second image; adjusting the first grayscale value of each pixel in the second image by a smooth step function and the grayscale value adjustment interval to obtain the second grayscale value of each pixel in the second image; obtaining the third image according to the second grayscale value of each pixel in the second image, wherein the third image is a striped image.

6. The image processing method of claim 5, wherein, The method of performing transparency processing on the target pixel in the offset region according to the third image and the first image to obtain a target image of the virtual model comprises the following steps: multiplying the second gray value of each pixel in the third image by the corresponding offset intensity of each pixel in the third image to obtain a third result; subtracting the third result of the corresponding pixel in the third image from the target transparency of each pixel in the first image to obtain a fourth result; performing value processing on the fourth result according to a saturation function to obtain the final transparency corresponding to each pixel of the virtual model; performing transparency processing on the target pixel according to the final transparency corresponding to the target pixel to obtain a target image of the virtual model.

7. An image processing apparatus characterized by comprising: The method comprises the following steps: an acquisition module is configured to acquire offset intensities corresponding to respective vertices of a virtual model; a first determination module is configured to determine vertices corresponding to each pixel of the virtual model, and determine the offset intensity of the vertices corresponding to each pixel as the offset intensity corresponding to each pixel; multiplying the offset intensity corresponding to each pixel by a first preset coefficient to obtain a first result; subtracting the first result from the transparency of each pixel to obtain a second result; performing value processing on the second result according to a saturation function to obtain a target transparency corresponding to each pixel; determining a first image according to the target transparency corresponding to each pixel; and determining a target pixel with a target transparency different from a preset transparency in the first image; determining a region in which the target pixel is located in the first image as an offset region corresponding to the vertices of the virtual model that have been offset; a second determination module is configured to determine a display image corresponding to the virtual model when the virtual model is displayed on a display screen, and perform image optimization processing on the display image to obtain a third image; a processing module is configured to perform transparency processing on the target pixel in the offset region according to the third image and the first image to obtain a target image of the virtual model.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a plurality of instructions adapted to be loaded by a processor to execute the image processing method of any one of claims 1-6.

9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the image processing method of any one of claims 1-6. The processor executes the program to implement the image processing method of any one of claims 1-6.

Citation Information

Patent Citations

  • Virtual object wind animation rendering method and device, storage medium and electronic device

    CN112767522A

  • Graphic processing method and device in game

    CN113181639A