Image processing method and device, nonvolatile storage medium and computer equipment

The arc position is determined through the arc stripe generation algorithm and noise function and the pixel color is adjusted, which solves the problem of complex and inefficient generation of arc light and shadow effects, and achieves efficient generation and visual effect improvement.

CN120355804APending Publication Date: 2025-07-22CHINA TELECOM BESTPAY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510442123.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The prior art images that generate arc light and shadow effects rely on complex algorithms, resulting in complex and inefficient generation processes.

Method used

By acquiring the initial image, based on the preset arc stripe generation algorithm and noise function, the initial position and target position of the arc are determined, and the pixel color is adjusted to generate a target image that simulates the arc effect.

Benefits of technology

It improves the generation efficiency of arc effect images, simplifies the generation process, and enhances the realism and attractiveness of the visual effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355804A_ABST
    Figure CN120355804A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device, a nonvolatile storage medium and computer equipment. The method comprises the following steps: acquiring an initial image; determining an initial position of an electric arc in the initial image based on a preset electric arc stripe generation algorithm; generating an offset based on a preset noise function; determining a target position of the arc based on the offset and the initial position; the color of a pixel point at the target position of the arc in the initial image is adjusted, a target image is obtained, and the target image is the initial image with the simulated arc effect. According to the method, the technical problem that the generation process is relatively complex and relatively low in efficiency due to the fact that the current generation of the image with the arc shadow effect depends on a complex algorithm is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular, to an image processing method, apparatus, non-volatile storage medium, and computer device. Background Art

[0002] On the browser side, arc-shaped light and shadow effects are increasingly used in generating image effects on web pages, especially in enhancing user interaction experience and visual attraction. However, the current technology still faces many challenges. First, the performance limitations on the web page make it difficult to implement complex light and shadow effects, which may lead to image rendering delays and lags. Second, generating arc-shaped light and shadow effects usually relies on complex algorithms, which requires developers to have relatively high graphics knowledge, increasing the development difficulty and time cost.

[0003] In response to the above problems, no effective solution has been proposed yet. Summary of the Invention

[0004] Embodiments of the present invention provide an image processing method, apparatus, non-volatile storage medium, and computer device to at least solve the technical problem that the current generation of images with arc light and shadow effects depends on complex algorithms, resulting in a relatively complex and inefficient generation process.

[0005] According to one aspect of the embodiments of the present invention, an image processing method is provided, including: obtaining an initial image; determining an initial position of an arc in the initial image based on a preset arc stripe generation algorithm; generating an offset based on a preset noise function; determining a target position of the arc based on the offset and the initial position; and adjusting the color of pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is the initial image simulating the appearance of an arc effect.

[0006] Optionally, determining an initial position of an arc in the initial image based on a preset arc stripe generation algorithm includes: randomly determining a starting point and an ending point of the arc in the initial image within a preset range; determining an arc path according to the starting point and the ending point based on the arc stripe generation algorithm; receiving an arc width input based on a target account; and determining the initial position based on the arc width and the arc path.

[0007] Optionally, adjusting the color of pixel points at the target position of the arc in the initial image to obtain a target image includes: receiving a halo thickness input based on a target account; determining a position of a halo effect based on the halo thickness and the target position of the arc; and adjusting the color of pixel points at the target position of the arc and at the position of the halo effect in the initial image to obtain a target image.

[0008] Optionally, adjusting the color of the pixel points at the target position of the arc in the initial image to obtain a target image includes: adjusting the initial brightness values corresponding to multiple pixel points in the initial image to obtain the target brightness values corresponding to the multiple pixel points; adjusting the color of the pixel points at the target position of the arc in the initial image to obtain the target color of the pixel points at the target position of the arc; based on the initial image, superimposing the target brightness values corresponding to the multiple pixel points and the target color of the pixel points at the target position of the arc to obtain the target image.

[0009] Optionally, the above method further includes: obtaining an initial video, where the initial image is any frame image in the initial video; generating random values for multiple frames of images in the initial video; determining the images with random values exceeding a preset threshold as the first images; performing the operation of generating a target image to generate an arc effect in the first images to obtain target first images; obtaining a target video according to the target first images, where the target video is the initial video under the simulated dynamic arc effect.

[0010] Optionally, obtaining a target video according to the target first images includes: determining the images with random values not exceeding the preset threshold as the second images; reducing the brightness values corresponding to multiple pixel points in the second images to obtain target second images; obtaining a target video based on the target first images and the target second images.

