Model scaling method, storage medium, electronic device, and computer program product
By segmenting the image model into multiple areas and adopting different scaling strategies, the cumbersome problem of model scaling and copying operations in sandbox games is solved, achieving convenient model editing and efficient user experience.
Patent Information
- Application Number
- CN202210105864.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-01-28
AI Technical Summary
In sandbox games, users need to manually modify multiple model parameters for scaling and copying operations, resulting in huge workloads and poor user experience, especially when using their own models for scene construction, there is a lack of convenient tools to adjust models. Size and position.
By segmenting the image model into multiple areas and adopting different scaling strategies, the top angle area remains unchanged, the edge area is scaled in the preset direction, and the center area is scaled in multiple directions, so it realizes flexible scaling and copying of the image model, which is suitable for a variety of purposes Original model.
It simplifies the model editing process, improves the user's operating freedom and user experience, reduces the hassle of users to manually modify parameters, and is suitable for models established by a variety of modeling software.
Smart Images

Figure CN114445281B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a model scaling method, a storage medium, an electronic device, and a computer program product. Background Art
[0002] At present, the development of game software is becoming more and more prosperous, and the operations provided by users to game software are becoming more and more diversified. In sandbox games that allow players to transform the world, users usually need to edit various material models provided in the game (for example, scaling, copying, rotating, etc.) to build their favorite scenes.
[0003] However, when editing a model, users can only use the model resources officially provided by the modeling software. For example, if you want to edit a stair model built using Unity software, you can only call Unity's plug-in to modify the stair model because such an operation is relatively convenient.
[0004] When users want to use their own models in the game to participate in scene construction, there will be problems with adaptive application. For example, when a user needs to use his own model to build a house in a scene, he needs to personalize the size, shape and other details of the model. If the house you want to build is 3D, or a complex house with multiple elements (for example, multiple floors, a rooftop, steps at the entrance on the first floor, columns at the four corners, etc.), then you need to personalize many models separately, and once you need to scale, copy (these two operations are obviously inevitable operations in sandbox games), you must manually modify the model parameters, and the workload will be huge.
[0005] Therefore, it is necessary to design a very convenient tool that allows users to adjust the size, position and other characteristics of the original model at will. Moreover, the tool can be used for a variety of original models, that is, the use of the tool is irrelevant to which modeling software the original model is built with. Summary of the invention
[0006] In order to solve the above defects, facilitate users to edit models conveniently, and improve the freedom of users to edit models, the present invention proposes a model scaling method and a storage medium, an electronic device, and a computer program product.
[0007] A model scaling method, used for electronic equipment, comprising:
[0008] Selecting an image model, and determining a two-dimensional operation surface in the image model for assisting the scaling of the image model, wherein the two-dimensional operation surface includes a plurality of vertex areas, a plurality of edge areas, and at least one center area;
[0009] receiving a scaling instruction for the two-dimensional operation surface, wherein the scaling instruction instructs the two-dimensional operation surface to deform along a first direction, and correspondingly causes the image model to deform synchronously with the two-dimensional operation surface;
[0010] During the deformation of the two-dimensional operating surface along the first direction, the shape and size of the vertex area remain unchanged, the edge area is scaled along a preset direction, and the center area is scaled along the first direction, wherein the preset direction is a component direction of the first direction.
[0011] In the above-mentioned model scaling method, determining the two-dimensional operation surface in the image model includes:
[0012] Selecting a first surface of the image model, and setting a circumscribed rectangular frame on the periphery of the first surface;
[0013] The area defined by the circumscribed rectangular frame is determined as the two-dimensional operation surface.
[0014] In the above-mentioned model scaling method, the sides of the two-dimensional operation surface are divided into three parts respectively, so as to divide the two-dimensional operation surface into nine areas; wherein the nine areas include: four corner areas, four edge areas and one center area.
[0015] In the above-mentioned model scaling method, the first direction is decomposed into an X direction and a Y direction along two intersecting edges of the two-dimensional operation surface. When the two-dimensional operation surface is stretched to an integer multiple in the X direction and / or the Y direction, a plurality of the image models are copied according to the initial size of the image model.
[0016] In the above-mentioned model scaling method, when the image model is a three-dimensional model, the two-dimensional operation plane is determined for each surface of the three-dimensional model.
[0017] In the above-mentioned model scaling method, for more than two image models, model association is also included, specifically including:
[0018] The vertex area of the first two-dimensional operation surface in the first image model and the vertex area of the second two-dimensional operation surface in the second image model are anchored to each other, and when a scaling instruction for the first two-dimensional operation surface is received, the second two-dimensional operation surface:
[0019] Execute the same scaling instruction as the first two-dimensional operation plane; or
[0020] The original size and shape are kept unchanged, and the first two-dimensional operation surface is filled in a copying manner.
[0021] In the above-mentioned model scaling method, when the second two-dimensional operation plane is included in the first two-dimensional operation plane:
[0022] When the first two-dimensional operation surface is stretched to an integer multiple in the length direction and / or the width direction, the first two-dimensional operation surface is enlarged;
[0023] When the second two-dimensional operation surface is stretched to an integer multiple in the length direction and / or the width direction, the second image model is replicated.
[0024] In the above-mentioned model scaling method, when the edge of the main image in the image model is a non-straight line, two adjacent image models are partially overlapped to make the main image continuous.
[0025] Based on the same inventive concept, the present invention also provides a computer-readable storage medium, in which at least one computer instruction is stored. The at least one instruction is loaded and executed by a processor to implement the above-mentioned model scaling method.
[0026] Based on the same inventive concept, the present invention also provides an electronic device, including:
[0027] at least one memory for storing computer instructions;
[0028] At least one processor, when the at least one processor executes the computer instructions, implements the above-mentioned model scaling method.
[0029] Based on the same inventive concept, the present invention also provides a computer program product, including a computer program, which implements the above-mentioned model scaling method when executed by a processor.
[0030] Compared with the prior art, the technical solution proposed in this application divides the image model into regions (if it is a three-dimensional model, multiple faces are operated separately). During the scaling process, different types of regions have different scaling strategies, so that the central area of the image model can be scaled normally, while the edge area of the image model is only scaled along the preset direction or even not scaled. It can be seen that this scaling method is particularly suitable for models with strip-like features in the edge area. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 and Figure 2 is a comparison of the effects of the stretched image model (schematic diagram) in the prior art, where Figure 1 The initial image model is shown. Figure 2 Shown is the result of stretching the initial image model to the right;
[0032] Figure 3It is a schematic diagram of dividing the image model into regions in the present invention;
[0033] Figure 4 is a flow chart of a scaling method according to some embodiments of the present invention;
[0034] Figure 5-6 In the present invention, Figure 1 The image model (schematic diagram) shown in FIG. 1 is used to compare the effects of scaling, where: Figure 5 This is the result of stretching the initial image model to the right to 1.5 times its size. Figure 6 This is the result of stretching the initial image model to the right to twice its size;
[0035] Figure 7 and Figure 8 This is the comparison of the effect of stretching the house foundation model;
[0036] Fig. 9 It is an image model of the front of a first-floor shop;
[0037] Fig.10 Yes Fig. 9 The effect of stretching it upwards by one time (copying it);
[0038] Fig.11 It is a rendering of the initial image model, which is a wall surface containing only one window, magnified several times (copied);
[0039] Fig.12 It is another effect diagram that enlarges (copies) the initial image model of a wall containing only one window several times;
[0040] Fig.13 It is a basic hardware structure diagram of an electronic device in the present invention. DETAILED DESCRIPTION
[0041] The following specific embodiments illustrate the implementation of the present invention, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Although the description of the present invention will be introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to this implementation. On the contrary, the purpose of introducing the invention in conjunction with the implementation is to cover other options or modifications that may extend based on the claims of the present invention. In order to provide a deep understanding of the present invention, the following description will include many specific details. The present invention can also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present invention, some specific details will be omitted in the description. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0042] It should be noted that in this specification, similar numbers and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings and is assumed to be the same definition.
[0043] As explained in the background technology, in existing sandbox games, when it is necessary to scale or copy an image model, the model parameters must be manually modified. For example, if the parameters are not manually modified, the scaled image may have unexpected effects. For example, "unexpected effects" can be found in Figure 1 and Figure 2 comparison. Figure 1 The diagram shows an initial image model, which represents an image model with frame structural features such as the basic frame, windows, and picture frames of an ancient building. Figure 2 It indicates that Figure 1 The results of the initial image model being stretched to the right / left are shown. By comparison, it can be seen that the parts of the top corners A, C, G, and I (the dot coverage area) of the model are deformed during the stretching process. Figure 1 In the figure, the vertex areas A, C, G, and I are squares, while in Figure 2 In the figure, the shapes of the top corner regions A, C, G, and I are rectangular. In some application scenarios, the graphic features located in the top corner regions A, C, G, and I are not expected to be deformed during the stretching process. For example, the basic frame of a house is usually represented by columns in the top corner regions A, C, G, and I. When the basic frame of the house is stretched to expand the floor area of the house, the columns in the top corner regions do not need to change.
[0044] However, in the prior art, when stretching or scaling an image model, the entire model is deformed together, so the user has to manually modify some parameters to meet the needs of building a house, which results in a poor user experience.
[0045] The inventive concept of the present invention is to divide the image model into multiple areas, for example, using the geometric dividing line (and its extension line) of the main figure in the image as the dividing line, and adopting different scaling strategies in different areas to meet the special needs of different image models during the scaling process, thereby reducing the trouble of users manually modifying parameters.
[0046] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0047] Figure 3It is a schematic diagram of the regional division of the image model in the present invention. The image model shown in the figure is a top view of a house (excluding the roof) of a national style ancient building. For such a house, there are columns at the four corners, the four sides correspond to the walls, and the space in the middle corresponds to the space of the house. On this basis, when it is necessary to use the image model to build a house by stretching or scaling, what is actually needed is to stretch the wall to make the room longer or larger, but at the same time, it is not necessary to simultaneously thicken the wall or stretch / scale the column. Therefore, the present invention determines a two-dimensional operation surface that coincides with the image model for the graphic model, and divides the two-dimensional operation surface into vertex areas A, C, G, I, edge areas B, D, F, H and center area E. Among them, the vertex areas A, C, G, I correspond to the columns of the house, the edge areas B, D, F, H correspond to the walls of the house, and the center area E corresponds to the internal space of the house. Further, no matter what shape the actual outline of the image model is, the image model can be mapped to a rectangular range by setting a circumscribed rectangle for the image model. Then, the above-mentioned two-dimensional operation surface is determined for the circumscribed rectangle, and further, on the two-dimensional operation surface, the ranges of the vertex area, the edge area and the center area are determined in combination with the features of each part of the graphic model.
[0048] The following combination Figure 4 How to use Figure 3 The partitions shown are used to scale the image model for further explanation. Figure 4 is a flow chart of a scaling method proposed according to some embodiments of the present invention.
[0049] S1: Select an image model, and determine a two-dimensional operation surface in the image model for assisting the scaling of the image model, wherein the two-dimensional operation surface includes: a plurality of vertex areas, a plurality of edge areas, and at least one center area.
[0050] First, the image model to be processed can be a two-dimensional model or a three-dimensional model. For a two-dimensional model, the two-dimensional operation surface can be directly determined for the two-dimensional image model as described above. For a three-dimensional model, the two-dimensional operation surface can be determined for each surface in the image model. The difference is that the two-dimensional operation surface of each surface of the three-dimensional model is not completely isolated, that is, there is a mutually constrained relationship between each two-dimensional operation surface of the same three-dimensional model. When scaling a two-dimensional operation surface, other two-dimensional operation surfaces that intersect with it (having common edges) are not directly operated, but also change synchronously (including two-dimensional operation surfaces that do not intersect with the two-dimensional operation surface being scaled, but intersect with the two-dimensional operation surface that changes synchronously, and so on). For example, when scaling a three-dimensional house model, the front of the house can be determined as the first two-dimensional operation surface. When the first operation surface is operated to scale, since the two side surfaces, the top surface (ceiling) and the bottom surface (ground) of the house all have edges intersecting with the front of the house, when the first two-dimensional operation surface is scaled, the above-mentioned surfaces are changed accordingly, and under the premise that the top surface, the bottom surface and the two side surfaces of the house are changed, the back of the house is also changed accordingly. On the other hand, when the top surface is determined as the second two-dimensional operation surface in the second step, when the second two-dimensional operation surface is operated to scale, the front, the two side surfaces, the back and the bottom surface (ground) of the house are also changed accordingly. In other embodiments of the present invention, constraint rules can also be set, and for the two-dimensional operation surface that has been operated, it will no longer change in the subsequent operation process for other operation surfaces, that is, the first step scales and adjusts the front surface. In this case, in the process of adjusting the top surface in the second step, the edge intersecting the top surface and the front surface does not change according to the operation of the second step. In other words, the front surface adjusted in the first step constrains the adjustment range of the top surface in the second step.
[0051] Secondly, if the image model to be processed is not rectangular, a circumscribed rectangular frame can be set around the model, and the range defined by the rectangular frame is used as the two-dimensional operation surface. Preferably, the smallest circumscribed rectangular frame is selected, or the circumscribed rectangular frame that is most convenient for dividing the two-dimensional operation surface is selected.
[0052] Then, the two-dimensional operation surface is divided into regions. Usually, a division method similar to the nine-square grid is adopted. That is, each side of the rectangular two-dimensional operation surface is divided into three parts, wherein the two opposite sides are divided using the same rule, that is, the added dividing lines are ensured to be parallel to the sides of the rectangle, thereby forming nine rectangular regions. For these nine regions, they can be defined as follows Figure 3The four vertex areas A, C, G, I, the four edge areas B, D, F, H and the one center area E are shown. Obviously, although the name of the Nine-square grid is borrowed here, the technical solution proposed by the present invention does not require that each grid of the Nine-square grid is evenly distributed. The purpose of the division of the two-dimensional operation surface in this application is to distinguish the different scaling strategies of each part of the image in the image model. The scaling strategy refers to how the part of the image changes accordingly during the scaling process. In addition, the 4×3 or 4×4 area segmentation method can also be used, depending on the characteristics of each part of the image.
[0053] Then you can set different scaling policies for different regions. For example, Figure 3 In the image model shown, the four corner regions A, C, G, and I can be set to be non-deformed and always maintain their original shape and size; the four edge regions B, D, F, and H are only scaled along their length direction, and the width direction always maintains the original size. Figure 3 In the orientation shown, edge areas B and H are only scaled in the horizontal direction, and the width in the vertical direction remains unchanged during the scaling process; edge areas D and F are only scaled in the vertical direction, and the width in the horizontal direction remains unchanged during the scaling process; the center area E can be scaled in both the horizontal and vertical directions. In other image models, an XY plane can also be set to limit the scaling strategy of some areas in the X and Y directions. For example, based on the premise that the two-dimensional operating surface is a rectangle, the two intersecting edges in the two-dimensional operating surface can be defined as the X-axis and the Y-axis, respectively. The X direction corresponding to the X-axis is the horizontal direction, and the Y direction corresponding to the Y-axis is the vertical direction. In such a case, Figure 3 In the model shown, the edge regions B and H are scaled only along the X direction, the edge regions D and F are scaled only along the Y direction, and the central region E can be scaled simultaneously along the X direction and the Y direction.
[0054] Next, when a zoom instruction for the two-dimensional operation surface is received, step S2 may be executed.
[0055] S2: deforming the two-dimensional operation surface along a first direction according to the scaling instruction, and correspondingly deforming the image model synchronously with the two-dimensional operation surface.
[0056] Specifically, when the electronic device supports mouse input, the zoom instruction is generally indicated by a mouse dragging action, and the first direction is the direction of the mouse motion trajectory. When the electronic device supports touch screen input, the zoom instruction can be indicated by a user's touch sliding operation. In most cases, the motion trajectory can be decomposed into a horizontal direction and a vertical direction, that is, the first direction can be decomposed into a direction along the edge area B (reference Figure 3 ) in the length direction (X direction) and along the edge area D (reference Figure 3)’s length direction (Y direction).
[0057] According to the preset scaling strategy, when the two-dimensional operating surface is deformed along the first direction, the relative positions of the nine areas do not change, the sizes of the vertex areas A, C, G, and I remain unchanged, the center area E is synchronously scaled along the first direction (i.e., scaled in the horizontal and vertical directions at the same time), and the edge areas B, D, F, and H are scaled in the preset direction, that is, the edge areas B and H are preset to be scaled only in the horizontal direction (X direction), and the preset direction is the X direction, and the edge areas D and F are preset to be scaled only in the vertical direction (Y direction), and the preset direction is the Y direction.
[0058] Figure 5-6 is based on Figure 4 The method shown is Figure 1 The initial image model (schematic diagram) shown in FIG. 1 is scaled for comparison, where: Figure 5 The initial image model is stretched to the right (in the horizontal direction, i.e., the X direction) to 1.5 times the size. Figure 5 It can be seen that after scaling, the size and shape of the vertex areas A, C, G, and I have not changed, and the original dimensions are maintained, while the edge areas B and H are only elongated in the horizontal direction (X direction) and do not change in size in the vertical direction (Y direction), and the edge areas D and F are not scaled in the vertical direction (Y direction) and the horizontal direction (X direction) (because the first direction given by this scaling instruction has no vertical direction, i.e., Y direction, component); the central area E is enlarged according to the first direction given by the scaling instruction. Since the first direction given by this instruction has only a horizontal direction (X direction) component, the central area E changes only in the horizontal direction (X direction). Figure 6 The result is that the original image model is stretched to the right to 2 times the size. According to the pre-set, when the size of the image model is stretched to an integer multiple of the original image model, the display effect of the stretched (scaled) image model can be as follows Figure 5 As shown, the top corner area is maintained, the edge area is scaled along a component direction of the instruction direction (for example, the first direction), and the center area is scaled along the instruction direction; a copy mode can also be executed, that is, as shown Figure 6 As shown, the two initial image models are used to fill the enlarged area. In other words, this scaling instruction (stretching to 2 times the size) is equivalent to the combination of the three operations of copying, pasting, and aligning.
[0059] Figure 6In the copy mode shown, the newly copied image model is connected to the original image model. This processing method is suitable for the processing effect of the wall (or the whole house). However, when the image model is a window or a chair, it is obviously unreasonable to connect the image models together. In this case, the following two methods can be used to solve the problem.
[0060] First, when setting the two-dimensional operation surface, the two-dimensional operation surface is set to be significantly larger than the image model, that is, the two-dimensional operation surface includes not only the image model itself, but also the part outside the image model. For example, based on the outer edge of the image model itself, the two-dimensional operation surface is uniformly expanded 1 cm outside the image model, so that the two-dimensional operation surface is one circle larger than the original image model. When the two-dimensional operation surface is stretched, the copied image model will be 2 cm away from the original image model. In other embodiments, it is also possible not to uniformly expand outward, so that the circle larger than the original image model by the two-dimensional operation surface is uneven.
[0061] Secondly, a spacing parameter can be set. When the two-dimensional operation surface is stretched to an integer multiple of the original image, the newly copied image model determines the position according to the spacing parameter. For example, the spacing parameters are set to: 2 cm in the X direction and 1 cm in the Y direction. Then, when the two-dimensional operation surface is stretched to twice the size of the original model in the X direction, the newly copied image model is 2 cm away from the original image model in the X direction; when the two-dimensional operation surface is stretched to twice the size of the original model in the Y direction, the newly copied image model is 1 cm away from the original image model in the Y direction.
[0062] Furthermore, this embodiment also includes a fusion step. Figure 6 The stretching result shown is unreasonable, that is, the two repeated walls and two groups of columns in the middle do not conform to the reality. For similar cases, the stretched image model is an integer multiple of the initial graphic model, which leads to repeated walls, frames, decorations, etc. on the boundaries of the image model. Figure 6 When the stretching result is shown, a fusion operation is performed on the adjacent areas. The fusion operation may include two-in-one, mutual offset or overlapping. Specifically, Figure 6 The edge areas F1 and D2 in the middle can perform a mutual offset operation, that is, after stretching / scaling, the house is still a space without a partition wall in the middle. Figure 6 The middle vertex areas C1 and A2 can be processed in two-in-one mode, leaving only one vertex area (the vertex areas I1 and G2 are processed in the same way). Figure 6The effect of stretching to twice the size is as follows: retaining the top corner areas A1, C1 / A2, C2, G1, I1 / G2, and I2, the edge areas B1, B2, D1, F2, H1 and H2, and the center areas E1 and E2.
[0063] The following Figure 7 and Figure 8 ,as well as Fig. 9 and Fig.10 The screenshots shown are used to further illustrate the effects of the above stretching and fusion steps.
[0064] Figure 7 and Figure 8 This is a comparison of the effects of stretching the house foundation model. Figure 7 is an initial model of a house including four walls and four columns (the figure shows an exploded view). Figure 7 After the house is stretched, Figure 8 The effect shown is that only the two walls facing each other on the left and right are stretched, while the two walls facing each other on the top and bottom and the pillars at the four corners do not change in size. In other words, the top corner area does not change, the edge area only changes in the specified direction, and the center area changes in the command direction.
[0065] Fig. 9 This is an image model of the front of a store. After receiving an upward stretch instruction, the effect of adding a second-floor store is achieved through the copy mode. At the same time, it also includes a fusion operation. Fig. 9 The columns on both sides of the front of the shop are higher than the wall of the front of the shop, as shown in the top corner areas A and C. Fig. 9 For the main image in the image model, i.e., the front of the store, the edge area B between the top corner areas A and C is actually a hollow area, which does not contain the information of the front of the store. The sky seen in the picture is the background image of the next layer revealed through the image model of the store. It is known to those skilled in the art that when Fig. 9 The next layer of the store image model shown is another image, and the edge area B will display the other image. If the fusion operation is not performed, a gap (sky) will appear at the edge area B between the first floor and the second floor, which does not conform to normal logic. Fig.10 For the second-floor shop shown in the figure, the fusion operation refers to the image model of the first floor of the shop ( Fig. 9 ) in the top corner area A and C, the edge area B and the top corner area G and I, the edge area H (not shown, can be combined with Figure 5 Confirm) to perform the cascade fusion operation. For details, see Fig.10As shown in the figure, the top corner areas A and C and the edge area B of the first-floor shops are superimposed on the top corner areas G and I and the edge area H of the second-floor shops, so that Fig.10 The effect of aligning the square wall of the shop on the second floor (edge area H) with the decoration on the top of the column (vertex area A, C) is shown in the figure. If the fusion operation is not performed, the square wall of the shop on the second floor should be above the top of the column of the shop on the first floor. It can be seen that the fusion operation is suitable for image models whose edge contours of the main image are not smooth or non-linear. When copying and superimposing this type of image model, you can choose to overlap part of two adjacent models (for example, the vertex area or edge area) according to the characteristics of the main image in the image model and / or the use environment of the image model, so that the two adjacent image models can be tightly connected together (without a gap in the middle), as if they were fused.
[0066] Fig.11 and Fig.12 An embodiment of synchronous scaling of a model nested in a model is shown. The initial image model is a composite image model (not shown), which includes an image model of a window (a second image model) and an image model of a wall (a first image model). The model of the window overlaps with the model of the wall, that is, it is displayed as a wall surface including a window, and the size of the wall surface is equivalent to that of the window. Among them, a first two-dimensional operation surface can be set for the wall surface, and a second two-dimensional operation surface can be set for the window body. For two two-dimensional operation surfaces with an overlapping (or nested) relationship, the two two-dimensional operation surfaces can be associated, that is, model association, to obtain a synchronous scaling effect. Specifically, one or more vertex areas of the two-dimensional operation surface can be used as anchor points, and the anchor points on the second two-dimensional operation surface can be made to follow the corresponding anchor points on the first operation surface. When the scaling instruction indicates that the first operation surface is scaled along the first direction, the position of one or more of the anchor points (i.e., vertex areas A, C, G, or I) on the first operation surface changes, and the corresponding anchor points (i.e., vertex areas A, C, G, or I) of the second two-dimensional operation surface respectively follow the anchor points on the first operation surface to change their positions. For example, the vertex area A of the first two-dimensional operation surface and the vertex area A of the second two-dimensional operation surface are used as anchor points, that is, the relative position relationship between the vertex area A of the first two-dimensional operation surface and the vertex area A of the second two-dimensional operation surface is fixed, and the relative position of the two vertex areas A remains unchanged during the scaling process. Further, when the second two-dimensional operation surface is in the copy mode, when the stretched (scaled) size reaches an integer multiple of the initial image model, the image model corresponding to the second two-dimensional operation surface performs a copy operation, that is, copies a new window. In other words, when the size of the first two-dimensional operation surface is stretched to be large enough to accommodate two (or more) second two-dimensional operation surfaces under the operation instruction, one (or more) second two-dimensional operation surfaces are copied and arranged in the above-mentioned first two-dimensional operation surface. Fig.11The effect shown is the effect of copying the initial second image model into a 3×4 array. If the stretching operation is continued on the first two-dimensional operation surface based on the 3×4 array that has been copied, the initial first window can be used as the second two-dimensional operation surface to continue the copying operation by default, or the range of the second two-dimensional operation surface can be selected, such as a custom range of 2×3 or 1×4, and then the top corner area A of the selected second two-dimensional operation surface is used as the anchor point to perform the stretching or copying operation.
[0067] In some other embodiments, two two-dimensional operation surfaces that are in an overlapping (or nested) relationship may not be associated. That is, when the first two-dimensional operation surface is stretched (scaled), the second two-dimensional operation surface remains unchanged and does not change accordingly. For example, when the original image is a row of three windows and a wall near them, that is, the first two-dimensional operation surface is a wall, and the second two-dimensional operation surface is a row of three windows (not shown), the first two-dimensional operation surface (wall) and the second two-dimensional operation surface (window) are not associated with each other. When the scaling instruction indicates that the first two-dimensional operation surface is stretched, as shown in FIG. Fig.12 As shown in the figure, the wall changes (becomes wider), but no window appears in the newly added wall part, that is, the above-mentioned row of three windows does not change. Because the first two-dimensional operating surface (wall) and the second two-dimensional operating surface (window) are not set to be related to each other, when the wall is stretched, the stretching effect is as follows Fig.12 As shown in the blank part of the wall on the right, the wall has been pulled out, but no new window has been added.
[0068] In summary, the present invention divides the initial image model into regions and executes different scaling strategies for different regions to achieve multiple operations on the initial model through simple stretching (scaling) instructions, thereby simplifying the operation process and greatly improving the user experience.
[0069] The embodiments of the model scaling method provided by the present invention can be run in a variety of terminals. For example, the terminal can be an electronic device such as a mobile phone, a computer, or a PAD. Fig.13 A basic hardware structure diagram of the electronic device 100 is given.
[0070] like Fig.13 As shown, the electronic device 100 at least includes a main processor 101 and a storage medium 103. According to different actual use requirements, the electronic device 100 may also include a coprocessor 102, an I / O unit 104, a network communication unit 105, and some other expansion units 106. The selectivity of the coprocessor 102, the I / O unit 104, the network communication unit 105, and other expansion units 106 is shown in the figure by dotted lines.
[0071] The main processor 101 and / or the coprocessor 102 are used to execute computer instructions stored in the storage medium 103 to implement the method proposed in the present invention. The main processor 101 is the control center of the electronic device 100, which is usually a general-purpose processor (for example, various series of Intel CPUs), and can implement logical processing and arithmetic calculations in a relatively balanced manner. The main processor 101 uses various interfaces to connect various parts of the entire electronic device 100, and implements various functions of the electronic device 100 by running or executing software programs stored in the storage medium 103, and calling data stored in the storage medium 103, thereby monitoring the electronic device 100 as a whole (for example, in some embodiments of the present application, the overall logical flow of the monitoring method is implemented).
[0072] The coprocessor 102 is usually a dedicated processor (e.g., a user-programmable embedded microprocessor) used to implement a single function. For example, the coprocessor 102 may be a graphics processor (GPU, Graphic Process Unit), which is dedicated to processing graphics and images (e.g., in some embodiments of the present application, to recognize the shape of metal abrasive particles). The main processor 101 does not directly process information about graphics and images at this time, but provides data from other units to the coprocessor 102 or sends management instructions to the coprocessor 102 to instruct the coprocessor 102 to obtain data from other units, and after the coprocessor 102 processes the data, the main processor 101 receives the processing results from the coprocessor 102 so that other decisions can be made based on the processing results (e.g., in some embodiments of the present application, the different numbers of different abrasive particle shapes are used to determine whether the industrial equipment has entered a stage of rapid aging). For different professional fields, the coprocessor 102 can also be a signal processor, a network communication processor, a complex computing processor, etc. Typically, the hardware implementation basis of the coprocessor 102 is a digital signal processing (DSP) chip, or a complex programmable logic device (CPLD), a field programmable gate array (FPGA), or other application-specific integrated circuits (ASIC).
[0073] The storage medium 103 may include an internal memory and an external memory, or may also include a volatile memory and a non-volatile memory, or may also include a magnetic storage device, a solid-state memory, a flash memory, a floppy disk, and a hard disk. The storage medium 103 may be used to store an operating system (e.g., it may be executed by the main processor 101) and data generated during the operation of the operating system, a software program of an application software and data generated during the operation of the application software, and a software program of a dedicated module (e.g., it may be executed by a certain coprocessor 102) and data generated during the operation of the program. For example, in one embodiment of the present invention, the main processor 101 executes various functional applications and data processing by running a monitoring program stored in the storage medium 103. In some embodiments, the storage medium 103 may also be a remote memory (relative to a memory in the usual sense) remotely arranged relative to the main processor 101, and these remote memories may be connected to the main processor 101 or a certain coprocessor 102 via a network connection (e.g., via a network communication device 105). Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0074] The I / O (Input / Output) unit 104 includes an information input device and an information output device, which enables a user to interact with the electronic device 100. The input device can be used to receive input digital or character information, and specifically can include: a keyboard, a mouse, a joystick, a touch input device or a trackball, etc. The output device can be used to output / display a processing result processed by the electronic device 100, and the processing result can be made based on the information input by the input device. Specifically, the output device can include: a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), etc.
[0075] The network communication unit 105 realizes communication between the electronic device 100 and various remote devices through the connection of the wired / wireless network, so that the electronic device 100 can also exchange data with the remote device (for example, the remote storage described above). Alternatively, the electronic device 100 can also realize connection with the server through the network communication unit 105, so that the electronic device 100 can interact with the server as part of a large system.
[0076] Other expansion units 106 include a variety of peripheral components and their interfaces, so that the electronic device 100 can interact with a variety of devices. For example, through the Bluetooth interface, it can be connected to a Bluetooth headset, so that the audio played by the electronic device 100 can be received by the Bluetooth headset. For another example, through a bus interface (such as an RS-485 bus), the electronic device 100 can be connected to some sensors to obtain some monitoring data to assist the electronic device 100 in implementing specific functions (for example, in some embodiments of the present application, the number of abrasive particles in the oil can be detected by an abrasive particle sensor, and the electronic device 100 determines the operating conditions of the monitored industrial equipment by studying the number). In various embodiments, other expansion units 106 can exist alone or be integrated with other components of the electronic device 100. At the same time, other expansion units 106 are optional, and their optional properties are represented in the figure by dotted lines.
[0077] According to some embodiments of the present application, a computer-readable storage medium is disclosed, in which at least one computer instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned model scaling method. The implementation methods disclosed in the foregoing are method implementation methods corresponding to the present implementation methods, and the present implementation methods can be implemented in conjunction with the above-mentioned implementation methods. The relevant technical details mentioned in the above-mentioned implementation methods are still valid in the present implementation methods, and in order to reduce repetition, they will not be repeated here. Accordingly, the relevant technical details mentioned in the present implementation methods can also be applied in the above-mentioned implementation methods.
[0078] According to some embodiments of the present application, a computer program product is disclosed, including computer executable instructions, which are executed by a processor to implement a model scaling method according to an embodiment of the present invention. The embodiments disclosed in the foregoing are method implementations corresponding to the present embodiment, and the present embodiment can be implemented in conjunction with the above-mentioned embodiments. The relevant technical details mentioned in the above-mentioned embodiments are still valid in the present embodiment, and in order to reduce repetition, they will not be repeated here. Accordingly, the relevant technical details mentioned in the present embodiment can also be applied in the above-mentioned embodiments.
[0079] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0080] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0081] It should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0082] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0083] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.
Claims
1. A model scaling method for an electronic device, characterized in that: include: Selecting an image model, and determining a two-dimensional operation surface in the image model for assisting the scaling of the image model, wherein the two-dimensional operation surface includes a plurality of vertex areas, a plurality of edge areas, and at least one center area; receiving a scaling instruction for the two-dimensional operation surface, wherein the scaling instruction instructs the two-dimensional operation surface to deform along a first direction, and correspondingly causing the image model to deform synchronously with the two-dimensional operation surface; in During the deformation of the two-dimensional operating surface along the first direction, the shape and size of the vertex area remain unchanged, the edge area is scaled along a preset direction, and the center area is scaled along the first direction, wherein the preset direction is a component direction of the first direction.
2. The model scaling method according to claim 1, characterized in that: Determining the two-dimensional operation surface in the image model comprises: Selecting a first surface of the image model, and setting a circumscribed rectangular frame on the periphery of the first surface; The area defined by the circumscribed rectangular frame is determined as the two-dimensional operation surface.
3. The model scaling method according to claim 2, characterized in that: The sides of the two-dimensional operation surface are divided into three parts respectively, so as to divide the two-dimensional operation surface into nine areas; wherein the nine areas include: four vertex areas, four edge areas and one center area.
4. The model scaling method according to any one of claims 2 to 3, characterized in that: The first direction is decomposed into an X direction and a Y direction along two intersecting edges of the two-dimensional operation surface. When the two-dimensional operation surface is stretched to an integer multiple in the X direction and / or the Y direction, a plurality of the image models are copied according to an initial size of the image model.
5. The model scaling method according to claim 3, characterized in that: In the case where the image model is a three-dimensional model, the two-dimensional operation plane is determined for each plane of the three-dimensional model.
6. The model scaling method according to claim 2, characterized in that: For more than two image models, model association is also included, specifically including: The vertex area of the first two-dimensional operation surface in the first image model and the vertex area of the second two-dimensional operation surface in the second image model are anchored to each other, and when a scaling instruction for the first two-dimensional operation surface is received, the second two-dimensional operation surface: Execute the same scaling instruction as the first two-dimensional operation plane; or The original size and shape are kept unchanged, and the first two-dimensional operation surface is filled in a copying manner.
7. The model scaling method according to claim 6, characterized in that: When the second two-dimensional operation plane is included in the first two-dimensional operation plane: When the first two-dimensional operation surface is stretched to an integer multiple in the length direction and / or the width direction, the first two-dimensional operation surface is enlarged; When the second two-dimensional operation surface is stretched to an integer multiple in the length direction and / or the width direction, the second image model is replicated.
8. The model scaling method according to any one of claims 1-3 and 5-7, characterized in that: When the edge of the main image in the image model is a non-straight line, two adjacent image models are partially overlapped to make the main image continuous.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer instruction, and the at least one instruction is loaded and executed by a processor to implement the method according to any one of claims 1 to 8.
10. An electronic device, characterized in that: include: at least one memory for storing computer instructions; At least one processor, when the at least one processor executes the computer instructions, implements the method according to any one of claims 1-8.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
China Tang dynasty style historic building modeling method
CN103279983A
House realistic picture display method and device, terminal equipment and storage medium
CN111145352A