Image processing method, device, electronic device, storage medium and program product

By obtaining and combining the original objects and their simulated objects in the image, and determining the difference information to generate the target simulated object, the problem that the stylized image design in the existing technology is difficult to accurately reflect the original image content is solved, and the quality of the stylized transfer is improved.

CN118485565BActive Publication Date: 2024-09-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410950917.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-09-24
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

Existing stylized image design relies on manual combination, which makes it difficult to ensure that the stylized image accurately reflects the original image content, affecting quality controllability.

Method used

By obtaining the original object and its multiple simulated objects in the image, the difference information between the objects is determined, the target part is determined from the simulated object for each part, and the combination process is performed to generate the target simulated object to ensure the quality of stylized transfer.

Benefits of technology

Improved the quality of content stylization transfer, ensuring that the generated target simulation object is closer to the original object, retaining its core characteristics and style.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118485565B
    Figure CN118485565B
Patent Text Reader

Abstract

The present application discloses an image processing method, device, electronic device, storage medium and program product; the embodiment of the present application is applied to artificial intelligence, and can obtain an original object, and multiple simulated objects corresponding to the original object, wherein the simulated object is an object obtained by reproducing the original object using reference elements; determine the difference information between the simulated object and the original object in the same part; for each corresponding part between the original object and the simulated object, determine the target part corresponding to each part from the multiple simulated objects according to the difference information; combine and process the target parts corresponding to each part to obtain a target simulated object. In the embodiment of the present application, it can be ensured that the generated target simulated object can accurately retain the core features and style of the original object. Therefore, this solution can improve the quality of content stylization migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Stylized images are created by selecting, adding, and transforming basic shape elements, such as circles, rectangles, or triangles, to reinterpret the structure and texture of the original image. This technique involves translating, rotating, and scaling these shape elements to reimagine and simplify the visual content of the original image. Through these transformations and combinations, a new visual style can be created, giving the image a completely different artistic feel and visual effect from the original image.

[0003] At present, stylized images are created by designers manually combining specific elements by referring to the original image. However, due to the differences in the technical level and aesthetic orientation of designers, it is difficult to ensure that the stylized images can accurately reflect the content of the original image, thus affecting the controllability of their quality. Summary of the invention

[0004] The embodiments of the present application provide an image processing method, device, electronic device, storage medium and program product, which can improve the quality of content stylization migration.

[0005] The present application provides an image processing method, including:

[0006] Acquire an original object in the image and multiple simulated objects corresponding to the original object, where the simulated object is an object obtained by reproducing the original object using reference elements, and the reference elements in different simulated objects are arranged in different ways;

[0007] Determine the difference information between the simulated object and the original object at the same part;

[0008] For each corresponding part between the original object and the simulated object, according to the difference information, a target part corresponding to each part is determined from a plurality of simulated objects;

[0009] The target parts corresponding to each part are combined and processed to obtain the target simulation object.

[0010] The present application also provides an image processing device, including:

[0011] An acquisition unit is used to acquire an original object in the image and a plurality of simulated objects corresponding to the original object, wherein the simulated object is an object obtained by reproducing the original object using reference elements, and the arrangement of the reference elements in different simulated objects is different;

[0012] A difference determination unit, used to determine difference information between the simulated object and the original object at the same part;

[0013] A part determination unit, for determining, for each corresponding part between the original object and the simulated object, a target part corresponding to each part from a plurality of simulated objects according to difference information;

[0014] The part combination unit is used to combine the target parts corresponding to the various parts to obtain a target simulation object.

[0015] In some embodiments, the apparatus further comprises an object generation unit, configured to:

[0016] Based on the original object in the image, a primary simulated object is generated using reference elements;

[0017] Based on the original object in the image, the reference elements constituting the primary simulated object are adjusted to obtain the secondary simulated object.

[0018] In some embodiments, the object generation unit is configured to:

[0019] Generate a new arrangement based on the original object in the image and the arrangement of reference elements in the primary simulated object;

[0020] According to the new arrangement, the reference elements constituting the primary simulation object are adjusted to obtain the secondary simulation object.

[0021] In some embodiments, the object generation unit is configured to:

[0022] Determine the layout position of the elements on the original object in the image;

[0023] Generates primary simulation objects based on element layout positions and reference elements.

[0024] In some embodiments, the object generation unit is configured to:

[0025] Get the target color information of the original object at the element layout position;

[0026] According to the target color information, the reference element at the element layout position is color filled to obtain a primary simulation object.

[0027] In some embodiments, the object generation unit is configured to:

[0028] Determine the part of the primary simulation object to be adjusted;

[0029] Based on the original object in the image, the arrangement of the reference elements of the to-be-adjusted part in the primary simulation object is adjusted to obtain a new arrangement.

[0030] In some embodiments, the difference determination unit is configured to:

[0031] Determine target difference information between the primary simulated object and the original object at the same location;

[0032] Object generation unit, used to:

[0033] According to the target difference information, the part to be adjusted is determined from the primary simulation object.

[0034] In some embodiments, the apparatus further comprises an element determination unit and an object conversion unit:

[0035] An element determination unit, used to obtain a specified element; determine a reference element according to a type corresponding to the specified element, wherein a subclass of the reference element includes the specified element;

[0036] The object conversion unit is used to perform element conversion processing on the reference elements constituting the target simulation object based on the specified elements to obtain a new target simulation object. The new target simulation object is an object obtained by reproducing the original object using the specified elements.

[0037] In some embodiments, the apparatus further comprises an object updating unit, configured to:

[0038] Perform element overlap detection on designated elements constituting the new target simulation object to obtain elements to be expanded and elements to be deleted, and the elements to be expanded and the elements to be deleted overlap;

[0039] According to the elements to be deleted, the elements to be expanded in the new target simulation object are expanded to obtain expanded elements, which include the elements to be deleted;

[0040] According to the external expansion elements, the elements to be deleted in the new target simulation object are deleted to obtain an updated new target simulation object.

[0041] In some embodiments, the object updating unit is configured to:

[0042] Determine the color information of the expanded element based on the color information of the element to be expanded and the color information of the element to be deleted;

[0043] Determine the reference position corresponding to the expanded element from the original object;

[0044] Determine the element retention information of the expanded element according to the color information of the reference part and the color information of the expanded element;

[0045] According to the element retention information of the externally expanded element, the elements to be deleted in the new target simulation object are deleted to obtain an updated new target simulation object.

[0046] In some embodiments, the apparatus further comprises an object introduction unit, configured to:

[0047] Obtaining an element list of elements constituting a target simulation object and a data format to be transferred into a scene, wherein the element list includes element parameters of each element constituting the target simulation object;

[0048] According to the data format, the element parameters of each element in the element list are format converted to obtain an updated element list;

[0049] The updated element list is sent to the scene to be transferred into, so as to present a virtual object composed of the elements in the updated element list in the scene to be transferred into.

[0050] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores multiple instructions; the processor loads instructions from the memory to execute the steps in any image processing method provided in the embodiment of the present application.

[0051] An embodiment of the present application also provides a computer-readable storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps in any one of the image processing methods provided in the embodiment of the present application.

[0052] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which implements the steps of any image processing method provided in the embodiment of the present application when the computer program / instruction is executed by a processor.

[0053] The embodiments of the present application can obtain an original object and multiple simulation objects corresponding to the original object, where the simulation object is an object obtained by reproducing the original object using reference elements; determine the difference information between the simulation object and the original object in the same part; for each part corresponding to the original object and the simulation object, determine the target part corresponding to each part from the multiple simulation objects according to the difference information; combine the target parts corresponding to each part to obtain the target simulation object.