[0011] According to another aspect of the embodiments of the present invention, there is also provided an image processing apparatus, including: an acquisition module, configured to acquire an initial image; a first determination module, configured to determine an initial position of an arc in the initial image based on a preset arc stripe generation algorithm; a generation module, configured to generate an offset based on a preset noise function; a second determination module, configured to determine a target position of the arc based on the offset and the initial position; an adjustment module, configured to adjust the color of the pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is the initial image simulating the appearance of an arc effect.

[0012] According to still another aspect of the embodiments of the present invention, there is also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, it controls the device where the non-volatile storage medium is located to execute any one of the above image processing methods.

[0013] According to yet another aspect of the embodiments of the present invention, there is also provided a computer device, where the computer device includes a processor, and the processor is used to run a program, and when the program runs, it executes any one of the above image processing methods.

[0014] According to yet another aspect of the embodiments of the present invention, there is also provided a computer program product, including a computer program, and when the computer program is executed by a processor, it implements any one of the above image processing methods.

[0015] In an embodiment of the present invention, an image processing method is adopted. By obtaining an initial image; based on a preset arc stripe generation algorithm, determining the initial position of the arc in the initial image; based on a preset noise function, generating an offset; based on the offset and the initial position, determining the target position of the arc; and adjusting the color of the pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is an initial image simulating the appearance of an arc effect, achieving the purpose of determining an image of an arc effect based on a noise function and an arc stripe generation algorithm, thereby realizing the technical effect of improving the generation efficiency of an image of an arc effect, and further solving the technical problem that the generation of an image of an arc light and shadow effect currently depends on a complex algorithm, resulting in a relatively complex and low-efficiency generation process. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:

[0017] Figure 1 Shows a hardware structure block diagram of a computer terminal for implementing an image processing method;

[0018] Figure 2 Is a flowchart of an image processing method provided according to an embodiment of the present invention;

[0019] Figure 3 Is a schematic diagram of an initial image and a target image in an image processing method provided according to an optional embodiment of the present invention;

[0020] Figure 4 Is a structure block diagram of an image processing device provided according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0021] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

[0022] It should be noted that the terms "first", "second", etc. in the description, claims and the above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0023] First, some nouns or terms that appear in the process of describing the embodiments of the present application are applicable to the following explanations:

[0024] According to an embodiment of the present invention, a method embodiment of an image processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0025] The method embodiment provided by the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 A hardware structure block diagram of a computer terminal for implementing the () method is shown. As Figure 1 shown, the computer terminal 10 may include one or more processors (processors may include, but are not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA, etc., shown as 102a, 102b,..., 102n in the figure) and a memory 104 for storing data. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may further include more or fewer components than Figure 1 shown, or have a configuration different from Figure 1 shown.

[0026] It should be noted that the above one or more processors and / or other data processing circuits can generally be referred to as "data processing circuits" herein. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any combination thereof. In addition, the data processing circuit can be a single independent processing module, or be incorporated in whole or in part into any one of other elements in the computer terminal 10. As involved in the embodiments of the present application, the data processing circuit is a kind of processor control (such as the selection of a variable resistance terminal path connected to an interface).

[0027] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image processing method in the embodiments of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the image processing method of the above application program. The memory 104 can include high-speed random access memory, and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 can further include a memory remotely disposed relative to the processor, and these remote memories can be connected to the computer terminal 10 through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network and combinations thereof.

[0028] The display can be, for example, a touch-screen liquid crystal display (LCD), and the liquid crystal display enables a user to interact with the user interface of the computer terminal 10.

[0029] Figure 2 is a schematic flowchart of an image processing method provided according to an embodiment of the present invention, as Figure 2 shown, the method includes the following steps:

[0030] Step S202, obtain an initial image.

[0031] In this step, the obtained initial image is an image for which an arc effect is to be generated, and specifically, the user can determine the initial image.

[0032] Step S204, based on a preset arc stripe generation algorithm, determine the initial position of the arc in the initial image.

[0033] In this step, the initial position of the arc can be determined based on a preset arc stripe generation algorithm. The shape of the arc path can be defined first, such as a straight line, an S-shaped curve, a wavy line, etc. Then the starting point and the ending point of the path can be determined, which can be confirmed by the user or generated randomly. Then the current position of the arc can be calculated according to the starting point and the ending point of the arc path. For example, a time parameter (usually used as a uniform variable, such as u_time) can be used to control the dynamic changes of the arc, including position, direction, and shape. When calculating the arc position, a noise function (such as Perlin noise) can also be introduced to simulate the irregularities in nature. The noise function can generate random perturbations based on the coordinates of the segment and the time parameter, causing the shape of the arc to change slightly between each frame and increasing the realism. Using the arc position and the influence of the noise, call the arc stripe generation algorithm (such as the createArcStripes function) to determine the intensity and color of the arc at each pixel point. The arc stripe algorithm may include calculating the arc contour, intensity distribution, and halo effect.

