Image processing method, device, electronic device and storage medium

By generating the first texture infographic and rendering the image containing multiple sub-images at one time, the problems of high processor memory usage and page lag during image processing are solved, and the user experience is improved.

CN114612292BActive Publication Date: 2025-04-08BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

During the image processing process, the new image contains multiple image areas, which requires texture rendering of each image area separately, resulting in high processor memory usage and lag on pages, which seriously affects the user experience.

Method used

By generating a first texture information map corresponding to the preset rules, the second image is rendered at one time. The first texture infographic includes a plurality of tiles, each tiles contain texture information required to render the corresponding sub-image, thereby obtaining the texture information of all sub-images at once for rendering.

Benefits of technology

It avoids the high processor memory footprint and page lag caused by multiple renderings, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114612292B_ABST
    Figure CN114612292B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method, device, electronic device and storage medium, and relates to the field of image processing technology. In the present disclosure, for a second image including multiple sub-images, the second image is rendered once according to a first texture information map corresponding to a preset rule. Among them, since the first texture information map includes multiple blocks corresponding to the multiple sub-images one by one, and each block includes the texture information required for rendering the corresponding sub-image, the texture information of all sub-images can be obtained from the first texture information map at one time, and then all sub-images can be completely rendered at one time, which solves the problem of high processor memory usage and page jamming caused by multiple renderings in the related technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, electronic device and storage medium. Background Art

[0002] In order to meet the diverse social needs of Internet users, many short video applications have emerged in recent years. Users can use short video applications to shoot images or short videos and publish them on the Internet. Short video applications provide many image processing functions, through which users can process images and obtain images with special display effects.

[0003] For example, through a certain image processing function, image regions from one or more images can be synthesized into a new image, and the new image includes multiple image regions to present the effect of displaying different parts of the image in different regions. However, in the above-mentioned image processing process, since the new image contains multiple image regions, it is necessary to perform texture rendering on each image region separately, resulting in high processor memory usage and page jams, which seriously affects the user experience. Summary of the invention

[0004] The present disclosure provides an image processing method, device, electronic device and storage medium, which can solve the problems of high server memory usage and page jamming in the process of rendering images input by users, and improve the user experience.

[0005] The technical solution of the embodiment of the present disclosure is as follows:

[0006] According to the first aspect of the embodiment of the present disclosure, an image processing method is provided. The method may include: in response to an image processing instruction, processing at least one first image according to a preset rule to obtain a second image, the second image including a plurality of sub-images arranged in an arrangement manner corresponding to the preset rule; rendering the second image according to a first texture information map corresponding to the preset rule, the first texture information map including a plurality of blocks determined from a second texture information map corresponding to the first image according to the preset rule, the plurality of blocks being arranged in an arrangement manner corresponding to the preset rule to correspond one-to-one with the positions of the plurality of sub-images; wherein, for each block, texture information required for rendering the sub-image corresponding to the block position is included.

[0007] Since the second image includes multiple sub-images, when the related art renders the second image, it is necessary to obtain the texture information of each sub-image separately, and render each sub-image according to the obtained texture information, which means that the second image needs to be rendered multiple times, and the number of times is consistent with the number of sub-images. Multiple renderings will lead to problems such as high processor memory usage and page jams. The present disclosure renders the second image once for a second image including multiple sub-images according to a first texture information map corresponding to a preset rule. Among them, since the first texture information map includes multiple blocks corresponding to multiple sub-images one by one, and each block includes the texture information required to render the corresponding sub-image, the texture information of all sub-images can be obtained from the first texture information map at one time, and then all sub-images can be completely rendered at one time, which solves the problem of high processor memory usage and page jams caused by multiple renderings in the related art.

[0008] Optionally, in response to an input image processing instruction, at least one first image is processed according to preset rules to obtain a second image, including: determining multiple sub-images from the at least one first image, each sub-image being a local area or a complete area of ​​a first image; the multiple sub-images correspond to different preset positions respectively, and are spliced ​​into a second image so that the multiple sub-images are arranged in an arrangement manner.

[0009] In this implementation, the preset rules include a first rule and a second rule. The first rule is actually a rule for determining a sub-image from a first image, and the second rule is actually a rule for determining the placement of a sub-image in a second image. Then, the process of generating a second image according to the preset rules is to first determine multiple sub-images from the first image according to the first rule, which may include operations of cropping and copying the first image. It should be noted that the sub-image can be a partial area of ​​the first image or a complete image of the first image of a preset size. Then, according to the second rule, the multiple sub-images are filled into different positions to obtain a second image with a special display effect, such as displaying different parts of the first image in different areas of the second image.

