Image processing method and device, storage medium and electronic device

By dividing the game scene into regions and determining the number of target resources, the problem of low efficiency in deleting decorative assets in online games is solved, thereby improving resource management efficiency and game performance.

CN115779415BActive Publication Date: 2025-11-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211385149.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-07
Publication Date
2025-11-25
Estimated Expiration
2042-11-07

AI Technical Summary

Technical Problem

In the wilderness forest scenes of online games, the efficiency of deleting decorative assets is low, which leads to difficulties in game resource management and affects game performance and player experience.

Method used

By dividing the game scene image into regions, determining the target resource quantity for each region, and precisely reducing the quantity, the target scene image is generated by combining the preset scaling ratio.

Benefits of technology

It improves the efficiency and balance of resource deletion in game scenes, reduces game lag, and enhances the player experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115779415B_ABST
    Figure CN115779415B_ABST
Patent Text Reader

Abstract

The application discloses an image processing method and device, a storage medium and an electronic device. The method comprises the following steps: acquiring a first scene image and a target resource, wherein the target resource is a resource to be deleted in the first scene image; performing regional division on the first scene image to obtain a plurality of scene regions; determining the number of target resources corresponding to each scene region in the plurality of scene regions, wherein the number of target resources is the number of target resources corresponding to each scene region; and deleting the target resources in the plurality of scene regions according to the number of target resources to obtain a target scene image. The application solves the technical problem of low efficiency in deleting resources in a game scene in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer, in particular to an image processing method and device, a storage medium and an electronic device. BACKGROUND

[0002] At present, in the wild forest scene of the network game, in order to make the terrain ground have better artistic effect, a large number of shrubs, trees, grasses and other decoration assets are often planted on the ground during production. However, the emergence of a large number of decoration assets in the game will cause the computer or mobile phone to lag, so it is necessary to delete a certain number of decoration assets, and at the same time of deleting game resources, the number and type of game resources also need to be controlled to achieve the same screen number meeting the requirements. As for deleting decoration assets, the method adopted in the related art is manual deletion, which requires a long time.

[0003] At present, no effective solution has been proposed for the above problems. SUMMARY

[0004] The embodiments of the present application at least provide an image processing method and device, a storage medium and an electronic device, to at least solve the technical problem of low efficiency in deleting resources in a game scene in the related art.

[0005] According to an embodiment of the present application, an image processing method is provided, comprising: obtaining a first scene image and a target resource, wherein the target resource is a resource to be deleted in the first scene image; performing region division on the first scene image to obtain a plurality of scene regions; determining a target resource quantity corresponding to each scene region in the plurality of scene regions, wherein the target resource quantity is the quantity of the target resource corresponding to each scene region; and deleting the target resource in the plurality of scene regions according to the target resource quantity to obtain a target scene image.

[0006] Optionally, the deleting the target resource in the plurality of scene regions according to the target resource quantity to obtain a target scene image comprises: deleting the target resource in the plurality of scene regions according to the target resource quantity to obtain a deleted scene image, wherein the display content of the deleted scene image comprises: the remaining resources obtained after deleting the target resource; and performing scaling processing on the remaining resources based on a preset scaling ratio to obtain the target scene image.

[0007] Optionally, target resources in multiple scene regions are reduced according to the number of target resources to obtain a reduced scene image, including: acquiring a first scene region and a second scene region in multiple scene regions, wherein the first scene region is a scene region in multiple scene regions where the number of target resources is greater than a preset number, and the second scene region is a scene region in multiple scene regions where the number of target resources is less than or equal to the preset number; reducing target resources in the first scene region according to a first reduction ratio to obtain a first reduced region; reducing target resources in the second scene region according to a second reduction ratio to obtain a second reduced region, wherein the first reduction ratio is greater than the second reduction ratio; and generating a reduced scene image based on the first and second reduced regions.

[0008] Optionally, obtaining the first scene image and target resources includes: obtaining a target list, wherein the target list is used to record at least one type of resource to be deleted; and traversing all resources in the first scene image based on the target list to obtain the target resources.

[0009] Optionally, the first scene image is divided into regions to obtain multiple scene regions, including: when the target resource contains multiple first resources, determining whether the first distance between the multiple first resources is less than or equal to a first preset value; in response to the first distance being less than or equal to the first preset value, deleting the multiple first resources in the first scene image to obtain a second scene image; and dividing the second scene image into regions to obtain multiple scene regions.

[0010] Optionally, the second scene image is divided into regions to obtain multiple scene regions, including: generating a target shape based on a preset size; dividing the second scene image into regions according to the target shape to obtain multiple scene regions, wherein each scene region has the same area.

[0011] Optionally, the target list is also used to record the reduction ratio corresponding to each type of resource to be reduced. The method further includes: obtaining the initial reduction ratio corresponding to the target resource according to the target list; determining the increased reduction ratio based on the product of the first preset ratio and the initial reduction ratio; and determining the first reduction ratio based on the sum of the initial reduction ratio and the increased reduction ratio.

[0012] Optionally, the method further includes: determining a reduction ratio based on the product of a second preset ratio and an initial reduction ratio; and determining a second reduction ratio based on the difference between the initial reduction ratio and the reduced reduction ratio.

[0013] Optionally, determining the number of target resources corresponding to each scene region in the multiple scene regions includes: obtaining multiple scene files corresponding to the multiple scene regions; and performing synchronous processing on the multiple scene files based on multiple processor cores to obtain the number of target resources corresponding to each scene region in the multiple scene regions.