[0034] The initial position and path of the arc can be predefined by the developer during programming or can be dynamically changed through user interaction, such as adjusting the starting point and the ending point of the arc according to the mouse position or touch screen input. This flexibility enables the arc effect generation algorithm to adapt to a variety of application scenarios, from special effects in games to enhanced data visualization and then to visual elements in artistic creation.

[0035] Step S206: Generate an offset based on a preset noise function.

[0036] In this step, generating an offset based on a preset noise function is usually to introduce natural random changes in image processing or effect generation, simulating the textures and dynamics of the real world. Noise functions such as Perlin noise or Simplex noise can generate smooth and continuous random values, which are very suitable for controlling the offset and changes of images or effects. By using a noise function to generate an offset, the initial position of the arc can be adjusted to make it more random, and thus the generated arc effect is better.

[0037] For example, after determining the initial position, a noise function can be used to calculate a horizontal offset, which will change the position of the arc and make it have a more random effect.

[0038] The offset generated by the noise function can not only introduce natural randomness but also control its intensity and frequency through parameters, making image processing and effect generation more flexible and controllable. In the generation of arc-shaped light and shadow effects, the application of this offset greatly enhances the realism and visual appeal of the visual effect.

[0039] Step S208: Determine the target position of the arc based on the offset and the initial position.

[0040] In this step, when determining the target position of the arc based on the offset and the initial position, the fragment shader in the arc generation algorithm can use these two parameters to calculate the actual position of the arc on the screen, thus realizing the dynamic change and natural fluctuation of the arc.

[0041] In this way, the arc generation algorithm can dynamically calculate the target position of each fragment, including the offset that changes with time, thus realizing the natural fluctuation and dynamic change of the arc effect. The introduction of the offset makes the arc look more realistic visually and avoids the stiffness of the predefined path. At the same time, this method also allows developers to customize the appearance of the arc effect by adjusting the parameters of the noise function and the offset to meet the requirements of different application scenarios.

[0042] Step S210: Adjust the color of the pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is the initial image simulating the arc effect.

[0043] In this step, adjusting the color of the pixel points at the target position of the arc in the initial image in WebGL and GLSL to simulate the arc effect involves steps such as image sampling, color calculation, and blending. First, the base color baseColor of the current fragment in the initial image can be sampled through the texture2D(u_texture, uv) function. Using the calculateTargetPosition function, calculate the initial position of the arc according to the start point u_startPoint, end point u_endPoint, and current time u_time of the arc. Then, determine the offset based on the noise function to obtain the target position of the arc. The calculateArcColor function can calculate the intensity of the arc according to the distance between the fragment coordinates and the target arc position. Finally, the mix function is used to blend the initial image color and the arc color according to the arc intensity to generate the final fragment color finalColor, where the arc color can be preset or randomly generated.

[0044] This method can effectively simulate the effect of arc discharge in the initial image by combining the offset generated by the noise function and the dynamic position calculation of the arc, while avoiding using complex algorithms to generate the arc, improving the generation efficiency. Since the color and intensity of the arc are dynamically calculated based on the fragment coordinates and time in the fragment shader, this method can realize the flicker and fluctuation of the arc, increasing the realism and attractiveness of the visual effect. At the same time, by adjusting the start point, end point, thickness of the arc, and the parameters of the noise function, the appearance and dynamic characteristics of the arc can be flexibly customized to adapt to various application scenarios and visual requirements.

[0045] Figure 3It is a schematic diagram of the initial image and the target image in the image processing method provided by an alternative embodiment of the present invention. As Figure 3 shown, the upper left corner is the initial image, and the other three images are all initial images of the generated arc effect, that is, the target images.

[0046] Through the above steps, the purpose of determining the image of the arc effect based on the noise function and the arc stripe generation algorithm can be achieved, thereby realizing the technical effect of improving the generation efficiency of the arc effect image, and further solving the technical problem that the current generation of the image of the arc light and shadow effect depends on a complex algorithm, resulting in a relatively complex and low-efficiency generation process.

[0047] As an alternative embodiment, based on a preset arc stripe generation algorithm, determining the initial position of the arc in the initial image includes: randomly determining the starting point and the ending point of the arc in the initial image within a preset range; based on the arc stripe generation algorithm, determining the arc path according to the starting point and the ending point; receiving the arc width input based on the target account; and determining the initial position based on the arc width and the arc path.