[0010] Optionally, before rendering the second image according to the first texture information map corresponding to the preset rule, it also includes: obtaining a second texture information map constructed with the first color channel value as the horizontal coordinate and the second color channel value as the vertical coordinate, the second texture information map has the same size as the first image; determining a plurality of blocks from the second texture information map, the blocks being a partial area or a complete area of ​​the second texture information map; corresponding the plurality of blocks to different preset positions respectively, and splicing them into the first texture information map, so that the plurality of blocks are arranged in an arrangement manner.

[0011] The idea of ​​this implementation is that, first, the color channel values ​​in two directions (horizontal and vertical) in the second texture information map are used to locate the texture coordinates of the pixel points in the actual image. Secondly, in order to obtain a texture information map corresponding to the second image, the second texture information map is processed in accordance with the first rule and the second rule in the above-mentioned preset rules. Since the process of generating the first texture information map according to the second texture information map is the same as the process of generating the second image according to the first image, it can be ensured that the obtained first texture information map corresponds to the second image, that is, the first texture information map includes a plurality of blocks corresponding to a plurality of sub-images one by one, and each block includes the texture information required for rendering the corresponding sub-image.

[0012] Optionally, the second image is rendered according to the first texture information map corresponding to the preset rule, including: collecting the first channel color value and the second channel color value corresponding to each pixel in the second image from the first texture information map as the texture coordinates of each pixel; and rendering the second image according to the texture coordinates of each pixel in the second image.

[0013] In this implementation, the second image is rendered by the texture coordinates corresponding to each pixel point in the second image to obtain a rendered second image. Since only one rendering is performed, there is no need to render each sub-image in the second image multiple times. This solves the problem of high processor memory usage and page jamming in the current image rendering process, which seriously affects the user experience.

[0014] Optionally, in response to an input image processing instruction, at least one first image is processed according to preset rules before obtaining a second image, including: displaying an image processing interface, the image processing interface including multiple controls corresponding to different preset rules; receiving an image processing instruction input by operating any control.

[0015] According to the second aspect of the embodiment of the present disclosure, an image processing device is provided. The device may include: an image generation unit and an image rendering unit; the image generation unit is used to process at least one first image according to a preset rule in response to an image processing instruction to obtain a second image, the second image including a plurality of sub-images arranged in an arrangement manner corresponding to the preset rule; the image rendering unit is used to render the second image according to a first texture information map corresponding to the preset rule, the first texture information map including a plurality of blocks determined from a second texture information map corresponding to the first image according to the preset rule, the plurality of blocks are arranged in an arrangement manner corresponding to the preset rule to correspond one-to-one with the positions of the plurality of sub-images; wherein, for each block, the texture information required for rendering the sub-image corresponding to the block position is included.

[0016] Optionally, the image generation unit is specifically used to: determine multiple sub-images from at least one first image, each sub-image is a local area or a complete area of ​​a first image; correspond the multiple sub-images to different preset positions respectively, and splice them into a second image so that the multiple sub-images are arranged in an arrangement manner.

[0017] Optionally, the image generation unit is further used to: obtain a second texture information map constructed with the first color channel value as the horizontal coordinate and the second color channel value as the vertical coordinate, the second texture information map having the same size as the first image; determine a plurality of blocks from the second texture information map, the blocks being a local area or a complete area of ​​the second texture information map; correspond the plurality of blocks to different preset positions respectively, and splice them into the first texture information map so that the plurality of blocks are arranged in an arrangement manner.

[0018] Optionally, the image rendering unit is specifically used to: collect the first channel color value and the second channel color value corresponding to each pixel in the second image from the first texture information map as the texture coordinates of each pixel; and render the second image according to the texture coordinates of each pixel in the second image.

[0019] Optionally, the image processing device further includes: an interface display unit, used to display an image processing interface, the image processing interface including a plurality of controls corresponding to different preset rules; and receive an image processing instruction input by operating any of the controls.

[0020] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, which may include: a processor and a memory for storing processor executable instructions; wherein the processor is configured to execute instructions to implement any one of the optional image processing methods in the above-mentioned first aspect.

[0021] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which instructions are stored. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the optional image processing methods in the first aspect above.

[0022] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes an image processing method as optionally implemented in any one of the first aspects.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