[0014] According to one embodiment of the present invention, an image processing apparatus is also provided, the apparatus comprising: an acquisition module for acquiring a first scene image and target resources, wherein the target resources are resources to be deleted in the first scene image; a division module for dividing the first scene image into regions to obtain multiple scene regions; a determination module for determining the number of target resources corresponding to each scene region in the multiple scene regions, wherein the number of target resources is the number of target resources corresponding to each scene region; and a deletion module for deleting target resources in the multiple scene regions according to the number of target resources to obtain a target scene image.

[0015] According to one embodiment of the present invention, a non-volatile storage medium is also provided, wherein a computer program is stored in the non-volatile storage medium, and the computer program is configured to execute the image processing method described in any of the above claims when running.

[0016] According to one embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the image processing method described in any of the preceding claims.

[0017] In at least some embodiments of the present invention, a first scene image and target resources are acquired, wherein the target resources are resources to be deleted in the first scene image; the first scene image is divided into regions to obtain multiple scene regions; the number of target resources corresponding to each scene region is determined, wherein the number of target resources is the quantity of target resources corresponding to each scene region; and the target resources in the multiple scene regions are deleted according to the number of target resources to obtain a target scene image. It is readily apparent that by first dividing the first scene image into regions to obtain multiple scene regions, and then deleting the target resources in the multiple scene regions according to the number of target resources corresponding to each scene region, the deletion efficiency can be improved while maintaining a balance in deletion, thereby solving the technical problem of low efficiency in deleting resources in game scenes in related technologies. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0019] Figure 1 This is a hardware structure block diagram of a mobile terminal for an image processing method according to an embodiment of the present invention.

[0020] Figure 2 This is a flowchart of vegetation deletion based on relevant technologies;

[0021] Figure 3 This is a flowchart of an image processing method according to an embodiment of the present invention;

[0022] Figure 4 This is a flowchart of a target resource reduction process according to an embodiment of the present invention;

[0023] Figure 5 This is a structural block diagram of an image processing apparatus according to an embodiment of the present invention;

[0024] Figure 6 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

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

[0028] This method embodiment can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smartphone (such as an Android phone, iOS phone, etc.), tablet computer, PDA, mobile Internet Device (MID), PAD, game console, and other terminal devices. Figure 1 This is a hardware structure block diagram of a mobile terminal for an image processing method according to an embodiment of the present invention. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data are also shown. Optionally, the mobile terminal may further include a transmission device 106 for communication functions, an input / output device 108, and a display device 110. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0029] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the image processing method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the aforementioned image processing method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0031] The inputs in input / output device 108 can come from multiple human interface devices (HIDs). Examples include keyboards and mice, gamepads, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, and remote controls). Some HIDs, in addition to providing input functions, can also provide output functions, such as force feedback and vibration from gamepads, and audio output from controllers.

[0032] Display device 110 may be, for example, a head-up display (HUD), a touchscreen liquid crystal display (LCD), and a touch display (also referred to as a "touchscreen" or "touch display"). The LCD allows a user to interact with the user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), which allows the user to interact with the GUI by touching and / or gesturing on a touch-sensitive surface. Optional human-computer interaction functions include: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, a call interface, playing digital video, playing digital music, and / or web browsing, etc. Executable instructions for performing the above human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.

[0033] In related technologies, the main method involves manually removing a large number of decorative plants. Manually removing a large number of decorative plants to control the density is equivalent to recreating the game scene, which requires a lot of time. Figure 2 It is a plant deletion flowchart based on existing technology, such as Figure 2 As shown, the method includes the following steps:

[0034] Step S202: Open the scene where the vegetation to be deleted is located.

[0035] Step S204: Select the vegetation to be removed.

[0036] Step S206: Manually delete.

[0037] The process involves opening the vegetation scene to be removed using the editor. After opening the scene, the player can select the terrain and manually remove vegetation by using a brush to place objects on the ground. This allows for the manual addition or removal of objects as needed. However, manual removal can be challenging due to the difficulty in controlling vegetation density, potentially resulting in a less aesthetically pleasing game scene and a reduced player experience. Furthermore, it's difficult to quickly determine if the removed scene meets the required polygon count per screen, potentially leading to repetitive work. The polygon count per screen refers to the number of triangles of all models displayed within one screen of the player's computer view.

[0038] Figure 3 This is a flowchart of an image processing method according to an embodiment of the present invention, such as... Figure 3 As shown, the method includes the following steps:

[0039] Step S302: Obtain the first scene image and the target resource, wherein the target resource is the resource to be deleted in the first scene image.

[0040] The first scene image mentioned above can be a game scene image that requires resource deletion. The first scene image can include at least one of the following decorations: trees, rocks, grass, shrubs, etc. Optionally, the game scene can be a three-dimensional game scene.

[0041] The target resources mentioned above can be game decorations, including but not limited to trees, rocks, grass, shrubs, etc. Optionally, target resources can be represented using Extensible Markup Language (XML) format. XML format can be used for data transmission and storage, and custom tags can be used to record attribute information. Attribute information can include the model resources referenced by the target resource, the target resource's position, and rotation direction. For example, for target resources in the first scene image, the tag "resource name" can represent the model resources referenced by different target resources, and the tag "orientation" can represent the target resource's position and rotation direction in the first scene image. The tag "resource list" represents a list that can list all target resources and their corresponding resource attributes.

[0042] The resources to be deleted mentioned above can be resources that need to be removed. These resources can be target resources whose distance to each other is less than a given value, or target resources that appear repeatedly in the same location. The given value can be set by the user, optionally by someone skilled in the art. Optionally, the resources to be deleted can include, but are not limited to, decorations such as trees, stones, grass, and shrubs.