[0048] Optionally, when creating an arc - type light and shadow effect, the starting point and ending point of the arc can be randomly determined within a preset range, an arc path can be generated, an arc width parameter can be received, and the specific area of the arc on the image can be determined. A preset range can be defined first, usually set based on the size of the image. For example, the arc may start at any corner of the image and end at another corner. The preset range can be a rectangular area or a more complex shape, depending on the desired effect. For example, the preset range corresponding to the starting point of the arc can be set on the upper edge of the initial image, and the preset range corresponding to the ending point of the arc can be set on the lower edge of the initial image. Within the preset range, the starting point and ending point of the arc are randomly selected. The random selection can be based on a uniform distribution or a more complex probability distribution to control the frequency or preferred direction of the arc appearance, adding variability and interest to the visual effect. Ensure that the starting point and ending point of the arc do not exceed the preset range to avoid unnecessary calculation or rendering errors. According to the starting point and ending point of the arc, an arc stripe generation algorithm is used to plan the arc path. This may include a simple linear path or more complex curves such as spline curves, Bezier curves, etc., to imitate the random fluctuations and complex shapes of natural arcs. The arc path can change over time. By introducing a time variable and a noise function, the arc path can be slightly different each time it is drawn, enhancing the dynamic effect and realism. The target account can be allowed to input the width of the arc through the user interface, which can be a slider or other type of input control, so that the user can intuitively adjust the thickness of the arc. The width of the arc input by the user is passed as a parameter to the rendering function. The width parameter can be used to control the boundary of the arc and the adjustment intensity of the pixel colors near the arc path. According to the arc width and path, the boundary area of the arc is determined, and thus the initial position of the arc can be determined. Among them, the arc path can change dynamically over time. By introducing a time variable and using techniques such as Perlin noise, the shape of the arc path can have slight changes at each time point, increasing the dynamic and vivid feeling of the visual effect.

[0049] As an alternative embodiment, adjusting the colors of the pixel points at the target position of the arc in the initial image to obtain a target image includes: receiving the halo thickness based on the input of the target account; determining the position of the halo effect based on the halo thickness and the target position of the arc; adjusting the colors of the pixel points at the target position of the arc and the position of the halo effect in the initial image to obtain the target image.

[0050] Optionally, the thickness of the halo can be received from the target user first. For example, a control can be provided for the user in the front-end interface, allowing them to input or select the thickness of the halo. This can be achieved through a slider, an input box, or a preset list, ensuring that the user can intuitively adjust the range of the arc halo. Then, according to the thickness of the halo input by the user, the range on both sides of the arc path is expanded to cover a wider pixel area, forming a halo effect. The shape of the halo can be smooth or have slight irregular fluctuations to mimic the halo shape of a real arc. For each pixel, it is determined whether it is located within the arc path or the halo range. This can be achieved by calculating the distance between the pixel and the arc path. If the distance is less than half of the arc width plus the halo thickness, the pixel is within the halo influence range. For the pixels on the arc path, their colors need to be adjusted to display the characteristics of the arc. This can be a high-brightness white, blue, or purple, and the specific color can be selected by the user or the designer. The superimposed intensity of the arc color can be dynamically adjusted according to the proximity of the pixel to the arc path, making the arc look more natural. The color of the pixels at the position of the halo effect should gradually change from the color of the arc center to the background color. The intensity and color of the gradient can be calculated based on the relative distance of the pixel from the arc path and the halo thickness, ensuring a smooth and natural transition of the halo effect. Within the arc and halo influence range, the brightness and saturation of the pixels can be further adjusted to enhance the visual effect. The brightness of the pixels near the arc can be increased, while the brightness of the pixels far from the arc is appropriately decreased to make the arc more prominent.

[0051] Among them, it can also be considered that the arc and the halo effect should be integrated with the underlying image texture. The texture of the underlying image can be sampled, and then the sampled color values can be adjusted according to the arc and the halo effect, ensuring that the arc effect is both prominent and does not lose the details of the background.

[0052] Through these steps, the user or the designer is allowed to adjust the color, width of the arc, and the thickness and range of the halo according to specific requirements, and finally generate the target image, greatly improving the flexibility of generating the arc image.