[0054] In this application, for the multiple simulated objects corresponding to the original object, for each corresponding part between the original object and the simulated object, according to the difference information between the simulated object and the original object in the same part, the target part corresponding to each part can be determined from the multiple simulated objects, so as to achieve targeted retention of the parts similar to the original object in each simulated object, and combine the target parts corresponding to each part, so that the final target simulated object is closer to the original object as a whole compared with the multiple simulated objects, ensuring that the generated target simulated object can accurately retain the core features and style of the original object. In this way, the quality of content stylization migration is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0056] Figure 1a is a scene schematic diagram of the image processing method provided in an embodiment of the present application;

[0057] Figure 1b is a flowchart of an image processing method provided in an embodiment of the present application;

[0058] Figure 2a It is a flowchart of the image processing method provided in the embodiment of the present application applied in a scene where the filling elements are geometric elements;

[0059] Figure 2b is a schematic diagram of a simplified scene provided by an embodiment of the present application;

[0060] Figure 2c is a schematic diagram of image style transfer provided by an embodiment of the present application;

[0061] Figure 2d is a schematic diagram of a scenario for generating a target simulation object provided by an embodiment of the present application;

[0062] Figure 2e is a schematic diagram of a scenario of filling position update provided in an embodiment of the present application;

[0063] Figure 2f is a schematic diagram of a scene for generating a reconstructed simulation object provided in an embodiment of the present application;

[0064] Figure 2g It is a schematic diagram of converting a triangle provided in an embodiment of the present application into a right triangle;

[0065] Figure 2h is a schematic diagram of triangle approximation optimization provided by an embodiment of the present application;

[0066] Figure 2i It is a schematic diagram of the effect of updating and reconstructing a simulation object provided in an embodiment of the present application;

[0067] Figure 3 is a structural schematic diagram of an image processing device provided in an embodiment of the present application;

[0068] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0070] Embodiments of the present application provide an image processing method, apparatus, electronic device, storage medium, and program product.

[0071] The image processing device can be integrated into an electronic device, which can be a terminal, a server, or other devices. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, or a personal computer (PC), etc. The server can be a single server or a server cluster composed of multiple servers.

[0072] In some embodiments, the image processing device may also be integrated into multiple electronic devices. For example, the image processing device may be integrated into multiple servers, and the image processing method of the present application may be implemented by multiple servers.

[0073] In some embodiments, the server may also be implemented in the form of a terminal.

[0074] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0075] For example, refer to Figure 1a The electronic device can obtain an original object in an image and multiple simulated objects corresponding to the original object, where the simulated object is an object obtained by reproducing the original object using reference elements, and the reference elements in different simulated objects are arranged in different ways; determine difference information between the simulated object and the original object at the same part; for each corresponding part between the original object and the simulated object, determine the target part corresponding to each part from the multiple simulated objects according to the difference information; combine the target parts corresponding to each part to obtain a target simulated object.

[0076] Among them, for the multiple simulated objects corresponding to the original object, for each corresponding part between the original object and the simulated object, according to the difference information between the simulated object and the original object in the same part, the target part corresponding to each part can be determined from the multiple simulated objects, so as to achieve targeted retention of the parts similar to the original object in each simulated object, and combine the target parts corresponding to each part, so that the final target simulated object is closer to the original object as a whole compared with the multiple simulated objects, ensuring that the generated target simulated object can accurately retain the core features and style of the original object. In this way, the quality of content stylization migration is improved.

[0077] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0078] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0079] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, pre-trained models are also called large models and basic models. After fine-tuning, they can be widely used in downstream tasks in various major directions of artificial intelligence. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0080] Among them, computer vision technology (Computer Vision, CV) is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify, detect and measure targets, and further perform image processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Large model technology has brought important changes to the development of computer vision technology. Pre-trained models in the visual field such as swin-transformer, ViT, V-MOE, MAE, etc. can be quickly and widely applied to downstream specific tasks after fine tuning. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0081] Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning by induction. The pre-trained model is the latest development of deep learning, which integrates the above technologies.

[0082] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless cars, autonomous driving, drones, digital twins, virtual humans, robots, artificial intelligence generated content (AIGC), conversational interaction, smart medical care, smart customer service, game AI, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0083] In this embodiment, a computer vision-based image processing method involving artificial intelligence is provided. Figure 1b As shown, the specific process of the image processing method can be as follows:

[0084] 101. Acquire an original object in an image and a plurality of simulated objects corresponding to the original object. The simulated object is an object obtained by reproducing the original object using reference elements. The reference elements in different simulated objects are arranged in different ways.

[0085] The image is an image to be style transferred. For example, the image can be an original unprocessed image, including background and noise, etc., or an image after background segmentation, where only the main object in the image is retained. The main object refers to a specific entity that occupies a dominant position in the image, including people, objects, etc.

[0086] The original object refers to the object in the image content that needs style transfer. For example, the original object can be a person, object, anime character, etc. in the image content.

[0087] The reference elements are elements used to transfer the image style. For example, the reference elements can be geometric elements, such as polygons, circles, ellipses, etc., or elements with complex structures, such as flowers, plants, trees, furniture, etc.

[0088] A simulated object is an object obtained by reproducing an original object using reference elements. Different simulated objects corresponding to the original object have different arrangements of reference elements.

[0089] The multiple simulation objects may be obtained from different servers or from the same server, wherein the server refers to the server used to generate the simulation objects corresponding to the original objects.

[0090] In some embodiments, in order to reduce the influence of the background on the main object during the image style transfer process, acquiring an image includes:

[0091] Get the image to be processed;

[0092] The original object is extracted from the image to be processed to obtain an image.

[0093] The image to be processed refers to an image containing background content. For example, the image to be processed may be an unprocessed image, or an image that has been partially processed but still contains background content, and so on.

[0094] In some embodiments, the image may be an image obtained after the image to be processed is processed by an object separation method such as region segmentation, foreground segmentation, etc.

[0095] In some embodiments, in order to obtain a simulated object similar to the original object, before obtaining multiple simulated objects corresponding to the original object, the method further includes:

[0096] acquiring an image and a reference element, wherein the image content of the image includes an original object;

[0097] Based on the original object in the image, multiple simulated objects are generated using reference elements.

[0098] The image content refers to the information expressed by the specific visual elements contained in the image. For example, the image content may include the scene and the main object in the scene.

[0099] Method for determining the original object in the image:

[0100] 1) Use Gaussian distribution to determine the characteristic distribution of pixels in the image, such as color information or texture information, and use this information to distinguish the background and original object in the image, as well as the various parts of the original object.

[0101] 2) Edge detection algorithms can detect intensity changes in different areas of an image, thereby distinguishing the background and original object in the image, as well as the various parts of the original object.

[0102] 3) Image semantic detection can obtain the semantic information of different areas in the image, so as to identify the area where the original object is located in the image. It can also identify the areas where different parts of the original object are located in the image and obtain the various parts of the original object.

[0103] In some embodiments, in order to randomly combine reference elements to obtain multiple simulated objects similar to the original objects, the method further includes:

[0104] Based on the original object in the image, a primary simulated object is generated using reference elements;

[0105] Based on the original object in the image, the reference elements constituting the primary simulated object are adjusted to obtain the secondary simulated object.

[0106] The primary simulation object is a simulation object similar to the original object obtained by first laying out multiple reference elements, and the sizes of multiple filling elements involved in the layout may be different.

