WO2023160050A1 - 数据处理方法、装置、设备及存储介质 - Google Patents
数据处理方法、装置、设备及存储介质 Download PDFInfo
- Publication number
- WO2023160050A1 WO2023160050A1 PCT/CN2022/133999 CN2022133999W WO2023160050A1 WO 2023160050 A1 WO2023160050 A1 WO 2023160050A1 CN 2022133999 W CN2022133999 W CN 2022133999W WO 2023160050 A1 WO2023160050 A1 WO 2023160050A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- graphics
- placement
- graphic
- container
- scaling
- Prior art date
Links
- 238000003860 storage Methods 0.000 title claims abstract description 38
- 238000003672 processing method Methods 0.000 title claims abstract description 27
- 238000000034 method Methods 0.000 claims abstract description 109
- 238000012545 processing Methods 0.000 claims description 192
- 230000008569 process Effects 0.000 claims description 79
- 230000005484 gravity Effects 0.000 claims description 26
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004422 calculation algorithm Methods 0.000 description 38
- 238000010586 diagram Methods 0.000 description 16
- 238000013507 mapping Methods 0.000 description 10
- 238000004364 calculation method Methods 0.000 description 6
- 238000012856 packing Methods 0.000 description 6
- 230000002068 genetic effect Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 238000005520 cutting process Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 238000005457 optimization Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000005094 computer simulation Methods 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 230000001788 irregular Effects 0.000 description 2
- 230000035772 mutation Effects 0.000 description 2
- 210000000349 chromosome Anatomy 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000008303 genetic mechanism Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012067 mathematical method Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 108090000623 proteins and genes Proteins 0.000 description 1
- 238000003892 spreading Methods 0.000 description 1
- 230000007480 spreading Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/06—Topological mapping of higher dimensional structures onto lower dimensional surfaces
- G06T3/067—Reshaping or unfolding 3D tree structures onto 2D planes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/10—Geometric CAD
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/20—Drawing from basic elements, e.g. lines or circles
- G06T11/203—Drawing of straight lines or curves
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
Definitions
- the present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and storage medium.
- Generalized boxing refers to given some polygons to be placed and a container of a given size and shape, placing the polygons to be placed in the container, and ensuring that the polygons do not overlap each other and have a stable distance, and must be extreme Take advantage of the container fill rate.
- the currently commonly used boxing method is based on NFP and the lowest center of gravity method. Specifically, multiple candidate angles are determined for each polygon to be placed and multiple candidate positions are determined according to the candidate angles, and the corresponding polygon is placed according to the candidate position with the largest center of gravity. In practical research, it is found that the filling rate of the container is low after being placed according to this packing method. Therefore, how to achieve a higher container filling rate has become one of the hot issues in current research.
- Embodiments of the present application provide a data processing method, device, device, and storage medium.
- an embodiment of the present application provides a data processing method executed by a data processing device, including:
- N is an integer greater than 2;
- the N graphics are placed in the container according to the placement rules corresponding to the N graphics.
- an image processing device including:
- An acquisition unit configured to acquire N graphics and a container for placing the N graphics, where N is an integer greater than 2;
- a determining unit configured to determine a reference graphic from the N graphics based on a graphic attribute of each graphic
- the determining unit is further configured to determine a placement rule corresponding to the N graphics from at least one placement rule according to the relationship between the graphic attribute of the reference graphic and the attribute threshold;
- a placement unit configured to place the N graphics in the container according to the placement rules corresponding to the N graphics.
- an embodiment of the present application provides a data processing device, including: a processor adapted to implement one or more computer-readable instructions; a computer storage medium storing one or more computer-readable instructions instructions, the one or more computer readable instructions being adapted to be loaded and executed by a processor:
- N is an integer greater than 2;
- the N graphics are placed in the container according to the placement rules corresponding to the N graphics.
- an embodiment of the present application provides a computer storage medium, where the computer storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor of a data processing device, they are used to perform:
- N is an integer greater than 2;
- the N graphics are placed in the container according to the placement rules corresponding to the N graphics.
- an embodiment of the present application provides a computer program product or a computer readable instruction
- the computer program product includes a computer readable instruction
- the computer readable instruction is stored in a computer storage medium
- the processor of the data processing device reads from the computer
- Computer-readable instructions are read from the storage medium, and the processor executes the computer-readable instructions, so that the data processing device performs:
- N is an integer greater than 2;
- the N graphics are placed in the container according to the placement rules corresponding to the N graphics.
- Fig. 1 is a schematic diagram of a setting window for automatic 2uv expansion provided by an embodiment of the present application
- Fig. 2 is a schematic flow chart of a data processing method provided by an embodiment of the present application.
- Fig. 3a is a schematic diagram of N graphics provided by the embodiment of the present application.
- Fig. 3b is a schematic diagram of a container provided in an embodiment of the present application.
- Fig. 4a is a schematic diagram of placing N graphics in a container provided by the embodiment of the present application.
- Fig. 4b is another schematic diagram of placing N graphics in the container provided by the embodiment of the present application.
- Fig. 5 is a schematic flow chart of another data processing method provided by the embodiment of the present application.
- Fig. 6a is another schematic diagram of placing N graphics in the container provided by the embodiment of the present application.
- Fig. 6b is another schematic diagram of placing N graphics in the container provided by the embodiment of the present application.
- FIG. 7 is a schematic structural diagram of a data processing device provided in an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of a data processing device provided by an embodiment of the present application.
- This application provides a data processing solution to solve the problem of graphics boxing (putting graphics in containers).
- an appropriate placement rule is determined for the N graphics, and then the N graphics are placed in the container according to the determined placement rule, and the N graphics are targeted. Placement rules are provided selectively. Compared with placing any graphics in a container using a uniform placement rule, placing N graphics according to targeted placement rules can improve the filling rate of the container.
- the above data processing scheme can be executed by a data processing device, and the data processing device can be a terminal device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, an intelligent voice interaction device, a smart home appliance, a smart watch, a vehicle terminal, an aircraft, etc.; or,
- the data processing device may also be a server, such as an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
- the data processing scheme provided by the embodiment of the present application can be applied in the automatic light texture mapping (2UV or Light Mapping) development project.
- Automatic 2UV is an automatic production tool for game art resources, which is used to replace the 2UV manual production process of the scene model in the game project.
- Automatic 2UV unwrapping refers to spreading out a 3D model in a 2D manner.
- This 3D model can be a 3D model in any scene, such as a game prop in a game scene, a game character, etc.; for another example, it can also be any virtual item in a virtual space scene, such as a cup, a chairs and more.
- a virtual space scene such as a cup, a chairs and more.
- UV mapping UV Mapping
- Texture mapping is to map texture pixels in texture space to 2D space.
- the process of pixels in . 2UV is the general term for the combination of light texture and UV mapping.
- Light texture also known as light map
- the light map is pre-calculated and used on static targets. , which is less computationally intensive than computing lighting in real time.
- UV Island After the 3D mesh in the 3D model is transferred to the 2D space, the closed and independent polygon formed in the UV coordinates in the 2D space can be called a UV Island (UV Island).
- Automatic 2UV can include three main steps of cutting and unfolding, horizontal and vertical, and compact packing. As shown in Figure 1, it is a setting window for automatic 2UV unfolding provided by the embodiment of this application. In this setting window, you can Including the global parameters required for automatic 2UV unwrapping, as shown in the area 101 in Figure 1, such as the direction of the coordinate system, the resolution of the light texture, the number of pixels on the edge of the UV island, etc., each parameter can correspond to a setting option, by triggering any A setting option can set the corresponding parameters.
- the parameter of the direction of the coordinate system corresponds to a setting option 110, and the direction of the coordinate system can be set by triggering the setting option 110.
- the direction of the coordinate system is set to the z-axis upward;
- the setting option corresponding to the parameter of the resolution of the light texture is 111
- the illumination texture resolution can be set by triggering the setting option 111
- the illumination texture resolution is set to 1024 in the embodiment of this application.
- the setting window of the automatic 2UV unfolding may also include the execution steps of the automatic 2UV unfolding as shown in the area 102 in FIG. 1 .
- Each execution step can set corresponding input and output names, and can also set corresponding execution rules for each execution step.
- the set execution rule can be fewer cutting lines;
- the step of boxing can be imported into the above data processing scheme of the embodiment of the present application, so as to realize compact box packing under the condition of high filling rate.
- Each execution step can be executed independently.
- each execution step corresponds to an "Execute" button, and when an execution button is triggered, the execution step corresponding to the execution button will be executed; or, the above three steps can be started at the same time.
- the three steps are executed sequentially in the order shown in Figure 1.
- the setting window includes a "one-key execution” button, and triggering the "one-key execution” button can trigger three steps to be started simultaneously, so that the three steps are executed in sequence.
- the N graphics to be placed refer to N UV islands, based on the graphic attributes of each UV island from the N UV islands Determine a reference UV island, and then determine a placement rule applicable to N UV islands from at least one placement rule according to the relationship between the graphic attribute of the reference UV island and the attribute threshold value, and place according to the determined placement rule N UV islands are placed into the container.
- Using the data processing scheme provided by this application can realize targeted packing of multiple UV islands and improve the container filling rate.
- FIG. 2 it is a schematic flowchart of a data processing method provided by an embodiment of the present application.
- the data processing method described in FIG. 2 may be executed by a data processing device, specifically, may be executed by a processor of the data processing device.
- the data processing method described in Fig. 2 may comprise the steps:
- Step S201 acquiring N graphics and containers for placing the N graphics.
- the N figures can be figures of any shape, for example, the N figures can be regular-shaped polygons, such as rectangles, triangles, and circles; for another example, the N figures can also be irregular-shaped polygons.
- Each of the N graphics can be an independent polygon, or a graphic obtained by splicing multiple polygons. Some of the same graphics can exist in N graphics. Referring to Figure 3a, it is a schematic diagram of N graphics provided by the embodiment of the present application.
- the N graphics shown in Figure 3a may include independent polygons 301 and 302 of regular shape, and may also include splicing of irregular shapes polygons such as 303 and 304, some of the same graphics may exist in the N graphics, for example, there are 3 301, 2 302 and 2 303.
- a container for placing N figures refers to a figure in which other figures can be placed, and the container may be a figure of a regular shape or a figure of an irregular shape.
- FIG. 3 b it is a schematic diagram of a container provided in the embodiment of the present application, 31 denotes an irregularly shaped container, and 32 denotes a regular shaped container.
- both the N graphics and the container for placing the N graphics can be stored in the local storage of the data processing device.
- the data processing device selects the Load N graphics and containers.
- the N graphics and the container for placing the N graphics may be stored in other devices.
- the data processing device When the data processing device needs to place the N graphics in the container, the data processing device interacts with other devices , to receive N graphics transmitted by other devices and a container for placing N graphics.
- Step S202 determining a reference graphic from N graphics based on the graphic attribute of each graphic.
- the graphic attribute of each graphic may include a graphic area, and determining a reference graphic from N graphics based on the graphic attribute of each graphic may refer to determining a reference graphic from N graphics based on the graphic area of each graphic .
- the total area of N figures is determined based on the figure area of each figure; the area difference between the figure area of each figure and the total area is determined; the first figure among the N figures is determined as a reference figure, and the The area difference between the graphic area and the total area of a graphic satisfies a first area difference threshold.
- N graphs include graph 1 and graph 2. If the area difference between graph 1 and the total area satisfies the first area difference threshold, graph 1 is the reference graph. Similarly, if the area difference between graph 2 and the total area If the area difference satisfies the first area difference threshold, graph 2 is also a reference graph. It can be seen that the number of reference graphics in the N graphics is one or more.
- the area difference between the graphic area of each graphic and the total area can be expressed by a ratio, for example, the ratio between the graphic area of the first graphic and the total area is the area between the graphic area of the first graphic and the total area difference.
- the first area difference threshold is a preset preset ratio, the area difference between the graphic area of the first graphic and the total area meets the first area difference threshold means: the ratio between the graphic area of the first graphic and the total area The ratio is greater than or equal to the preset ratio.
- the above-mentioned ratio can be expressed in the form of a percentage, for example, the first area difference threshold can be 5%, if the ratio between the graphic area of the first graphic in the N graphics and the total area of the N graphics is greater than 5% , then the first graph is determined as the reference graph. In other words, among the N graphics, the graphics whose graphics area is larger than 5% of the total area are determined as the reference graphics.
- the first area difference threshold is used to determine the reference pattern.
- the area difference between the graphic area of the reference graphic and the total area satisfies the first area difference threshold.
- the reference graphic has a larger graphic area and has a greater influence on the container filling rate. Determining the placement rules corresponding to the N graphics according to the relationship between the graphics attributes of the reference graphics and the attribute threshold helps to improve the reliability of the finally determined placement rules.
- the graphic attribute of each graphic can also include the graphic long side length of each graphic, and determining the reference graphic from N graphics based on the graphic attribute of each graphic can refer to: based on the graphic length of each graphic
- the edge length determines the reference graph from N graphs.
- the multiple candidate graphics include N graphics, that is, the reference graphics are selected from the N graphics according to the length of the graphic long side of each graphic.
- the plurality of candidate graphics may further include: remaining graphics in the N graphics except the first graphics. That is to say, if the reference figure has been selected from the N figures according to the figure area of each figure, it can also be selected from the remaining pictures of the N figures except the selected reference figure according to the length of the long side of the figure, and then continue Select some reference graphics, so that among the N graphics, the length difference between the length of the long side of the graphics and the length of the long side of the container satisfies the length difference threshold, or the area difference between the area of the graphics and the total area satisfies the first area The graphics of the difference threshold will be selected as the reference graphics.
- the length difference between the length of the long side of each figure and the length of the long side of the container can be represented by a ratio, for example, the ratio between the length of the long side of the figure of the second figure and the length of the long side of the container is the figure of the second figure The difference in length between the length of the long side and the length of the long side of the container.
- the length difference threshold is a preset preset ratio. The length difference between the length of the long side of the second graphic and the length of the long side of the container satisfies the threshold of length difference: the length of the long side of the second graphic and the long side of the container The ratio between the lengths is greater than or equal to the preset ratio.
- the above-mentioned ratio can be expressed in the form of a percentage, for example, the length difference threshold can be 55%, if the ratio between the length of the long side of the second graphic in the N graphics and the length of the long side of the container is greater than 55%, then The second figure is determined as a reference figure. In other words, among the N graphics, the graphics whose length of the long side is greater than 55% of the length of the long side of the container are determined as the reference graphics.
- the length difference between the length of the long side of the reference graphic and the length of the long side of the container satisfies the length difference threshold.
- the reference graphic has a larger length of the long side of the graphic, which affects the filling rate of the container.
- the force is greater, and the placement rules corresponding to the N graphics are determined according to the relationship between the graphic attributes of such reference graphics and the attribute threshold, which helps to improve the reliability of the finally determined placement rules.
- Step S203 according to the relationship between the graphic attribute of the reference graphic and the attribute threshold, determine the placement rules corresponding to the N graphics from at least one placement rule.
- At least one placement rule includes a global zoom placement rule and a mixed zoom placement rule, and according to the relationship between the graphic attributes of the reference graphics and the attribute threshold, determining the placement rules corresponding to the N graphics from the at least one placement rule may include: if the reference If there is a first numerical relationship between the graphic attribute of the graphic and the attribute threshold, the hybrid zoom placement rule is determined as the placement rule corresponding to N graphics; if there is a second numerical relationship between the graphic attribute of the reference graphic and the attribute threshold, then the The global scaling placement rule is determined as the placement rule corresponding to the N graphics.
- the graph attribute of the reference graph mentioned here refers to the graph area attribute of the reference graph. If there are multiple reference graphs, the graph area attribute of the reference graph is the addition result obtained by adding the graph areas of multiple reference graphs. .
- the attribute threshold may be determined based on the total area of the N graphics and the second area difference threshold. Specifically, the total area of the graphics and the second area difference threshold may be multiplied, and the result of the multiplication operation is used as attribute threshold.
- the second area difference threshold is a preset preset ratio, which may be expressed in the form of a percentage, for example, the second area difference threshold may be 55%.
- the attribute threshold may also be a value pre-executed based on experience. A second area difference threshold is used to determine the attribute threshold.
- Step S204 placing the N graphics in the container according to the placement rules corresponding to the N graphics.
- the N graphics are placed according to the placement rule corresponding to the N graphics.
- the container may refer to: perform independent scaling and placement processing on the reference graphics according to the independent scaling and placement rules, and place the reference graphics in the container according to the independent scaling and placement processing results; and remove the reference graphics from the N graphics according to the global scaling and placement rules According to the global scaling and placement rules, the remaining graphics are placed in the container according to the global scaling and placement processing results.
- N graphics into the container according to the mixed placement rule means: Different placement rules among the placement rules are mixed to process the reference graphic and the rest of the N graphics except the reference graphic.
- placing the N graphics in the container according to the placement rule corresponding to the N graphics refers to: placing the N graphics according to the global zoom placement rule
- Each of the graphics in N is subjected to global scaling and placement processing, and each of the N graphics is placed in a container according to the global scaling and placement processing result. That is to say, if it is determined based on the relationship between the graphic attributes of the reference graphics and the attribute threshold that the placement rule corresponding to the N graphics is the global zoom placement rule, then all the graphics in the N graphics are processed according to the global zoom placement rule. Place N graphics into the container.
- 401 indicates that each of the N graphics is placed in the container after being processed by global zoom and placement according to the global zoom and placement rules Placement result
- 404 represents the placement result of placing N graphics into the container by adopting the hybrid scaling placement rule.
- the N graphics in 401 and 402 are the same, and the N graphics in 403 and 404 are the same.
- the N graphics are placed according to different placement rules to place the N graphics in the container, and the targeted packaging is realized. box, use more appropriate placement rules to box the N graphics, so that the filling rate of the container can be improved to a certain extent.
- FIG. 5 is a schematic flowchart of another data processing method provided in the embodiment of the present application.
- the data processing method described in FIG. 5 may be executed by a data processing device, specifically, may be executed by a processor of the data processing device.
- the data processing method described in Fig. 5 may comprise the following steps:
- Step S501 acquiring N graphics and a container for placing the N graphics.
- Step S502 determining a reference graphic from N graphics based on the graphic attribute of each graphic.
- step S501 and step S502 reference may be made to the relevant description in step S201 and step S202 in the embodiment in FIG. 2 , and details are not repeated here.
- Step S503 if there is a first numerical relationship between the graphic attribute of the reference graphic and the attribute threshold, determine the mixed zoom placement rule as the placement rule corresponding to N graphics, and place the N graphics in the container according to the mixed zoom placement rule .
- placing N graphics in the container according to the mixed scaling and placement rules means: performing independent scaling and placement processing on the reference graphics among the N graphics according to the independent scaling and placement rules, and placing the reference graphics according to the independent scaling and placement processing results In the container; according to the global scaling and placement rules, perform global scaling and placement processing on the remaining graphics except the reference graphics among the N graphics, and place the remaining graphics in the container according to the global scaling and placement processing results.
- Step S504 if there is a second numerical relationship between the graphic attribute of the reference graphic and the attribute threshold, determine the global zoom placement rule as the placement rule corresponding to N graphics, and place the N graphics in the container according to the global zoom placement rule .
- Placing N graphics in the container according to the global scaling and placement rules means: performing global scaling and placement processing on each of the N graphics according to the global scaling and placement rules, and placing each of the N graphics in accordance with the global scaling and placement processing results Place in a container.
- independent scaling and placing processing and the flow of global scaling and placing processing are respectively introduced below.
- the number of times of independent scaling and placement processing be i, where i is a positive integer
- the process of performing independent scaling and placement processing on reference graphics according to independent scaling and placement rules includes:
- the first preset value is a preset upper limit of independent scaling attempts.
- step S503 the first set of graphics to be placed includes the rest of the N graphics except the reference graphic; in step S504, the first set of graphics to be placed includes N graphics.
- the second preset value refers to the upper limit of the number of attempts of the preset global scaling ratio.
- step S503 After the independent scaling and placement process is performed on the reference graphics, the reference graphics are placed in the container according to the independent scaling and placement processing results.
- the reference graphics are placed in the container according to the independent scaling and placement processing results.
- the container filling rate corresponding to the first placement result determined in each cycle determine the first container filling rate and obtain the independent scaling ratio when the first container filling rate is obtained; according to the obtained independent scaling ratio, the reference The graphic is scaled, and the scaled reference graphic is placed in the container according to the first placement result corresponding to the first container filling rate.
- the first container filling rate may refer to the largest container filling rate among the various container filling rates determined in each cycle, so that the reference graphics are placed in the container according to the first placement result corresponding to the first container filling rate, An optimum container filling rate of the container can be guaranteed.
- step S503 the reference graphics and the remaining graphics in the N graphics except the reference graphics are respectively scaled and placed, and then placed in the container respectively.
- the above describes how to place the reference graphics in the container.
- the following describes how to place the reference graphics in the container.
- the rest of the N graphics except the reference graphics are placed in the container. Specifically, after performing global scaling and placement processing on the remaining graphics according to the aforementioned process of global scaling, a global scaling and placement processing result is obtained, and then the remaining graphics are placed in the container according to the global scaling and placement processing result.
- placing the remaining graphics in the container according to the global zoom placement processing result may include: determining the second container from the container filling rate corresponding to the second placement result determined in each cycle of the global zoom placement processing process Filling rate, and the global scaling ratio when the second container filling rate is obtained; the remaining graphics are scaled according to the obtained global scaling ratio, and the scaled images are scaled according to the second placement result corresponding to the second container filling rate The rest of the graphics are placed in the container.
- the second container filling rate may refer to the largest container filling rate among the container filling rates corresponding to each second placement result determined in each cycle, and the global scaling ratio corresponding to the largest container filling rate and the second placement result will be The rest of the graphics are placed in the container, which can ensure the best filling rate of the container.
- each of the N graphics is placed in the container according to the global scaling and placement rules, that is, each of the N graphics must perform global scaling and placement processing, and then place the graphics according to the global scaling and placement processing results.
- Each graphic is placed in a container.
- Placing each graphic in the container according to the result of the global zoom placement process may include: for the process of the global zoom placement process, determining the second container fill rate from the container fill rate corresponding to the second placement result determined in each cycle, and obtain the global scaling ratio when the second container filling rate is obtained; perform scaling processing on each of the N graphics according to the obtained global scaling ratio, and perform scaling processing according to the second placement result corresponding to the second container filling rate Each graphic of is placed in a container.
- each of the N graphics can be placed in the container in an appropriate manner to ensure the best filling rate of the container.
- each cycle involves placing a certain graphic to obtain the placement result.
- the placement process In the process of independent scaling and placing processing and the process of global zooming and placing processing, each cycle involves placing a certain graphic to obtain the placement result.
- the reference graphics after independent zoom processing In each cycle It is necessary to place the reference graphics after independent zoom processing to obtain the first placement result; in the process of global zoom placement processing, it is necessary to place each graphic in the first graphics set to be placed after global zoom processing in each cycle. Placement processing, obtaining a second placement result of the first graphics set to be placed. Regardless of whether it is a reference graphic after independent zoom processing or a graphic in the first graphics set to be placed after global zoom processing, the placement process is the same.
- the graphics to be placed are added to the second set of graphics to be placed, and the second set of graphics to be placed may include reference graphics after independent scaling processing in each independent scaling and placement process flow; or, reference graphics after global scaling processing in each global scaling and placement process flow
- the shape in the first set of shapes to be placed may include reference graphics after independent scaling processing in each independent scaling and placement process flow; or, reference graphics after global scaling processing in each global scaling and placement process flow.
- Placement processing, obtaining the second placement result of placing the first set of graphics to be placed in the container all refer to: performing placement processing on the graphics in the second set of graphics to be placed, and obtaining the result of placing the second set of graphics to be placed in the container Place the result.
- performing placement processing on the graphics in the second set of graphics to be placed to obtain a placement result of placing the second set of graphics to be placed in the container including: calculating the second The set of graphics to be placed is grouped to obtain P graphics groups arranged in sequence, each graphics group includes one or more graphics belonging to the second set of graphics to be placed, and the area of each graphic in the top-ranked graphics group is larger than the sorted The graphic area of each graphic in the later graphic group, and each graphic in each graphic group is sorted according to the graphic area from large to small; each graphic group is placed, and the corresponding placement result of each graphic group is determined; each The placement results corresponding to the graphic groups form the placement results of placing each graphic in the second graphics to be placed into the container.
- Carry out cross-transformation processing on the graphic group j determine the population individual set corresponding to the graphic group j, the population individual set includes multiple candidate individuals, each candidate individual includes Mj graphics arranged in an order, and Mj graphics in different candidate individuals
- the arrangement order of Mj graphics in each candidate individual is not the same; according to the arrangement order of Mj graphics in each candidate individual, the Mj graphics are placed, and the placement result corresponding to each candidate individual is obtained; each candidate individual is calculated according to the placement result corresponding to each candidate individual
- the corresponding average placement center of gravity; the placement result corresponding to the candidate individual whose average placement center of gravity satisfies the center of gravity condition is taken as the placement result corresponding to the graphic group j.
- an average placement center of gravity satisfying the center of gravity condition may mean that the average placement center of gravity is the minimum value among the average placement centroids corresponding to all candidate individuals.
- carrying out the cross-transformation process on the graphics group j can be realized based on a genetic algorithm, and a genetic algorithm (Genetic Algorithm) is a computational model of the biological evolution process that simulates the natural selection of Darwin's biological evolution theory and the genetic mechanism. The method of simulating the natural evolution process to search for the optimal solution.
- This algorithm uses mathematical methods and computer simulation operations to convert the problem solving process into a process similar to the crossover and mutation of chromosome genes in biological evolution. When solving more complex combinatorial optimization problems, compared with some conventional optimization algorithms, it can usually obtain better optimization results faster.
- the data processing device may determine the placement result corresponding to any candidate individual based on a binning algorithm based on NFP (No Fit Polygon) and the lowest center of gravity principle.
- NFP refers to the trajectory of a reference point on the boundary formed by a polygon (which may refer to a figure in this application) along the internal boundary of another polygon (which may refer to a container in this application).
- NFP defines the feasible region when placing a polygon into a container.
- the data processing device determines the placement result of any candidate individual based on the binning algorithm of NFP and the principle of the lowest center of gravity, which may include: for any candidate individual among multiple candidate individuals, sequentially extract For each graphic, calculate the candidate placement angle of each graphic; determine the placement position of each graphic in the container based on the principle of the lowest center of gravity and the candidate placement angle of each graphic, and place each graphic in the container according to the determined placement position , the placement result corresponding to any candidate individual can be obtained.
- the binning algorithm based on NFP and the lowest center-of-gravity atom is also used to fill N graphics into the container, but practice has proved that although this binning algorithm can obtain reasonable placement results, the calculation time is long, Container fill rate is low.
- this application considers that in most scenes such as game art production 2UV scenes, graphics are allowed to be deformed, and the input graphics can be enlarged or reduced on the basis of satisfying the original relative size, so as to make the best use of the container. Space, therefore, the data processing method described in Figure 5 is proposed, using the data processing method described in Figure 5 to place N graphics in the container can ensure a higher container filling rate.
- the same symmetric graphics are used to be divided into the same graphics group, and the same symmetric graphics correspond to the same scaling ratio during scaling processing, and the same Symmetrical graphics are used for centralized placement during placement processing.
- the symmetrical figure refers to an image with a symmetrical shape, for example, an axisymmetrical image and a centrosymmetrical figure.
- the same symmetrical figures refer to figures that not only have the same shape but also are symmetrical figures.
- This application can add a symmetry maintaining strategy no matter in the independent zooming and placement process or the global zooming and placement process, so that the originally symmetrical graphics adopt the same scaling ratio when zooming, thereby maintaining the relative size mode of the input graphics.
- the placement of N graphics in the container will be more neat, and the same symmetric graphics will tend to aggregate together and maintain a consistent scaling.
- Fig. 6a and Fig. 6b two kinds of schematic diagrams of N figures placed in the container provided for the implementation of the present application, the figures in the area 601 in Fig. 6a are symmetrical, these figures tend to gather together, and these figures keep With the same zoom ratio, similarly, the graphics in the region 602 are symmetrical; in FIG.
- the graphics in 603 and 604 are symmetrical to each other. Since each graphics group is placed separately, in order to place the same symmetrical graphics together and maintain a consistent scaling, when performing group processing, the same symmetrical graphics can be divided into the same graphics group, so that the same Symmetrical graphics are placed in the same space area, so as to ensure a high container filling rate and at the same time ensure the uniformity of filling.
- the step of placing the graphics in the second set of graphics to be placed to obtain the placement result of placing the second set of graphics to be placed in the container is performed in the process of independent scaling and placement processing, or in the process of global scaling and placement. In the process of processing, it will be executed many times. In order to provide the final execution efficiency of placing N graphics into the container, it is natural to think of improving the calculation efficiency of this step. In order to improve the calculation efficiency of this step, this application introduces the technique of snap rounding (Snap Rounding) in robust geometric calculation when performing this step.
- a finite-precision approximation technique a method for converting an arbitrary-precision permutation of line segments into a fixed-precision representation.
- the application of fast rounding in this application is mainly used to constrain the number of decimal places in the vertex data of any graph. For example, when placing any graph into a container, the vertex coordinates of any graph are calculated to be n decimals When calculating the placement position or other information of the arbitrary graphics, it takes more computing time.
- the fast rounding technique is introduced to stipulate that the decimal places of the vertex coordinates are m, and m is much smaller than n, which can save calculating time.
- the above-mentioned data processing method in the embodiment of the present application may be implemented based on a piece of software, for example, a binning algorithm is integrated in the data processing device, and the data processing device executes the binning algorithm to place N graphics in the container.
- the input of the binning algorithm is N graphics and a container for placing N graphics.
- the N graphics Before executing the binning algorithm, first, arrange the N graphics to be placed in descending order of graphics area, and select graphics with an area larger than The total area of N graphics is 5%, or the graphics whose long side of the bounding box (that is, the length of the long side of the graphics) is greater than 55% of the length of the long side of the container is used as a reference graphics, and the selected reference graphics are also called big islands; if If the ratio of the graphics area of the selected reference graphics to the total area of the N graphics is greater than 55%, then perform independent scaling and placement processing on the reference graphics and perform global scaling and placement processing on the remaining graphics except the reference graphics; otherwise, perform Each of the N graphics performs global scaling placement processing.
- the bin packing algorithm can include three algorithm modules, which are the basic public algorithm module, the independent scaling algorithm module and the global scaling algorithm module.
- the basic public algorithm module is shared by the independent scaling algorithm module and the global scaling algorithm module, based on genetic algorithm, NFP and Designed based on the principle of the lowest global center of gravity.
- the scaled graphics to be placed (the scaled graphics to be placed include reference graphics that have been independently scaled, N graphics that have been globally scaled, and the rest of the N graphics except the reference graphics. , the scaled graphics to be placed here are equivalent to the second set of graphics to be placed mentioned above), arrange the graphics area from large to small, take the first m graphics as basic individuals, and cross according to the genetic algorithm , mutation, exchange and other basic operations to generate n candidate individuals of the population, each candidate individual is a sequence composed of m graphics, the arrangement order of m graphics in different candidate individuals is different, n candidate individuals of the population can be expressed as [ ⁇ S 1 ⁇ , ⁇ S 2 ⁇ ,... ⁇ S n ⁇ ], S i represents the i-th candidate individual among n candidate individuals, and the value of i is greater than or equal to 1 and less than or equal to n;
- step 2) multiple effective placement results can be obtained, and the candidate individual with the lowest average center of gravity is selected from the multiple effective placement results, as the best candidate individual of the population, that is, the best candidate for the m graphics Boxing results, and then update the remaining container space and the scaled graphics to be boxed, if there are zoomed graphics that have not been boxed, then jump to step 1), otherwise end the algorithm flow of the basic public algorithm module.
- an effective placement result means that each graphic can be successfully placed into the container without overlapping each other.
- the algorithm flow of the independent scaling algorithm module is:
- the independent scaling ratio combination is obtained by combining the independent scaling ratios of each reference graphic.
- the independent scaling ratio Combinations can be expressed as ⁇ scale 1 , scale 2 , ... scale w ⁇ ;
- Placement results place the reference drawing).
- step 5 If the number of global scaling ratios reaches the upper limit of the number of attempts, jump to step 5), otherwise update the current global scaling ratio to scale g , and uniformly scale the execution objects according to the global scaling ratio;
- the data processing device uses the above-mentioned binning algorithm to place the N graphics into the container, and can perform N graphics according to different placement rules according to different relationships between the graphic attributes of the reference graphics and the attribute thresholds. Placement processing to place N graphics into the container to achieve targeted boxing, and use more appropriate placement rules to box N graphics, so that the filling rate of the container can be improved to a certain extent .
- this embodiment of the present application provides a data processing device.
- FIG. 7 it is a schematic structural diagram of a data processing device provided in the embodiment of the present application.
- the data processing device described in FIG. 7 can operate the following units:
- the acquiring unit 701 is configured to acquire N graphics and a container for placing the N graphics, where N is an integer greater than 2.
- a determining unit 702 configured to determine a reference graphic from the N graphics based on the graphic attribute of each graphic.
- the determining unit 702 is further configured to determine a placement rule corresponding to the N graphics from at least one placement rule according to the relationship between the graphic attribute of the reference graphic and the attribute threshold.
- the placement unit 703 is configured to place the N graphics in the container according to the placement rules corresponding to the N graphics.
- the at least one placement rule includes a hybrid zoom placement rule and a global zoom placement rule; the determination unit 702 determines from the at least one placement rule that N graphics correspond to When placing rules, perform the following steps:
- the global scaling placement rule is determined as the placement rule corresponding to the N graphics.
- the graphic attribute of each graphic includes the graphic area of each graphic, and the determining unit 702 performs the following steps when determining a reference graphic from N graphics based on the graphic attribute of each graphic:
- the first figure in the N figures is determined as the reference figure, and the area difference between the figure area of the first figure and the total area satisfies the first area difference threshold.
- the graphic attribute of each graphic includes the length of the long side of each graphic, and the determining unit 702 performs the following steps when determining a reference graphic from N graphics based on the graphic attribute of each graphic:
- the multiple candidate graphics include: N graphics; or, the multiple candidate graphics include the remaining graphics in the N graphics except the first graphics, the first graphics refers to N Any figure whose area difference between the figure area in the figures and the total area of the N figures satisfies the first area difference threshold;
- a second figure among the plurality of candidate figures is determined as the reference figure, and the length difference between the length of the long side of the figure and the length of the long side of the container of the second figure satisfies a length difference threshold.
- the attribute threshold is determined based on the total area of the N graphics and the second area difference threshold, and the determining unit 702 is further configured to:
- the graphic area of the reference graphic is less than or equal to the attribute threshold, it is determined that there is a second numerical relationship between the graphic attribute of the reference graphic and the attribute threshold.
- At least one placement rule includes a mixed zoom placement rule, then the remaining graphics in the N graphics except the reference graphics need to be processed by global zoom placement; if at least one placement rule includes a global zoom placement rule, then N All graphics need to be processed by global zoom placement; the graphics that need to be processed by global zoom placement are added to the first set of graphics to be placed, and the number of times of global zoom placement processing is r, where r is a positive integer; the flow of global zoom placement processing include:
- the placement unit 703 places the N graphics according to the placement rules corresponding to the N graphics.
- the placement unit 703 performs the following steps when placing the N graphics in the container according to the placement rule corresponding to the N graphics:
- the process of performing independent scaling and placing processing on reference graphics according to independent scaling and placing rules includes:
- the placement unit 703 performs the following steps when placing the reference graphic in the container according to the independent scaling and placement processing result:
- the reference graphic is scaled according to the obtained independent scaling ratio, and the scaled reference graphic is placed in the container according to the first placement result corresponding to the first container filling rate.
- the placement unit 703 performs the following steps when placing the remaining graphics in the container according to the global scaling placement processing result:
- the remaining graphics are scaled according to the acquired global scaling ratio, and the scaled remaining graphics are placed in the container according to the second placement result corresponding to the second container filling rate.
- the graphics that need to be placed are added to the second set of graphics to be placed; the second set of graphics to be placed includes reference graphics after independent scaling processing in each independent scaling and placement process; or, the second The set of placed graphics includes the graphics in the first set of graphics to be placed after the global scaling process in each global scaling and placement process; the placement unit 703 performs placement processing on the graphics in the second set of graphics to be placed, and obtains the second set of graphics to be placed When placing the placement result of the graphics set placed in the container, perform the following steps:
- the second set of graphics to be placed is grouped according to the graphics area of each graphics in the second graphics set to be placed, to obtain P graphics groups arranged in order, P is a positive integer, and each graphics group includes one or more graphics belonging to the first 2.
- P is a positive integer
- each graphics group includes one or more graphics belonging to the first 2.
- the placement results corresponding to each graphic group constitute a placement result for placing each graphic in the second set of graphics to be placed in the container.
- the placement unit 703 performs placement processing in graphic group j, and determines the placement result corresponding to graphic group j , perform the following steps:
- Carry out cross-transformation processing on the graphic group j determine the population individual set corresponding to the graphic group j, the population individual set includes a plurality of candidate individuals, each candidate individual includes Mj graphics arranged in an order; Mj graphics in different candidate individuals are not in the same order;
- the placement results corresponding to the candidate individuals whose average placement center of gravity satisfies the center of gravity condition are taken as the placement results corresponding to the graphic group j.
- the placement unit 703 performs the following steps when placing the Mj graphics according to the arrangement order of the Mj graphics in each candidate individual, and obtaining the placement result corresponding to each candidate individual:
- the same symmetric graphics are used to be divided into the same graphics group, and the same symmetric graphics correspond to the same scaling ratio during scaling processing, and the same Symmetrical graphics are used for centralized placement during placement processing.
- each step involved in the data processing method shown in FIG. 2 and FIG. 5 may be executed by each unit in the data processing device shown in FIG. 7 .
- step S202 and step S203 described in FIG. 2 can be performed by the determination unit 702 in the data processing device shown in FIG. 7, and step S201 can be performed by the acquisition unit 701 in the data processing device shown in FIG. 7.
- step S204 can be performed by the placing unit 703 in the data processing device described in FIG. 7; for another example, step S501 described in FIG. 5 can be performed by the acquiring unit 701 in the data processing device described in FIG. 7, and step S502 can be performed by Step S503 and step S504 may be executed by the determining unit 702 and the placing unit 703 in the data processing device described in FIG. 7 .
- each unit in the data processing device shown in Fig. 7 can be respectively or all combined into one or several other units to constitute, or one (some) units can be disassembled again. Divided into a plurality of functionally smaller units, this can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application.
- the above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit may also be realized by multiple units, or the functions of multiple units may be realized by one unit. In other embodiments of the present application, the data-based processing device may also include other units. In practical applications, these functions may also be implemented with the assistance of other units, and may be implemented cooperatively by multiple units.
- a general-purpose computing device such as a computer that includes processing elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM) and storage elements
- processing elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM) and storage elements
- Executing computer-readable instructions capable of performing the steps involved in the corresponding methods shown in Figure 2 and Figure 5, to construct a data processing device as shown in Figure 7, and to realize the embodiment of the present application data processing method.
- the computer-readable instructions may be recorded in, for example, a computer-readable storage medium, loaded into a data processing device through the computer-readable storage medium, and executed therein.
- N graphics into the container when it is necessary to place N graphics into the container, first determine the reference graphics from the N graphics based on the graphic attributes of each graphic; then according to the relationship between the graphic attributes of the reference graphics and the attribute threshold, A placement rule suitable for the N graphics is determined from at least one placement rule, and finally the N graphics are placed in the container according to the determined placement rule. It should be understood that by adopting a suitable placement rule to place the N graphics, targeted placement processing is realized, which can effectively improve the filling rate of the container.
- FIG. 8 it is a schematic structural diagram of a data processing device provided by an embodiment of the present application.
- the data processing device shown in FIG. 8 may include a processor 801 , an input interface 802 , an output interface 803 and a computer storage medium 804 .
- the processor 801, the input interface 802, the output interface 803, and the computer storage medium 804 may be connected through a bus or in other ways.
- the computer storage medium 804 may be stored in the memory of the message processing device, the computer storage medium 804 is used for storing computer-readable instructions, and the processor 801 is used for executing the computer-readable instructions stored in the computer storage medium 804 .
- Processor 801 or CPU (Central Processing Unit, central processing unit) is the calculation core and control core of the data processing device, which is suitable for implementing one or more computer-readable instructions, specifically for loading and executing:
- N is an integer greater than 2;
- N graphics into the container when it is necessary to place N graphics into the container, first determine the reference graphics from the N graphics based on the graphic attributes of each graphic; then according to the relationship between the graphic attributes of the reference graphics and the attribute threshold, A placement rule suitable for the N graphics is determined from at least one placement rule, and finally the N graphics are placed in the container according to the determined placement rule. It should be understood that placing the N graphics by adopting a suitable placement rule realizes targeted placement processing and can effectively improve the filling rate of the container.
- the embodiment of the present application also provides a computer storage medium (Memory).
- the computer storage medium is a memory device of a data processing device, and is used to store programs and data. It can be understood that the computer storage medium here may not only include a built-in storage medium of the data processing device, but of course may also include an extended storage medium supported by the data processing device.
- the computer storage medium provides storage space, which stores the operating system of the data processing device. Moreover, one or more computer-readable instructions adapted to be loaded and executed by the processor 801 are also stored in the storage space.
- the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory; computer storage media.
- one or more computer readable instructions stored in the computer storage medium may be loaded and executed by the processor 801:
- N is an integer greater than 2;
- At least one placement rule includes a hybrid zoom placement rule and a global zoom placement rule; the processor 801 determines from the at least one placement rule that N graphics correspond to When placing rules, perform the following steps:
- the global scaling placement rule is determined as the placement rule corresponding to the N graphics.
- the graphic attribute of each graphic includes the graphic area of each graphic, and the processor 801 performs the following steps when determining a reference graphic from N graphics based on the graphic attribute of each graphic:
- the first figure among the N figures is determined as the reference figure, and the area difference between the figure area of the first figure and the total area satisfies the first area difference threshold.
- the graphic attribute of each graphic includes the length of the long side of each graphic, and the processor 801 performs the following steps when determining a reference graphic from N graphics based on the graphic attribute of each graphic:
- a plurality of candidate graphics are determined from N graphics, and the multiple candidate graphics include N graphics; or, the multiple candidate graphics include the remaining graphics in the N graphics except the first graphics, and the first graphics refer to the N graphics. Any figure whose area difference between the area of the figure in the figure and the total area of the N figures satisfies the first area difference threshold;
- a second figure among the plurality of candidate figures is determined as the reference figure, and the length difference between the length of the long side of the figure and the length of the long side of the container of the second figure satisfies a length difference threshold.
- the attribute threshold is determined based on the total area of the N graphics and the second area difference threshold, and the processor 801 is further configured to:
- the graphic area of the reference graphic is less than or equal to the attribute threshold, it is determined that there is a second numerical relationship between the graphic attribute of the reference graphic and the attribute threshold.
- At least one placement rule includes a mixed zoom placement rule, then the remaining graphics in the N graphics except the reference graphics need to be processed by global zoom placement; if at least one placement rule includes a global zoom placement rule, then N All graphics need to be processed by global zoom placement; the graphics that need to be processed by global zoom placement are added to the first set of graphics to be placed, and the number of times of global zoom placement processing is r, where r is a positive integer; the flow of global zoom placement processing include:
- the processor 801 places the N graphics according to the placement rules corresponding to the N graphics.
- the processor 801 places the N graphics according to the placement rules corresponding to the N graphics.
- the processor 801 performs the following steps when placing the N graphics in the container according to the placement rule corresponding to the N graphics:
- the process of performing independent scaling and placing processing on reference graphics according to independent scaling and placing rules includes:
- the processor 801 performs the following steps when placing the reference graphics in the container according to the independent scaling and placement processing results:
- the reference graphic is scaled according to the obtained independent scaling ratio, and the scaled reference graphic is placed in the container according to the first placement result corresponding to the first container filling rate.
- processor 801 when the processor 801 places the remaining graphics in the container according to the result of the global scaling and placement process, it performs the following steps:
- the remaining graphics are scaled according to the acquired global scaling ratio, and the scaled remaining graphics are placed in the container according to the second placement result corresponding to the second container filling rate.
- the graphics that need to be placed are added to the second set of graphics to be placed; the second set of graphics to be placed includes reference graphics after independent scaling processing in each independent scaling and placement process; or, the second The set of placed graphics includes the graphics in the first set of graphics to be placed after the global scaling process in each global scaling and placement process; the processor 801 performs placement processing on the graphics in the second set of graphics to be placed, and obtains the second set of graphics to be placed.
- the placement result of the graphics set placed in the container perform the following steps:
- the second set of graphics to be placed is grouped according to the graphics area of each graphics in the second graphics set to be placed, to obtain P graphics groups arranged in order, P is a positive integer, and each graphics group includes one or more graphics belonging to the first 2.
- P is a positive integer
- each graphics group includes one or more graphics belonging to the first 2.
- the placement results corresponding to each graphic group constitute a placement result for placing each graphic in the second set of graphics to be placed in the container.
- processor 801 performs placement processing in graphic group j, and determines the placement result corresponding to graphic group j , perform the following steps:
- Carry out cross-transformation processing on the graphic group j determine the population individual set corresponding to the graphic group j, the population individual set includes a plurality of candidate individuals, each candidate individual includes Mj graphics arranged in an order; Mj graphics in different candidate individuals are not in the same order;
- the placement results corresponding to the candidate individuals whose average placement center of gravity satisfies the center of gravity condition are taken as the placement results corresponding to the graphic group j.
- the processor 801 executes the following steps when placing the Mj graphics according to the arrangement order of the Mj graphics in each candidate individual, and obtaining the placement result corresponding to each candidate individual:
- the same symmetric graphics are used to be divided into the same graphics group, and the same symmetric graphics correspond to the same scaling ratio during scaling processing, and the same Symmetrical graphics are used for centralized placement during placement processing.
- N graphics into the container when it is necessary to place N graphics into the container, first determine the reference graphics from the N graphics based on the graphic attributes of each graphic; then according to the relationship between the graphic attributes of the reference graphics and the attribute threshold, A placement rule suitable for the N graphics is determined from at least one placement rule, and finally the N graphics are placed in the container according to the determined placement rule. It should be understood that by adopting a suitable placement rule to place the N graphics, targeted placement processing is realized, which can effectively improve the filling rate of the container.
- the embodiment of the present application also provides a computer program product or computer readable instructions, the computer program product includes computer readable instructions, the computer readable instructions are stored in a computer storage medium; the computer readable instructions are loaded and executed by the processor 801 :
- N is an integer greater than 2;
- N graphics into the container when it is necessary to place N graphics into the container, first determine the reference graphics from the N graphics based on the graphic attributes of each graphic; then according to the relationship between the graphic attributes of the reference graphics and the attribute threshold, A placement rule suitable for the N graphics is determined from at least one placement rule, and finally the N graphics are placed in the container according to the determined placement rule. It should be understood that by adopting a suitable placement rule to place the N graphics, targeted placement processing is realized, which can effectively improve the filling rate of the container.
- a data processing device including a memory and a processor, where computer-readable instructions are stored in the memory, and the steps in the foregoing method embodiments are implemented when the processor executes the computer-readable instructions.
- a computer-readable storage medium which stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps in the foregoing method embodiments are implemented.
- a computer program product includes computer readable instructions, and when the computer readable instructions are executed by a processor, the steps in the foregoing method embodiments are implemented.
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Geometry (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Optimization (AREA)
- Mathematical Analysis (AREA)
- Computer Hardware Design (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Computational Mathematics (AREA)
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
本申请实施例公开了一种数据处理方法、装置、设备及存储介质,其中方法包括:获取N个图形及用于放置N个图形的容器,N为大于2的整数(步骤S201);基于每个图形的图形属性从N个图形中确定参考图形(步骤S202);根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则(步骤S203);按照N个图形对应的放置规则将N个图形放置于容器中(步骤S204)。
Description
本申请要求于2022年02月28日提交中国专利局,申请号为202210184708.1,申请名称为“数据处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机技术领域,尤其涉及一种数据处理方法、装置、设备及存储介质。
广义的装箱是指给定一些待放置的多边形和一个给定大小和形状的容器,将待放置的多边形放置到容器中,并且要保证多边形之间互不重叠且具有稳定间距,且要极致利用容器填充率。目前常用的装箱方法是基于NFP和最低重心方法,具体是依次为每个待放置的多边形确定多个候选角度以及依据候选角度确定多个候选位置,按照重心最大的候选位置放置相应多边形。在实践研究中发现,按照这种装箱方法放置后,容器的填充率较低。因此,如何实现较高的容器填充率的装箱,成为当今研究的热点问题之一。
发明内容
本申请实施例提供了一种数据处理方法、装置、设备及存储介质。
一方面,本申请实施例提供了一种数据处理方法,由数据处理设备执行,包括:
获取N个图形及用于放置所述N个图形的容器,N为大于2的整数;
基于每个图形的图形属性从所述N个图形中确定参考图形;
根据所述参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定所述N个图形对应的放置规则;及
按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中。
一方面,本申请实施例还提供了一种图像处理装置,包括:
获取单元,用于获取N个图形及用于放置所述N个图形的容器,N为大于2的整数;
确定单元,用于基于每个图形的图形属性从所述N个图形中确定参考图形;
所述确定单元,还用于根据所述参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定所述N个图形对应的放置规则;及
放置单元,用于按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中。
一方面,本申请实施例提供了一种数据处理设备,包括:处理器,适用于实现一条或多条计算机可读指令;计算机存储介质,所述计算机存储介质存储有一条或多条计算机可读指令,所述一条或多条计算机可读指令适于由处理器加载并执行:
获取N个图形及用于放置所述N个图形的容器,N为大于2的整数;
基于每个图形的图形属性从所述N个图形中确定参考图形;
根据所述参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定所述N个图形对应的放置规则;及
按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中。
一方面,本申请实施例提供了一种计算机存储介质,所述计算机存储介质存储有计算机可读指令,所述计算机可读指令被数据处理设备的处理器执行时,用于执行:
获取N个图形及用于放置所述N个图形的容器,N为大于2的整数;
基于每个图形的图形属性从所述N个图形中确定参考图形;
根据所述参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定所述N个图形对应的放置规则;及
按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中。
一方面,本申请实施例提供了一种计算机程序产品或计算机可读指令,所述计算机程序产品包括计算机可读指令,计算机可读指令存储在计算机存储介质中;数据处理设备的处理器从计算机存储介质中读取计算机可读指令,该处理器执行计算机可读指令,使得数据处理设备执行:
获取N个图形及用于放置所述N个图形的容器,N为大于2的整数;
基于每个图形的图形属性从所述N个图形中确定参考图形;
根据所述参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定所述N个图形对应的放置规则;及
按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种自动2uv展开的设置窗口的示意图;
图2是本申请实施例提供的一种数据处理方法的流程示意图;
图3a是本申请实施例提供的一种N个图形的示意图;
图3b是本申请实施例提供的一种容器的示意图;
图4a是本申请实施例提供的一种将N个图形放置于容器中的示意图;
图4b是本申请实施例提供的另一种将N个图形放置于容器中的示意图;
图5是本申请实施例提供的另一种数据处理方法的流程示意图;
图6a是本申请实施例提供的又一种将N个图形放置于容器中的示意图;
图6b是本申请实施例提供的再一种将N个图形放置于容器中的示意图;
图7是本申请实施例提供的一种数据处理装置的结构示意图;
图8是本申请实施例提供的一种数据处理设备的结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
本申请提供了一种数据处理方案,用来解决图形装箱(将图形放置于容器中)问题。具体实现中,根据待放置的N个图形中的参考图形,为N个图形确定一个合适的放置规则,然后根据确定的放置规则将N个图形放置到容器中,实现了为N个图形有针对性地提供放置规则,与任意图形均采用统一的放置规则放置到容器中相比,按照具有针对性的放置规则放置N个图形,可以提高容器的填充率。
上述数据处理方案可由数据处理设备执行,数据处理设备可以是终端设备,比如智能手机、平板电脑、笔记本电脑、台式计算机、智能语音交互设备、智能家电、智能手表、车载终端、飞行器等;或者,数据处理设备还可以是服务器,比如独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云计算服务的云服务器。
本申请实施例提供的数据处理方案可以应用在自动光照纹理映射(2UV或者Light Mapping)展开项目中,自动2UV是游戏美术资源自动化生产工具,用以替换游戏项目中场景模型的2UV人工制作流程。
自动2UV展开是指将一个三维模型以二维的方式铺开。这个三维模型可以是任意场景中的三维模型,比如是游戏场景中的一个游戏道具,一个游戏角色等等;再如,还可以是虚拟空间场景中的任意一个虚拟物品,比如一个杯子、一张椅子等等。为了让三维模型 更加逼真,通常需要为三维模型添加一些纹理细节,但是由于三维模型是三维的,而用于表征纹理细节的纹理是二维的,所以为了给三维模型添加纹理,需要将三维模型中3D网格转移到2D空间,这一过程称为UV映射(UV Mapping)。
在2D空间中,制作纹理时常用到纹理贴图(又可以称为纹理映射1UV)和光照纹理映射(又可以称为2UV/Light Mapping),纹理贴图是将纹理空间中的纹理像素映射到2D空间中的像素的过程。2UV是光照纹理和UV映射合并在一起的统称,光照纹理(又称为光照图)是包含了光照信息的一种三维引擎的光强数据,光照图是预先计算好的,用于静态目标上的,其计算量比实时计算照明更少。
将三维模型中的3D网格转移到2D空间之后,2D空间中的UV坐标中形成的闭合且独立的多边形可以称为UV岛(UV Island)。自动2UV可以包括切割展开、横平竖直以及紧致装箱三大主步骤,如图1所示,为本申请实施例提供的一种在自动2UV展开时的一个设置窗口,在该设置窗口可以包括自动2UV展开时所需的全局参数如图1中101区域内所示,比如坐标系方向、光照纹理分辨率、UV岛边沿像素数等等,每个参数可以对应一个设置选项,通过触发任一设置选项可以对相应参数进行设置。比如坐标系方向这个参数对应一个设置选项110,通过触发设置选项110可以设置坐标系方向,在图1中假设设置坐标系方向为z轴朝上;再如光照纹理分辨率这个参数对应的设置选项为111,通过触发设置选项111可以设置光照纹理分辨率,本申请实施例中将光照纹理分辨率设置为1024。
自动2UV展开的设置窗口还可以包括自动2UV展开的执行步骤如图1中102区域内所示。每个执行步骤可以设置相应的输入和输出的命名,还可以为每个执行步骤设置相应的执行规则,比如对于切割展开这个执行步骤,设置的执行规则可以是更少切割线;对应紧致装箱这个步骤可以导入本申请实施例的上述数据处理方案,以实现在高填充率的情况下完成紧致装箱。
每个执行步骤可以单独执行,比如每个执行步骤均对应一个“执行”按钮,触发一个执行按钮,该执行按钮对应的执行步骤将会被执行;或者,上述的三个步骤可以同时启动执行,三个步骤按照图1中的顺序依次执行。比如,设置窗口包括一个“一键执行”按钮,触发该“一键执行”按钮可以触发同时启动三个步骤,以使3个步骤依序执行。
在执行步骤三时,采用本申请实施例上述提供的数据处理方案,在自动2UV展开中,待放置的N个图形是指N个UV岛,基于每个UV岛的图形属性从N个UV岛中确定出一个参考UV岛,然后根据该参考UV岛的图形属性与属性阈值之间的关系,从至少一个放置规则中确定出适用于N个UV岛的放置规则,按照确定出的放置规则将N个UV岛放置到容器中。采用本申请提供的数据处理方案可以实现有针对性地将多个UV岛装箱,提高容器填充率。
基于上述的数据处理方案,本申请实施例提供了一种数据处理方法。参见图2,为本申请实施例提供的一种数据处理方法的流程示意图。图2所述的数据处理方法可由数据处理设备执行,具体可由数据处理设备的处理器执行。图2所述的数据处理方法可包括如下步骤:
步骤S201、获取N个图形以及用于放置N个图形的容器。
其中,N个图形可以是任意形状的图形,比如N个图形可以是规则形状的多边形,如矩形、三角形、圆形;再如N个图形还可以是不规则形状的多边形。N个图形中每个图形可以是一个独立的多边形,也可以是由多个多边形拼接得到的一个图形。N个图形中可以存在一些相同的图形。参见图3a,为本申请实施例提供的一种N个图形的示意图,图3a所示的N个图形中可以包括规则形状的独立的多边形301和302,还可以包括不规则形状的拼接而成的多边形如303和304,N个图形中可以存在一些相同的图形,比如存在3个 301,2个302以及2个303。
用于放置N个图形的容器是指能够将其他图形放置在其中的一种图形,该容器可以是规则形状的图形,也可以是不规则形状的图形。参见图3b,为本申请实施例提供的一种容器的示意图,31表示一个不规则形状的容器,32表示一个规则形状的容器。
在一个实施例中,N个图形以及用于放置N个图形的容器均可以是存储在数据处理设备的本地存储中,当需要将N个图形放置到容器中时,数据处理设备从本地存储中加载出N个图形以及容器。
在其他实施例中,N个图形以及用于放置N个图形的容器可以是存储在其他设备中,当数据处理设备需要将N个图形放置到容器中时,数据处理设备通过与其他设备进行交互,接收其他设备传输的N个图形以及用于放置N个图形的容器。
步骤S202、基于每个图形的图形属性从N个图形中确定参考图形。
在一个实施例中,每个图形的图形属性可以包括图形面积,基于每个图形的图形属性从N个图形中确定参考图形可以是指基于每个图形的图形面积从N个图形中确定参考图形。具体实现中,基于每个图形的图形面积确定出N个图形的总面积;确定每个图形的图形面积与总面积之间的面积差异;将N个图形中第一图形确定为参考图形,第一图形的图形面积与总面积之间的面积差异满足第一面积差异阈值。
简单来说,就是计算每个图形的图形面积与N个图形的总面积之间的面积差异,将图形面积与总面积之间的面积差异满足第一面积差异阈值的图形确定为N个图形中的参考图形。比如N个图形中包括图形1和图形2,如果图形1与总面积之间的面积差异满足第一面积差异阈值,则图形1是参考图形,同理的,如果图形2与总面积之间的面积差异满足第一面积差异阈值,则图形2也是参考图形。由此可见,N个图形中参考图形的数量为一个或多个。
每个图形的图形面积与总面积之间的面积差异可以通过一个比值来表示,比如第一图形的图形面积与总面积之间的比值即为第一图形的图形面积与总面积之间的面积差异。第一面积差异阈值是一个预先设定的预设比值,第一图形的图形面积与总面积之间的面积差异满足第一面积差异阈值是指:第一图形的图形面积与总面积之间的比例大于或等于预设比值。上述提到的比值可以是通过百分比的形式表示的,例如,第一面积差异阈值可以是5%,如果N个图形中第一图形的图形面积与N个图形总面积之间的比值大于5%,则将第一图形确定为参考图形。换言之,将N个图形中,图形面积大于总面积5%的图形确定为参考图形。第一面积差异阈值用于确定参考图形。
参考图形的图形面积与总面积之间的面积差异满足第一面积差异阈值,参考图形相比于N个图形中的其他图形,具有更大的图形面积,对容器填充率的影响力更大,根据这样的参考图形的图形属性与属性阈值之间的关系确定N个图形对应的放置规则,有助于提高最终确定的放置规则的可靠性。
另一个实施例中,每个图形的图形属性还可以包括每个图形的图形长边长度,基于每个图形的图形属性从N个图形中确定参考图形可以是指:基于每个图形的图形长边长度从N个图形中确定参考图形。具体实现中,从N个图形中确定多个候选的图形;确定多个候选的图形中每个图形的图形长边长度与容器长边长度之间的长度差异;将多个候选的图形中的第二图形确定为参考图形,第二图形的图形长边长度与容器长边长度之间的长度差异满足长度差异阈值。
其中,可选的,多个候选的图形包括N个图形,也就是说,依据每个图形的图形长边长度从N个图形中选取参考图形。
可选的,多个候选的图形还可以包括:N个图形中除第一图形外的剩余图形。也就是说,如果已经根据每个图形的图形面积从N个图形中选择了参考图形,则还可以依据图形长边长度从N个图形除已经选择出的参考图形外的剩余图像中,再继续选择一些参考图 形,如此一来,N个图形中,图形长边长度与容器长边长度之间的长度差异满足长度差异阈值的图形,或者图形面积与总面积之间的面积差异满足第一面积差异阈值的图形均会被选出来作为参考图形。
每个图形的图形长边长度与容器长边长度之间的长度差异可以通过一个比值来表示,比如第二图形的图形长边长度与容器长边长度之间的比值即为第二图形的图形长边长度与容器长边长度之间的长度差异。长度差异阈值是一个预先设定的预设比值,第二图形的图形长边长度与容器长边长度之间的长度差异满足长度差异阈值是指:第二图形的图形长边长度与容器长边长度之间的比例大于或等于预设比值。上述提到的比值可以是通过百分比的形式表示的,例如,长度差异阈值可以是55%,如果N个图形中第二图形的图形长边长度容器长边长度之间的比值大于55%,则将第二图形确定为参考图形。换言之,将N个图形中,图形长边长度大于容器长边长度55%的图形确定为参考图形。
参考图形的图形长边长度与容器长边长度之间的长度差异满足长度差异阈值,参考图形相比于N个图形中的其他图形,具有更大的图形长边长度,对容器填充率的影响力更大,根据这样的参考图形的图形属性与属性阈值之间的关系确定N个图形对应的放置规则,有助于提高最终确定的放置规则的可靠性。
步骤S203、根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则。
其中,至少一个放置规则包括全局缩放放置规则和混合缩放放置规则,根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则可以包括:如果参考图形的图形属性与属性阈值之间存在第一数值关系,则将混合缩放放置规则确定为N个图形对应的放置规则;如果参考图形的图形属性与属性阈值之间存在第二数值关系,则将全局缩放放置规则确定为N个图形对应的放置规则。
此处提到参考图形的图形属性是指参考图形的图形面积属性,如果参考图形的数量为多个,参考图形的图形面积属性是将多个参考图形的图形面积进行相加得到的相加结果。可选的,属性阈值可以是基于N个图形的总面积和第二面积差异阈值确定的,具体地,可以将图形的总面积和第二面积差异阈值进行相乘运算,相乘运算的结果作为属性阈值。第二面积差异阈值是一个预先设定的预设比值,可以是通过百分比的形式表示的,例如,第二面积差异阈值可以是55%。可选的,属性阈值也可以是根据经验预先执行的一个值。第二面积差异阈值用于确定属性阈值。
参考图形的图形属性与属性阈值之间存在第一数值关系是指:参考图形的图形面积大于属性阈值;参考图形的图形属性与属性阈值之间存在第二数值关系是指:参考图形的图形面积小于或等于属性阈值。
步骤S204、按照N个图形对应的放置规则将N个图形放置于容器中。
在一个实施例中,如果N个图形对应的放置规则是指混合缩放放置规则,混合缩放放置规则包括独立缩放放置规则和全局缩放放置规则,则按照N个图形对应的放置规则将N个图形放置于容器中可以是指:按照独立缩放放置规则对参考图形进行独立缩放放置处理,并根据独立缩放放置处理结果将参考图形放置于容器中;以及按照全局缩放放置规则对N个图形中除参考图形外的剩余的图形进行全局缩放放置规则,并根据全局缩放放置处理结果将剩余的图形放置于容器中。
简单来说,如果基于参考图形的图形属性与属性阈值之间的关系确定出N个图形对应的放置规则是混合放置规则,那么按照混合放置规则将N个图形放置到容器中是指:分别按照混合放置规则中的不同放置规则来处理参考图形和N个图形中除参考图形外的剩余的图形。
另一个实施例中,如果N个图形对应的放置规则是指全局缩放放置规则,则按照N个图形对应的放置规则将N个图形放置于容器中是指:按照全局缩放放置规则对N个图 形中每个图形进行全局缩放放置处理,并根据全局缩放放置处理结果将N个图形中每个图形放置于容器中。也就是说,如果基于参考图形的图形属性与属性阈值之间的关系确定出N个图形对应的放置规则是全局缩放放置规则,那么就将N个图形中所有图形按照全局缩放放置规则进行处理以将N个图形放置到容器中。
通过上述两个实施例可以看出,在参考图形的图形属性与属性阈值之间存在不同关系的情况下,采用了不同的放置规则将N个图形放置到容器中。这是因为如果参考图形的图形属性与属性阈值之间存在第一数值关系时,参考图形相比于N个图形中的其他图形,具有更大的图形面积或者更大的图形长边长度,对其进行全局缩放时对全局缩放比例会存在一定限制,也就是说不能缩放到很小,如果不考虑这一点,把参考图形和其他图形一起进行全局缩放放置处理,就会影响整体的全局缩放比例,这样一来就会影响到容器的填充率。
如果参考图形的图形属性与属性阈值之间存在第二数值关系时,参考图形与N个图形中的其他图形在图形属性上就不存在很大的区别,可以对这N个图形一起进行全局缩放放置处理。下面通过图形直观的来进行对比,假设N个图形中参考图形的图形面积属性大于属性阈值,参见图4a,为本申请实施例提供的一种将N个图形放置到容器中的示意图,参见图4b,为本申请实施例提供的另一种将N个图形放置到容器中的示意图,401表示将N个图形中每个图形都按照全局缩放放置规则进行全局缩放放置处理后放置到容器中的放置结果,404表示采用混合缩放放置规则将N个图形放置到容器中的放置结果。401和402中N个图形是相同的,403和404中N个图形是相同的。
通过401和402的对比,以及403和404的对比可见,在参考图形的图形数据大于属性阈值的情况下,采用混合缩放放置规则将N个图形放置到容器中,相比于按照全局缩放放置规则将N个图形放置到容器中,具有更高的容器填充率。
本申请实施例中,针对参考图形的图形属性与属性阈值之间不同的关系,按照不同的放置规则对N个图形进行放置处理以将N个图形放置到容器中,实现了有针对性的装箱,使用较为合适的放置规则将N个图形进行装箱处理,如此一来,在一定程度上可以提高容器的填充率。
基于上述的数据处理方法,本申请实施例提供了另一种数据处理方法,参见图5,为本申请实施例提供的另一种数据处理方法的流程示意图。图5所述的数据处理方法可由数据处理设备执行,具体可由数据处理设备的处理器执行。图5所述的数据处理方法可包括如下步骤:
步骤S501、获取N个图形以及用于放置N个图形的容器。
步骤S502、基于每个图形的图形属性从N个图形中确定参考图形。
在一个实施例中,步骤S501和步骤S502中包括的一些可行的实施方式可参见图2实施例中步骤S201和步骤S202中的相关描述,在此不再赘述。
步骤S503、如果参考图形的图形属性与属性阈值之间存在第一数值关系,则将混合缩放放置规则确定为N个图形对应的放置规则,并将N个图形按照混合缩放放置规则放置于容器中。
由前述可知,将N个图形按照混合缩放放置规则放置于容器中是指:按照独立缩放放置规则对N个图形中的参考图形进行独立缩放放置处理,并根据独立缩放放置处理结果将参考图形放置于容器中;按照全局缩放放置规则对N个图形中除参考图形外的剩余的图形进行全局缩放放置处理,并根据全局缩放放置处理结果将剩余的图形放置于容器中。
步骤S504、如果参考图形的图形属性与属性阈值之间存在第二数值关系,则将全局缩放放置规则确定为N个图形对应的放置规则,并将N个图形按照全局缩放放置规则放置于容器中。
将N个图形按照全局缩放放置规则放置于容器中是指:按照全局缩放放置规则对N 个图形中每个图形进行全局缩放放置处理,并根据全局缩放放置处理结果将N个图形中每个图形放置于容器中。
下面分别介绍独立缩放放置处理的流程以及全局缩放放置处理的流程。针对独立缩放放置处理,令独立缩放放置处理的次数为i,i为正整数,按照独立缩放放置规则对参考图形进行独立缩放放置处理的流程包括:
1)令i=1,确定第i次独立缩放放置处理对应的独立缩放比例;
2)按照第i次独立缩放放置处理对应的独立缩放比例对参考图形进行独立缩放处理;
3)对独立缩放处理后的参考图形进行放置处理,得到将独立缩放处理后的参考图形放置到容器中的第一放置结果;
4)确定第一放置结果对应的容器填充率;
5)若i小于第一预设数值,则令i=i+1,并循环执行第i次的独立缩放放置处理的流程,直至i大于或等于第预设数值为止。其中,第一预设数值是预先设定的独立缩放比例尝试次数的上限。
针对全局缩放放置处理,因为步骤S503和步骤S504中均涉及到全局缩放放置处理,但是被执行全局缩放放置处理的对象不同,但是全局缩放放置处理的流程是相同的。因此,为了方便描述,将N个图形中需要进行全局缩放放置处理的图形添加到第一待放置图形集中,换句话说,第一待放置图形集中的图形均是被执行全局缩放放置处理的对象。在步骤S503中,第一待放置图形集中包括N个图形中除参考图形外的剩余的图形;在步骤S504中,第一待放置图形集中包括N个图形。令全局缩放放置处理的次数为r,r为正整数;全局缩放放置处理的流程包括:
1)令r=1,确定第r次全局缩放放置处理对应的全局缩放比例;
2)按照第r次全局缩放放置处理对应的全局缩放比例对第一待放置图形集中每个图形进行全局缩放处理;
3)对全局缩放处理后的每个图形进行放置处理,得到第一待放置图形集放置到容器中的第二放置结果;
4)确定第二放置结果对应的容器填充率;
5)若r小于第二预设数值,则令r=r+1,并循环执行第r次的全局缩放放置处理的流程,直到r大于或等于第二预设数值为止。其中,第二预设数值是指预先设定的全局缩放比例的尝试次数上限。
由步骤S503中描述可知,对参考图形进行独立缩放放置处理后,根据独立缩放放置处理结果将参考图形放置于容器中。具体实现中,从每次循环确定的第一放置结果对应的容器填充率中,确定第一容器填充率以及获取得到第一容器填充率时的独立缩放比例;按照获取到的独立缩放比例对参考图形进行缩放处理,并按照第一容器填充率对应的第一放置结果将缩放处理后的参考图形放置于容器中。其中,第一容器填充率可以是指每次循环确定的各个容器填充率中最大的容器填充率,这样一来,按照第一容器填充率对应的第一放置结果将参考图形放置到容器中,可以保证容器的容器填充率最佳。
在步骤S503中参考图形和N个图形中除参考图形外的剩余的图形是分别进行缩放放置处理,然后分别放置于容器中的,上述介绍了如何将参考图形放置到容器中,下面介绍如何将N个图形中除参考图形外的剩余的图形放置于容器中。具体地,按照前述全局缩放方式处理的流程对剩余的图形进行全局缩放放置处理后,得到全局缩放放置处理结果,然后根据全局缩放放置处理结果将剩余的图形放置于容器中。可选的,根据全局缩放放置处理结果将剩余的图形放置于容器中,可包括:从全局缩放放置处理的流程的每次循环确定的第二放置结果对应的容器填充率中,确定第二容器填充率,以及获取得到第二容器填充率时的全局缩放比例;按照获取到的全局缩放比例对剩余的图形进行缩放处理,并按照第二容器填充率对应的第二放置结果将缩放处理后的剩余的图形放置于容器中。其中,第二 容器填充率可以是指每次循环确定出的各个第二放置结果对应的容器填充率中最大的容器填充率,依据最大的容器填充率对应的全局缩放比例和第二放置结果将剩余的图形放置到容器中,可以保证容器的最佳填充率。
在步骤S504中,N个图形中每个图形都是按照全局缩放放置规则放置到容器中的,也即N个图形中每个图形都要执行全局缩放放置处理,然后根据全局缩放放置处理结果将每个图形放置于容器中。对N个图形中每个图形进行全局缩放放置处理的流程可参见前述。根据全局缩放放置处理结果将每个图形放置于容器中,可以包括:针对全局缩放放置处理的流程,从每次循环确定的第二放置结果对应的容器填充率中,确定第二容器填充率,以及获取得到第二容器填充率时的全局缩放比例;按照获取到的全局缩放比例对N个图形中每个图形进行缩放处理,并按照第二容器填充率对应的第二放置结果将缩放处理后的每个图形放置于容器中。
由此可见,通过步骤S503和步骤S504,N个图形中每个图形都能按照合适的方式放置到容器中,以保证容器的最佳填充率。
在上述独立缩放放置处理的流程和全局缩放放置处理的流程中,每次循环均涉及到要对某个图形进行放置处理,得到放置结果,比如在独立缩放放置处理的流程中,在每次循环时需要对独立缩放处理后的参考图形进行放置处理得到第一放置结果;在全局缩放放置处理的流程中,在每次循环时需要对全局缩放处理后的第一待放置图形集中每个图形进行放置处理,得到第一待放置图形集的第二放置结果。无论是独立缩放处理后的参考图形,还是全局缩放处理后的第一待放置图形集中的图形,放置处理的流程均是相同的,因此,为了方便下面介绍放置处理的流程,将需要进行放置处理的图形添加到第二待放置图形集中,第二待放置图形集中可以包括每次独立缩放放置处理流程中独立缩放处理后的参考图形;或者,每次全局缩放放置处理流程中全局缩放处理后的第一待放置图形集中的图形。
因此,对独立缩放处理后的参考图形进行放置处理,得到将独立缩放处理后的参考图形放置到容器中的第一放置结果,以及对全局缩放处理后的第一待放置图形集中每个图形进行放置处理,得到第一待放置图形集放置到容器中的第二放置结果,均是指:对第二待放置图形集中的图形进行放置处理,得到将第二待放置图形集放置于容器中的放置结果。可选的,对第二待放置图形集中的图形进行放置处理,得到将第二待放置图形集放置于容器中的放置结果,包括:按照第二待放置图形集中各个图形的图形面积对第二待放置图形集进行分组处理,得到按序排列的P个图形组,每个图形组包括一个或多个属于第二待放置图形集中的图形,排序靠前的图形组中各个图形的面积大于排序靠后的图形组中各个图形的图形面积,且在每个图形组中各个图形按照图形面积由大到小排序;对每个图形组进行放置处理,确定每个图形组对应的放置结果;各个图形组对应的放置结果组成将第二待放置图形中每个图形放置到容器中的放置结果。
其中,假设P个图形组中包括图形组j,图形组j中包括Mj个图形,下面以图形组j为例,介绍如何对每个图形组进行放置处理,确定每个图形组对应的放置结果。对图形组j进行放置处理,确定图形组j对应的放置结果,可以包括:
对图形组j进行交叉变换处理,确定图形组j对应的种群个体集合,种群个体集合包括多个候选个体,每个候选个体包括按照一种顺序排列的Mj个图形,不同候选个体中Mj个图形的排列顺序不相同;按照每个候选个体中Mj个图形的排列顺序对Mj个图形进行放置处理,得到每个候选个体对应的放置结果;根据每个候选个体对应的放置结果计算每个候选个体对应的平均放置重心;将平均放置重心满足重心条件的候选个体对应的放置结果作为图形组j对应的放置结果。其中,一个平均放置重心满足重心条件可以是指:该平均放置重心是所有候选个体对应的平均放置重心中的最小值。可选的,对图形组j进行交叉变换处理可以是基于遗传算法实现的,遗传算法(Genetic Algorithm)是模拟达尔文生物进化论的自然选择和遗传学机理的生物进化过程的计算模型,是一种通过模拟自然进化 过程搜索最优解的方法,该算法通过数学的方式,利用计算机仿真运算,将问题的求解过程转换成类似生物进化中的染色体基因的交叉、变异等过程。在求解较为复杂的组合优化问题时,相对一些常规的优化算法通常能够较快地获得较好的优化结果。
在一个实施例中,对任一候选个体来说,数据处理设备可以基于NFP(No Fit Polygon)和最低重心原则的装箱算法来确定任一候选个体对应的放置结果。其中,NFP是指一个多边形(在本申请中可以指一个图形)沿着另外一个多边形(在本申请可以指容器)的内部边界进行划动时,其边界上的某个参考点的轨迹所形成的多边形,在装箱问题中,NFP定义了将一个多边形放置到容器时的可行区域。具体实现中,数据处理设备基于NFP和最低重心原则的装箱算法来确定任一候选个体的放置结果,可以包括:针对多个候选个体中的任一候选个体,依序取出任一候选个体中每个图形,计算每个图形的候选放置角度;基于最低重心原则和每个图形的候选放置角度确定每个图形在容器中的放置位置,并按照确定出的放置位置将每个图形放置在容器中,便可以得到任一候选个体对应的放置结果。
现有技术中,基于NFP和最低重心原子的装箱算法也被用来将N个图形填充到容器中,但是实践证明,这种装箱算法虽然可以得到合理的放置结果,但是计算时间长,容器填充率较低。另外本申请考虑到,在游戏美术制作2UV场景等多数场景中,图形是允许形变的,可以在满足原始相对比例大小的基础上,将输入的图形进行放大、缩小等操作,以极致利用容器的空间,因此,提出了图5所述的数据处理方法,采用图5所述的数据处理方法将N个图形放置于容器中可以保证较高的容器填充率。
在一个实施例中,若N个图形包括至少两个相同的对称图形,则相同的对称图形用于划分在同一图形组中,相同的对称图形在进行缩放处理时对应相同的缩放比例,相同的对称图形在进行放置处理时用于集中放置。
其中,对称图形是指形状对称的图像,例如,轴对称图像、中心对称图形。相同的对称图形是指不仅形状一致而且均为对称图形的图形。
本申请无论是在独立缩放放置处理还是全局缩放放置处理时,均可以加入对称保持策略,使得原本保持对称的图形在缩放时采用相同的缩放比例,从而保持了输入的图形的相对大小模式。加入了对称保持策略后,N个图形在容器中的摆放会更加整齐,相同的对称图形趋于聚合在一起,并保持一致的缩放比例。参见图6a和图6b,为本申请实施提供的两种N个图形放置于容器中的示意图,在图6a中601区域内的图形是对称的,这些图形趋于聚合在一起,并且这些图形保持了相同的缩放比例,同理的,602区域内的图形是对称的;在图6b中,603中的图形相互对称以及604中的图形相互对称。由于每个图形组是分别进行放置处理的,为了让相同的对称图形放置在一起且保持一致的缩放比例,在进行分组处理时,相同的对称图形可以划分为同一图形组中,以便将相同的对称图形放置在同一空间区域,从而在保障较高的容器填充率的同时,保障填充的整齐度。
应当理解的,对第二待放置图形集中的图形进行放置处理,得到将第二待放置图形集放置于容器中的放置结果这个步骤无论是在独立缩放放置处理的流程中,还是在全局缩放放置处理的流程中,都会被执行很多次,为了提供N个图形放置到容器中的最终执行效率,自然想到要提高该步骤的计算效率。为了提高该步骤的计算效率,本申请在执行该步骤时引入了鲁棒几何计算中的快速舍入(Snap Rounding)的技巧,在鲁棒几何计算的研究中,快速舍入可以归类为一种有限精度逼近技术,是一种将线段的任意精度排列转换为固定精度表示的方法。快速舍入在本申请中的应用主要是用于约束任意一个图形的顶点数据中的小数位数,比如在将任意一个图形放置到容器时,计算出该任意一个图形的顶点坐标是n个小数位,n个小数位在计算该任意图形的放置位置或者其他信息时,需要耗费更多的计算时间,引入快速舍入技巧来规定顶点坐标的小数位为m,m远小于n,这样可以节省计算时间。为了满足快速舍入后的图形在放置于容器的过程中不与其他图形产生重叠,对于任意一个需要进行快速舍入的图形A1,要满足快速舍入后得到的图形A2小于该任 意一个图形A1。为满足该条件,在进行快速舍入之前,需要加额外半个像素距离外扩得到A3,再对A3进行快速舍入,得到有限精度的A2(即A1->A3->A2)。实践证明,在采用有限精度逼近技巧后,将N个图形放置于容器的整体时间可节省仅20%。
本申请实施例上述的数据处理方法可以是基于一个软件实现的,比如在数据处理设备中集成一个装箱算法,数据处理设备执行该装箱算法以实现将N个图形放置于容器中。该装箱算法的输入为N个图形和用于放置N个图形的容器,在执行装箱算法之前,首先,将待放置的N个图形按照图形面积从大到小排列,选出图形面积大于N个图形的总面积5%,或者有向包围盒的长边(也就是图形的长边长度)大于容器长边长度55%的图形作为参考图形,选出的参考图形也叫做大岛;若选出的参考图形的图形面积占N个图形的总面积的比值大于55%,则对参考图形执行独立缩放放置处理以及对除参考图形外的剩余的图形执行全局缩放放置处理;否则,则对N个图形中的每个图形执行全局缩放放置处理。
装箱算法可以包括三个算法模块,分别是基础公共算法模块、独立缩放算法模块以及全局缩放算法模块,基础公共算法模块是独立缩放算法模块和全局缩放算法模块共享的、基于遗传算法、NFP和全局最低重心原则设计的。
基础公共算法模块的算法流程为:
1)将待放置的已缩放的图形(待放置的已缩放的图形包括已进行独立缩放处理后的参考图形、已进行全局缩放处理的N个图形,以及N个图形中除参考图形外的剩余的图形,此处的待放置的已缩放的图形相当于前述提到的第二待放置图形集),进行图形面积从大到小排列,取前m个图形作为基础个体,根据遗传算法的交叉、变异、交换等基础操作,生成种群的n个候选个体,每个候选个体为m个图形组成的序列,在不同候选个体中m个图形的排列顺序不同,种群的n个候选个体可以表示为[{S
1},{S
2},...{S
n}],S
i表示n个候选个体中第i个候选个体,i的取值为大于或等于1,且小于或等于n;
2)对种群的每个候选个体S
i,基于NFP和最低重心原则,依序取出候选个体中的多个图形,计算每个图形的候选角度,根据NFP计算每个图形的放置位置并更新容器的空间,直到S
i中每个图形均放置到容器中。若发现无法按照序列中各个图形的排列顺序得到有效的放置结果,则跳过并处理下一个候选个体S
i+1;
3)通过步骤2),可以得到多个有效的放置结果,从得到多个有效的放置结果中选取平均重心最低的候选个体,作为种群的最佳候选个体,也就是对m个图形的最佳装箱结果,然后更新剩余的容器空间和待装箱的已缩放的图形,若存在还未装箱的已缩放的图形,则跳转至步骤1),否则结束基础公共算法模块的算法流程。
其中,有效的放置结果是指各个图形可以互相不重叠的成功放置到容器中。
独立缩放算法模块的算法流程为:
1)假设选取出的参考图形的数量为w个,分别表示为{B
1,B
2,...B
w},并设置独立缩放比例尝试次数上限;
2)若独立缩放比例次数达到上限,则跳转至步骤5),否则更新当前的独立缩放比例组合,独立缩放比例组合是将每个参考图形的独立缩放比例组合在一起得到的,独立缩放比例组合可以表示为{scale
1,scale
2,...scale
w};
3)对当前独立缩放处理后的w个参考图形执行基础公共算法模块;
4)计算当前的独立缩放比例组合对应的容器填充率(相当于前述提到的第一放置结果对应的容器填充率),更新全局最佳的容器填充率,跳转到步骤2);
5)输出全局最佳的容器填充率对应的放置结果(相当于前述提到的,获取第一放置结果对应的容器填充率中第一容器填充率,并按照第一容器填充率对应的第一放置结果放置参考图形)。
全局缩放算法模块的算法流程:
1)若已执行了独立缩放算法模块,则根据已放置好的参考图形,更新剩余的待放置的图形,将剩余的图形作为全局缩放算法模块的执行对象;如果未执行独立缩放算法模块,则将N个待放置的图形均作为全局缩放算法模块的执行对象。更新容器的剩余的空间,并设置全局缩放比例尝试次数上限;
2)若全局缩放比例次数达到尝试次数上限,跳转至步骤5),否则更新当前的全局缩放比例为scale
g,对执行对象按照该全局缩放比例进行统一缩放;
3)对按照scale
g缩放后的执行对象执行基础公共算法模块;
4)计算当前的全局缩放比例对应的容器填充率,并更新全局最佳的容器填充率,跳转至步骤2);
5)输出全局最佳的容器填充率对应的放置结果(相当于前述提到的,获取第二放置结果对应的容器填充率中第二容器填充率,并按照第二容器填充率对应的第二放置结果放置N个图形中的剩余的图形或者N个图形)。
本申请实施例中,数据处理设备采用上述的装箱算法将N个图形放置到容器中,可以针对参考图形的图形属性与属性阈值之间不同的关系,按照不同的放置规则对N个图形进行放置处理以将N个图形放置到容器中,实现了有针对性的装箱,使用较为合适的放置规则将N个图形进行装箱处理,如此一来,在一定程度上可以提高容器的填充率。
基于上述的数据处理方法实施例,本申请实施例提供了一种数据处理装置。参见图7,为本申请实施例提供的一种数据处理装置的结构示意图,图7所述的数据处理装置可运行如下单元:
获取单元701,用于获取N个图形及用于放置N个图形的容器,N为大于2的整数。
确定单元702,用于基于每个图形的图形属性从N个图形中确定参考图形。
确定单元702,还用于根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则。
放置单元703,用于按照N个图形对应的放置规则将N个图形放置于容器中。
在一个实施例中,至少一个放置规则包括混合缩放放置规则和全局缩放放置规则;确定单元702在根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则时,执行如下步骤:
如果参考图形的图形属性与属性阈值之间存在第一数值关系,则将混合缩放放置规则确定为N个图形对应的放置规则;
如果参考图形的图形属性与属性阈值存在第二数值关系,则将全局缩放放置规则确定为N个图形对应的放置规则。
在一个实施例中,每个图形的图形属性包括每个图形的图形面积,确定单元702在基于每个图形的图形属性从N个图形中确定参考图形时,执行如下步骤:
基于每个图形的图形面积确定N个图形的总面积;
确定每个图形的图形面积与总面积之间的面积差异;
将N个图形中第一图形确定为参考图形,第一图形的图形面积与总面积之间的面积 差异满足第一面积差异阈值。
在一个实施例中,每个图形的图形属性包括每个图形的图形长边长度,确定单元702在基于每个图形的图形属性从N个图形中确定参考图形时,执行如下步骤:
从N个图形中确定多个候选的图形,多个候选的图形包括:N个图形;或者,多个候选的图形包括N个图形中除第一图形外的剩余图形,第一图形是指N个图形中图形面积与N个图形的总面积之间的面积差异满足第一面积差异阈值的任一图形;
确定多个候选的图形中每个图形的图形长边长度与容器长边长度之间的长度差异;
将多个候选的图形中的第二图形确定为参考图形,第二图形的图形长边长度与容器长边长度之间的长度差异满足长度差异阈值。
在一个实施例中,属性阈值是基于N个图形的总面积和第二面积差异阈值确定的,确定单元702还用于:
若参考图形的图形面积大于属性阈值,则确定参考图形的图形属性与属性阈值之间存在第一数值关系;
若参考图形的图形面积小于或等于属性阈值,则确定参考图形的图形属性与属性阈值之间存在第二数值关系。
在一个实施例中,若至少一个放置规则包括混合缩放放置规则,则N个图形中除参考图形外的剩余的图形需要进行全局缩放放置处理;若至少一个放置规则包括全局缩放放置规则,则N个图形均需要进行全局缩放放置处理;将需要进行全局缩放放置处理的图形添加到第一待放置图形集中,以及令全局缩放放置处理的次数为r,r为正整数;全局缩放放置处理的流程包括:
令r=1,确定第r次全局缩放放置处理对应的全局缩放比例;
按照第r次全局缩放放置处理对应的全局缩放比例对第一待放置图形集中每个图形进行全局缩放处理;
对全局缩放处理后的第一待放置图形集中的每个图形进行放置处理,得到第一待放置图形集放置于容器中的第二放置结果;
确定第二放置结果对应的容器填充率;
若r小于第二预设数值,则令r=r+1,并循环执行第r次全局缩放放置处理的流程,直到r大于或等于第二预设数值为止。
在一个实施例中,若N个图形对应的放置规则包括混合缩放放置规则,混合缩放放置规则包括独立缩放放置规则和全局缩放放置规则,则放置单元703在按照N个图形对应的放置规则将N个图形放置于容器中时,执行如下步骤:
按照独立缩放放置规则对参考图形进行独立缩放放置处理,并根据独立缩放放置处理结果将参考图形放置于容器中;
按照全局缩放放置规则对N个图形中除参考图形外的剩余的图形进行全局缩放放置处理,并根据全局缩放放置处理结果将剩余的图形放置于容器中。
在一个实施例中,若N个图形对应的放置规则是指全局缩放放置规则,则放置单元703在按照N个图形对应的放置规则将N个图形放置于容器中时,执行如下步骤:
按照全局缩放放置规则对N个图形中每个图形进行全局缩放放置处理,并根据全局缩放放置处理结果将N个图形中每个图形放置于容器中。
在一个实施例中,令独立缩放放置处理的次数为i,i为正整数;按照独立缩放放置规则对参考图形进行独立缩放放置处理的流程包括:
令i=1,确定第i次独立缩放放置处理对应的独立缩放比例;
按照第i次独立缩放放置处理对应的独立缩放比例对参考图形进行独立缩放处理;
对独立缩放处理后的参考图形进行放置处理,得到将独立缩放处理后的参考图形放置于容器中的第一放置结果;
确定第一放置结果对应的容器填充率;
若i小于第一预设数值,则令i=i+1,并循环执行第i次独立缩放放置处理的流程,直到i大于或等于第一预设数值为止。
在一个实施例中,放置单元703在根据独立缩放放置处理结果将参考图形放置于容器中时,执行如下步骤:
从每次循环确定的第一放置结果对应的容器填充率中,确定第一容器填充率,以及获取得到第一容器填充率时的独立缩放比例;
按照获取到的独立缩放比例对参考图形进行缩放处理,并按照第一容器填充率对应的第一放置结果将缩放处理后的参考图形放置于容器中。
在一个实施例中,放置单元703在根据全局缩放放置处理结果将剩余的图形放置于容器中时,执行如下步骤:
从每次循环确定的第二放置结果对应的容器填充率中,确定第二容器填充率,以及获取得到第二容器填充率时的全局缩放比例;
按照获取到的全局缩放比例对剩余的图形进行缩放处理,并按照第二容器填充率对应的第二放置结果将缩放处理后的剩余的图形放置于容器中。
在一个实施例中,将需要进行放置处理的图形添加至第二待放置图形集中;第二待放置图形集中包括每次独立缩放放置处理的流程中独立缩放处理后的参考图形;或者,第二放置图形集中包括在每次全局缩放放置处理的流程中全局缩放处理后的第一待放置图形集中的图形;放置单元703在对第二待放置图形集中的图形进行放置处理,得到将第二待放置图形集放置于容器中的放置结果时,执行如下步骤:
按照第二待放置图形集中各个图形的图形面积对第二待放置图形集进行分组处理,得到按序排列的P个图形组,P为正整数,每个图形组中包括一个或多个属于第二待放置图形集中的图形;排序靠前的图形组中各个图形的图形面积大于排序靠后的图形组中各个图形的图形面积,在每个图形组中各个图形按照图形面积由大到小排序;
对每个图形组进行放置处理,确定每个图形组对应的放置结果;
各个图形组对应的放置结果组成将第二待放置图形集中每个图形放置于容器中的放置结果。
在一个实施例中,若P个图形组包括图形组j,图形组j中包括Mj个图形,Mj为正整数,放置单元703在图形组j进行放置处理,确定图形组j对应的放置结果时,执行如下步骤:
对图形组j进行交叉变换处理,确定图形组j对应的种群个体集合,种群个体集合包括多个候选个体,每个候选个体包括按照一种顺序排列的Mj个图形;不同候选个体中Mj个图形的排列顺序不相同;
按照每个候选个体中的Mj个图形的排列顺序对Mj个图形进行放置处理,得到每个候选个体对应的放置结果;
根据每个候选个体对应的放置结果计算每个候选个体对应的平均放置重心;
将平均放置重心满足重心条件的候选个体对应的放置结果作为图形组j对应的放置结果。
在一个实施例中,放置单元703在按照每个候选个体中的Mj个图形的排列顺序对Mj个图形进行放置处理,得到每个候选个体对应的放置结果时,执行如下步骤:
针对多个候选个体中的任一候选个体,依序取出任一候选个体中每个图形,计算每个图形的候选放置角度;
基于最低重心原则和每个图形的候选放置角度确定每个图形在容器中的放置位置,并按照确定出的放置位置将每个图形放置在容器中,得到任一候选个体对应的放置结果。
在一个实施例中,若N个图形包括至少两个相同的对称图形,则相同的对称图形用于 划分在同一图形组中,相同的对称图形在进行缩放处理时对应相同的缩放比例,相同的对称图形在进行放置处理时用于集中放置。
根据本申请的一个实施例,图2和图5所示的数据处理方法所涉及各个步骤可以是由图7所示的数据处理装置中的各个单元来执行的。例如,图2所述的步骤S202和步骤S203均可由图7所示的数据处理装置中的确定单元702来执行,步骤S201可由图7所述的数据处理装置中的获取单元701来执行,步骤S204可由图7所述的数据处理装置中的放置单元703来执行;再如,图5所述步骤S501可由图7所述的数据处理装置中的获取单元701来执行,步骤S502可由图7所述的数据处理装置中的确定单元702来执行,步骤S503和步骤S504可由图7所述的数据处理装置中的确定单元702和放置单元703来执行。
根据本申请的另一个实施例,图7所示的数据处理装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,基于数据处理装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算设备上运行能够执行如图2以及图5所示的相应方法所涉及的各步骤的计算机可读指令(包括程序代码),来构造如图7中所示的数据处理装置,以及来实现本申请实施例数据处理方法。所述计算机可读指令可以记载于例如计算机可读存储介质上,并通过计算机可读存储介质装载于数据处理设备中,并在其中运行。
本申请实施例中,在需要将N个图形放置到容器中时,首先基于每个图形的图形属性从N个图形中确定参考图形;然后根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定适合N个图形的放置规则,最后按照确定出的放置规则将N个图形放置于容器中。应当理解的,采用适合的放置规则对N个图形进行放置,实现了针对性的放置处理,可有效提高容器填充率。
参见图8,为本申请实施例提供的一种数据处理设备的结构示意图。图8所示的数据处理设备可包括处理器801、输入接口802、输出接口803以及计算机存储介质804。其中,处理器801、输入接口802、输出接口803以及计算机存储介质804可通过总线或其他方式连接。
计算机存储介质804可以存储在消息处理设备的存储器中,计算机存储介质804用于存储计算机可读指令,处理器801用于执行计算机存储介质804存储的计算机可读指令。处理器801(或称CPU(Central Processing Unit,中央处理器))是数据处理设备的计算核心以及控制核心,其适于实现一条或多条计算机可读指令,具体适于加载并执行:
获取N个图形及用于放置N个图形的容器,N为大于2的整数;
基于每个图形的图形属性从N个图形中确定参考图形;
根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则;
按照N个图形对应的放置规则将N个图形放置于容器中。
本申请实施例中,在需要将N个图形放置到容器中时,首先基于每个图形的图形属性从N个图形中确定参考图形;然后根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定适合N个图形的放置规则,最后按照确定出的放置规则将N个图形放置于容器中。应当理解的,采用适合的放置规则对N个图形进行放置,实现了针对性 的放置处理,可有效提高容器填充率。
本申请实施例还提供了一种计算机存储介质(Memory),计算机存储介质是数据处理设备的记忆设备,用于存放程序和数据。可以理解的是,此处的计算机存储介质既可以包括数据处理设备的内置存储介质,当然也可以包括数据处理设备所支持的扩展存储介质。计算机存储介质提供存储空间,该存储空间存储了数据处理设备的操作系统。并且,在该存储空间中还存放了适于被处理器801加载并执行的一条或多条的计算机可读指令。需要说明的是,此处的计算机存储介质可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器;可选的还可以是至少一个位于远离前述处理器的计算机存储介质。
在一个实施例中,计算机存储介质中存储的一条或多条计算机可读指令可有处理器801加载并执行:
获取N个图形及用于放置N个图形的容器,N为大于2的整数;
基于每个图形的图形属性从N个图形中确定参考图形;
根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则;
按照N个图形对应的放置规则将N个图形放置于容器中。
在一个实施例中,至少一个放置规则包括混合缩放放置规则和全局缩放放置规则;处理器801在根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则时,执行如下步骤:
如果参考图形的图形属性与属性阈值之间存在第一数值关系,则将混合缩放放置规则确定为N个图形对应的放置规则;
如果参考图形的图形属性与属性阈值存在第二数值关系,则将全局缩放放置规则确定为N个图形对应的放置规则。
在一个实施例中,每个图形的图形属性包括每个图形的图形面积,处理器801在基于每个图形的图形属性从N个图形中确定参考图形时,执行如下步骤:
基于每个图形的图形面积确定N个图形的总面积;
确定每个图形的图形面积与总面积之间的面积差异;
将N个图形中第一图形确定为参考图形,第一图形的图形面积与总面积之间的面积差异满足第一面积差异阈值。
在一个实施例中,每个图形的图形属性包括每个图形的图形长边长度,处理器801在基于每个图形的图形属性从N个图形中确定参考图形时,执行如下步骤:
从N个图形中确定多个候选的图形,多个候选的图形包括N个图形;或者,多个候选的图形包括N个图形中除第一图形外的剩余图形,第一图形是指N个图形中图形面积与N个图形的总面积之间的面积差异满足第一面积差异阈值的任一图形;
确定多个候选的图形中每个图形的图形长边长度与容器长边长度之间的长度差异;
将多个候选的图形中的第二图形确定为参考图形,第二图形的图形长边长度与容器长边长度之间的长度差异满足长度差异阈值。
在一个实施例中,属性阈值是基于N个图形的总面积和第二面积差异阈值确定的,处理器801还用于:
若参考图形的图形面积大于属性阈值,则确定参考图形的图形属性与属性阈值之间存在第一数值关系;
若参考图形的图形面积小于或等于属性阈值,则确定参考图形的图形属性与属性阈值之间存在第二数值关系。
在一个实施例中,若至少一个放置规则包括混合缩放放置规则,则N个图形中除参考 图形外的剩余的图形需要进行全局缩放放置处理;若至少一个放置规则包括全局缩放放置规则,则N个图形均需要进行全局缩放放置处理;将需要进行全局缩放放置处理的图形添加到第一待放置图形集中,以及令全局缩放放置处理的次数为r,r为正整数;全局缩放放置处理的流程包括:
令r=1,确定第r次全局缩放放置处理对应的全局缩放比例;
按照第r次全局缩放放置处理对应的全局缩放比例对第一待放置图形集中每个图形进行全局缩放处理;
对全局缩放处理后的第一待放置图形集中的每个图形进行放置处理,得到第一待放置图形集放置于容器中的第二放置结果;
确定第二放置结果对应的容器填充率;
若r小于第二预设数值,则令r=r+1,并循环执行第r次全局缩放放置处理的流程,直到r大于或等于第二预设数值为止。
在一个实施例中,若N个图形对应的放置规则包括混合缩放放置规则,混合缩放放置规则包括独立缩放放置规则和全局缩放放置规则,则处理器801在按照N个图形对应的放置规则将N个图形放置于容器中时,执行如下步骤:
按照独立缩放放置规则对参考图形进行独立缩放放置处理,并根据独立缩放放置处理结果将参考图形放置于容器中;
按照全局缩放放置规则对N个图形中除参考图形外的剩余的图形进行全局缩放放置处理,并根据全局缩放放置处理结果将剩余的图形放置于容器中。
在一个实施例中,若N个图形对应的放置规则是指全局缩放放置规则,则处理器801在按照N个图形对应的放置规则将N个图形放置于容器中时,执行如下步骤:
按照全局缩放放置规则对N个图形中每个图形进行全局缩放放置处理,并根据全局缩放放置处理结果将N个图形中每个图形放置于容器中。
在一个实施例中,令独立缩放放置处理的次数为i,i为正整数;按照独立缩放放置规则对参考图形进行独立缩放放置处理的流程包括:
令i=1,确定第i次独立缩放放置处理对应的独立缩放比例;
按照第i次独立缩放放置处理对应的独立缩放比例对参考图形进行独立缩放处理;
对独立缩放处理后的参考图形进行放置处理,得到将独立缩放处理后的参考图形放置于容器中的第一放置结果;
确定第一放置结果对应的容器填充率;
若i小于第一预设数值,则令i=i+1,并循环执行第i次独立缩放放置处理的流程,直到i大于或等于第一预设数值为止。
在一个实施例中,处理器801在根据独立缩放放置处理结果将参考图形放置于容器中时,执行如下步骤:
从每次循环确定的第一放置结果对应的容器填充率中,确定第一容器填充率,以及获取得到第一容器填充率时的独立缩放比例;
按照获取到的独立缩放比例对参考图形进行缩放处理,并按照第一容器填充率对应的第一放置结果将缩放处理后的参考图形放置于容器中。
在一个实施例中,处理器801在根据全局缩放放置处理结果将剩余的图形放置于容器中时,执行如下步骤:
从每次循环确定的第二放置结果对应的容器填充率中,确定第二容器填充率,以及获取得到第二容器填充率时的全局缩放比例;
按照获取到的全局缩放比例对剩余的图形进行缩放处理,并按照第二容器填充率对应的第二放置结果将缩放处理后的剩余的图形放置于容器中。
在一个实施例中,将需要进行放置处理的图形添加至第二待放置图形集中;第二待放 置图形集中包括每次独立缩放放置处理的流程中独立缩放处理后的参考图形;或者,第二放置图形集中包括在每次全局缩放放置处理的流程中全局缩放处理后的第一待放置图形集中的图形;处理器801在对第二待放置图形集中的图形进行放置处理,得到将第二待放置图形集放置于容器中的放置结果时,执行如下步骤:
按照第二待放置图形集中各个图形的图形面积对第二待放置图形集进行分组处理,得到按序排列的P个图形组,P为正整数,每个图形组中包括一个或多个属于第二待放置图形集中的图形;排序靠前的图形组中各个图形的图形面积大于排序靠后的图形组中各个图形的图形面积,在每个图形组中各个图形按照图形面积由大到小排序;
对每个图形组进行放置处理,确定每个图形组对应的放置结果;
各个图形组对应的放置结果组成将第二待放置图形集中每个图形放置于容器中的放置结果。
在一个实施例中,若P个图形组包括图形组j,图形组j中包括Mj个图形,Mj为正整数,处理器801在图形组j进行放置处理,确定图形组j对应的放置结果时,执行如下步骤:
对图形组j进行交叉变换处理,确定图形组j对应的种群个体集合,种群个体集合包括多个候选个体,每个候选个体包括按照一种顺序排列的Mj个图形;不同候选个体中Mj个图形的排列顺序不相同;
按照每个候选个体中的Mj个图形的排列顺序对Mj个图形进行放置处理,得到每个候选个体对应的放置结果;
根据每个候选个体对应的放置结果计算每个候选个体对应的平均放置重心;
将平均放置重心满足重心条件的候选个体对应的放置结果作为图形组j对应的放置结果。
在一个实施例中,处理器801在按照每个候选个体中的Mj个图形的排列顺序对Mj个图形进行放置处理,得到每个候选个体对应的放置结果时,执行如下步骤:
针对多个候选个体中的任一候选个体,依序取出任一候选个体中每个图形,计算每个图形的候选放置角度;
基于最低重心原则和每个图形的候选放置角度确定每个图形在容器中的放置位置,并按照确定出的放置位置将每个图形放置在容器中,得到任一候选个体对应的放置结果。
在一个实施例中,若N个图形包括至少两个相同的对称图形,则相同的对称图形用于划分在同一图形组中,相同的对称图形在进行缩放处理时对应相同的缩放比例,相同的对称图形在进行放置处理时用于集中放置。
本申请实施例中,在需要将N个图形放置到容器中时,首先基于每个图形的图形属性从N个图形中确定参考图形;然后根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定适合N个图形的放置规则,最后按照确定出的放置规则将N个图形放置于容器中。应当理解的,采用适合的放置规则对N个图形进行放置,实现了针对性的放置处理,可有效提高容器填充率。
本申请实施例还提供了一种计算机程序产品或计算机可读指令,计算机程序产品中包括计算机可读指令,计算机可读指令存储在计算机存储介质中;计算机可读指令被处理器801加载并执行:
获取N个图形及用于放置N个图形的容器,N为大于2的整数;
基于每个图形的图形属性从N个图形中确定参考图形;
根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定N个图形对应的放置规则;
按照N个图形对应的放置规则将N个图形放置于容器中。
本申请实施例中,在需要将N个图形放置到容器中时,首先基于每个图形的图形属性 从N个图形中确定参考图形;然后根据参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定适合N个图形的放置规则,最后按照确定出的放置规则将N个图形放置于容器中。应当理解的,采用适合的放置规则对N个图形进行放置,实现了针对性的放置处理,可有效提高容器填充率。
在一个实施例中,还提供了一种数据处理设备,包括存储器和处理器,存储器中存储有计算机可读指令,处理器执行计算机可读指令时实现上述各方法实施例中的步骤。
在一个实施例中,提供了一种计算机可读存储介质,存储有计算机可读指令,该计算机可读指令被处理器执行时实现上述各方法实施例中的步骤。
在一个实施例中,提供了一种计算机程序产品,该计算机程序产品包括计算机可读指令,该计算机可读指令被处理器执行时实现上述各方法实施例中的步骤。
Claims (19)
- 一种数据处理方法,其特征在于,由数据处理设备执行,包括:获取N个图形及用于放置所述N个图形的容器,N为大于2的整数;基于每个图形的图形属性从所述N个图形中确定参考图形;根据所述参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定所述N个图形对应的放置规则;及按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中。
- 如权利要求1所述的方法,其特征在于,所述至少一个放置规则包括混合缩放放置规则和全局缩放放置规则;所述根据所述参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定所述N个图形对应的放置规则,包括:如果所述参考图形的图形属性与属性阈值之间存在第一数值关系,则将所述混合缩放放置规则确定为所述N个图形对应的放置规则;及如果所述参考图形的图形属性与所述属性阈值存在第二数值关系,则将所述全局缩放放置规则确定为所述N个图形对应的放置规则。
- 如权利要求1所述的方法,其特征在于,所述每个图形的图形属性包括所述每个图形的图形面积,所述基于每个图形的图形属性从所述N个图形中确定参考图形,包括:基于所述每个图形的图形面积确定所述N个图形的总面积;确定所述每个图形的图形面积与所述总面积之间的面积差异;及将所述N个图形中第一图形确定为参考图形,所述第一图形的图形面积与所述总面积之间的面积差异满足第一面积差异阈值。
- 如权利要求1所述的方法,其特征在于,所述每个图形的图形属性包括所述每个图形的图形长边长度,所述基于每个图形的图形属性从所述N个图形中确定参考图形,包括:从所述N个图形中确定多个候选的图形;所述多个候选的图形包括所述N个图形;或者,所述多个候选的图形包括所述N个图形中除第一图形外的剩余图形,所述第一图形是指所述N个图形中图形面积与所述N个图形的总面积之间的面积差异满足第一面积差异阈值的任一图形;确定所述多个候选的图形中每个图形的图形长边长度与容器长边长度之间的长度差异;及将所述多个候选的图形中的第二图形确定为所述参考图形,所述第二图形的图形长边长度与所述容器长边长度之间的长度差异满足长度差异阈值。
- 如权利要求3所述的方法,其特征在于,所述属性阈值是基于所述N个图形的总面积和第二面积差异阈值确定的,所述方法还包括:若所述参考图形的图形面积大于所述属性阈值,则确定所述参考图形的图形属性与所述属性阈值之间存在第一数值关系;及若所述参考图形的图形面积小于或等于所述属性阈值,则确定所述参考图形的图形属性与所述属性阈值之间存在第二数值关系。
- 如权利要求1所述的方法,其特征在于,若所述至少一个放置规则包括混合缩放放置规则,则所述N个图形中除所述参考图形外的剩余的图形需要进行全局缩放放置处理;若所述至少一个放置规则包括全局缩放放置规则,则所述N个图形均需要进行全局缩放放置处理;将需要进行全局缩放放置处理的图形添加到第一待放置图形集中,以及令全局缩放放置处理的次数为r,r为正整数;全局缩放放置处理的流程包括:令r=1,确定第r次全局缩放放置处理对应的全局缩放比例;按照所述第r次全局缩放放置处理对应的全局缩放比例对所述第一待放置图形集中 每个图形进行全局缩放处理;对全局缩放处理后的所述第一待放置图形集中的每个图形进行放置处理,得到所述第一待放置图形集放置于所述容器中的第二放置结果;确定所述第二放置结果对应的容器填充率;及若r小于第二预设数值,则令r=r+1,并循环执行第r次全局缩放放置处理的流程,直到r大于或等于所述第二预设数值为止。
- 如权利要求1所述的方法,其特征在于,若所述N个图形对应的放置规则包括混合缩放放置规则,所述混合缩放放置规则包括独立缩放放置规则和全局缩放放置规则,则所述按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中,包括:按照所述独立缩放放置规则对所述参考图形进行独立缩放放置处理,并根据独立缩放放置处理结果将所述参考图形放置于所述容器中;及按照所述全局缩放放置规则对所述N个图形中除所述参考图形外的剩余的图形进行全局缩放放置处理,并根据全局缩放放置处理结果将所述剩余的图形放置于所述容器中。
- 如权利要求1所述的方法,其特征在于,若所述N个图形对应的放置规则是指全局缩放放置规则,则所述按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中,包括:按照所述全局缩放放置规则对所述N个图形中每个图形进行全局缩放放置处理,并根据全局缩放放置处理结果将所述N个图形中每个图形放置于所述容器中。
- 如权利要求7所述的方法,其特征在于,令独立缩放放置处理的次数为i,i为正整数;按照所述独立缩放放置规则对所述参考图形进行独立缩放放置处理的流程包括:令i=1,确定第i次独立缩放放置处理对应的独立缩放比例;按照所述第i次独立缩放放置处理对应的独立缩放比例对所述参考图形进行独立缩放处理;对独立缩放处理后的参考图形进行放置处理,得到将独立缩放处理后的参考图形放置于所述容器中的第一放置结果;确定所述第一放置结果对应的容器填充率;及若i小于第一预设数值,则令i=i+1,并循环执行第i次独立缩放放置处理的流程,直到i大于或等于所述第一预设数值为止。
- 如权利要求9所述的方法,其特征在于,所述根据独立缩放放置处理结果将所述参考图形放置于所述容器中,包括:从每次循环确定的第一放置结果对应的容器填充率中,确定第一容器填充率,以及获取得到所述第一容器填充率时的独立缩放比例;及按照获取到的独立缩放比例对所述参考图形进行缩放处理,并按照所述第一容器填充率对应的第一放置结果将缩放处理后的参考图形放置于所述容器中。
- 如权利要求7所述的方法,其特征在于,所述根据全局缩放放置处理结果将所述剩余的图形放置于所述容器中,包括:从每次循环确定的第二放置结果对应的容器填充率中,确定第二容器填充率,以及获取得到所述第二容器填充率时的全局缩放比例;及按照获取到的全局缩放比例对所述剩余的图形进行缩放处理,并按照所述第二容器填充率对应的第二放置结果将缩放处理后的剩余的图形放置于所述容器中。
- 如权利要求6或9所述的方法,其特征在于,将需要进行放置处理的图形添加至第二待放置图形集中;所述第二待放置图形集中包括每次独立缩放放置处理的流程中独立缩放处理后的参考图形;或者,所述第二放置图形集中包括在每次全局缩放放置处理的流程中全局缩放处理后的第一待放置图形集中的图形;对所述第二待放置图形集中的图形进行放置处理,得到将所述第二待放置图形集放置 于所述容器中的放置结果,包括:按照所述第二待放置图形集中各个图形的图形面积对所述第二待放置图形集进行分组处理,得到按序排列的P个图形组,P为正整数,每个图形组中包括一个或多个属于所述第二待放置图形集中的图形;排序靠前的图形组中各个图形的图形面积大于排序靠后的图形组中各个图形的图形面积,在每个图形组中各个图形按照图形面积由大到小排序;对每个图形组进行放置处理,确定每个图形组对应的放置结果;及各个图形组对应的放置结果组成将所述第二待放置图形集中每个图形放置于所述容器中的放置结果。
- 如权利要求12所述的方法,其特征在于,若所述P个图形组包括图形组j,所述图形组j中包括Mj个图形,Mj为正整数,对图形组j进行放置处理,确定所述图形组j对应的放置结果,包括:对所述图形组j进行交叉变换处理,确定所述图形组j对应的种群个体集合,所述种群个体集合包括多个候选个体,每个候选个体包括按照一种顺序排列的Mj个图形;不同候选个体中Mj个图形的排列顺序不相同;按照所述每个候选个体中的Mj个图形的排列顺序对所述Mj个图形进行放置处理,得到每个候选个体对应的放置结果;根据所述每个候选个体对应的放置结果计算所述每个候选个体对应的平均放置重心;及将平均放置重心满足重心条件的候选个体对应的放置结果作为所述图形组j对应的放置结果。
- 如权利要求13所述的方法,其特征在于,所述按照所述每个候选个体中的Mj个图形的排列顺序对所述Mj个图形进行放置处理,得到所述每个候选个体对应的放置结果,包括:针对所述多个候选个体中的任一候选个体,依序取出所述任一候选个体中每个图形,计算每个图形的候选放置角度;及基于最低重心原则和所述每个图形的候选放置角度确定所述每个图形在所述容器中的放置位置,并按照确定出的放置位置将所述每个图形放置在所述容器中,得到所述任一候选个体对应的放置结果。
- 如权利要求12所述的方法,其特征在于,若所述N个图形包括至少两个相同的对称图形,则相同的对称图形用于划分在同一图形组中,相同的对称图形在进行缩放处理时对应相同的缩放比例,相同的对称图形在进行放置处理时用于集中放置。
- 一种数据处理装置,其特征在于,包括:获取单元,用于获取N个图形及用于放置所述N个图形的容器,N为大于2的整数;确定单元,用于基于每个图形的图形属性从所述N个图形中确定参考图形;所述确定单元,还用于根据所述参考图形的图形属性与属性阈值之间的关系,从至少一个放置规则中确定所述N个图形对应的放置规则;及放置单元,用于按照所述N个图形对应的放置规则将所述N个图形放置于所述容器中。
- 一种数据处理设备,其特征在于,包括:处理器,适于实现一条或多条计算机可读指令;以及,计算机存储介质,所述计算机存储介质存储有一条或多条计算机可读指令,所述一条或多条计算机可读指令适于由所述处理器加载并执行如权利要求1-15任一项所述的数据处理方法。
- 一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序被处理器加载并执行如权利要求1-15任一项所述的数据处理方法。
- 一种计算机程序产品,包括计算机可读指令,所述计算机可读指令被处理器执行时实现权利要求1-15中任一项所述的数据处理方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US18/201,640 US20230298237A1 (en) | 2022-02-28 | 2023-05-24 | Data processing method, apparatus, and device and storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210184708.1 | 2022-02-28 | ||
CN202210184708.1A CN114255160B (zh) | 2022-02-28 | 2022-02-28 | 数据处理方法、装置、设备及存储介质 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US18/201,640 Continuation US20230298237A1 (en) | 2022-02-28 | 2023-05-24 | Data processing method, apparatus, and device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023160050A1 true WO2023160050A1 (zh) | 2023-08-31 |
Family
ID=80797095
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/133999 WO2023160050A1 (zh) | 2022-02-28 | 2022-11-24 | 数据处理方法、装置、设备及存储介质 |
Country Status (3)
Country | Link |
---|---|
US (1) | US20230298237A1 (zh) |
CN (1) | CN114255160B (zh) |
WO (1) | WO2023160050A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114255160B (zh) * | 2022-02-28 | 2022-06-14 | 腾讯科技(深圳)有限公司 | 数据处理方法、装置、设备及存储介质 |
CN114708358B (zh) * | 2022-05-25 | 2022-09-02 | 腾讯科技(深圳)有限公司 | 对象处理方法、装置、设备及计算机可读存储介质 |
CN114781014B (zh) * | 2022-06-17 | 2022-09-09 | 腾讯科技(深圳)有限公司 | 对象处理方法、装置、设备及计算机可读存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7444603B1 (en) * | 2006-12-15 | 2008-10-28 | Xilinx, Inc. | Transformation of graphs representing an electronic design in a high modeling system |
CN111738935A (zh) * | 2020-05-15 | 2020-10-02 | 完美世界(北京)软件科技发展有限公司 | 残影渲染方法和装置、存储介质和电子装置 |
CN113791914A (zh) * | 2021-11-17 | 2021-12-14 | 腾讯科技(深圳)有限公司 | 对象处理方法、装置、计算机设备、存储介质及产品 |
CN113920184A (zh) * | 2021-12-13 | 2022-01-11 | 腾讯科技(深圳)有限公司 | 多边形简化方法、装置、设备及计算机可读存储介质 |
CN114255160A (zh) * | 2022-02-28 | 2022-03-29 | 腾讯科技(深圳)有限公司 | 数据处理方法、装置、设备及存储介质 |
CN114708358A (zh) * | 2022-05-25 | 2022-07-05 | 腾讯科技(深圳)有限公司 | 对象处理方法、装置、设备及计算机可读存储介质 |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2556492A4 (en) * | 2010-04-07 | 2016-08-31 | Ericsson Telefon Ab L M | COMPRESSION AND DECOMPRESSION OF TEXTURE |
WO2013091078A1 (en) * | 2011-12-23 | 2013-06-27 | Liu Junmin | Method for phase unwrapping |
US9972111B2 (en) * | 2016-02-24 | 2018-05-15 | Adobe Systems Incorporated | Optimizing image cropping |
KR102049906B1 (ko) * | 2016-09-02 | 2019-11-28 | 이스탄불 테크니크 위니웨르시테시 | 분할 패킹 접근 방식에 의한 선박 선체의 소형 플레이트로의 세그먼트화를 위한 컴퓨터 구현 방법 |
US10540821B2 (en) * | 2018-03-09 | 2020-01-21 | Staples, Inc. | Dynamic item placement using 3-dimensional optimization of space |
CN110097315B (zh) * | 2019-04-24 | 2021-06-25 | 阿里巴巴(中国)有限公司 | 容器确定方法、容器确定装置、介质和计算设备 |
-
2022
- 2022-02-28 CN CN202210184708.1A patent/CN114255160B/zh active Active
- 2022-11-24 WO PCT/CN2022/133999 patent/WO2023160050A1/zh unknown
-
2023
- 2023-05-24 US US18/201,640 patent/US20230298237A1/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7444603B1 (en) * | 2006-12-15 | 2008-10-28 | Xilinx, Inc. | Transformation of graphs representing an electronic design in a high modeling system |
CN111738935A (zh) * | 2020-05-15 | 2020-10-02 | 完美世界(北京)软件科技发展有限公司 | 残影渲染方法和装置、存储介质和电子装置 |
CN113791914A (zh) * | 2021-11-17 | 2021-12-14 | 腾讯科技(深圳)有限公司 | 对象处理方法、装置、计算机设备、存储介质及产品 |
CN113920184A (zh) * | 2021-12-13 | 2022-01-11 | 腾讯科技(深圳)有限公司 | 多边形简化方法、装置、设备及计算机可读存储介质 |
CN114255160A (zh) * | 2022-02-28 | 2022-03-29 | 腾讯科技(深圳)有限公司 | 数据处理方法、装置、设备及存储介质 |
CN114708358A (zh) * | 2022-05-25 | 2022-07-05 | 腾讯科技(深圳)有限公司 | 对象处理方法、装置、设备及计算机可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
US20230298237A1 (en) | 2023-09-21 |
CN114255160A (zh) | 2022-03-29 |
CN114255160B (zh) | 2022-06-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023160050A1 (zh) | 数据处理方法、装置、设备及存储介质 | |
CN106897143A (zh) | 对图形处理系统中的处理引擎的区片分配 | |
CN110990516B (zh) | 地图数据的处理方法、装置和服务器 | |
CN105809728A (zh) | 在图形处理单元中渲染场景的视图 | |
WO2023087893A1 (zh) | 对象处理方法、装置、计算机设备、存储介质及程序产品 | |
CN106251384A (zh) | 使用三角形的递归再分的细分方法 | |
CN104200506A (zh) | 三维gis海量矢量数据渲染方法及装置 | |
CN104239431B (zh) | 三维gis模型显示方法及装置 | |
CN110368694A (zh) | 游戏场景的数据处理方法、装置、设备及可读存储介质 | |
US20240208679A1 (en) | Optimized packing of polygons into a container | |
US10482629B2 (en) | System, method and computer program product for automatic optimization of 3D textured models for network transfer and real-time rendering | |
CN111985597B (zh) | 模型压缩方法及装置 | |
CN104751507A (zh) | 图形内容渲染方法和装置 | |
CN110378992A (zh) | 面向大场景模型web端动态渲染LOD处理方法 | |
US20240212236A1 (en) | Polygon Processing Methods and Systems | |
CN113426130B (zh) | 一种模型的合批处理方法和装置 | |
US20240177396A1 (en) | Object processing method and apparatus, device, computer-readable storage medium, and computer program product | |
US20130176304A1 (en) | Method and apparatus for processing three-dimensional model data | |
CN117237502A (zh) | 一种三维渲染方法、装置、设备及介质 | |
CN110264546A (zh) | 图像合成的方法、装置、计算机可读存储介质及终端 | |
CN107784674B (zh) | 一种三维模型简化的方法及系统 | |
Tian et al. | An approach to generate spatial Voronoi Treemaps for points, lines, and polygons | |
CN109949420A (zh) | 适用于GPU的Delaunay三角剖分网格细化方法、GPU及系统 | |
CN117953181B (zh) | 一种面向web3d的顶点分层与增量式lod方法及系统 | |
US11861785B2 (en) | Generation of tight world space bounding regions |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22928310 Country of ref document: EP Kind code of ref document: A1 |