[0053] As an alternative embodiment, adjusting the colors of the pixels at the target position of the arc in the initial image to obtain the target image includes: adjusting the respective initial brightness values of multiple pixels in the initial image to obtain the respective target brightness values of the multiple pixels; adjusting the colors of the pixels at the target position of the arc in the initial image to obtain the target colors of the pixels at the target position of the arc; and based on the initial image, superimposing the respective target brightness values of the multiple pixels and the target colors of the pixels at the target position of the arc to obtain the target image.

[0054] Optionally, during the process of generating the arc - type light and shadow effect, adjust the initial brightness values corresponding to multiple pixel points in the initial image, as well as the color of the pixel points at the arc target position. The arc effect can be highlighted by dimming the initial brightness values corresponding to multiple pixel points. For example, first obtain its RGB color value from the initial image through a texture sampler. Then, calculate the brightness value of this pixel point. Usually, the brightness value is the weighted sum of the RGB color values. For pixel points not on the arc path, consider reducing their brightness values to highlight the arc effect. A global brightness attenuation factor can be set, such as 0.8, and then different degrees of attenuation are performed according to the distance of the pixel from the arc path. The farther the pixel point is from the arc path, the greater the degree of its brightness attenuation. For each pixel point, calculate its target brightness value according to the above strategy. If the pixel point is on the arc path, then keep its brightness value unchanged or adjust it according to the brightness requirement of the arc; for pixel points far from the arc path, attenuate the brightness value according to the distance. Because the arc usually has high brightness and strong contrast. The designed arc color can include white - hot, blue, or purple tones, which are visually similar to the natural arc discharge phenomenon. The arc color can be achieved by mixing colors with different brightness and saturation levels. For pixel points on the arc path, use the arc color to cover the color value at the corresponding position in the initial image. A blending function (such as the mix function in GLSL) can be used to adjust the degree of coverage according to the intensity and position of the arc. The greater the arc intensity, the deeper the covered color, and vice versa. Blend the adjusted brightness value with the target color at the arc position. For pixel points not on the arc path, recalculate their color values according to the adjusted brightness value; for pixel points on the arc path, use the calculated arc color value. The process of fusing brightness adjustment and color coverage can be linear or non - linear, depending on the desired visual effect. Linear blending directly mixes two color values in proportion, while non - linear blending may use more complex functions to adjust the final output brightness and color.

[0055] Through the above - mentioned fusion strategy, calculate the final color value for each pixel point. Map these color values back to the initial image to generate a target image containing the arc - type light and shadow effect. Through the above steps, a vivid and highly customizable arc - type light and shadow effect can be created.

[0056] As an optional embodiment, obtain an initial video, where the initial image is any frame image in the initial video; generate random values for multiple frames of images in the initial video; determine the images with random values exceeding a preset threshold as the first images; perform the operation of generating a target image to generate an arc effect in the first images to obtain target first images; according to the target first images, obtain a target video, where the target video is the initial video under the simulated dynamic arc effect.

[0057] Optionally, a series of frame images can be read from the initial video as the raw data to be processed. A random value is generated for each frame image in the initial video, and these values can be used for subsequent threshold judgments to determine which frame images will receive the arc effect processing. A preset threshold is set. If the random value corresponding to a certain frame image exceeds this threshold, it is marked as the first image, that is, the arc effect will be generated on this image. For the frames marked as the first images, an arc effect generation algorithm is applied. The algorithm includes but is not limited to determining the starting and ending points of the arc, generating the arc path, receiving the arc and halo thickness parameters, determining the arc boundary position based on the arc width and path, and adjusting the color and brightness of the pixels within the influence range of the arc position and halo. The processed first images (target first images) are re-integrated into the video to form a target video with the arc effect.

[0058] Specifically, first, each frame image is read from the initial video. To simplify subsequent processing, the video frames can be optionally cached in memory or pre-processed, such as adjusting the resolution or color space. A random value is generated for each frame image. This value can be generated based on various algorithms, such as a pseudo-random number generator or a noise function. Subsequently, each random value is compared with the preset threshold. If the random value exceeds the threshold, the corresponding frame is marked as the first image and is ready for the generation of the arc effect. On the frames marked as the first images, the arc effect is generated according to the arc stripe generation algorithm. This process involves determining the path, width, and color of the arc, as well as adjusting the color and brightness of the pixels within the arc position and its surrounding halo area. The design of the arc effect should consider visual impact, realism, and the degree of integration with the background texture. Receive the halo thickness parameter input based on the target account to determine the range of the halo effect around the arc. The halo thickness can be fixed or dynamically adjusted according to user input to achieve different visual effects. For the pixels at the arc target position and the halo effect position, adjust their color and brightness. The color adjustment should make the arc and halo blend harmoniously with the background image, and the brightness adjustment is used to enhance the visual prominence of the arc. The first images processed with the arc effect are recombined with the other unprocessed frame images to form the target video. The video recombination should ensure the frame rate and the continuity of the video stream, avoiding stuttering or flickering phenomena.