[0043] Using trees as an example, we can determine if multiple trees appear at the same location. If more than one tree is detected at the same location, only one tree can be retained, and the others designated as resources to be deleted. Furthermore, if identical trees are found within a distance of less than a threshold, those trees within the threshold range can be designated as resources to be deleted. The threshold can be set by the user.

[0044] In one optional embodiment, a first scene image can be obtained through a cloud server. Optionally, upon obtaining the first scene image, duplicate resources in the first scene image can be identified as target resources, or resources with higher density in the first scene image can be identified as target resources. Furthermore, after identifying the target resources, they can be placed into a set. During subsequent deletion steps, only the target resources in the set need to be deleted, thereby improving the efficiency of target resource deletion.

[0045] Step S304: Divide the first scene image into regions to obtain multiple scene regions.

[0046] The aforementioned scene region can be obtained from the first scene image. Optionally, the range of the scene region can be smaller than the first scene image. Optionally, the first scene image can be divided into multiple regions, and each region can be defined as a scene region.

[0047] In one optional embodiment, since the first scene image may include a large 3D game scene with uneven resource distribution, if a deletion operation is performed based on the entire first scene image, the deletion efficiency will be low, and the resulting aesthetic effect will be difficult to achieve, thus reducing the player's experience. Here, the player refers to the player controlling the game containing the first scene image. Therefore, the first scene image can be divided into multiple scene regions on a horizontal plane. These multiple scene regions can be of equal or unequal size.

[0048] Using the assumption that the scene area is equal in size, in one optional embodiment, assuming the scene area is circular, the first scene image will be divided into multiple circles of equal area. In this case, a portion of the adjacent scene areas will lie outside the scene area; therefore, target resources in that area will not be deleted. In another optional embodiment, assuming the scene area is square, the first scene image will be divided into multiple squares of equal area. In this case, the entire area contained in the first scene image will be included within the scene area; therefore, all types of target resources within the range of the first scene image will be deleted.

[0049] In this system, multiple scene regions exist independently and do not affect each other. This allows the deletion tasks of different scene regions to be performed simultaneously. By performing deletion operations on multiple scene regions, the first scene image can be deleted. This further reduces the technical problem of low deletion efficiency caused by the large range of the first scene region and the uneven distribution of target resources, which makes the deletion operation difficult.

[0050] Step S306: Determine the number of target resources corresponding to each scene area in the multiple scene areas, wherein the number of target resources is the number of target resources corresponding to each scene area.

[0051] The aforementioned target resource quantity can be the number of resources to be deleted in each scene area. Taking trees as an example, the target resource quantity in a scene area can be 10 trees to be deleted.

[0052] In one alternative embodiment, the number of target resources corresponding to each scene area can be obtained by traversing the set of target resources in each scene area and determining the type of target resources in each scene area.

[0053] In another alternative embodiment, the tag "Resource List" can be selected from the target resources represented in XML format, and the information of all target resources can be traversed in the tag "Resource List" to obtain the number of target resources, wherein the information of the target resources may include the number of target resources.

[0054] Furthermore, after determining the target resources and their quantities for each scene area, since the types and quantities of resources differ in different scene areas, different target resource quantities can be determined for different scene areas. For example, scene area 1 has more trees and fewer stones, while scene area 2 has fewer trees and more stones. Therefore, when determining the target resource quantities, the number of target resources representing trees in scene area 1 can be greater than the number of target resources representing stones, and the number of target resources representing stones in scene area 2 can be greater than the number of target resources representing trees.

[0055] Step S308: Based on the number of target resources, the target resources in multiple scene areas are reduced to obtain the target scene image.

[0056] The aforementioned target scene image can be the scene image obtained after removing the target resources. Optionally, the number of resources in the target scene image is less than the number of resources in the scene area. Game operation based on the target scene image can effectively reduce the problem of mobile phone or computer lag, thereby affecting the player's experience. The aforementioned game can be the game where the target resources are located, and the aforementioned computer and mobile phone can be the computer and mobile phone used by the player to perform game operation.

[0057] In one optional embodiment, the presence of numerous target resources in the game scene during gameplay can cause lag on computers or mobile phones, thus affecting the player's experience. Optionally, the number of target resources in each scene area can be determined. When the number of target resources in a scene area exceeds a certain threshold, the target resources in that scene area can be reduced to obtain a target scene image. The threshold can be set by the user. Optionally, target resources can also be reduced based on the distance between them in the scene area. Taking trees as an example, if another tree is detected within a preset distance of a certain tree in the scene area, the other tree can be reduced.

[0058] In another alternative embodiment, after determining the target resources and their quantity, multiple deletion tasks can be started simultaneously for multiple scene regions. These tasks perform target resource deletion on multiple different scene regions under each first scene image, thereby obtaining the target scene image. It is noteworthy that since each program is only responsible for deleting one scene region, it is equivalent to multiple pipelines operating simultaneously, thus improving the efficiency of target resource deletion.

[0059] In at least some embodiments of the present invention, a first scene image and target resources are acquired, wherein the target resources are resources to be deleted in the first scene image; the first scene image is divided into regions to obtain multiple scene regions; the number of target resources corresponding to each scene region is determined, wherein the number of target resources is the quantity of target resources corresponding to each scene region; and the target resources in the multiple scene regions are deleted according to the number of target resources to obtain a target scene image. It is readily apparent that by first dividing the first scene image into regions to obtain multiple scene regions, and then deleting the target resources in the multiple scene regions according to the number of target resources corresponding to each scene region, the deletion efficiency can be improved while maintaining a balance in deletion, thereby solving the technical problem of low efficiency in deleting resources in game scenes in related technologies.

