Image processing method and device, equipment and storage medium
By mapping the initial rendering area of the target object to a larger target rendering area in multimedia editing, the truncation problem of map animation display is solved, and efficient map display is achieved under a single rendering channel, reducing the performance burden.
Patent Information
- Application Number
- CN202310706575.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-17
AI Technical Summary
In multimedia editing, truncation is prone to occur when displaying map animations, resulting in poor results. The existing technology solves the problem of calculations through multiple rendering channels, which increases the performance burden.
By determining the initial rendering area of the target object and mapping it to a larger target rendering area, establishing a position mapping relationship, performing rendering and map mapping, ensuring that the map is not truncated in a single rendering channel.
It realizes no truncation of map display in a single rendering channel, reducing the amount of calculation and improving rendering performance.
Smart Images

Figure CN119152095A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular, to an image processing method, apparatus, device and storage medium. Background Art
[0002] When multimedia is edited, editing effects are usually displayed through stickers, which are usually displayed through grids. When stickers are animated, the sticker content is limited to a grid. When the sticker content is animated, it may be truncated, resulting in poor sticker animation display effects.
[0003] At present, in order to solve the problem of truncation of texture content when texture animation is displayed, two rendering channels are used to implement the texture animation. That is to say, multiple cameras are used to render the scene. However, this method requires additional rendering channels, which requires a large amount of calculation and increases the performance burden. Summary of the invention
[0004] The present disclosure provides an image processing method, apparatus, device and storage medium to solve the technical problems of large amount of calculation and increased performance burden caused by realizing texture animation display through multiple rendering channels.
[0005] In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
[0006] In response to a display operation on a target object, determining an initial rendering area of the target object;
[0007] Mapping an initial rendering area of the target object to a target rendering area, and determining a position mapping relationship between the initial rendering area and the target rendering area;
[0008] Rendering the target object in the target rendering area to obtain an initial object map;
[0009] Based on the position mapping relationship, the initial object map is mapped from the target rendering area to the initial rendering area to obtain a target object map, and the target object is displayed based on the target object map.
[0010] In a second aspect, the present disclosure also provides an image processing device, including:
[0011] An initial rendering area determination module, configured to determine an initial rendering area of a target object in response to a display operation on the target object;
[0012] A rendering area mapping module, used to map an initial rendering area of the target object to a target rendering area, and determine a position mapping relationship between the initial rendering area and the target rendering area;
[0013] An initial object map generation module is used to render the target object in the target rendering area to obtain an initial object map;
[0014] The target object display module is used to map the initial object map from the target rendering area to the initial rendering area based on the position mapping relationship to obtain a target object map, and display the target object based on the target object map.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] a storage device for storing one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any embodiment of the present disclosure.
[0019] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the image processing method as described in any embodiment of the present disclosure.
[0020] The technical solution of the disclosed embodiment determines an initial rendering area of the target object in response to a display operation on the target object; maps the initial rendering area of the target object to a target rendering area, and determines a position mapping relationship between the initial rendering area and the target rendering area; renders the target object in the target rendering area to obtain an initial object map; based on the position mapping relationship, maps the initial object map from the target rendering area to the initial rendering area to obtain a target object map, and displays the target object based on the target object map. By first enlarging the rendering area of the target object and mapping it to the target rendering area, and then mapping the map drawn in the target rendering area to the initial rendering area, it is achieved that only a single rendering channel is required to achieve non-truncation map display, and solves the technical problems of large computational complexity and poor performance when rendering with multiple rendering channels. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0022] Figure 1A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0023] Figure 2a is a schematic diagram of a region expansion provided by an embodiment of the present disclosure;
[0024] Figure 2b It is a schematic diagram of the text texture display effect of a single rendering channel in the prior art;
[0025] Figure 2c This is a schematic diagram of a text sticker display effect provided by an embodiment of the present disclosure;
[0026] Figure 3 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;
[0027] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0034] Figure 1 A flow chart of an image processing method provided in an embodiment of the present disclosure is applicable to situations when a target object is displayed, such as situations when objects such as text stickers / picture stickers are displayed. The method can be executed by an image processing device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0035] like Figure 1 As shown, the method includes:
[0036] S110: In response to a display operation on a target object, determine an initial rendering area of the target object.
[0037] In order to solve the technical problem that the target object is truncated when displayed through a texture animation, and the computational problem that multiple rendering channel processing leads to large computational complexity and poor rendering performance, the disclosed embodiment provides a technical solution for texture rendering through a single rendering channel. In general, the initial rendering area of the target object is first enlarged, a texture is constructed in the enlarged rendering area, and then the texture is adjusted to the initial rendering area, so that the texture will not be affected by the fixed mesh size, and the texture is prevented from being truncated by the mesh. At the same time, the single channel has low computational complexity, which can improve rendering performance.
[0038] Optionally, the target object may be any object that can be displayed by a sticker. Taking the field of multimedia file processing as an example, the target object is text or an image, wherein the text may be text of any font, any size, and any shape, and the image may be a static image, a virtual reality (VR) object, an augmented reality (AR) object, etc.
[0039] For example, when a user renders text and needs to display it through a texture, the target object is the text; for another example, when a user renders a video image frame or an image or a VR / AR object and needs to display it through a texture, the target object is the corresponding image.
[0040] In this embodiment, the initial rendering area of the target object can be understood as the original area when rendering the target object. Taking the existing texture display as an example, the texture of the target object is displayed in a fixed mess, and the fixed mess area is used as the initial rendering area of the target object.
[0041] S120: Map an initial rendering area of the target object to a target rendering area, and determine a position mapping relationship between the initial rendering area and the target rendering area.
[0042] In order to avoid the fixed initial rendering area being unable to render the target object completely, and the map showing the truncated target object, in this embodiment, the rendering area of the target object is first enlarged to the target rendering area, the initial rendering area is mapped to the target rendering area, and the target object is rendered in the enlarged target rendering area, so that the rendered map is not limited by the size of the initial rendering area and can render the complete target object. Optionally, the target rendering area is an area that includes the initial rendering area and is larger than the initial rendering area. When determining the target rendering area, it is sufficient as long as the above conditions are met.
[0043] Among them, mapping the initial rendering area to the target rendering area can be understood as mapping the area coordinates in the initial rendering area to the area coordinates in the target rendering area, and the position mapping relationship between the initial rendering area and the target rendering area can also be understood as the position mapping relationship between the corresponding coordinate points in the initial rendering area and the target rendering area.
[0044] Assuming that the target rendering area is a square centered at the center of the initial rendering area and having a side length that is twice the side length of the initial rendering area, mapping the initial rendering area to the target rendering area can be understood as mapping the coordinate points in the initial rendering area to the target rendering area. Taking the upper left corner point of the initial rendering area as an example, it is mapped to the upper left corner point of the target rendering area. Based on the coordinate mapping relationship, the position mapping relationship between the initial rendering area and the target rendering area can be determined.
[0045] The target rendering area can be set according to actual conditions. For example, the target rendering area can be set to a fixed area, or can be set to an area adjusted based on the application scenario. The larger the target rendering area, the more it can ensure that the rendered map will not be truncated.
[0046] In one implementation, a fixed area can be set as the target rendering area based on empirical values. For example, based on historical rendering operations, a fixed area that meets the rendering requirements of the target object in the historical rendering operations is set as the target rendering area. Alternatively, the target rendering area can be directly set to the size of the display area to simplify the setting of the target rendering area and ensure that the map is not truncated to the greatest extent, such as using the display area of the map display device as the target rendering area.
[0047] In another implementation, the target rendering area can be dynamically set based on the current target object or the display device of the map. For example, based on the size of the current target object and the animation requirements, an area that satisfies the animation display of the current target object can be set as the target rendering area; the setting of the target rendering area can also be simplified, and the display area of the display device of the map can be directly used as the target rendering area.
[0048] In an embodiment of the present disclosure, before mapping the initial rendering area of the target object to the target rendering area, the method further includes:
[0049] Acquire an initial grid area of the target object as the initial rendering area;
[0050] The target rendering area is set based on a preset rule and the initial rendering area, wherein the target rendering area includes an initial rendering area and an extended rendering area.
[0051] Optionally, the mesh area of the target object can be directly used as the initial rendering area, the size of the extended rendering area can be preset, and the initial rendering area and the preset extended rendering area can be merged to obtain the target rendering area. The size of the extended rendering area can be set to a fixed value; the extended rendering area can also be set to a value related to the initial rendering area, such as setting the extended rendering area to be a region vertically extended outward by k coordinates based on the boundary of the initial rendering area, where k can be a set value.
[0052] It should be noted that the target rendering area may be set in any one of the above methods or in any combination thereof, and is not limited here.
[0053] S130: Render the target object in the target rendering area to obtain an initial object map.
[0054] In this embodiment, after determining the target rendering area, the target rendering area is used as the rendering area of the target object, and a rendering map of the target object in the target rendering area is obtained as the initial object map. The rendering operation of the target object can refer to the rendering operation in the prior art, and is not limited here, as long as the rendering of the target object can be achieved.
[0055] S140. Based on the position mapping relationship, map the initial object map from the target rendering area to the initial rendering area to obtain a target object map, and display the target object based on the target object map.
[0056] It can be understood that the initial object map is obtained by rendering the target object in the target rendering area. In order to accurately display the target object in the initial rendering area, it is necessary to map the initial object map obtained by rendering the target rendering area back to the initial rendering area to obtain a target object map that conforms to the initial rendering area. In the above steps, after mapping the initial rendering area to the target rendering area, a position mapping relationship between the initial rendering area and the target rendering area can be obtained. Based on the position mapping relationship, the initial object map can be mapped back to the initial rendering area to obtain the target object map.
[0057] In an embodiment of the present disclosure, mapping the initial object map from the target rendering area to the initial rendering area based on the position mapping relationship to obtain the target object map further includes:
[0058] Based on the position mapping relationship, determining a texture mapping relationship in which the initial object texture is mapped from the target rendering area to the initial rendering area;
[0059] According to the texture mapping relationship, the initial object texture is mapped from the target rendering area to the initial rendering area to obtain the target object texture.
[0060] It can be understood that the position mapping relationship between the initial rendering area and the target rendering area represents the coordinate point correspondence relationship between the initial rendering area and the target rendering area, and the initial object map is mapped from the target rendering area to the initial rendering area, which needs to be mapped based on the coordinate point correspondence relationship between the target rendering area and the initial rendering area. Based on this, the mapping relationship (i.e., the map mapping relationship) between the target rendering area and the initial rendering area can be determined based on the position mapping relationship between the initial rendering area and the target rendering area, and then the initial object map is mapped from the target rendering area to the initial rendering area based on the map mapping relationship to obtain the target object map.
[0061] Among them, the texture mapping relationship can be obtained by combining the position mapping relationship and the interpolation characteristics of texture rendering.
[0062] In an embodiment of the present disclosure, determining, based on the position mapping relationship, a texture mapping relationship in which the initial object texture is mapped from the target rendering area to the initial rendering area includes:
[0063] Based on the position mapping relationship, determining initial area position parameters of the initial rendering area in a world coordinate system;
[0064] The texture mapping relationship is determined based on the initial region position parameters and the target region position parameters of the target rendering region.
[0065] It can be understood that the mapping relationship of the target rendering area to the initial rendering area represents the coordinate point mapping relationship of the target rendering area to the initial rendering area. Based on this, the mapping relationship can be determined according to the area coordinates of the target rendering area and the area coordinates of the initial rendering area. Among them, the area coordinates of the target rendering area can be determined by the target rendering area position parameters, and the area coordinates of the initial rendering area can be determined by the initial rendering area position parameters. The target rendering area position parameters are known values and can be obtained by setting the target rendering area. The initial rendering area position parameters can be determined by the position mapping relationship. Both the initial area position parameters and the target area position parameters are parameters in the world coordinate system.
[0066] Among them, the initial area position parameter can be the position information or size information of the initial rendering area, such as the area position of the initial rendering area, the area size of the initial rendering area and other parameters. Correspondingly, the target area position parameter can be the position information or size information of the target rendering area, such as the area position of the target rendering area, the area size of the target rendering area and other parameters.
[0067] In one embodiment of the present disclosure, the initial region position parameter includes vertex position information of the initial rendering region in a world coordinate system, and determining the texture mapping relationship based on the initial region position parameter and the target region position parameter of the target rendering region includes:
[0068] Determine an initial area size parameter of the initial rendering area based on vertex position information of the initial rendering area in a world coordinate system;
[0069] The texture mapping relationship is determined based on the initial region size parameter and the target region position parameter.
[0070] When the initial region position parameter is the vertex position information (coordinates) of the initial rendering region in the world coordinate system, the length and width of the initial rendering region can be calculated based on the vertex position coordinates, thereby obtaining the initial region size parameter of the initial rendering region. Exemplarily, assuming that the vertex position coordinates of the initial rendering region in the world coordinate system are (1,2), (2,2), (1,1) and (2,1), respectively, the length and width of the initial rendering region are 1, that is, the initial region size parameters are: length is 1, width is 1.
[0071] After the initial region size parameters are determined, a mapping relationship between the target region position parameters and the initial region size parameters is used as a texture mapping relationship.
[0072] In an implementation manner of the present disclosure, determining the initial region position parameters of the initial rendering region in the world coordinate system based on the position mapping relationship includes:
[0073] Based on the position mapping relationship, determining a first coordinate mapping relationship in which the boundary point of the initial rendering area is mapped from the target rendering area to the initial rendering area;
[0074] constructing an auxiliary point based on the position mapping relationship and the vertex, and determining a second coordinate mapping relationship of the auxiliary point from the target rendering area to the initial rendering area;
[0075] According to the first coordinate mapping relationship and the second coordinate mapping relationship, vertex position information of the initial rendering area in the world coordinate system is determined, and the initial area position parameters are determined according to the vertex position information.
[0076] It can be understood that the target object is rendered in the target rendering area, and the initial object map obtained has the characteristics of the uv map. When the map is rendered, the interpolation process from the vertex shader to the fragment shader during the rendering process has the interpolation characteristics. The equation can be constructed based on the above two characteristics, and the constructed equation is solved to obtain the area size parameters of the initial rendering area. In other words, when determining the initial area position parameters, the calculation can be combined based on the mapping relationship and the interpolation characteristics. Taking the mapping of any boundary point of the initial rendering area as an example, the first coordinate mapping relationship of the vertex from the target rendering area to the initial rendering area can be determined based on the position mapping relationship and the interpolation characteristics to obtain the first equation. Then construct the auxiliary point, determine the second coordinate mapping relationship of the auxiliary point from the target rendering area to the initial rendering area, and obtain the second equation. Then, the first equation and the second equation are combined to obtain the vertex position information of the initial rendering area in the world coordinate system, thereby determining the initial area position parameters. Among them, the construction of the auxiliary point can be constructed based on the position mapping relationship.
[0077] Optionally, taking the horizontal coordinate of the left vertex of the initial rendering area as x and the horizontal coordinate of the right vertex as x1 as an example, the first coordinate mapping relationship of any boundary point from the target rendering area to the initial rendering area is determined based on the position mapping relationship and the interpolation characteristics, and the first equation obtained is m=(1-u)x1+ux, where m is the horizontal coordinate of the boundary point and u is the size parameter of the initial object map; the second coordinate mapping relationship of the auxiliary point from the target rendering area to the initial rendering area is n=(1-u)-x1+ux, where n is the horizontal coordinate of the auxiliary point and u is the size parameter of the initial object map. The first equation and the second equation are combined to obtain the vertex position coordinates of the initial rendering area, thereby obtaining the area size parameter of the initial rendering area.
[0078] S140. Based on the position mapping relationship, map the initial object map from the target rendering area to the initial rendering area to obtain a target object map, and display the target object based on the target object map.
[0079] After the position mapping relationship is determined, the coordinates of the initial object map in the target rendering area are mapped to the coordinates of the initial rendering area based on the position mapping relationship to obtain the target object map, and the target object map is displayed.
[0080] Optionally, after the target object map is adjusted to the initial rendering area, texture sampling may be performed on the target object map to obtain an object texture map of the target object, and the object texture map may be displayed in the display area.
[0081] The method of performing texture sampling on the target object map may refer to the texture sampling method in the prior art, and is not limited here.
[0082] On the basis of the above solution, the solution provided by the embodiment of the present disclosure also includes:
[0083] In response to a dynamic display operation on a target object, position information of the target object map in a world coordinate system is adjusted based on a dynamic display rule of the dynamic display operation, and the target object is dynamically displayed based on the adjusted target object map.
[0084] After obtaining the target object map, when the user operates to dynamically display the target object, the positions of some coordinate points in the target object map can be adjusted based on the dynamic display rules of the dynamic display, and the target object map after the coordinate point positions are adjusted can be displayed. Taking the up and down floating dynamic display as an example, the vertical coordinates of the coordinate points in the target object map can be dynamically adjusted within a set time period to display the target object map that floats up and down. Based on the technical solution of the embodiment of the present disclosure, when the target object map is animatedly displayed, the position information of the target object in the target object map can be adjusted based on the animation to realize the animated display of the map, and the target object map will not be truncated during the animated display.
[0085] The technical solution of the disclosed embodiment determines an initial rendering area of the target object in response to a rendering operation on the target object; enlarges the initial rendering area of the target object to a target rendering area, renders the target object in the target rendering area to obtain an initial object map; maps the initial object map to the initial rendering area to obtain a target object map; performs texture sampling on the target object map to obtain an object texture map, and displays the object texture map. By first enlarging the rendering area of the target object and mapping it to the target rendering area, and then mapping the initial object map drawn in the target rendering area back to the target rendering area for display, it is achieved that only a single rendering channel is required to achieve non-truncated map display, and the technical problems of large computational complexity and poor performance when rendering with multiple rendering channels are solved.
[0086] Taking the target object as text as an example, the display of text stickers is illustrated.
[0087] Before text model is textured, it is necessary to convert the text model to clip space, implement text texture in clip space, and display the texture in screen space. Optionally, the mesh can be converted from model space to clip space by multiplying uMVP in the rendering pipeline. It should be noted that in clip space, the coordinates of any coordinate axis are always limited to [-1, 1].
[0088] After converting the mesh to clip space, the mesh is processed. Specifically:
[0089] (1) Use UV information to map the mesh area of the text model to the screen area.
[0090] Figure 2a FIG. 1 is a schematic diagram of a region expansion provided by an embodiment of the present disclosure. Figure 2aAs shown, the mesh area of the text model (i.e., the initial rendering area) is a rectangular area composed of (0,0) and (1,1), and the screen area is a rectangular area composed of (-1,-1) and (1,1). Expanding the mesh area of the text model to the screen area is equivalent to mapping (0,0) and (1,1) to (-1,-1) and (1,1), that is, clip_space = uv*2-1.
[0091] (2) Calculate the uv of the current vertex through the inverse of uMVP.
[0092] (3) Calculate the size of the original text model through simultaneous equations.
[0093] The specific calculation method may refer to the method of calculating the area position parameters of the initial rendering area in the above embodiment, which will not be described in detail here.
[0094] (4) Obtain the target UV position based on the size of the original text model.
[0095] If the width of the original text model is set to width and the height is set to height, the target uv position can be calculated as follows:
[0096] uv.x-=(x.x+yx)*0.5;
[0097] uv.y+=(x.y+yy)*0.5;
[0098] uv.x / =(width)*0.5;
[0099] uv.y / =(height)*0.5;
[0100] uv = uv * 0.5 + 0.5;
[0101] Among them, x and y are the vertex position coordinates of the original text model (i.e., the initial rendering area).
[0102] (5) Adjust the map position based on the target UV position and display it after texture sampling.
[0103] Figure 2b It is a schematic diagram of the text texture display effect of a single rendering channel in the prior art; Figure 2c Schematic diagram of a text sticker display effect provided by an embodiment of the present disclosure. Figure 2b and Figure 2c As shown, the texture rendering method provided by the embodiment of the present disclosure avoids the truncation of the texture.
[0104] The technical solution of the disclosed embodiment realizes rendering of a complete texture by using UV to convert the initial mesh area into a full-screen mesh in a single rendering channel, and determines the correct UV value in the full-screen mesh by using simultaneous equations to realize accurate display of the complete texture.
[0105] Figure 3 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the device includes: an initial rendering area determination module 310, a rendering area mapping module 320, an initial object map generation module 330 and a target object display module 340.
[0106] An initial rendering area determination module 310, configured to determine an initial rendering area of a target object in response to a display operation on the target object;
[0107] A rendering area mapping module 320, configured to map an initial rendering area of the target object to a target rendering area, and determine a position mapping relationship between the initial rendering area and the target rendering area;
[0108] An initial object map generation module 330 is used to render the target object in the target rendering area to obtain an initial object map;
[0109] The target object display module 340 is used to map the initial object map from the target rendering area to the initial rendering area based on the position mapping relationship to obtain a target object map, and display the target object based on the target object map.
[0110] The technical solution of the disclosed embodiment determines an initial rendering area of the target object in response to a rendering operation on the target object; enlarges the initial rendering area of the target object to a target rendering area, renders the target object in the target rendering area to obtain an initial object map; maps the initial object map to the initial rendering area to obtain a target object map; performs texture sampling on the target object map to obtain an object texture map, and displays the object texture map. By first enlarging the rendering area of the target object and mapping it to the target rendering area, and then mapping the initial object map drawn in the target rendering area back to the target rendering area for display, it is achieved that only a single rendering channel is required to achieve non-truncated map display, and the technical problems of large computational complexity and poor performance when rendering with multiple rendering channels are solved.
[0111] Based on any optional technical solution in the embodiments of the present disclosure, optionally, a target area setting module is further included, which is used to:
[0112] Before mapping the initial rendering area of the target object to the target rendering area, acquiring an initial grid area of the target object as the initial rendering area;
[0113] The target rendering area is set based on a preset rule and the initial rendering area, wherein the target rendering area includes an initial rendering area and an extended rendering area.
[0114] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the target object display module 340 is specifically used to:
[0115] Based on the position mapping relationship, determining a texture mapping relationship in which the initial object texture is mapped from the target rendering area to the initial rendering area;
[0116] According to the texture mapping relationship, the initial object texture is mapped from the target rendering area to the initial rendering area to obtain the target object texture.
[0117] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the target object display module 340 is specifically used to:
[0118] Based on the position mapping relationship, determining initial area position parameters of the initial rendering area in a world coordinate system;
[0119] The texture mapping relationship is determined based on the initial region position parameters and the target region position parameters of the target rendering region.
[0120] On the basis of any optional technical solution in the embodiments of the present disclosure, optionally, the initial area position parameter includes vertex position information of the initial rendering area in the world coordinate system, and the target object display module 340 is specifically used to:
[0121] Determine an initial area size parameter of the initial rendering area based on vertex position information of the initial rendering area in a world coordinate system;
[0122] The texture mapping relationship is determined based on the initial region size parameter and the target region position parameter.
[0123] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the target object display module 340 is specifically used to:
[0124] Based on the position mapping relationship, determining a first coordinate mapping relationship in which the boundary point of the initial rendering area is mapped from the target rendering area to the initial rendering area;
[0125] constructing auxiliary points based on the position mapping relationship and the boundary points, and determining a second coordinate mapping relationship of the auxiliary points from the target rendering area to the initial rendering area;
[0126] According to the first coordinate mapping relationship and the second coordinate mapping relationship, vertex position information of the initial rendering area in the world coordinate system is determined, and the initial area position parameters are determined according to the vertex position information.
[0127] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the target object is text or an image.
[0128] Based on any optional technical solution in the embodiments of the present disclosure, optionally, the device further includes a dynamic display module for:
[0129] In response to a dynamic display operation on a target object, position information of the target object map in a world coordinate system is adjusted based on a dynamic display rule of the dynamic display operation, and the target object is dynamically displayed based on the adjusted target object map.
[0130] The image processing device provided in the embodiments of the present disclosure can execute the image processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0131] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0132] Figure 4 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 4 , which shows an electronic device (eg, Figure 4 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0133] like Figure 4As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An edit / output (I / O) interface 405 is also connected to the bus 404.
[0134] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0135] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0136] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0137] The electronic device provided by the embodiment of the present disclosure and the image processing method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0138] The embodiments of the present disclosure further provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the image processing method provided by the above embodiments is implemented.
[0139] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0140] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0141] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0142] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0143] In response to a display operation on a target object, determining an initial rendering area of the target object;
[0144] Mapping an initial rendering area of the target object to a target rendering area, and determining a position mapping relationship between the initial rendering area and the target rendering area;
[0145] Rendering the target object in the target rendering area to obtain an initial object map;
[0146] Based on the position mapping relationship, the initial object map is mapped from the target rendering area to the initial rendering area to obtain a target object map, and the target object is displayed based on the target object map.
[0147] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0149] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0150] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0151] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0152] According to one or more embodiments of the present disclosure, [Example 1] provides an image processing method, including:
[0153] In response to a display operation on a target object, determining an initial rendering area of the target object;
[0154] Mapping an initial rendering area of the target object to a target rendering area, and determining a position mapping relationship between the initial rendering area and the target rendering area;
[0155] Rendering the target object in the target rendering area to obtain an initial object map;
[0156] Based on the position mapping relationship, the initial object map is mapped from the target rendering area to the initial rendering area to obtain a target object map, and the target object is displayed based on the target object map.
[0157] According to one or more embodiments of the present disclosure, [Example 2] provides an image processing method, the method further comprising:
[0158] Before mapping the initial rendering area of the target object to the target rendering area, the method further includes:
[0159] Acquire an initial grid area of the target object as the initial rendering area;
[0160] The target rendering area is set based on a preset rule and the initial rendering area, wherein the target rendering area includes an initial rendering area and an extended rendering area.
[0161] According to one or more embodiments of the present disclosure, [Example 3] provides an image processing method, the method further comprising:
[0162] The mapping of the initial object map from the target rendering area to the initial rendering area based on the position mapping relationship to obtain a target object map further includes:
[0163] Based on the position mapping relationship, determining a texture mapping relationship in which the initial object texture is mapped from the target rendering area to the initial rendering area;
[0164] According to the texture mapping relationship, the initial object texture is mapped from the target rendering area to the initial rendering area to obtain the target object texture.
[0165] According to one or more embodiments of the present disclosure, [Example 4] provides an image processing method, the method further comprising:
[0166] The determining, based on the position mapping relationship, a mapping relationship of the initial object texture from the target rendering area to the initial rendering area comprises:
[0167] Based on the position mapping relationship, determining initial area position parameters of the initial rendering area in a world coordinate system;
[0168] The texture mapping relationship is determined based on the initial region position parameters and the target region position parameters of the target rendering region.
[0169] According to one or more embodiments of the present disclosure, [Example 5] provides an image processing method, the method further comprising:
[0170] The initial region position parameter includes vertex position information of the initial rendering region in a world coordinate system, and determining the texture mapping relationship based on the initial region position parameter and the target region position parameter of the target rendering region includes:
[0171] Determine an initial area size parameter of the initial rendering area based on vertex position information of the initial rendering area in a world coordinate system;
[0172] The texture mapping relationship is determined based on the initial region size parameter and the target region position parameter.
[0173] According to one or more embodiments of the present disclosure, [Example 6] provides an image processing method, the method further comprising:
[0174] The determining, based on the position mapping relationship, initial region position parameters of the initial rendering region in a world coordinate system comprises:
[0175] Based on the position mapping relationship, determining a first coordinate mapping relationship in which the boundary point of the initial rendering area is mapped from the target rendering area to the initial rendering area;
[0176] constructing auxiliary points based on the position mapping relationship and the boundary points, and determining a second coordinate mapping relationship of the auxiliary points from the target rendering area to the initial rendering area;
[0177] According to the first coordinate mapping relationship and the second coordinate mapping relationship, vertex position information of the initial rendering area in the world coordinate system is determined, and the initial area position parameters are determined according to the vertex position information.
[0178] According to one or more embodiments of the present disclosure, [Example 7] provides an image processing method, the method further comprising:
[0179] The target object is text or an image.
[0180] According to one or more embodiments of the present disclosure, [Example 8] provides an image processing method, the method further comprising:
[0181] In response to a dynamic display operation on a target object, position information of the target object map in a world coordinate system is adjusted based on a dynamic display rule of the dynamic display operation, and the target object is dynamically displayed based on the adjusted target object map.
[0182] According to one or more embodiments of the present disclosure, [Example 9] provides an image processing device, the device comprising:
[0183] An initial rendering area determination module, configured to determine an initial rendering area of a target object in response to a display operation on the target object;
[0184] A rendering area mapping module, used to map an initial rendering area of the target object to a target rendering area, and determine a position mapping relationship between the initial rendering area and the target rendering area;
[0185] An initial object map generation module is used to render the target object in the target rendering area to obtain an initial object map;
[0186] The target object display module is used to map the initial object map from the target rendering area to the initial rendering area based on the position mapping relationship to obtain a target object map, and display the target object based on the target object map.
[0187] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0188] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0189] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An image processing method, characterized in that: include: In response to a display operation on a target object, determining an initial rendering area of the target object; Mapping an initial rendering area of the target object to a target rendering area, and determining a position mapping relationship between the initial rendering area and the target rendering area; Rendering the target object in the target rendering area to obtain an initial object map; Based on the position mapping relationship, the initial object map is mapped from the target rendering area to the initial rendering area to obtain a target object map, and the target object is displayed based on the target object map.
2. The method according to claim 1, characterized in that Before mapping the initial rendering area of the target object to the target rendering area, the method further includes: Acquire an initial grid area of the target object as the initial rendering area; The target rendering area is set based on a preset rule and the initial rendering area, wherein the target rendering area includes an initial rendering area and an extended rendering area.
3. The method according to claim 1, characterized in that The mapping of the initial object map from the target rendering area to the initial rendering area based on the position mapping relationship to obtain a target object map further includes: Based on the position mapping relationship, determining a texture mapping relationship in which the initial object texture is mapped from the target rendering area to the initial rendering area; According to the texture mapping relationship, the initial object texture is mapped from the target rendering area to the initial rendering area to obtain the target object texture.
4. The method according to claim 3, characterized in that The determining, based on the position mapping relationship, a mapping relationship of the initial object texture from the target rendering area to the initial rendering area comprises: Based on the position mapping relationship, determining initial area position parameters of the initial rendering area in a world coordinate system; The texture mapping relationship is determined based on the initial region position parameters and the target region position parameters of the target rendering region.
5. The method according to claim 4, characterized in that The initial region position parameter includes vertex position information of the initial rendering region in a world coordinate system, and determining the texture mapping relationship based on the initial region position parameter and the target region position parameter of the target rendering region includes: Determine an initial area size parameter of the initial rendering area based on vertex position information of the initial rendering area in a world coordinate system; The texture mapping relationship is determined based on the initial region size parameter and the target region position parameter.
6. The method according to claim 4, characterized in that The determining, based on the position mapping relationship, initial region position parameters of the initial rendering region in a world coordinate system comprises: Based on the position mapping relationship, determining a first coordinate mapping relationship in which the boundary point of the initial rendering area is mapped from the target rendering area to the initial rendering area; constructing auxiliary points based on the position mapping relationship and the boundary points, and determining a second coordinate mapping relationship of the auxiliary points from the target rendering area to the initial rendering area; According to the first coordinate mapping relationship and the second coordinate mapping relationship, vertex position information of the initial rendering area in the world coordinate system is determined, and the initial area position parameters are determined according to the vertex position information.
7. The method according to claim 1, characterized in that The target object is text or an image.
8. The method according to claim 1, characterized in that Also includes: In response to a dynamic display operation on a target object, position information of the target object map in a world coordinate system is adjusted based on a dynamic display rule of the dynamic display operation, and the target object is dynamically displayed based on the adjusted target object map.
9. An image processing device, characterized in that: include: An initial rendering area determination module, configured to determine an initial rendering area of a target object in response to a display operation on the target object; A rendering area mapping module, used to map an initial rendering area of the target object to a target rendering area, and determine a position mapping relationship between the initial rendering area and the target rendering area; An initial object map generation module is used to render the target object in the target rendering area to obtain an initial object map; The target object display module is used to map the initial object map from the target rendering area to the initial rendering area based on the position mapping relationship to obtain a target object map, and display the target object based on the target object map.
10. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any one of claims 1 to 8.
11. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the image processing method according to any one of claims 1 to 8 when executed by a computer processor.