[0059] Among them, the generation of the arc effect can be synchronized with the time axis of the video. By introducing time variables and noise functions, the arc effect has dynamic changes between different frames, enhancing the dynamics and immersion of the video. It can also allow users to adjust the parameters of the arc effect in real time through the front-end interface, such as position, width, color, and halo thickness. After the user adjusts, the video effect can be updated immediately, providing a good interactive experience. On some frame images, multiple layers of arc effects can be superimposed, with each layer of arc having different positions, widths, and colors. This superimposed effect can produce more complex and rich visual textures, making the video effect more expressive. When generating the arc effect, the natural integration with the background texture should be considered. This can be achieved by sampling the color and brightness of the background texture and dynamically adjusting the parameters of the arc effect to ensure there is no abrupt transition between the arc and the background. After the arc effect is generated, the brightness of the video can be adaptively adjusted to ensure that the arc effect can maintain a good visual effect under different lighting conditions.

[0060] Through the above steps, the dynamic arc effect can be effectively simulated in the initial video, not only improving the efficiency and quality of video processing, but also providing users with rich customization options, meeting the video special effect requirements in diverse scenarios. This technology has broad application prospects in fields such as game development, film production, data visualization, creative design, and online education, and can significantly enhance the visual appeal and user experience of the content.

[0061] As an optional embodiment, obtaining the target video according to the target first image includes: determining the image with the random value not exceeding the preset threshold as the second image; reducing the brightness values corresponding to each of the multiple pixel points in the second image to obtain the target second image; and obtaining the target video based on the target first image and the target second image.

[0062] Optionally, for frame images that do not meet the arc effect generation conditions, the brightness value can be reduced to form a contrast with the arc effect frames, thereby enhancing the overall visual effect of the target video. First, those frame images in the initial video with random values not exceeding a preset threshold can be identified and marked as the second images. These images will not directly generate the arc effect but will assist in enhancing the visual hierarchy of the target video through brightness adjustment. For the pixel points in the second images, a brightness reduction strategy is implemented. The brightness reduction is not only to reduce its visual prominence but also to visually set off the brightness and contrast of the first images with the arc effect, making the arc more prominent. Specifically, the brightness reduction can be achieved in various ways. For example, through linear brightness adjustment, the brightness of each pixel point in the second image is reduced by a fixed ratio (such as 80%). A brightness curve function (such as gamma correction) can also be used to adjust the brightness to enhance the contrast of dark details, making the brightness adjustment more natural and rich in details. The brightness can be dynamically adjusted according to the distance between the second image and the nearest first image (i.e., the image containing the arc effect) on the time axis. The closer to the first image, the smaller the degree of brightness reduction, and vice versa. This can simulate the natural phenomenon of light changing over time. The second image after brightness adjustment is called the target second image. During the generation of the target video, the target second image will be integrated with other target first images containing the arc effect into a continuous video stream. Finally, the target first image and the target second image are recombined according to the frame sequence of the original video to generate the target video. The brightness difference between the arc effect frames (target first images) and the non-arc effect frames (target second images) will significantly enhance the visual hierarchy and dynamics of the target video. Among them, considering the naturalness of the brightness transition between the frames with the arc effect and the frames without the arc effect, a gradual brightness reduction strategy can be implemented. That is, within a few frames after the arc effect is generated, the brightness of the second image is gradually reduced until a predetermined ratio is reached, and then the brightness is gradually restored within a few frames before the arc effect disappears. This gradual adjustment can smooth the brightness change and avoid a sense of abruptness in vision. A time parameter can also be introduced to dynamically adjust the brightness of the second image. For example, when the arc effect frame appears, the brightness of the second image can be automatically reduced to a lower level; after the arc effect disappears, the brightness gradually recovers. This time-based control can synchronize the brightness adjustment with the frequency of the arc effect appearance and enhance the rhythm of the video.

[0063] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0064] Through the description of the above embodiments, those skilled in the art can clearly understand that the image processing method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0065] According to an embodiment of the present invention, there is also provided an image processing apparatus for implementing the above image processing method. Figure 4 It is a structural block diagram of the image processing apparatus provided according to an embodiment of the present invention, as Figure 4 shown. The image processing apparatus includes: an acquisition module 402, a first determination module 404, a generation module 406, a second determination module 408, and an adjustment module 410. The following is an explanation of the image processing apparatus.