[0107] The secondary simulation object is a simulation object based on the original object, which is obtained by adjusting the reference elements that constitute the primary simulation object.

[0108] For example, the secondary simulation object may be obtained by adjusting the layout position, size or rotation angle and other parameters of the reference elements constituting the primary simulation object in the image.

[0109] Alternatively, a secondary simulation object may be obtained by adding reference elements, deleting reference elements, merging reference elements, splitting reference elements, and other adjustment methods.

[0110] In some embodiments, including but not limited to utilizing genetic algorithms and particle swarm algorithms, reference elements constituting the primary simulation object are adjusted.

[0111] For example, using genetic algorithms and particle swarm algorithms, the reference elements that constitute the primary simulation object can be adjusted, specifically the position, size, shape, etc. of the reference elements, so that the resulting secondary simulation object has an appearance more similar to the original object than the primary simulation object.

[0112] In some embodiments, in order to avoid infinite generation of simulation objects, the following further includes:

[0113] Get the preset simulation stop condition;

[0114] According to the preset simulation stop condition, the adjustment process of the reference elements constituting the primary simulation object is stopped.

[0115] The preset simulation stop condition is a preset condition for stopping the generation of the control simulation object. For example, the preset simulation stop condition may be iteration time, reaching a preset goal, etc. The preset goal may be a preset goal that the generated simulation object needs to reach, specifically, the similarity between the finally generated target simulation object and the original object may meet the preset condition.

[0116] In some embodiments, in order to generate multiple simulated objects similar to the original object, so that the simulated object that is more similar to the original object can be further optimized through comparison and selection, the reference elements constituting the primary simulated object are adjusted based on the original object in the image to obtain the secondary simulated object, including:

[0117] Generate a new arrangement based on the original object in the image and the arrangement of reference elements in the primary simulated object;

[0118] According to the new arrangement, the reference elements constituting the primary simulation object are adjusted to obtain the secondary simulation object.

[0119] The arrangement mode refers to the layout adopted by the reference element to reproduce the original object. For example, the arrangement mode may include the position, size, rotation angle, etc. of the reference element to reproduce the original object.

[0120] The new arrangement is obtained by adjusting the layout of reference elements constituting the primary simulation object based on the original image in the image.

[0121] For example, based on the original image in the image, the position, size, rotation angle, etc. of the reference elements constituting the primary simulation object are adjusted to obtain the secondary simulation object.

[0122] The purpose of the primitives in the image is to ensure that when the simulated object is constructed, the reference elements do not exceed certain boundaries or ranges.

[0123] In some embodiments, in order to combine multiple reference elements and reproduce the original object, based on the original object in the image, the reference elements are used to generate a primary simulated object, including:

[0124] Determine the layout position of the elements on the original object in the image;

[0125] Generates primary simulation objects based on element layout positions and reference elements.

[0126] The element layout position refers to the position that needs to be aligned when the reference elements are combined to form a preliminary simulation object in the area where the original object is located in the image. For example, the element layout position can be a layout point, a layout area, etc. for guiding the reference elements to be combined to form a preliminary simulation object.

[0127] In some embodiments, if the element layout position is a layout point obtained based on the original object in the image, the vertices, center points or preset position points of the reference element can be aligned with the layout points to arrange the reference elements at various layout points to form a preliminary simulated object similar to the original object, wherein the preset position points can be specific positions of the reference elements that are preset so that the reference elements are aligned with the layout points, thereby achieving the layout of the reference elements when reproducing the original object.

[0128] In some embodiments, if the element layout position is a layout area obtained based on the original object in the image, the reference elements are arranged in each layout area to reproduce the original object. In some embodiments, in order to enable the reference element combination to form a simulated object similar to the original object, a primary simulated object is generated based on the element layout position and the reference element, including:

[0129] Align the vertices of the reference element with the element layout position to generate a primary simulation object.

[0130] The vertex of the reference element refers to the point where two sides of the reference element intersect. For example, if the reference element is a polygon (such as a triangle, quadrilateral, pentagon, etc.), the vertex is the point where two sides of the polygon intersect.

[0131] In some embodiments, including but not limited to using Gaussian distribution, edge detection algorithm, and image semantic detection to determine the layout position of elements on the original object in the image.

[0132] For example, when the reference element is a polygon, the element layout position is first determined on the original object in the image, and then the vertices of the reference element are aligned with the element layout position to obtain the reference element at the element layout position, thereby realizing a simulated object that reproduces the original object.

[0133] In some embodiments, in order to make the simulated object have color information similar to that of the original object so as to distinguish the difference between the simulated object and the original object according to the color of the simulated object, a primary simulated object is generated based on the element layout position and the reference element, including:

[0134] Get the target color information of the original object at the element layout position;

[0135] According to the target color information, the reference element at the element layout position is color filled to obtain a primary simulation object.

[0136] The target color information refers to the color characteristics of the original object in the image at the element layout position. For example, the target color information can be the exact color, representative color, comprehensive color, average color, etc. of the original object at the element layout position.

[0137] In some embodiments, in order to obtain a secondary simulated object similar to the primary simulated object, the primary simulated object includes a plurality of reference elements;

[0138] Based on the original object in the image, the reference elements constituting the primary simulated object are adjusted to obtain a secondary simulated object, including:

[0139] Based on the original object in the image, the element layout position aligned with each reference element in the primary simulation object is updated to obtain an updated element layout position;

[0140] determining a reference element at a layout position of the update element;

[0141] According to the color information at the layout position of the update element in the original object, the reference element at the layout position of the update element is subjected to color filling processing to obtain a secondary simulation object.

[0142] Wherein, updating the element layout position refers to updating the positions of multiple reference elements that need to be aligned when forming a preliminary simulation object based on the original object in the image, and obtaining the positions.

[0143] For example, if the reference element is a polygon, and the vertices of the polygons constituting the primary simulation object are aligned with the element layout position, within the range of the original object in the image, the element layout position of the aligned polygons constituting the primary simulation object can be adjusted to align the vertices of the reference element with the update element layout position to obtain the reference element at the update element layout position, and the shape obtained by combining the reference elements at the update element layout positions is similar to the shape of the primary simulation object, and then based on the color information at the update element layout position in the element object, the reference element at the update element layout position is color filled to obtain the secondary simulation object.

[0144] In some embodiments, when the similarity between some parts of the primary simulated object and the original object does not meet the standard, in order to update some parts of the primary simulated object and retain parts similar to the original object, so that the subsequently obtained simulated object is more similar to the original object than the primary simulated object, a new arrangement is generated based on the original object in the image and the arrangement of reference elements in the primary simulated object, including:

[0145] Determine the part of the primary simulation object to be adjusted;

[0146] Based on the original object in the image, the arrangement of the reference elements of the to-be-adjusted part in the primary simulation object is adjusted to obtain a new arrangement.

[0147] The part to be adjusted refers to the part of the primary simulation object that is inconsistent with the original object.

[0148] For example, when adjusting the reference elements that constitute the part to be adjusted, if the reference element is a polygon, the positions of the vertices of the polygon can be adjusted within the range of the part to be adjusted. If the reference element is a circle, the radius, diameter, rotation angle, etc. of the circle can be adjusted. If the reference element is an ellipse, the center point of the ellipse, semi-axis length, rotation angle, etc. can be adjusted. If the reference element is an element with a complex structure, the position, size, rotation angle, etc. of the element with a complex structure can be adjusted, which is conducive to obtaining a secondary simulation object that is closer to the original object.