[0060] Optionally, the target resources in multiple scene areas are reduced according to the number of target resources to obtain a target scene image, including: reducing the target resources in multiple scene areas according to the number of target resources to obtain a reduced scene image, wherein the display content of the reduced scene image includes: the remaining resources obtained after reducing the target resources; scaling the remaining resources according to a preset scaling ratio to obtain the target scene image.

[0061] The aforementioned deleted scene images can be the remaining scene images after removing target resources from multiple scene areas. Optionally, the deleted scene images can be represented in XML format.

[0062] The preset scaling ratio mentioned above can be a magnification ratio, which can be set by the user.

[0063] The target scene image mentioned above can be the image obtained after enlarging the deleted scene image.

[0064] In one optional embodiment, after deleting target resources in multiple scene areas, a deleted scene image can be obtained. Optionally, after obtaining the deleted scene image, the deleted scene image, originally represented in XML format, can be restored to text format, and this text format can be re-output as a scene file and saved. This allows the effect of the target resource deletion to be viewed simply by opening the game engine. Optionally, a preset scaling ratio can be pre-set by the user to appropriately enlarge the size of the remaining resources, making the visual effect of decorations in the deleted scene image more complete. For example, if multiple trees in the same location are deleted, resulting in fewer trees remaining in that location, the visual effect of decorations in that location may appear somewhat monotonous. Therefore, appropriately enlarging the remaining resources will increase the aesthetics of the target scene image.

[0065] Optionally, target resources in multiple scene regions are reduced according to the number of target resources to obtain a reduced scene image, including: acquiring a first scene region and a second scene region in multiple scene regions, wherein the first scene region is a scene region in multiple scene regions where the number of target resources is greater than a preset number, and the second scene region is a scene region in multiple scene regions where the number of target resources is less than or equal to the preset number; reducing target resources in the first scene region according to a first reduction ratio to obtain a first reduced region; reducing target resources in the second scene region according to a second reduction ratio to obtain a second reduced region, wherein the first reduction ratio is greater than the second reduction ratio; and generating a reduced scene image based on the first and second reduced regions.

[0066] The above preset quantity can be the number of target resources set in advance. Optionally, the preset quantity can be set by the user.

[0067] The first and second scene regions mentioned above can be obtained from multiple scene regions. Optionally, the target resource quantity of each scene region can be compared with a preset quantity, and the scene region with a target resource quantity greater than the preset quantity can be determined as the first scene region, and the scene region with a target resource quantity less than or equal to the preset quantity can be set as the second scene region.

[0068] The aforementioned first reduction ratio can be the reduction ratio when reducing target resources in the first scene area. Optionally, the first reduction ratio can be set by the user. Optionally, after reducing target resources in the first scene area based on the first reduction ratio, the first reduction area can be obtained.

[0069] The aforementioned second reduction ratio can be the reduction ratio when reducing target resources in the second scene area. Optionally, the second reduction ratio can be set by the user. Optionally, after reducing target resources in the second scene area based on the second reduction ratio, the second reduction area can be obtained.

[0070] In one alternative embodiment, since the number of target resources in the first scene area is greater than the number of target resources in the second scene area, the first reduction ratio is greater than the second reduction ratio.

[0071] In another optional embodiment, after reducing the target resources in the first scene region based on a first reduction ratio to obtain a first reduced region, and reducing the target resources in the second scene region based on a second reduction ratio to obtain a second reduced region, the first reduced region and the second reduced region can be determined as the reduced scene image.

[0072] Optionally, obtaining the first scene image and target resources includes: obtaining a target list, wherein the target list is used to record at least one type of resource to be deleted; and traversing all resources in the first scene image based on the target list to obtain the target resources.

[0073] The aforementioned target list may include resource types from the first scene image, where the type can be: target resource is a tree, target resource is a rock, etc. Optionally, this target list may be provided by relevant technical personnel, who may be artists.

[0074] In one optional embodiment, a target list is provided in advance by those skilled in the art. This target list may contain target resources that need to be removed. Optionally, the target list describes which types of resources in the first scene image need to be removed, and the percentage of resources to be removed. Optionally, after obtaining the target list, all resources in the first scene image can be traversed using a corresponding program or function to determine whether the type of the resource is in the target list. If the resource is in the target list, it is identified as a target resource, and all individuals of the target resource are stored in a set. If the resource is not in the target list, its information in the first scene image is retained unchanged.

[0075] Optionally, the first scene image is divided into regions to obtain multiple scene regions, including: when the target resource contains multiple first resources, determining whether the first distance between the multiple first resources is less than or equal to a first preset value; in response to the first distance being less than or equal to the first preset value, deleting the multiple first resources in the first scene image to obtain a second scene image; and dividing the second scene image into regions to obtain multiple scene regions.

[0076] The first resource mentioned above can be an overlapping resource in the first scene image. Optionally, the first resource may include, but is not limited to, decorations such as trees, stones, grass, and shrubs.

[0077] The aforementioned first distance can be the distance between the first resources.

[0078] The first preset value mentioned above can be set by the user.

[0079] The aforementioned second scene image can be obtained by deleting multiple first resources from the first scene image.