[0024] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0025] Since the second image includes multiple sub-images, when the related art renders the second image, it is necessary to obtain the texture information of each sub-image separately, and render each sub-image according to the obtained texture information, which means that the second image needs to be rendered multiple times, and the number of times is consistent with the number of sub-images. Multiple renderings will lead to problems such as high processor memory usage and page jams. The present disclosure renders the second image once for a second image including multiple sub-images according to a first texture information map corresponding to a preset rule. Among them, since the first texture information map includes multiple blocks corresponding to multiple sub-images one by one, and each block includes the texture information required to render the corresponding sub-image, the texture information of all sub-images can be obtained from the first texture information map at one time, and then all sub-images can be completely rendered at one time, which solves the problem of high processor memory usage and page jams caused by multiple renderings in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0027] Figure 1 An effect display diagram of an image processing function provided by an embodiment of the present disclosure is shown;

[0028] Figure 2 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown;

[0029] Figure 3 A schematic diagram of a flow chart of an image processing method provided by an embodiment of the present disclosure is shown;

[0030] Figure 4 A schematic diagram of a second image generation process provided by an embodiment of the present disclosure is shown;

[0031] Figure 5 A schematic diagram of another second image generation process provided by an embodiment of the present disclosure is shown;

[0032] Figure 6 A schematic diagram of another second image generation process provided by an embodiment of the present disclosure is shown;

[0033] Figure 7 A schematic diagram of another second image generation process provided by an embodiment of the present disclosure is shown;

[0034] Figure 8 A schematic diagram showing a flow chart of another image processing method provided by an embodiment of the present disclosure;

[0035] Fig. 9A schematic diagram of a second image rendering process provided by an embodiment of the present disclosure is shown;

[0036] Fig.10 A schematic structural diagram of another image processing device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0037] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0039] It should also be understood that the term “comprising” indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements and / or components.

[0040] The data involved in the present disclosure may be data authorized by the user or fully authorized by all parties.

[0041] As described in the background technology, in order to meet the diverse social needs of Internet users, many short video applications have emerged in recent years. Users can use short video applications to shoot images or short videos and publish them on the Internet. Short video applications provide many image processing functions, and users can use these image processing functions to process images to obtain images with special display effects.

[0042] For example, through a certain image processing function, image regions from one or more images can be synthesized into a new image, and the new image includes multiple image regions to present the effect of displaying different parts of the image in different regions. However, in the above-mentioned image processing process, since the new image contains multiple image regions, it is necessary to perform texture rendering on each image region separately, resulting in high processor memory usage and page jams, which seriously affects the user experience.

[0043] Based on this, the embodiment of the present disclosure provides an image processing method, including: in response to an image processing instruction, processing at least one first image according to a preset rule to obtain a second image, the second image including a plurality of sub-images arranged in an arrangement manner corresponding to the preset rule; rendering the second image according to a first texture information map corresponding to the preset rule, the first texture information map including a plurality of blocks determined from a second texture information map corresponding to the first image according to the preset rule, the plurality of blocks being arranged in an arrangement manner corresponding to the preset rule to correspond one-to-one with the positions of the plurality of sub-images; wherein, for each block, texture information required for rendering the sub-image corresponding to the block position is included. By rendering the second image once according to the texture information corresponding to each sub-image in the second image to obtain the rendered second image, rendering each sub-image separately is avoided, thereby solving the problem of high processor memory usage and page jamming in the current image rendering process, which seriously affects the user experience.

[0044] The following is an exemplary description of the application scenarios of the image processing method provided by the embodiment of the present disclosure:

[0045] The image processing method, device, electronic device, and storage medium provided by the embodiments of the present disclosure can at least be applied to a scenario in which a user processes one or more images through an application (such as a short video application, Kuaishou) installed on an electronic device to obtain an image with a special display effect. The electronic device can process the input image by executing the image processing method provided by the embodiments of the present disclosure to obtain an image with a special display effect and display it in the interface. For example, through a certain image processing function, image areas from one or more images can be synthesized into a new image, and the new image includes multiple image areas to present the effect of displaying different parts of the image in different areas. Exemplary, such as Figure 1 As shown, Figure 1 A is a photo of an apple taken by a user. Figure 1 After A is copied and cut multiple times, multiple sub-images are obtained, each of which shows different parts of A. Then, the multiple sub-images are placed according to a preset rule to obtain Figure 1 Middle B, Figure 1 In B, there are multiple image regions, each of which displays a different sub-image. Figure 1 The different parts of A in Figure 1 are the different parts of the apple in Figure 1. Figure 1 After processing in A, users can get a special display effect Figure 1 Middle B.