[0149] 102. Determine the difference information between the simulated object and the original object at the same part.

[0150] The same part refers to the area where the simulated object and the original object are at the same position.

[0151] The difference information indicates the difference between the simulated object and the original object. For example, the difference information can be a loss value, a similarity, etc.

[0152] In some embodiments, it also includes:

[0153] Divide the simulated object and the original object into multiple parts;

[0154] Based on the position of each part in the simulated object and the position of each part in the original object, the same part corresponding to the simulated object and the original object is determined.

[0155] The position of a part in the simulated object refers to the position of the part in the simulated object. For example, the position of a part can be the area occupied by the part in the simulated object, or the coordinate position in the simulated object, or the semantics of the part obtained by semantic segmentation, such as the left hand part, the right hand part, the body part, etc.

[0156] The position of a part in the original object refers to the position of the part in the original object, and the position of the part in the original object is determined in the same manner as the position of the part in the simulated object.

[0157] In some embodiments, the difference information includes the loss value or similarity between the simulated object and the original object in terms of shape, size, position, color, material, texture, etc. at the same part.

[0158] In some embodiments, in order to analyze the differences between the simulated object and the original object at different parts, so as to update the parts of the simulated object that are not similar to the original object and retain the parts that are similar to the original object, determining the difference information between the simulated object and the original object at the same part includes:

[0159] Determine target difference information between the primary simulated object and the original object at the same location;

[0160] Determine the parts of the primary simulation object to be adjusted, including:

[0161] According to the target difference information, the part to be adjusted is determined from the primary simulation object.

[0162] The target difference information is the difference between the primary simulated object and the original object at the same part.

[0163] For example, when the target difference information reflects that the difference between the primary simulated object and the original object in the same part does not meet the preset difference condition, the part is used as the part to be adjusted, and the preset difference condition is a preset setting for measuring the difference between the primary simulated object and the original object in the same part.

[0164] 103. For each corresponding part between the original object and the simulated object, determine the target part corresponding to each part from the multiple simulated objects according to the difference information.

[0165] The target part refers to the part of the simulated object that is similar to the original object.

[0166] For example, the multiple corresponding parts between the original object and the simulated object include part 1 and part 2, and the difference information between the simulated object and the original object includes difference information 1 corresponding to part 1 and difference information 2 corresponding to part 2. Based on the difference information 1 and the difference information 2, the target part is determined from part 1 and part 2 of the simulated object.

[0167] In some embodiments, the plurality of simulation objects may include primary simulation objects and secondary simulation objects, or may include only secondary simulation objects, and so on.

[0168] 104. Combine and process the target parts corresponding to the various parts to obtain a target simulation object.

[0169] The target simulation object is a simulation object obtained by combining target parts similar to parts of the original object in multiple simulation objects.

[0170] In some embodiments, in order to ensure that the generated simulated object is similar to the original object and can also adjust its style according to user needs, it also includes:

[0171] Get the specified element;

[0172] Determine a reference element according to the type corresponding to the specified element, wherein the subclass of the reference element includes the specified element;

[0173] After combining the target parts corresponding to the various parts to obtain the target simulation object, it also includes:

[0174] Based on the designated elements, element conversion processing is performed on the reference elements constituting the target simulation object to obtain a new target simulation object, where the new target simulation object is an object obtained by reproducing the original object using the designated elements.

[0175] The designated element is used to specify that the simulation object finally generated is obtained by its composition, and its type corresponds to a specific reference element.

[0176] For example, when the specified element is a direct triangle, an isosceles triangle, or an obtuse triangle, the corresponding type is a triangle, and the triangle is used as the reference element. When the specified element is a flower, plant, or tree, the corresponding type is an element with a complex structure, and the bounding box, preset shape, etc. of the flower, plant, or tree are used as reference elements. When the specified element is a parallelogram, rectangle, or square, the corresponding type is a quadrilateral, and the quadrilateral is used as the reference element, and so on.

[0177] The new target simulation object is a new object similar to the original object obtained by converting the reference elements constituting the target simulation object into specified elements.

[0178] For example, when the reference element is a triangle and the designated element is a direct triangle, the triangles constituting the target simulation object are converted into direct triangles, and an object consisting of multiple direct triangles and having an appearance similar to the original object is obtained.

[0179] In some embodiments, considering that redundant designated elements may exist after the target simulation object is converted into a new target simulation object, in order to optimize the new target simulation object, after performing element conversion processing on reference elements constituting the target simulation object based on the designated elements to obtain the new target simulation object, the following is further included:

[0180] Perform element overlap detection on designated elements constituting the new target simulation object to obtain elements to be expanded and elements to be deleted, and the elements to be expanded and the elements to be deleted overlap;

[0181] According to the elements to be deleted, the elements to be expanded in the new target simulation object are expanded to obtain expanded elements, which include the elements to be deleted;

[0182] According to the external expansion elements, the elements to be deleted in the new target simulation object are deleted to obtain an updated new target simulation object.

[0183] The elements to be expanded refer to the designated elements in the overlapping designated elements that need to be expanded to cover the overlapping area.

[0184] The to-be-deleted filling element refers to a specified element that needs to be deleted from the overlapping specified elements.

[0185] For example, the element to be expanded may be the upper designated element among the overlapping designated elements, or the lower designated element, or the designated element whose overlapping area accounts for a smaller proportion of its own total area, or the designated element whose overlapping area accounts for a larger proportion of its own total area, and so on.

[0186] For example, when the element to be expanded is the upper specified element among the overlapping specified elements, the filling element to be deleted is the lower specified element, and vice versa. When the element to be expanded is the specified element whose overlapping area accounts for a smaller proportion of its total area, the element to be deleted is the specified element whose overlapping area accounts for a larger proportion of its total area, and vice versa, and so on.

[0187] The externally expanded element is an element that covers the element to be deleted after the externally expanded element is expanded.

[0188] The updated new target simulation object refers to a simulation object obtained after deleting redundant designated elements in the new target simulation object.

[0189] In some embodiments, in order to accurately remove redundant designated elements in the new target simulation object, the elements to be deleted in the new target simulation object are deleted according to the external expansion elements to obtain an updated new target simulation object, including:

[0190] Determine the color information of the expanded element based on the color information of the element to be expanded and the color information of the element to be deleted;

[0191] Determine the reference position corresponding to the expanded element from the original object;

[0192] Determine the element retention information of the expanded element according to the color information of the reference part and the color information of the expanded element;

[0193] According to the element retention information of the externally expanded element, the elements to be deleted in the new target simulation object are deleted to obtain an updated new target simulation object.

[0194] The color information of the element to be expanded is used to represent the color of the corresponding part in the original object.

[0195] The color information of the element to be deleted is used to represent the color of the corresponding part in the original object.

[0196] The color information of the expanded element is used to represent the color of the portion of the original object corresponding to the element to be expanded and the element to be deleted.

[0197] The color information may include exact color, representative color, comprehensive color, average color, etc.

[0198] The reference part is the part of the original object that corresponds to the expanded element.

[0199] The color information of the reference part is the color of the reference part in the original object.

[0200] The element retention information is used to indicate whether to retain the external expansion element.

[0201] In some embodiments, when the color information of the expanded element matches the color information of the reference part, the element preservation information indicates to preserve the expanded element.

[0202] In some embodiments, when the color information of the expanded element does not match the color information of the reference part, the element retention information indicates that the expanded element should not be retained.

[0203] In some embodiments, in order to present a virtual object obtained by a new target simulation object in a specified scene, the method further includes:

[0204] Obtaining an element list of elements constituting a target simulation object and a data format to be transferred into a scene, wherein the element list includes element parameters of each element constituting the target simulation object;

[0205] According to the data format, the element parameters of each element in the element list are format converted to obtain an updated element list;

[0206] The updated element list is sent to the scene to be transferred into, so as to present a virtual object composed of the elements in the updated element list in the scene to be transferred into.

[0207] The element list records the relevant element parameters of each element constituting the target simulation object.

[0208] For example, the element list may be a list recording relevant element parameters of each element constituting the target simulation object, wherein each element may be a reference element. It may also be a list recording relevant element parameters of each element constituting the new target simulation object, wherein each element may be a designated element. It may also be a list recording relevant element parameters of each element constituting the updated new target simulation object, wherein each element may be an optimized designated element.

[0209] The relevant element parameters of each element in the element list include the vertex coordinates, center point coordinates, size, rotation angle, etc. of the element.

[0210] The scene to be transferred into is a scene waiting to be introduced into the target simulation object. For example, the scene to be transferred into can be a game scene, a simulation scene, a virtual scene, etc.

[0211] The data format is the format required for the data to be transferred into the scene. For example, the data format may include data processing format, parameter mapping, coordinate system conversion, etc.

[0212] Update the element list to a new list obtained after converting the element list format so that the scene to be transferred can be read and loaded.

[0213] The virtual object is the visual effect presented by the updated element list in the scene to be transferred in. For example, the virtual object can be a virtual prop, a virtual scene, a virtual character, etc.

[0214] The method provided in the embodiment of the present application can obtain the original object in the image and multiple simulated objects corresponding to the original object, where the simulated object is an object obtained by reproducing the original object using reference elements, and the reference elements in different simulated objects are arranged differently; determine the difference information between the simulated object and the original object in the same part; for each corresponding part between the original object and the simulated object, determine the target part corresponding to each part from the multiple simulated objects according to the difference information; and combine the target parts corresponding to each part to obtain the target simulated object.

[0215] As can be seen from the above, the original object in the embodiment of the present application corresponds to multiple simulated objects. For each corresponding part between the original object and the simulated object, the target part corresponding to each part can be determined from multiple simulated objects based on the difference information between the simulated object and the original object in the same part, so as to achieve targeted retention of parts similar to the original object in each simulated object, and combine the target parts corresponding to each part, so that the final target simulated object is closer to the original object as a whole compared to the multiple simulated objects, ensuring that the generated target simulated object can accurately retain the core features and style of the original object. As a result, the quality of content stylization migration is improved.

[0216] The method described in the above embodiment will be further described in detail below.

[0217] In this embodiment, the method of the embodiment of the present application is described in detail by taking the filling element as a geometric element as an example.

[0218] like Figure 2a As shown, the specific process of an image processing method is as follows:

[0219] 201. Obtain an image and a specified element, wherein the image content of the image includes an original object.

[0220] In some embodiments, acquiring an image includes:

[0221] Get the image to be processed;

[0222] The original object is extracted from the image to be processed to obtain an image.

[0223] In some embodiments, when extracting the original object in the image to be processed, region segmentation, foreground segmentation, etc. can be performed according to the image to be processed and user needs to meet the needs. Technical aspects simplify the image to be processed to be more conducive to the input of subsequent algorithms, and the adopted technologies include but are not limited to color clustering and simplified models.

[0224] When extracting the original object in the image to be processed:

[0225] 1) Object segmentation. The object that the user wants to stylize is not necessarily the complete input image, but may be the main subject in the image, such as people, cartoon characters, and objects in the scene. For such needs, this application includes optional image region cropping and foreground segmentation modules, and also supports cutting out transparent background areas based on user input red, blue, and green transparent channels (RGBA channels). The foreground segmentation module usually uses related deep learning models.

[0226] 2) Image simplification, before and after comparison effect is as follows Figure 2bAs shown. The details of complex images to be processed are often not conducive to the abstract expression of the images to be processed by filling elements, such as hair details of people, landscape plants, furniture textures, gradients and lighting of objects, noise in the image, etc., which will have a negative impact on the abstract expression of the image content in the image to be processed. Therefore, the present application includes an optional image simplification module to retain the main body and simplify the details of complex images to be processed. The simplification module may include multiple processing flows, including but not limited to traditional image processing schemes and deep learning models. Color clustering is based on the K-means algorithm (Kmeans algorithm) and the like, which can cluster complex gradient colors and shadows to avoid an increase in the number of fitting components caused by gradient lights and shadows. Traditional image processing schemes such as opening and closing operations can simplify details and noise. The deep learning model regards image simplification as a computer vision task of image transformation-image style transfer, and its model is not limited to generative adversarial networks (GANs), diffusion models (DMs), etc. Among them, the multimodal image-generating model can edit images through multimodal control. Specifically, it can perform image-generating editing based on text control tasks and new style descriptions. Through multiple control network modules (ControlNet modules), according to the reference style map, the semantic segmentation map and the edge extraction map of the image to be processed constrain the semantic content to remain unchanged and only transfer the style.

[0227] 202. Determine a reference element according to a type corresponding to the designated element, wherein a subclass of the reference element includes the designated element.

[0228] 203. Based on the original object in the image, multiple simulated objects are generated using reference elements. The simulated objects are objects obtained by reproducing the original objects using the reference elements. The reference elements in different simulated objects are arranged in different ways.

[0229] In some embodiments, when constructing a simulation object, it includes but is not limited to using an approximate optimization algorithm, a data-driven method based on reinforcement learning, and a large language model.

[0230] In some embodiments, when constructing a simulated object, multiple polygonal partitions may be obtained by nesting image processing algorithms, and a traditional polygon fitting algorithm may be applied to each polygonal partition to further reduce the number of reference elements.

[0231] In some embodiments, when constructing a simulated object, the image complexity can be graded, and simple images can be replaced with traditional algorithms that are faster and have fewer components.

[0232] In some embodiments, in addition to one-time global fitting, a user interaction process can also be developed to further refine the user's selection of specific important areas to improve the effect.

[0233] like Figure 2cAs shown, the present application can also be used for image-specific style transfer, changing the image into a specific style built based on basic elements (such as pixel style and low-poly style) for creative display, content creation, etc.

[0234] In some embodiments, based on the original object in the image, multiple simulated objects are generated using reference elements, including:

[0235] Determine the layout position of the elements on the original object in the image;

[0236] Get the target color information of the original object at the element layout position;

[0237] According to the target color information, the reference element at the element layout position is color filled to obtain a primary simulation object;

[0238] Based on the original object in the image, the reference elements constituting the primary simulated object are adjusted to obtain the secondary simulated object.

[0239] In some embodiments, in order to avoid infinite generation of simulation objects, the following further includes:

[0240] Get the preset simulation stop condition;

[0241] According to the preset simulation stop condition, the adjustment process of the reference elements constituting the primary simulation object is stopped.

[0242] When converting an image into a simulation object composed of multiple specified elements, you need to first design it according to the type of the specified elements, including:

[0243] For example, Figure 2d As shown, when the reference element is determined to be a triangle according to the type of the specified element, the triangulation algorithm can construct multiple non-intersecting triangular meshes according to the element layout position on the original object in the image (the layout points created on the original object in the image), that is, align the vertices of the triangle with the layout points on the original object in the image, so as to reproduce the element object through the reference element to obtain the simulated object. Therefore, a series of vertices can be defined and the coordinates of each layout point can be optimized through an approximate algorithm to adjust the reference elements constituting the primary simulated object and obtain the secondary simulated object.