[0080] In one optional embodiment, a first distance between multiple target resources can be determined, and a first preset value can be set. The first distance between the multiple target resources is compared with the first preset value. Optionally, if the first distance is less than or equal to the first preset value, the resources in that area can be considered duplicated. Optionally, the overlapping target resources can be identified as first resources, and a deletion operation can be performed on the first resources to obtain a second scene image. Optionally, during the deletion process, one of the first resources that are duplicated at the same location can be retained. For example, if it is determined that there are three identical trees at a certain location, only one tree can be retained, and the other two can be deleted. After obtaining the second scene image, multiple scene regions can be obtained by dividing the second scene image into regions. Furthermore, this step can effectively solve the problems of poor game screen aesthetics and computer lag caused by overlapping target resources.

[0081] Optionally, the second scene image is divided into regions to obtain multiple scene regions, including: generating a target shape based on a preset size; dividing the second scene image into regions according to the target shape to obtain multiple scene regions, wherein each scene region has the same area.

[0082] The preset size and target shape mentioned above can be set by the user. Optionally, the target shape can be a circle or a square, but is not limited to these.

[0083] In one optional embodiment, after obtaining the second scene image, the user can set a preset size and target shape. Optionally, the second scene image can be divided into regions based on the preset size and target shape to obtain multiple scene regions with the same size, area, and shape.

[0084] Optionally, the target list is also used to record the reduction ratio corresponding to each type of resource to be reduced. The method further includes: obtaining the initial reduction ratio corresponding to the target resource according to the target list; determining the increased reduction ratio based on the product of the first preset ratio and the initial reduction ratio; and determining the first reduction ratio based on the sum of the initial reduction ratio and the increased reduction ratio.

[0085] The aforementioned reduction ratio may include the initial reduction ratio, the first preset ratio, the increased reduction ratio, and the first reduction ratio.

[0086] The initial reduction ratio mentioned above can be the ratio to be reduced from the target resource plan. Optionally, the initial reduction ratio can be set by the user.

[0087] The first preset ratio mentioned above can be the ratio to be increased based on the initial reduction ratio.

[0088] The aforementioned increase / decrease ratio can be the product of the first preset ratio and the initial deletion ratio.

[0089] The aforementioned first reduction ratio can be the ratio to be reduced when actually reducing the target resource.

[0090] In an optional embodiment, for a scene area with a large number of target resources, i.e., the first scene area, the system can automatically increase the initial reduction ratio. Taking vegetation as an example, if the target resource is vegetation, and the initial reduction ratio is 30% and the first preset ratio is 20%, then the increase reduction ratio can be determined to be 6% by calculating the product of the first preset ratio and the initial reduction ratio. Optionally, after determining the increase reduction ratio, the sum of the initial reduction ratio and the increase reduction ratio can be calculated to determine the first reduction ratio to be 36%.

[0091] Optionally, the method further includes: determining a reduction ratio based on the product of a second preset ratio and an initial reduction ratio; and determining a second reduction ratio based on the difference between the initial reduction ratio and the reduced reduction ratio.

[0092] The second preset ratio mentioned above can be the ratio to be reduced based on the initial reduction ratio.

[0093] The reduction / reduction ratio mentioned above can be the product of the second preset ratio and the initial reduction / reduction ratio.

[0094] The second reduction ratio mentioned above can be the ratio to be reduced when actually reducing the target resource.

[0095] In an optional embodiment, for a scene area with a small number of target resources, i.e., the second scene area, the system can automatically reduce the initial reduction ratio. Taking the target resource as a stone as an example, assuming the initial reduction ratio is 30% and the second preset ratio is 20%, the reduction ratio can be determined to be 6% by calculating the product of the second preset ratio and the initial reduction ratio. Optionally, after determining the reduction ratio, the difference between the initial reduction ratio and the reduction ratio can be calculated to determine the second reduction ratio to be 24%.

[0096] Optionally, determining the number of target resources corresponding to each scene region in the multiple scene regions includes: obtaining multiple scene files corresponding to the multiple scene regions; and performing synchronous processing on the multiple scene files based on multiple processor cores to obtain the number of target resources corresponding to each scene region in the multiple scene regions.

[0097] The aforementioned scene file can be used to store the target resources corresponding to the scene, and the scene file can be in XML format.

[0098] In one optional embodiment, since each scene region is independent of the others, the target resource reduction work in different scene regions can be carried out simultaneously. Therefore, multiple processor cores can be used to start multiple reduction task programs at the same time to perform target resource reduction on multiple scene regions under the same scene, thereby improving the reduction efficiency.

[0099] Figure 4 This is a flowchart of a target resource reduction process according to an embodiment of the present invention, such as... Figure 4 As shown, before starting the reduction process, an initial reduction ratio can be determined. Then, the first scene image is acquired, and it's determined whether a resource in the first scene image is in the target list. If the result is no, the resource is retained. If the result is yes, the resource is identified as a target resource and stored in a set. Next, it's determined whether the distance between target resources is less than a first preset value. If the result is no, the resource is retained. If the result is yes, the target resources need to be divided into two sets according to their density. Optionally, after reduction, the remaining resources can be scaled, and the modified text information can be saved. The game engine can then be opened to view the effect of the reduction.

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

[0101] This embodiment also provides an image processing apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "unit" and "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0102] Figure 5 This is a structural block diagram of an image processing apparatus according to an embodiment of the present invention. The content displayed by the graphical user interface includes a touch area, such as... Figure 4 As shown, the device includes:

[0103] The acquisition module 502 is used to acquire a first scene image and a target resource, wherein the target resource is the resource to be deleted in the first scene image.

[0104] The segmentation module 504 is used to segment the first scene image into multiple scene regions.