[0046] It should be noted that the electronic devices that execute the image processing method provided by the embodiments of the present disclosure may be servers and terminal devices. Among them, the terminal devices may be mobile phones, tablet computers, desktops, laptops, handheld computers, notebook computers, ultra-mobile personal computers (UMPC), netbooks, as well as cellular phones, personal digital assistants (PDA), augmented reality (AR) and virtual reality (VR) devices, etc., which can install and use content community applications (such as Kuaishou). The present disclosure does not impose any special restrictions on the specific form of the electronic device. It can interact with the user through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device. It should be noted that the specific form of the electronic device is not limited. For example, it can be Figure 2 The electronic device shown in the figure may be an image processing device and may include at least one processor 21 , a communication bus 22 , a memory 23 and at least one communication interface 24 .

[0047] The processor 21 may be a central processing unit (CPU), a microprocessing unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the disclosed solution.

[0048] The communication bus 22 may include a pathway for transmitting information between the above-mentioned components.

[0049] The communication interface 24 uses any transceiver-like device for communicating with other devices or communication networks, such as servers, Ethernet, radio access networks (RAN), wireless local area networks (WLAN), etc. As an example,

[0050] The memory 23 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processing unit through a bus. The memory may also be integrated with the processing unit.

[0051] The memory 23 is used to store application code for executing the solution of the present disclosure, and the execution is controlled by the processor 21. The processor 21 is used to execute the application code stored in the memory 23, so as to realize the functions in the method of the present disclosure.

[0052] In a specific implementation, as an embodiment, the processor 21 may include one or more CPUs, such as Figure 2 CPU0 and CPU1 in.

[0053] In a specific implementation, as an embodiment, the electronic device may include multiple processors, such as Figure 2 21 and processor 25 in the embodiment of the present invention. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0054] In a specific implementation, as an embodiment, the electronic device may further include an input device 26 and an output device 27. The input device 26 communicates with the output device 27 and may receive user input in a variety of ways. For example, the input device 26 may be a mouse, a keyboard, a touch screen device, or a sensor device. The output device 27 communicates with the processor 21 and may display information in a variety of ways. For example, the output device 27 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, or the like.

[0055] Those skilled in the art will understand that Figure 2 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0056] In some embodiments, the electronic device may include an image processing device, and the electronic device executes the method provided by the embodiments of the present disclosure through the image processing device.

[0057] The specific implementation of the image processing method provided by the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.

[0058] Figure 3 A flowchart of an image processing method provided by an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, when the image processing method is applied to an electronic device, the image processing method may include:

[0059] S301 . In response to an image processing instruction, at least one first image is processed according to a preset rule to obtain a second image, where the second image includes a plurality of sub-images arranged in an arrangement manner corresponding to the preset rule.

[0060] Specifically, the first image may be an image captured by the user through the camera of the electronic device, or may be an image selected by the user in the photo album. For example, when the user uses the electronic device to capture a photo, the user may select a corresponding special effect control in the capture interface, and use the special effect control to process the image to obtain an image with a special display effect. In addition, the first image may be any frame of a video captured by the user through the camera of the electronic device, and a video with a special display effect may be obtained by sequentially processing the image corresponding to each frame of the video.

[0061] In some embodiments, in response to an image processing instruction, at least one first image is processed according to preset rules to obtain a second image, including: displaying an image processing interface, the image processing interface including multiple controls corresponding to different preset rules, and receiving an image processing instruction input by operating any of the controls.

[0062] Specifically, the control also includes a special effect name. When the control is displayed on the image processing interface, the user selects the intended control by viewing the corresponding special effect name on each control. From the above, it can be seen that by responding to the user's operation on any control on the image processing interface, a method for the user to send an image processing instruction is provided. The user can select the corresponding control on the image processing interface according to his own needs. Each control corresponds to a different preset rule. The input image is processed according to the preset rule to obtain an image with a special display effect.

[0063] In some embodiments, the preset rules include a first rule and a second rule. The first rule is actually a rule for determining a sub-image from a first image, and the second rule is actually a rule for determining the placement of the sub-image in the second image. It should be understood that the preset rules corresponding to different controls may be different, and the first rules in different preset rules may be different, and the second rules in different preset rules may also be different.

[0064] Based on this, in some implementations, the above S301 may specifically include:

[0065] First, according to a first rule in the preset rules, multiple sub-images are determined from at least one first image, each sub-image being a partial area or a complete area of ​​a first image. Then, according to a second rule in the preset rules, the multiple sub-images are respectively matched to different preset positions to splice the multiple sub-images into a second image. It should be noted that when the first rule is different, the multiple sub-images determined from the same first image are different.