[0066] The acquisition module 402 is used to acquire an initial image.

[0067] The first determination module 404 is connected to the acquisition module 402 and is used to determine the initial position of the arc in the initial image based on a preset arc stripe generation algorithm.

[0068] The generation module 406 is connected to the first determination module 404 and is used to generate an offset based on a preset noise function.

[0069] The second determination module 408 is connected to the generation module 406 and is used to determine the target position of the arc based on the offset and the initial position.

[0070] The adjustment module 410 is connected to the second determination module 408 and is used to adjust the color of the pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is an initial image simulating the appearance of an arc effect.

[0071] Optionally, the first determination module is configured to determine an initial position of an arc in an initial image based on a preset arc stripe generation algorithm, including: a first determination unit configured to randomly determine a starting point and an ending point of the arc in the initial image within a preset range; a second determination unit configured to determine an arc path based on the arc stripe generation algorithm according to the starting point and the ending point; a first receiving unit configured to receive an arc width input based on a target account; and a third determination unit configured to determine the initial position based on the arc width and the arc path.

[0072] Optionally, the adjustment module is configured to adjust colors of pixel points at a target position of an arc in an initial image to obtain a target image, including: a receiving unit configured to receive a halo thickness input based on a target account; a fourth determination unit configured to determine a position of a halo effect based on the halo thickness and the target position of the arc; and a first adjustment unit configured to adjust colors of pixel points at the target position of the arc and at the position of the halo effect in the initial image to obtain the target image.

[0073] Optionally, the adjustment module is configured to adjust colors of pixel points at a target position of an arc in an initial image to obtain a target image, including: a second adjustment unit configured to adjust initial brightness values corresponding to multiple pixel points in the initial image to obtain target brightness values corresponding to the multiple pixel points; a third adjustment unit configured to adjust colors of pixel points at the target position of the arc in the initial image to obtain target colors of pixel points at the target position of the arc; and an overlay unit configured to overlay the target brightness values corresponding to the multiple pixel points and the target colors of pixel points at the target position of the arc based on the initial image to obtain the target image.

[0074] Optionally, the above device further includes: a second acquisition module configured to acquire an initial video, where the initial image is any frame image in the initial video; a second generation module configured to generate random values for multiple frame images in the initial video respectively; a third determination module configured to determine an image with a random value exceeding a preset threshold as a first image; a third generation module configured to generate an arc effect in the first image by performing an operation of generating a target image to obtain a target first image; and a video generation module configured to obtain a target video according to the target first image, where the target video is the initial video under a simulated dynamic arc effect.

[0075] Optionally, the video generation module is configured to obtain a target video according to the target first image, including: a fifth determination module configured to determine an image with a random value not exceeding a preset threshold as a second image; a reduction unit configured to reduce brightness values corresponding to multiple pixel points in the second image to obtain a target second image; and a video generation unit configured to obtain the target video based on the target first image and the target second image.

[0076] It should be noted here that the above-mentioned acquisition module 402, first determination module 404, generation module 406, second determination module 408, and adjustment module 410 correspond to steps S202 to S210 in the embodiment. The instances and application scenarios implemented by the multiple modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiment. It should be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in the embodiment.

[0077] Embodiments of the present invention can provide a computer device. Optionally, in this embodiment, the above computer device can be located in at least one of multiple network devices in a computer network. The computer device includes a memory and a processor.

[0078] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and device in the embodiments of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above-mentioned image processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely set relative to the processor, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0079] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: obtain an initial image; determine the initial position of the arc in the initial image based on a preset arc stripe generation algorithm; generate an offset based on a preset noise function; determine the target position of the arc based on the offset and the initial position; adjust the color of the pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is an initial image simulating the appearance of an arc effect.

[0080] By adopting the embodiment of the present invention, a method for image processing is provided. The method includes: obtaining an initial image; determining an initial position of an arc in the initial image based on a preset arc stripe generation algorithm; generating an offset based on a preset noise function; determining a target position of the arc based on the offset and the initial position; and adjusting the color of the pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is the initial image simulating the appearance of an arc effect. Thus, the purpose of determining an image with an arc effect based on a noise function and an arc stripe generation algorithm is achieved, and the technical effect of improving the generation efficiency of the arc effect image is realized. Furthermore, the technical problem that the generation of an image with an arc light and shadow effect currently depends on a complex algorithm, resulting in a complex and inefficient generation process, is solved.