[0244] When the reference element obtained by the specified element type is determined to be a circle, the vertices and radius of the circle constituting the primary simulation object can be optimized to obtain a secondary simulation object. For example, when the reference element is an ellipse, the center point, semi-axis length, rotation and other parameters of the ellipse constituting the primary simulation object can be optimized to obtain a secondary simulation object. When the reference element obtained by the specified element type is determined to be a structurally complex element, such as flowers, trees, tables, chairs, benches, etc., the structurally complex elements (such as position, size, rotation and other parameters) constituting the primary simulation object can be optimized to obtain a secondary simulation object. It is worth mentioning that the specified element is not necessarily optimized directly. For example, the optimization effect of a right triangle is not as good as that of an ordinary triangle. Therefore, a triangle can be used as the fitting target, and then the ordinary triangle can be replaced by direct triangle post-processing and approximate optimization.

[0245] The reference elements constituting the primary simulation object are adjusted to obtain the secondary simulation object, which may be:

[0246] Based on the original object in the image, the reference elements constituting the primary simulation object are adjusted, and the difference information in the same part with the original object is used to evaluate the quality and further optimize. When initializing the parameters, a random Gaussian distribution can be used, or prior knowledge such as object edge detection or image semantic detection can be used to obtain the original object in the image, so as to determine the element layout position on the original object in the image. The optimization target is usually defined as the semantic perception loss (LPIPS loss) with the image, the pixel consistency loss (L1 / L2 loss) and other custom losses (such as edge loss). The reference elements constituting the primary simulation object can be adjusted by using a group approximate search algorithm such as a genetic algorithm and a particle swarm algorithm, which randomly perturbs the element layout position on the original object in the image to obtain the updated element layout position. The reference elements at the updated element layout position constitute the secondary simulation object, and the perceptual loss change with the input image is judged to determine whether to retain the perturbation result, that is, whether to retain the updated element layout position. The perturbation amplitude can be controlled according to rules, and the element layout position and / or the updated element layout position can be manually added according to manually designed rules, such as Figure 2e As shown, the element layout position can be added, deleted, merged and split, etc.

[0247] 204. Determine difference information between the simulated object and the original object at the same position.

[0248] 205. For each corresponding part between the original object and the simulated object, determine a target part corresponding to each part from a plurality of simulated objects according to the difference information.

[0249] 206. Combine and process the target parts corresponding to the various parts to obtain a target simulation object.

[0250] 207. Based on the specified filling element, perform element conversion processing on the reference elements constituting the target simulation object to obtain a new target simulation object, where the new target simulation object is an object obtained by reproducing the original object using the specified element.

[0251] For example, Figure 2f As shown in the figure, after the preset simulation stop conditions (such as iteration time), a primary simulation object similar to the original object has been formed by the combination of reference elements. For some cases where the specified elements are different from the reference elements, it is necessary to transform the reference elements that constitute the target simulation object into fully consistent with the specified elements.

[0252] like Figure 2g As shown, take the conversion from a triangle to a right triangle as an example: the primary simulation object formed by the combination of triangulation algorithms is composed of multiple arbitrary triangles, which need to be converted into right triangles or isosceles triangles after post-processing. According to the definition, a right triangle can be obtained by taking a perpendicular line to an arbitrary triangle. For an obtuse triangle, the two acute angle vertices are not perpendicular to the triangle, so taking the vertex with the largest angle as a perpendicular line can split the arbitrary triangle into two right triangles to obtain the specified element that meets the requirements.

[0253] In some embodiments, optimizing the new target simulation object is to significantly reduce the number of specified fill elements with very low loss of accuracy. Depending on the application scenario, the specified elements are adapted, approximated, deleted, split and merged in some cases.

[0254] In some embodiments, after performing element conversion processing on reference elements constituting the target simulation object based on the designated element to obtain a new target simulation object, the method further includes:

[0255] Perform element overlap detection on designated elements constituting the new target simulation object to obtain elements to be expanded and elements to be deleted, and the elements to be expanded and the elements to be deleted overlap;

[0256] According to the elements to be deleted, the elements to be expanded in the new target simulation object are expanded to obtain expanded elements, which include the elements to be deleted;

[0257] According to the external expansion elements, the elements to be deleted in the new target simulation object are deleted to obtain an updated new target simulation object.

[0258] In some embodiments, according to the external expansion element, the to-be-deleted element in the new target simulation object is deleted to obtain the updated new target simulation object, including:

[0259] Determine the color information of the expanded element based on the color information of the element to be expanded and the color information of the element to be deleted;

[0260] Determine the reference position corresponding to the expanded element from the original object;

[0261] Determine the element retention information of the expanded element according to the color information of the reference part and the color information of the expanded element;

[0262] According to the element retention information of the externally expanded element, the elements to be deleted in the new target simulation object are deleted to obtain an updated new target simulation object.

[0263] For example, converting the reference elements that constitute the target simulation object into designated elements may cause the number of designated elements to increase exponentially, and direct optimization may produce redundant designated elements. Therefore, an approximate optimization alternative can be designed. Take the conversion of a triangle to a right triangle as an example: when components are allowed to overlap, in addition to segmentation, approximate expansion can also be performed. Specifically, any acute-angled edge can be expanded into a right-angled edge, or an obtuse-angled edge can be completed to a right-angled edge. Take the conversion of a triangle to an isosceles triangle as an example: any shorter edge can be completed to be the same length as the longer edge. Approximate optimization of a triangle is as follows: Figure 2h In addition to triangles, approximate optimization can also include some traditional image processing schemes, such as ellipse recognition, and try to replace the same-color polygonal areas with approximate ellipses.

[0264] Since the expansion area will be generated when updating and reconstructing the simulated object, the perceived accuracy of the updated reconstructed simulated object may decrease. Therefore, artificial rules can be designed to determine whether the approximate optimization is feasible. For example, the difference between the color information of the expanded filling element and the color information of the reference part in the original object can be used to determine whether to proceed. Figure 2i shown.

[0265] In some embodiments, it also includes:

[0266] Obtaining an element list of elements constituting a target simulation object and a data format to be transferred into a scene, wherein the element list includes element parameters of each element constituting the target simulation object;

[0267] According to the data format, the element parameters of each element in the element list are format converted to obtain an updated element list;

[0268] The updated element list is sent to the scene to be transferred into, so as to present a virtual object composed of the elements in the updated element list in the scene to be transferred into.

[0269] For example, the element list of the elements that constitute the target simulation object has been obtained, and the element list includes the two-dimensional position corresponding to each element. In some application scenarios such as the automated construction of user-generated content games (UGC games), it is also necessary to design a conversion interface to convert the element parameters of each element in the element list into element parameters that the game can recognize. For example, from the vertex coordinates, calculate the center point coordinates, side length, relative standard fill element scaling and rotation angle, etc., to complete the access.

[0270] This application is applicable to all application scenarios that require converting images into specific element styles, such as UGC game element construction, image specific style migration, etc.

[0271] like Figure 2f As shown in Figure 1, in UGC games, some users expect to add high-level semantic content to the game, such as anime characters, landscape photos, and artistic creations. This requires manual construction using basic components supported by the game, and fine editing of dozens or hundreds of components to obtain a complex image, which is time-consuming and has a high threshold for creation. The image elementization intelligent construction system allows players to upload original images and perform optional operations to approximate them into new target simulation objects composed of multiple specified elements within a few seconds to a few minutes.

[0272] The beneficial effects of this application:

[0273] (1) Compared with the block pixelization scheme, it has higher accuracy and can obtain better image approximation visualization effects with fewer elements, retaining more details;

[0274] (2) It is time-efficient and controllable. Compared with manual editing, it is several orders of magnitude more efficient, which speeds up user creation and design. It can be personalized and adjusted over time, and the effect becomes better with time and complexity.

[0275] (3) Good applicability. It is applicable to a variety of filling elements. The scheme can be designed and expanded in detail. It is not limited to simple geometric shapes in traditional image processing. It can also process more complex target shapes. It is also applicable to a variety of input images, including simple abstract patterns and extremely complex landscape photos. It can reduce the number of components while retaining good effects.

[0276] (4) Iterative optimization avoids errors caused by one-time object detection failure in traditional algorithms and gradually obtains better results.

[0277] As can be seen from the above, the present application achieves targeted retention of the parts of each simulated object that are similar to the original object, and combines the target parts corresponding to each part, so that the final target simulated object is closer to the original object as a whole compared to multiple simulated objects, ensuring that the generated target simulated object can accurately retain the core features and style of the original object. Thus, the quality of content stylization migration is improved.

[0278] In order to better implement the above method, the embodiment of the present application also provides an image processing device, which can be integrated in an electronic device, and the electronic device can be a terminal, a server, etc. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers.

[0279] For example, in this embodiment, the method of the embodiment of the present application is described in detail by taking the image processing device specifically integrated in an electronic device as an example.

[0280] For example, Figure 3 As shown, the image processing device may include an acquisition unit 301, a difference determination unit 302, a part determination unit 303, and a part combination unit 304, as follows:

[0281] (i) Acquisition unit 301.

[0282] The acquisition unit 301 is used to acquire the original object in the image and multiple simulated objects corresponding to the original object. The simulated object is an object obtained by reproducing the original object using reference elements. The reference elements in different simulated objects are arranged in different ways.

[0283] In some embodiments, the apparatus further comprises an object generation unit, configured to:

[0284] Based on the original object in the image, a primary simulated object is generated using reference elements;

[0285] Based on the original object in the image, the reference elements constituting the primary simulated object are adjusted to obtain the secondary simulated object.

[0286] In some embodiments, the object generation unit is configured to:

[0287] Generate a new arrangement based on the original object in the image and the arrangement of reference elements in the primary simulated object;

[0288] According to the new arrangement, the reference elements constituting the primary simulation object are adjusted to obtain the secondary simulation object.

[0289] In some embodiments, the object generation unit is configured to:

[0290] Determine the layout position of the elements on the original object in the image;

[0291] Generates primary simulation objects based on element layout positions and reference elements.

[0292] In some embodiments, the object generation unit is configured to:

[0293] Get the target color information of the original object at the element layout position;

[0294] According to the target color information, the reference element at the element layout position is color filled to obtain a primary simulation object.

[0295] In some embodiments, the object generation unit is configured to:

[0296] Determine the part of the primary simulation object to be adjusted;

[0297] Based on the original object in the image, the arrangement of the reference elements of the to-be-adjusted part in the primary simulation object is adjusted to obtain a new arrangement.

[0298] (ii) Difference determination unit 302.

[0299] The difference determination unit 302 is used to determine the difference information between the simulated object and the original object at the same part.

[0300] In some embodiments, the difference determination unit is configured to:

[0301] Determine target difference information between the primary simulated object and the original object at the same location;

[0302] Object generation unit, used to:

[0303] According to the target difference information, the part to be adjusted is determined from the primary simulation object.

[0304] (iii) Location determination unit 303.

[0305] The part determination unit 303 is used to determine the target part corresponding to each part from the plurality of simulated objects according to the difference information for each part corresponding to the original object and the simulated object.

[0306] (iv) Part combination unit 304.

[0307] The part combining unit 304 is used to combine the target parts corresponding to the various parts to obtain a target simulation object.

[0308] In some embodiments, the apparatus further comprises an element determination unit and an object conversion unit:

[0309] An element determination unit, used to obtain a specified element; determine a reference element according to a type corresponding to the specified element, wherein a subclass of the reference element includes the specified element;

[0310] The object conversion unit is used to perform element conversion processing on the reference elements constituting the target simulation object based on the specified elements to obtain a new target simulation object. The new target simulation object is an object obtained by reproducing the original object using the specified elements.

[0311] In some embodiments, the apparatus further comprises an object updating unit, configured to:

[0312] Perform element overlap detection on designated elements constituting the new target simulation object to obtain elements to be expanded and elements to be deleted, and the elements to be expanded and the elements to be deleted overlap;

[0313] According to the elements to be deleted, the elements to be expanded in the new target simulation object are expanded to obtain expanded elements, which include the elements to be deleted;

[0314] According to the external expansion elements, the elements to be deleted in the new target simulation object are deleted to obtain an updated new target simulation object.

[0315] In some embodiments, the object updating unit is configured to:

[0316] Determine the color information of the expanded element based on the color information of the element to be expanded and the color information of the element to be deleted;

[0317] Determine the reference position corresponding to the expanded element from the original object;

[0318] Determine the element retention information of the expanded element according to the color information of the reference part and the color information of the expanded element;

[0319] According to the element retention information of the externally expanded element, the elements to be deleted in the new target simulation object are deleted to obtain an updated new target simulation object.

[0320] In some embodiments, the apparatus further comprises an object introduction unit, configured to:

[0321] Obtaining an element list of elements constituting a target simulation object and a data format to be transferred into a scene, wherein the element list includes element parameters of each element constituting the target simulation object;

[0322] According to the data format, the element parameters of each element in the element list are format converted to obtain an updated element list;

[0323] The updated element list is sent to the scene to be transferred into, so as to present a virtual object composed of the elements in the updated element list in the scene to be transferred into.

[0324] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0325] As can be seen from the above, the image processing device of this embodiment acquires the original object in the image and multiple simulated objects corresponding to the original object by an acquisition unit, wherein the simulated object is an object obtained by reproducing the original object using reference elements, and the reference elements in different simulated objects are arranged in different ways; the difference determination unit determines the difference information between the simulated object and the original object at the same part; the part determination unit determines the target part corresponding to each part from the multiple simulated objects according to the difference information for each part corresponding to the original object and the simulated object; the part combination unit combines the target parts corresponding to each part to obtain the target simulated object.

[0326] Therefore, the embodiment of the present application can achieve targeted retention of the parts of each simulated object that are similar to the original object, and combine the target parts corresponding to each part, so that the final target simulated object is closer to the original object as a whole compared to the multiple simulated objects, ensuring that the generated target simulated object can accurately retain the core features and style of the original object. Therefore, the quality of content stylization migration is improved.

[0327] The embodiment of the present application also provides an electronic device, which can be a terminal, a server, etc. The terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop, a personal computer, etc. The server can be a single server or a server cluster composed of multiple servers, etc.

[0328] In some embodiments, the image processing device may also be integrated into multiple electronic devices. For example, the image processing device may be integrated into multiple servers, and the image processing method of the present application may be implemented by multiple servers.

[0329] In this embodiment, the electronic device of this embodiment is a server as an example for detailed description, for example, Figure 4 As shown, it shows a schematic diagram of the structure of the server involved in the embodiment of the present application, specifically:

[0330] The server may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will appreciate that Figure 4 The server structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0331] The processor 401 is the control center of the server, and uses various interfaces and lines to connect various parts of the entire server. It executes various functions of the server and processes data by running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0332] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0333] The server also includes a power supply 403 for supplying power to various components. In some embodiments, the power supply 403 may be logically connected to the processor 401 through a power management system, so that the power management system can manage charging, discharging, power consumption, and other functions. The power supply 403 may also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0334] The server may further include an input module 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0335] The server may further include a communication module 405. In some embodiments, the communication module 405 may include a wireless module. The server may perform short-range wireless transmission through the wireless module of the communication module 405, thereby providing wireless broadband Internet access for the user. For example, the communication module 405 may be used to help the user send and receive emails, browse web pages, and access streaming media.

[0336] Although not shown, the server may also include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the server will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby implementing the steps in the methods of the embodiments of the present application.

[0337] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0338] As can be seen from the above, it is possible to retain the parts of each simulated object that are similar to the original object in a targeted manner, and combine the target parts corresponding to each part, so that the final target simulated object is closer to the original object as a whole compared to multiple simulated objects, ensuring that the generated target simulated object can accurately retain the core features and style of the original object. This improves the quality of content stylization migration.

[0339] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0340] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the image processing methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:

[0341] Acquire an original object in the image and multiple simulated objects corresponding to the original object, where the simulated object is an object obtained by reproducing the original object using reference elements, and the reference elements in different simulated objects are arranged in different ways;

[0342] Determine the difference information between the simulated object and the original object at the same part;

[0343] For each corresponding part between the original object and the simulated object, according to the difference information, a target part corresponding to each part is determined from a plurality of simulated objects;

[0344] The target parts corresponding to each part are combined and processed to obtain the target simulation object.

[0345] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0346] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including a computer program / instruction, the computer program / instruction being stored in a computer-readable storage medium. A processor of an electronic device reads the computer program / instruction from the computer-readable storage medium, and the processor executes the computer program / instruction, so that the electronic device executes the method provided in various optional implementations of the image processing provided in the above embodiments.

[0347] Since the instructions stored in the storage medium can execute the steps in any image processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any image processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0348] The above is a detailed introduction to an image processing method, device, electronic device, storage medium and program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image processing method, It is characterized in that include: Acquire an original object in an image, and multiple simulated objects corresponding to the original object, each simulated object is an object obtained by reproducing the original object using a reference element, the reference elements in different simulated objects are arranged differently, the reference element is determined according to the type corresponding to a specified element, and a subclass of the reference element includes the specified element; Determine difference information between each simulated object and the original object at the same part; For each corresponding part between the original object and each simulated object, determining a target part corresponding to each part from the plurality of simulated objects according to the difference information; Combining and processing the target parts corresponding to the various parts to obtain a target simulation object; Based on the designated element, element conversion processing is performed on the reference elements constituting the target simulation object to obtain a new target simulation object, where the new target simulation object is an object obtained by reproducing the original object using the designated element.

2. The image processing method according to claim 1, It is characterized in that Also includes: Based on the original object in the image, generate a primary simulated object using the reference element; Based on the original object in the image, reference elements constituting the primary simulated object are adjusted to obtain a secondary simulated object.

3. The image processing method according to claim 2, It is characterized in that The adjusting process of the reference elements constituting the primary simulated object based on the original object in the image to obtain the secondary simulated object includes: Generating a new arrangement based on the original object in the image and the arrangement of reference elements in the primary simulated object; According to the new arrangement, the reference elements constituting the primary simulation object are adjusted to obtain a secondary simulation object.

4. The image processing method according to claim 2, It is characterized in that The step of generating a primary simulated object based on the original object in the image by using the reference element comprises: determining an element layout position on an original object in the image; A primary simulation object is generated based on the element layout position and the reference element.

5. The image processing method according to claim 4, It is characterized in that The generating of a primary simulation object based on the element layout position and the reference element comprises: Acquire target color information of the original object at the element layout position; According to the target color information, a color filling process is performed on the reference element at the element layout position to obtain a primary simulation object.

6. The image processing method according to claim 3, It is characterized in that The generating a new arrangement based on the original object in the image and the arrangement of reference elements in the primary simulated object comprises: Determining a part of the primary simulation object to be adjusted; Based on the original object in the image, the arrangement of the reference elements of the to-be-adjusted part in the primary simulated object is adjusted to obtain a new arrangement.

7. The image processing method according to claim 6, It is characterized in that The determining of difference information between each simulated object and the original object at the same position includes: Determine target difference information of the primary simulated object and the original object at the same part; The step of determining the part of the primary simulation object to be adjusted comprises: According to the target difference information, a part to be adjusted is determined from the primary simulation object.

8. The image processing method according to claim 1, It is characterized in that Also includes: Get the specified element; A reference element is determined according to a type corresponding to the designated element, wherein a subclass of the reference element includes the designated element.

9. The image processing method according to claim 8, It is characterized in that After performing element conversion processing on the reference elements constituting the target simulation object based on the designated element to obtain a new target simulation object, the method further includes: Performing element overlap detection on designated elements constituting the new target simulation object to obtain elements to be expanded and elements to be deleted, wherein the elements to be expanded and the elements to be deleted overlap; According to the element to be deleted, the element to be expanded in the new target simulation object is expanded to obtain an expanded element, wherein the expanded element includes the element to be deleted; According to the externally expanded element, the to-be-deleted element in the new target simulation object is deleted to obtain an updated new target simulation object.

10. The image processing method according to claim 9, It is characterized in that The step of deleting the to-be-deleted element in the new target simulation object according to the externally-expanded element to obtain an updated new target simulation object includes: Determine the color information of the expanded element based on the color information of the element to be expanded and the color information of the element to be deleted; Determining a reference position corresponding to the outward expansion element from the original object; Determining element retention information of the outward-expanding element according to the color information of the reference part and the color information of the outward-expanding element; According to the element retention information of the externally expanded element, the to-be-deleted element in the new target simulation object is deleted to obtain an updated new target simulation object.

11. The image processing method according to any one of claims 1 to 10, It is characterized in that Also includes: Acquire an element list of elements constituting the target simulation object and a data format to be transferred into the scene, wherein the element list includes element parameters of each element constituting the target simulation object; According to the data format, performing format conversion processing on the element parameters of each element in the element list to obtain an updated element list; The updated element list is sent to the scene to be transferred to, so as to present a virtual object composed of the elements in the updated element list in the scene to be transferred to.

12. An image processing device, It is characterized in that include: an acquisition unit, configured to acquire an original object in an image, and a plurality of simulated objects corresponding to the original object, each simulated object being an object obtained by reproducing the original object using a reference element, the reference elements in different simulated objects being arranged in different ways, the reference element being determined according to a type corresponding to a designated element, and a subclass of the reference element including the designated element; A difference determination unit, used to determine difference information between each simulated object and the original object at the same part; a part determination unit, configured to determine, for each part corresponding to each part between the original object and each simulated object, a target part corresponding to each part from among the multiple simulated objects according to the difference information; A part combining unit, used for combining target parts corresponding to the various parts to obtain a target simulation object; The object conversion unit is used to perform element conversion processing on the reference elements constituting the target simulation object based on the specified elements to obtain a new target simulation object, wherein the new target simulation object is an object obtained by reproducing the original object using the specified elements.

13. An electronic device, It is characterized in that It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the image processing method according to any one of claims 1 to 11.

14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores instructions, and the instructions are suitable for a processor to load to execute the steps in the image processing method according to any one of claims 1 to 11.

15. A computer program product comprising instructions, It is characterized in that When the instructions are executed by the processor, the steps in the image processing method according to any one of claims 1 to 11 are implemented.