[0066] In some embodiments, the first rule may be a rule for copying the first image and then cutting the multiple first images to obtain multiple sub-images. Each sub-image is a partial image of the first image. The second rule may be a rule for determining the position of each sub-image in the second image to be generated, or a rule for splicing the multiple sub-images. After cutting into a preset shape according to the first rule, the multiple sub-images are respectively matched to different preset positions according to the second rule, and spliced ​​to obtain the second image. Exemplarily, Figure 4 The figure is a schematic diagram of the second image generation process in an embodiment shown in the present disclosure. Image A is the first image. According to the first rule, it is copied three times to obtain images A1, A2 and A3; then A1, A2 and A3 are cropped respectively, and one sub-image is determined in each first image, which are sub-image B, sub-image C and sub-image D respectively. According to the second rule, sub-image B, sub-image C and sub-image D are respectively mapped to different preset positions, and spliced ​​to obtain the second image F. It can be seen that the multiple sub-images included in the second image F are partial areas of the same first image, so the second image shows multiple partial areas of the first image. In this example, the multiple partial areas are not completely the same.

[0067] In some embodiments, the first rule may be a rule for directly cutting the first image to obtain multiple sub-images. Each sub-image is a partial image of the first image. It should be noted that since the multiple sub-images are from the same first image, the multiple sub-images respectively display different parts of the first image. Then, according to the second rule, the multiple sub-images are respectively mapped to different preset positions, and the second image is obtained by splicing. The obtained second image can display multiple different parts of the first image.

[0068] For example, Figure 5 The figure is a schematic diagram of a second image generation process in an embodiment of the present disclosure, wherein image A is a first image, and according to a first rule, image A is cropped to obtain three sub-images, namely, sub-image B, sub-image C, and sub-image D. Then, according to a second rule, sub-image B, sub-image C, and sub-image D are respectively mapped to different preset positions, and spliced ​​to obtain a second image F.

[0069] In some embodiments, the first rule may be a rule that after copying the first image, the multiple first images are scaled to obtain multiple sub-images. Each sub-image is a complete image in the first image. After scaling to a preset size according to the first rule, the multiple sub-images are respectively mapped to different preset positions according to the second rule to obtain a second image.

[0070] For example, Figure 6 Schematic diagram of the second image generation process in an embodiment of the present disclosure, image H is the first image, and according to the first rule, image H is copied and scaled to obtain three sub-images, namely sub-image I, sub-image J and sub-image K. According to the second rule, sub-image I, sub-image J and sub-image K are respectively mapped to different preset positions, and the second image L is obtained by splicing.

[0071] It should be noted that when the second rules are different, the second images formed by splicing multiple sub-images are different, and the second images obtained by processing multiple identical sub-images according to different second rules are also different.

[0072] For example, see Figure 7 , sub-image B, sub-image C and sub-image D are three sub-images obtained after processing the first image, and are processed by the second rule M and the second rule N respectively, and the obtained second images are image M and image N respectively. It can be seen from the figure that although image M and image N are obtained from the same sub-image, the corresponding second images are different due to different corresponding second rules. By combining different first rules and second rules, different solutions for images with special effects can be provided to users, and users can choose according to their own needs to improve the user experience.

[0073] It can be seen from the above implementation that the preset rules include a first rule and a second rule. The first rule is actually a rule for determining a sub-image from a first image, and the second rule is actually a rule for determining the placement of a sub-image in a second image. Then, the process of generating a second image according to the preset rules is to first determine multiple sub-images from the first image according to the first rule, which may include operations of cropping and copying the first image. It should be noted that the sub-image can be a partial area of ​​the first image or a complete image of the first image of a preset size. Then, according to the second rule, the multiple sub-images are filled into different positions to obtain a second image. The second image has a special display effect, such as displaying different parts of the first image in different areas of the second image.

[0074] S302. Render the second image according to a first texture information map corresponding to a preset rule, wherein the first texture information map includes a plurality of tiles determined from a second texture information map corresponding to the first image according to the preset rule, and the plurality of tiles are arranged in an arrangement manner corresponding to the preset rule so as to correspond one-to-one to a plurality of sub-image positions; wherein each tile includes texture information required for rendering the sub-image corresponding to the tile position.

[0075] In some embodiments, see Figure 8 , before rendering the second image according to the first texture information map corresponding to the preset rule, it also includes:

[0076] S801. Obtain a second texture information map constructed with the first color channel value as the horizontal coordinate and the second color channel value as the vertical coordinate, wherein the second texture information map has the same size as the first image.

[0077] In one implementation, the first color is red, and the second color is green. The color of the lower left corner of the second texture information map is black, and the corresponding texture coordinate is (0, 0), the color of the upper left corner is green, and the corresponding texture coordinate is (0, 1), the color of the lower right corner is red, and the corresponding texture coordinate is (1, 0), and the color of the upper right corner is yellow, and the corresponding texture coordinate is (1, 1).

[0078] S802: Determine a plurality of image blocks from the second texture information map, where the image blocks are local areas or complete areas of the second texture information map.

[0079] It should be noted that, for a detailed description of the first rule mentioned in S802, reference may be made to the introduction of the first rule in S301, which will not be repeated here.

[0080] S803: Corresponding the plurality of image blocks to different preset positions respectively, and splicing them into a first texture information map, so that the plurality of image blocks are arranged according to an arrangement method.

[0081] It should be noted that, for a detailed description of the second rule mentioned in S803, reference may be made to the introduction of the second rule in S301 above, which will not be repeated here.

[0082] As can be seen from S801-S803, in this implementation, first, the color channel values ​​in two directions (horizontal and vertical) in the second texture information map are used to locate the texture coordinates of the pixel points in the actual image. Secondly, in order to obtain a first texture information map corresponding to the second image, the second texture information map is processed in accordance with the first rule and the second rule in the above-mentioned preset rules. Since the process of generating the first texture information map according to the second texture information map is the same as the process of generating the second image according to the first image, it can be ensured that the obtained first texture information map corresponds to the second image, that is, the first texture information map includes a plurality of blocks corresponding to a plurality of sub-images one by one, and each block includes the texture information required for rendering the corresponding sub-image.

[0083] Specifically, the above-mentioned rendering of the second image according to the first texture information map corresponding to the preset rule includes: collecting the first channel color value and the second channel color value corresponding to each pixel point in the second image from the first texture information map as the texture coordinates of each pixel point, and rendering the second image according to the texture coordinates of each pixel point in the second image.

[0084] For example, see Fig. 9 , Figure A is the first image, and Figure A is processed according to the preset rule. First, the first rule is used to divide Figure A into sub-images B, C, and D. At the same time, the UV map, i.e., the second texture information map, is processed according to the first rule to obtain Figure X , and blocks X, Y, and Z corresponding to blocks A, Y, and Z respectively. According to sub-images B, C, and D, a corresponding second image is obtained by a second rule, and the second image is image E. At the same time, blocks X, Y, and Z are processed according to the same second rule to obtain a texture information map of the corresponding UV map, i.e., a first texture information map, wherein the second texture information map has the same size as that of image A. The texture coordinates corresponding to each pixel in the first texture information map are sampled to obtain the texture coordinates corresponding to each pixel point. Each pixel point in image E is rendered by the texture coordinates to obtain a rendered image E.

[0085] It can be seen from the above embodiments that the second image is rendered by the texture coordinates corresponding to each pixel point in the second image to obtain a rendered second image. Since only one rendering is performed, there is no need to render each sub-image in the second image multiple times. This solves the problem of high processor memory usage and page jams in the current image rendering process, which seriously affects the user experience.

[0086] It can be seen from S301-S302 that since the second image includes multiple sub-images, when the related technology renders the second image, it is necessary to obtain the texture information of each sub-image separately, and render each sub-image according to the obtained texture information, which means that the second image needs to be rendered multiple times, and the number of times is consistent with the number of sub-images. Multiple renderings will lead to problems such as high processor memory usage and page jams. The concept of the present disclosure is that for a second image including multiple sub-images, the second image is rendered once according to a first texture information map corresponding to a preset rule. Among them, since the first texture information map includes multiple blocks corresponding to multiple sub-images one by one, and each block includes the texture information required to render the corresponding sub-image, the texture information of all sub-images can be obtained from the first texture information map at one time, and then all sub-images can be completely rendered at one time, which solves the problem of high processor memory usage and page jams caused by multiple renderings in the related technology.

[0087] It is understandable that, in actual implementation, the terminal / server of the embodiment of the present disclosure may include one or more hardware structures and / or software modules for implementing the aforementioned corresponding image processing method, and these execution hardware structures and / or software modules may constitute an electronic device. It should be easily appreciated by those skilled in the art that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present disclosure.