[0105] The determination module 506 is used to determine the number of target resources corresponding to each scene area in multiple scene areas, wherein the number of target resources is the number of target resources corresponding to each scene area.

[0106] The deletion module 508 is used to delete target resources in multiple scene areas according to the number of target resources to obtain the target scene image.

[0107] Optionally, the deletion module 508 includes: a deletion unit, used to delete target resources in multiple scene areas according to the number of target resources to obtain a deleted scene image, wherein the display content of the deleted scene image includes: the remaining resources obtained after deleting the target resources; and a scaling unit, used to scale the remaining resources according to a preset scaling ratio to obtain a target scene image.

[0108] Optionally, the deletion unit includes: an acquisition subunit, used to acquire a first scene region and a second scene region among multiple scene regions, wherein the first scene region is a scene region among multiple scene regions where the number of target resources is greater than a preset number, and the second scene region is a scene region among multiple scene regions where the number of target resources is less than or equal to the preset number; a first deletion subunit, used to delete target resources in the first scene region according to a first deletion ratio to obtain a first deletion region; a second deletion subunit, used to delete target resources in the second scene region according to a second deletion ratio to obtain a second deletion region, wherein the first deletion ratio is greater than the second deletion ratio; and a generation subunit, used to generate a deleted scene image based on the first deletion region and the second deletion region.

[0109] Optionally, the sub-unit acquisition is further configured to: acquire a target list, wherein the target list is used to record at least one type of resource to be deleted; and traverse all resources in the first scene image based on the target list to obtain the target resources.

[0110] Optionally, the sub-unit acquisition is further configured to: determine whether the first distance between the multiple first resources is less than or equal to a first preset value when the target resource contains multiple first resources; in response to the first distance being less than or equal to the first preset value, delete the multiple first resources in the first scene image to obtain a second scene image; and divide the second scene image into regions to obtain multiple scene regions.

[0111] Optionally, obtaining the sub-unit is also used to: generate a target shape based on a preset size; divide the second scene image into regions according to the target shape to obtain multiple scene regions, wherein each scene region has the same area.

[0112] Optionally, the sub-unit is further configured to: obtain the initial reduction ratio corresponding to the target resource according to the target list; determine the increase reduction ratio based on the product of the first preset ratio and the initial reduction ratio; and determine the first reduction ratio based on the sum of the initial reduction ratio and the increase reduction ratio.

[0113] Optionally, obtaining the sub-unit is further configured to: determine the reduction ratio based on the product of the second preset ratio and the initial reduction ratio; and determine the second reduction ratio based on the difference between the initial reduction ratio and the reduction ratio.

[0114] Optionally, the determining module 506 includes: an acquisition unit for acquiring multiple scene files corresponding to multiple scene regions; and a processing unit for synchronously processing the multiple scene files based on multiple processor cores to obtain the target resource quantity corresponding to each scene region in the multiple scene regions.

[0115] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but not limited to these: all the above-mentioned units and modules are located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.

[0116] Embodiments of the present invention also provide a non-volatile storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0117] Optionally, in this embodiment, the aforementioned non-volatile storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0118] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0119] Optionally, in this embodiment, the non-volatile storage medium described above can be configured to store a computer program for performing the following steps:

[0120] Acquire a first scene image and target resources, wherein the target resources are the resources to be deleted in the first scene image; divide the first scene image into regions to obtain multiple scene regions; determine the number of target resources corresponding to each scene region in the multiple scene regions, wherein the number of target resources is the number of target resources corresponding to each scene region; delete the target resources in the multiple scene regions according to the number of target resources to obtain the target scene image.

[0121] Optionally, the target resources in multiple scene areas are reduced according to the number of target resources to obtain a target scene image, including: reducing the target resources in multiple scene areas according to the number of target resources to obtain a reduced scene image, wherein the display content of the reduced scene image includes: the remaining resources obtained after reducing the target resources; scaling the remaining resources according to a preset scaling ratio to obtain the target scene image.

[0122] Optionally, target resources in multiple scene regions are reduced according to the number of target resources to obtain a reduced scene image, including: acquiring a first scene region and a second scene region in multiple scene regions, wherein the first scene region is a scene region in multiple scene regions where the number of target resources is greater than a preset number, and the second scene region is a scene region in multiple scene regions where the number of target resources is less than or equal to the preset number; reducing target resources in the first scene region according to a first reduction ratio to obtain a first reduced region; reducing target resources in the second scene region according to a second reduction ratio to obtain a second reduced region, wherein the first reduction ratio is greater than the second reduction ratio; and generating a reduced scene image based on the first and second reduced regions.

[0123] Optionally, obtaining the first scene image and target resources includes: obtaining a target list, wherein the target list is used to record at least one type of resource to be deleted; and traversing all resources in the first scene image based on the target list to obtain the target resources.

[0124] Optionally, the first scene image is divided into regions to obtain multiple scene regions, including: when the target resource contains multiple first resources, determining whether the first distance between the multiple first resources is less than or equal to a first preset value; in response to the first distance being less than or equal to the first preset value, deleting the multiple first resources in the first scene image to obtain a second scene image; and dividing the second scene image into regions to obtain multiple scene regions.

[0125] Optionally, the second scene image is divided into regions to obtain multiple scene regions, including: generating a target shape based on a preset size; dividing the second scene image into regions according to the target shape to obtain multiple scene regions, wherein each scene region has the same area.

[0126] Optionally, the target list is also used to record the reduction ratio corresponding to each type of resource to be reduced. The method further includes: obtaining the initial reduction ratio corresponding to the target resource according to the target list; determining the increased reduction ratio based on the product of the first preset ratio and the initial reduction ratio; and determining the first reduction ratio based on the sum of the initial reduction ratio and the increased reduction ratio.