[0081] Those of ordinary skill in the art can understand that all or part of the steps in the above-mentioned various methods can be completed by instructing the relevant hardware of the terminal device through a program. The program can be stored in a non-volatile storage medium, and the storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disc, etc.

[0082] The embodiment of the present invention also provides a non-volatile storage medium. Optionally, in this embodiment, the above-mentioned non-volatile storage medium can be used to store the program code executed by the image processing method provided in the above-mentioned embodiment.

[0083] Optionally, in this embodiment, the above-mentioned non-volatile storage medium can be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.

[0084] Optionally, in this embodiment, the non-volatile storage medium is set to store the program code for performing the following steps: obtaining an initial image; determining an initial position of an arc in the initial image based on a preset arc stripe generation algorithm; generating an offset based on a preset noise function; determining a target position of the arc based on the offset and the initial position; and adjusting the color of the pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is the initial image simulating the appearance of an arc effect.

[0085] An embodiment of the present invention also provides a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it can implement: obtaining an initial image; determining an initial position of an arc in the initial image based on a preset arc stripe generation algorithm; generating an offset based on a preset noise function; determining a target position of the arc based on the offset and the initial position; adjusting colors of pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is the initial image simulating the appearance of an arc effect.

[0086] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0087] In the above embodiments of the present invention, the descriptions of each embodiment have their own focuses. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0088] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the units or modules can be in an electrical or other form.

[0089] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0090] In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0091] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs.

[0092] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. An image processing method, characterized in that, Including: Obtain an initial image; Based on a preset arc stripe generation algorithm, determine the initial position of the arc in the initial image; Based on a preset noise function, generate an offset; Based on the offset and the initial position, determine the target position of the arc; Adjust the color of the pixel points at the target position of the arc in the initial image to obtain a target image, where the target image is the initial image simulating the appearance of an arc effect.

2. The method according to claim 1, wherein The step of determining the initial position of the arc in the initial image based on a preset arc stripe generation algorithm includes: Randomly determine the starting point and the ending point of the arc in the initial image within a preset range; Based on the arc stripe generation algorithm, determine the arc path according to the starting point and the ending point; Receive the arc width input based on the target account; Based on the arc width and the arc path, determine the initial position.

3. The method according to claim 1, wherein The step of adjusting the color of the pixel points at the target position of the arc in the initial image to obtain a target image includes: Receive the halo thickness input based on the target account; Based on the halo thickness and the target position of the arc, determine the position of the halo effect; Adjust the colors of the pixel points at the target position of the arc and at the position of the halo effect in the initial image to obtain the target image.

4. The method according to claim 1, characterized in that, The step of adjusting the color of the pixel points at the target position of the arc in the initial image to obtain a target image includes: Adjust the respective initial brightness values of multiple pixel points in the initial image to obtain the respective target brightness values of the multiple pixel points; Adjust the color of the pixel points at the target position of the arc in the initial image to obtain the target color of the pixel points at the target position of the arc; Based on the initial image, superimpose the respective target brightness values of the multiple pixel points and the target color of the pixel points at the target position of the arc to obtain the target image.

5. The method according to any one of claims 1 to 4, characterized in that It also includes: Obtain an initial video, where the initial image is any frame image in the initial video; Generate random values for multiple frame images in the initial video respectively; Determine the images with the random values exceeding a preset threshold as the first images; Perform the operation of generating a target image to generate an arc effect in the first images to obtain target first images; According to the target first images, obtain a target video, where the target video is the initial video simulating a dynamic arc effect.

6. The method according to claim 5, characterized in that, The step of obtaining the target video according to the target first images includes: Determine the images with the random values not exceeding the preset threshold as the second images; Reduce the respective brightness values of multiple pixel points in the second images to obtain target second images; Based on the target first images and the target second images, obtain the target video.

7. An image processing apparatus, characterized in that, Including: An acquisition module for obtaining an initial image; A first determination module for determining the initial position of the arc in the initial image based on a preset arc stripe generation algorithm; A generation module for generating an offset based on a preset noise function; A second determination module for determining the target position of the arc based on the offset and the initial position; An adjustment module, configured to adjust the color of pixel points at a target position of the arc in the initial image to obtain a target image, where the target image is the initial image simulating the appearance of an arc effect.

8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, where, when the program runs, it controls the device where the non-volatile storage medium is located to execute the image processing method according to any one of claims 1 to 6.

9. A computer device, characterized in that, Comprising: A memory and a processor, The memory stores a computer program; The processor is configured to execute the computer program stored in the memory, and when the computer program runs, it causes the processor to execute the image processing method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the image processing method according to any one of claims 1 to 6.