[0088] Based on such understanding, the embodiments of the present disclosure also provide a data processing device that can be applied to electronic devices. Fig.10 FIG. 2 shows a schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure. Fig.10 As shown, the image processing device may include: an image generating unit 111 and an image rendering unit 112; the image generating unit 111 is used to respond to an image processing instruction, process at least one first image according to a preset rule, and obtain a second image, the second image including a plurality of sub-images arranged in an arrangement manner corresponding to the preset rule; the image rendering unit 112 is used to render the second image according to a first texture information map corresponding to the preset rule, the first texture information map including a plurality of blocks determined from a second texture information map corresponding to the first image according to the preset rule, the plurality of blocks being arranged in an arrangement manner corresponding to the preset rule so as to correspond one-to-one to the positions of the plurality of sub-images; wherein, for each block, the texture information required for rendering the sub-image corresponding to the block position is included.

[0089] Optionally, the image generation unit 111 is specifically used to: determine multiple sub-images from at least one first image, each sub-image being a local area or a complete area of ​​a first image; respectively correspond the multiple sub-images to different preset positions, and splice them into a second image so that the multiple sub-images are arranged in an arrangement manner.

[0090] Optionally, the image generation unit 111 is further used to: obtain a second texture information map constructed with the first color channel value as the horizontal coordinate and the second color channel value as the vertical coordinate, the second texture information map having the same size as the first image; determine a plurality of blocks from the second texture information map, the blocks being a local area or a complete area of ​​the second texture information map; correspond the plurality of blocks to different preset positions respectively, and splice them into the first texture information map so that the plurality of blocks are arranged in an arrangement manner.

[0091] Optionally, the image rendering unit 112 is specifically used to: collect the first channel color value and the second channel color value corresponding to each pixel in the second image from the first texture information map as the texture coordinates of each pixel; and render the second image according to the texture coordinates of each pixel in the second image.

[0092] Optionally, the image processing device further includes: an interface display unit 113, used to display an image processing interface, the image processing interface includes a plurality of controls corresponding to different preset rules; and receive an image processing instruction input by operating any control.

[0093] Since the second image includes multiple sub-images, when the related art renders the second image, it is necessary to obtain the texture information of each sub-image separately, and render each sub-image according to the obtained texture information, which means that the second image needs to be rendered multiple times, and the number of times is consistent with the number of sub-images. Multiple renderings will lead to problems such as high processor memory usage and page jams. The present disclosure renders the second image once for a second image including multiple sub-images according to a first texture information map corresponding to a preset rule. Among them, since the first texture information map includes multiple blocks corresponding to multiple sub-images one by one, and each block includes the texture information required to render the corresponding sub-image, the texture information of all sub-images can be obtained from the first texture information map at one time, and then all sub-images can be completely rendered at one time, which solves the problem of high processor memory usage and page jams caused by multiple renderings in the related art.

[0094] As described above, the embodiments of the present disclosure can divide the functional modules of the electronic device according to the above method examples. Among them, the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. In addition, it should be noted that the division of modules in the embodiments of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module.

[0095] Regarding the image processing device in the above embodiment, the specific manner in which each module performs operations and the beneficial effects possessed have been described in detail in the aforementioned method embodiment and will not be repeated here.

[0096] The disclosed embodiments also provide an electronic device. The electronic device may be an image processing device. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors and one or more memories. Among them, at least one instruction is stored in the memory, and at least one instruction is loaded and executed by the processor to implement the image processing method provided by each of the above method embodiments. Of course, the electronic device may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The electronic device may also include other components for implementing the functions of the device, which will not be described in detail here.

[0097] The present disclosure also provides a computer-readable storage medium including instructions, and the computer-readable storage medium stores instructions. When the instructions in the computer-readable storage medium are executed by the processor of a computer device, the computer can execute the image processing method provided by the above-mentioned embodiment. For example, the computer-readable storage medium can be a memory 23 including instructions, and the above instructions can be executed by the processor 21 of the terminal to complete the above method. For another example, the computer-readable storage medium can be a memory including instructions, and the above instructions can be executed by the processor of an electronic device to complete the above method. Optionally, the computer-readable storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0098] The present disclosure also provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned image processing method.