[0127] Optionally, the method further includes: determining a reduction ratio based on the product of a second preset ratio and an initial reduction ratio; and determining a second reduction ratio based on the difference between the initial reduction ratio and the reduced reduction ratio.

[0128] Optionally, determining the number of target resources corresponding to each scene region in the multiple scene regions includes: obtaining multiple scene files corresponding to the multiple scene regions; and performing synchronous processing on the multiple scene files based on multiple processor cores to obtain the number of target resources corresponding to each scene region in the multiple scene regions.

[0129] In this embodiment, a technical solution for image processing is provided in the non-volatile storage medium. The process involves acquiring a first scene image and target resources, where the target resources are resources to be deleted from the first scene image; dividing the first scene image into multiple scene regions; determining the number of target resources corresponding to each scene region, where the number of target resources is the quantity of target resources corresponding to each scene region; and deleting target resources from the multiple scene regions according to the number of target resources to obtain the target scene image. It is noteworthy that by first dividing the first scene image into multiple scene regions, and then deleting target resources from the multiple scene regions according to the number of target resources corresponding to each scene region, the deletion efficiency can be improved while maintaining a balance in deletion, thereby solving the technical problem of low efficiency in deleting resources in game scenes in related technologies.

[0130] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of the present invention.

[0131] In exemplary embodiments of this application, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of the present invention can also be implemented as a program product comprising program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this embodiment according to various exemplary embodiments of the present invention.

[0132] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In the embodiments of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0133] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0134] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0135] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0136] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0137] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0138] Acquire a first scene image and target resources, wherein the target resources are the resources to be deleted in the first scene image; divide the first scene image into regions to obtain multiple scene regions; determine the number of target resources corresponding to each scene region in the multiple scene regions, wherein the number of target resources is the number of target resources corresponding to each scene region; delete the target resources in the multiple scene regions according to the number of target resources to obtain the target scene image.

[0139] Optionally, the target resources in multiple scene areas are reduced according to the number of target resources to obtain a target scene image, including: reducing the target resources in multiple scene areas according to the number of target resources to obtain a reduced scene image, wherein the display content of the reduced scene image includes: the remaining resources obtained after reducing the target resources; scaling the remaining resources according to a preset scaling ratio to obtain the target scene image.

[0140] Optionally, target resources in multiple scene regions are reduced according to the number of target resources to obtain a reduced scene image, including: acquiring a first scene region and a second scene region in multiple scene regions, wherein the first scene region is a scene region in multiple scene regions where the number of target resources is greater than a preset number, and the second scene region is a scene region in multiple scene regions where the number of target resources is less than or equal to the preset number; reducing target resources in the first scene region according to a first reduction ratio to obtain a first reduced region; reducing target resources in the second scene region according to a second reduction ratio to obtain a second reduced region, wherein the first reduction ratio is greater than the second reduction ratio; and generating a reduced scene image based on the first and second reduced regions.

[0141] Optionally, obtaining the first scene image and target resources includes: obtaining a target list, wherein the target list is used to record at least one type of resource to be deleted; and traversing all resources in the first scene image based on the target list to obtain the target resources.

[0142] Optionally, the first scene image is divided into regions to obtain multiple scene regions, including: when the target resource contains multiple first resources, determining whether the first distance between the multiple first resources is less than or equal to a first preset value; in response to the first distance being less than or equal to the first preset value, deleting the multiple first resources in the first scene image to obtain a second scene image; and dividing the second scene image into regions to obtain multiple scene regions.

[0143] Optionally, the second scene image is divided into regions to obtain multiple scene regions, including: generating a target shape based on a preset size; dividing the second scene image into regions according to the target shape to obtain multiple scene regions, wherein each scene region has the same area.

[0144] Optionally, the target list is also used to record the reduction ratio corresponding to each type of resource to be reduced. The method further includes: obtaining the initial reduction ratio corresponding to the target resource according to the target list; determining the increased reduction ratio based on the product of the first preset ratio and the initial reduction ratio; and determining the first reduction ratio based on the sum of the initial reduction ratio and the increased reduction ratio.

[0145] Optionally, the method further includes: determining a reduction ratio based on the product of a second preset ratio and an initial reduction ratio; and determining a second reduction ratio based on the difference between the initial reduction ratio and the reduced reduction ratio.

[0146] Optionally, determining the number of target resources corresponding to each scene region in the multiple scene regions includes: obtaining multiple scene files corresponding to the multiple scene regions; and performing synchronous processing on the multiple scene files based on multiple processor cores to obtain the number of target resources corresponding to each scene region in the multiple scene regions.

[0147] In the electronic device of this embodiment, an image processing technical solution is provided. This involves acquiring a first scene image and target resources, where the target resources are resources to be deleted from the first scene image; dividing the first scene image into multiple scene regions; determining the number of target resources corresponding to each scene region, where the number of target resources is the quantity of target resources corresponding to each scene region; and deleting target resources from the multiple scene regions according to the number of target resources to obtain a target scene image. It is noteworthy that by first dividing the first scene image into multiple scene regions, and then deleting target resources from the multiple scene regions according to the number of target resources corresponding to each scene region, the deletion efficiency can be improved while maintaining a balance in deletion, thereby solving the technical problem of low efficiency in deleting resources in game scenes in related technologies.

[0148] Figure 6 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Figure 6 As shown, the electronic device 600 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0149] like Figure 6 As shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processor 610, at least one memory 620, a bus 630 connecting different system components (including memory 620 and processor 610), and a display 640.