[0099] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include undisclosed common knowledge or customary techniques in the art. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0100] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: The method comprises: In response to an image processing instruction, at least one first image is processed according to a preset rule to obtain a second image, wherein the second image includes a plurality of sub-images arranged in an arrangement manner corresponding to the preset rule; the preset rule includes a first rule and a second rule; the first rule is used to determine the sub-image from the first image; and the second rule is used to determine the position of the sub-image in the second image; The second image is rendered according to a first texture information map corresponding to the preset rule, the first texture information map including a plurality of tiles determined from a second texture information map corresponding to the first image according to the first rule, the plurality of tiles being arranged in an arrangement manner corresponding to the second rule so as to correspond one-to-one with the plurality of sub-image positions; wherein each of the tiles includes texture information required for rendering the sub-image corresponding to the tile position.

2. The image processing method according to claim 1, characterized in that: The step of processing at least one first image according to a preset rule in response to an input image processing instruction to obtain a second image includes: Determine the plurality of sub-images from the at least one first image, each of the sub-images being a partial region or a complete region of the first image; The multiple sub-images are respectively matched to different preset positions and spliced ​​into the second image, so that the multiple sub-images are arranged according to the arrangement method.

3. The image processing method according to claim 1, characterized in that: Before rendering the second image according to the first texture information map corresponding to the preset rule, the method further includes: Acquire a second texture information map constructed with the first color channel value as the horizontal coordinate and the second color channel value as the vertical coordinate, wherein the second texture information map has the same size as the first image; Determine a plurality of image blocks from the second texture information map, where the image blocks are local areas or complete areas of the second texture information map; The multiple image blocks are respectively corresponded to different preset positions and spliced ​​into the first texture information map, so that the multiple image blocks are arranged according to the arrangement method.

4. The image processing method according to claim 3, characterized in that: The rendering of the second image according to the first texture information map corresponding to the preset rule includes: Collecting the first channel color value and the second channel color value corresponding to each pixel point in the second image from the first texture information map as the texture coordinates of each pixel point; The second image is rendered according to the texture coordinates of each pixel in the second image.

5. The image processing method according to claim 1 or 2, characterized in that: The method includes: processing at least one first image according to a preset rule in response to the input image processing instruction to obtain a second image, comprising: Displaying an image processing interface, wherein the image processing interface includes a plurality of controls corresponding to different preset rules; An image processing instruction input by operating any of the controls is received.

6. An image processing device, characterized in that: The device comprises: An image generation unit, configured to process at least one first image according to a preset rule in response to an image processing instruction to obtain a second image, wherein the second image includes a plurality of sub-images arranged in an arrangement manner corresponding to the preset rule; the preset rule includes a first rule and a second rule; the first rule is used to determine the sub-image from the first image; and the second rule is used to determine the position of the sub-image in the second image; An image rendering unit is used to render the second image according to a first texture information map corresponding to the preset rule, the first texture information map comprising a plurality of blocks determined from a second texture information map corresponding to the first image according to the first rule, the plurality of blocks being arranged in an arrangement manner corresponding to the second rule so as to correspond one-to-one with the plurality of sub-image positions; wherein, for each of the blocks, texture information required for rendering the sub-image corresponding to the block position is included.

7. The image processing device according to claim 6, characterized in that: The image generating unit is specifically used for: Determine the plurality of sub-images from the at least one first image, each of the sub-images being a partial region or a complete region of the first image; The multiple sub-images are respectively matched to different preset positions and spliced ​​into the second image, so that the multiple sub-images are arranged according to the arrangement method.

8. The image processing device according to claim 6 or 7, characterized in that: The image generating unit is further used for: Acquire a second texture information map constructed with the first color channel value as the horizontal coordinate and the second color channel value as the vertical coordinate, wherein the second texture information map has the same size as the first image; Determine a plurality of image blocks from the second texture information map, where the image blocks are local areas or complete areas of the second texture information map; The multiple image blocks are respectively corresponded to different preset positions and spliced ​​into the first texture information map, so that the multiple image blocks are arranged according to the arrangement method.

9. The image processing device according to claim 8, characterized in that: The image rendering unit is specifically used for: Collecting the first channel color value and the second channel color value corresponding to each pixel point in the second image from the first texture information map as the texture coordinates of each pixel point; The second image is rendered according to the texture coordinates of each pixel in the second image.

10. The image processing device according to claim 6 or 7, characterized in that: The device further comprises: An interface display unit, used to display an image processing interface, wherein the image processing interface includes a plurality of controls corresponding to different preset rules; An image processing instruction input by operating any of the controls is received.

11. An electronic device, characterized in that: include: processor; A memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the image processing method according to any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the image processing method as claimed in any one of claims 1 to 5.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image processing method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Panoramic rendering method of 3D video, computer equipment and readable storage medium

    CN112104853A