[0150] The memory 620 stores program code that can be executed by the processor 610, causing the processor 610 to perform the steps described in the method section of the embodiments of this application according to various exemplary implementations of the present invention.

[0151] The memory 620 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include a read-only memory (ROM) 6203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0152] In some instances, memory 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 620 may further include memory remotely located relative to processor 610, which can be connected to electronic device 600 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0153] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 610, or a local bus using any of the various bus structures.

[0154] The display 640 may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 600.

[0155] Optionally, the electronic device 600 can also communicate with one or more external devices 1400 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 650. Furthermore, the electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 660. Figure 6 As shown, network adapter 660 communicates with other modules of electronic device 600 via bus 630. It should be understood that, although... Figure 6As not shown in the diagram, other hardware and / or software modules may be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0156] The aforementioned electronic device 600 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.

[0157] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 600 may also include components that are more... Figure 6 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 620 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the image processing method in this embodiment of the invention. The processor 610 executes various functional applications and data processing by running the computer program stored in the memory 620, thereby implementing the aforementioned image processing method.

[0158] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0159] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0160] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

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

[0162] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0163] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0164] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An image processing method, characterized in that, include: Acquire a first scene image and a target resource, wherein the target resource is the resource to be deleted in the first scene image; The first scene image is divided into regions to obtain multiple scene regions; Determine the number of target resources corresponding to each of the plurality of scene regions, wherein the number of target resources is the number of target resources corresponding to each scene region; Based on the number of target resources, the target resources in the multiple scene regions are reduced to obtain the target scene image; The first scene image is divided into multiple scene regions, including: When the target resource includes multiple first resources, it is determined whether the first distance between the multiple first resources is less than or equal to a first preset value; In response to the first distance being less than or equal to the first preset value, multiple first resources in the first scene image are deleted to obtain a second scene image; The second scene image is divided into regions to obtain the multiple scene regions.

2. The method according to claim 1, characterized in that, Based on the number of target resources, the target resources in the multiple scene regions are reduced to obtain a target scene image, including: Based on the target resource quantity, the target resources in the multiple scene regions are reduced to obtain a reduced scene image, wherein the display content of the reduced scene image includes: the remaining resources obtained after reducing the target resources; The remaining resources are scaled based on a preset scaling ratio to obtain the target scene image.

3. The method according to claim 2, characterized in that, Based on the number of target resources, the target resources in the multiple scene regions are reduced to obtain a reduced scene image, including: Obtain a first scene region and a second scene region from the plurality of scene regions, wherein the first scene region is a scene region in the plurality of scene regions where the number of target resources is greater than a preset number, and the second scene region is a scene region in the plurality of scene regions where the number of target resources is less than or equal to the preset number; The target resources in the first scene area are reduced according to the first reduction ratio to obtain the first reduction area; The target resources in the second scene area are reduced according to the second reduction ratio to obtain the second reduction area, wherein the first reduction ratio is greater than the second reduction ratio; The deleted scene image is generated based on the first deleted region and the second deleted region.

4. The method according to claim 3, characterized in that, Acquire the first scene image and target resources, including: Obtain a target list, wherein the target list is used to record at least one type of resource to be removed; Based on the target list, all resources in the first scene image are traversed to obtain the target resources.

5. The method according to claim 1, characterized in that, The second scene image is divided into regions to obtain the plurality of scene regions, including: Generate the target shape based on the preset dimensions; The second scene image is divided into regions based on the target shape to obtain multiple scene regions, wherein each scene region has the same area.

6. The method according to claim 4, characterized in that, The target list is also used to record the reduction ratio corresponding to each type of resource to be reduced, and the method further includes: Obtain the initial reduction ratio corresponding to the target resource based on the target list; The increase / decrease ratio is determined based on the product of the first preset ratio and the initial reduction ratio; The first reduction ratio is determined based on the sum of the initial reduction ratio and the increased reduction ratio.

7. The method according to claim 6, characterized in that, The method further includes: The reduction ratio is determined based on the product of the second preset ratio and the initial reduction ratio; The second reduction ratio is determined based on the difference between the initial reduction ratio and the reduced reduction ratio.

8. The method according to claim 1, characterized in that, Determining the number of target resources corresponding to each of the multiple scene regions includes: Obtain multiple scene files corresponding to the multiple scene regions; The multiple scene files are processed synchronously using multiple processor cores to obtain the number of target resources corresponding to each scene region in the multiple scene regions.

9. An image processing apparatus, characterized in that, include: An acquisition module is used to acquire a first scene image and a target resource, wherein the target resource is the resource to be deleted in the first scene image; The segmentation module is used to segment the first scene image into multiple scene regions. The determining module is used to determine the number of target resources corresponding to each of the plurality of scene regions, wherein the number of target resources is the number of target resources corresponding to each scene region; The deletion module is used to delete the target resources in the multiple scene regions according to the number of target resources to obtain a target scene image; The segmentation module is used to determine whether the first distance between the multiple first resources is less than or equal to a first preset value when the target resource contains multiple first resources; in response to the first distance being less than or equal to the first preset value, the module deletes multiple first resources in the first scene image to obtain a second scene image; and the module performs region segmentation on the second scene image to obtain the multiple scene regions.

10. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a computer program, wherein the computer program is configured to execute the image processing method according to any one of claims 1 to 8 when run by a processor.

11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the image processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Virtual reality scene loading method and device

    CN106502654A

  • Object detection in an image

    US20210303862A1