Image processing method and device, computer equipment and storage medium
By meshing, beautifying and subdividing the image, the problem of excessive grid numbers affecting beautification efficiency is solved, and the balance of beautification efficiency and quality is achieved.
Patent Information
- Application Number
- CN202311182776.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2025-03-21
AI Technical Summary
In image beautification processing, too many grids will affect the beautification efficiency. How to improve the beautification efficiency while ensuring the beautification effect becomes a challenge.
By meshing the image to be processed, beautifying the image, then subdividing the beautified grid data to increase the number of grids, and image processing is performed based on the target grid data.
This method uses less grid data during beautification processing, which improves processing speed, while using more grid data during rendering, which improves image quality and achieves balance of beautification efficiency and quality.
Smart Images

Figure CN119672245A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an image processing method, apparatus, computer equipment and storage medium. Background Art
[0002] At present, when beautifying an image, the image is generally gridded and then beautified based on the grid, such as slimming, enlarging eyes, increasing height, etc. The number of grids in the gridding process will directly affect the beautification effect. However, when the number of grids in the gridding process is large, the beautification efficiency will be affected. Therefore, how to balance the beautification effect and beautification efficiency in the beautification process has become one of the issues that need to be paid attention to in the beautification process. Summary of the invention
[0003] The embodiments of the present disclosure at least provide an image processing method, apparatus, computer equipment, and storage medium.
[0004] In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
[0005] Acquire an image to be processed, perform gridding processing on the image to be processed, and obtain first grid data corresponding to the image to be processed;
[0006] beautify the first grid data corresponding to the image to be processed to obtain beautified second grid data;
[0007] Subdividing the second grid data to obtain target grid data; wherein the number of grids in the target grid data is greater than the number of grids in the first grid data;
[0008] Image processing is performed based on the target grid data to obtain a beautified target image corresponding to the image to be processed.
[0009] In a possible implementation manner, the mesh data includes position coordinates of mesh vertices and pixel values within the mesh; the mesh data includes the first mesh data, the second mesh data, and the target mesh data.
[0010] In a possible implementation manner, subdividing the second grid data to obtain target grid data includes:
[0011] Determine third grid data corresponding to the beautification area of the beautification process in the second grid data;
[0012] The third grid data is subdivided, and the subdivided third grid data and other grid data in the second grid data except the third grid data constitute the target grid data.
[0013] In a possible implementation manner, determining the third grid data corresponding to the beautified area of the beautification processing in the second grid data includes:
[0014] The first grid data and the second grid data are compared, and grid data in the second grid data that is different from the first grid data is used as the third grid data.
[0015] In a possible implementation manner, before subdividing the second grid data, the method further includes:
[0016] Determining a processing type of the beautification processing;
[0017] When the processing type is a deformation processing type, subdividing the second mesh data;
[0018] When the processing type is not the deformation processing type, image processing is performed based on the second grid data to obtain a target image after beautification processing corresponding to the image to be processed.
[0019] In a possible implementation manner, before determining the third grid data corresponding to the beautified area in the second grid data, the method further includes:
[0020] Determining a processing type of the beautification processing;
[0021] In a case where the processing type is a target deformation processing type, third mesh data corresponding to the beautification area of the beautification processing is determined in the second mesh data.
[0022] In a possible implementation manner, the gridding processing step, the beautification processing step and the subdivision processing step are executed by a central processing unit, and the image processing step is executed by a graphics processing unit.
[0023] In a second aspect, the present disclosure also provides an image processing device, including:
[0024] A gridding module, used for acquiring an image to be processed, performing gridding processing on the image to be processed, and obtaining first grid data corresponding to the image to be processed;
[0025] A beautification module, used for beautifying the first grid data corresponding to the image to be processed to obtain beautified second grid data;
[0026] A subdivision module, used for subdividing the second grid data to obtain target grid data; wherein the number of grids in the target grid data is greater than the number of grids in the first grid data;
[0027] The rendering module is used to perform image processing based on the target grid data to obtain a beautified target image corresponding to the image to be processed.
[0028] In a possible implementation manner, the mesh data includes position coordinates of mesh vertices and pixel values within the mesh; the mesh data includes the first mesh data, the second mesh data, and the target mesh data.
[0029] In a possible implementation manner, the subdivision module, when performing subdivision processing on the second grid data to obtain target grid data, is used to:
[0030] Determine third grid data corresponding to the beautification area of the beautification process in the second grid data;
[0031] The third grid data is subdivided, and the subdivided third grid data and other grid data in the second grid data except the third grid data constitute the target grid data.
[0032] In a possible implementation manner, the subdivision module, when determining the third grid data corresponding to the beautified area in the second grid data, is configured to:
[0033] The first grid data and the second grid data are compared, and grid data in the second grid data that is different from the first grid data is used as the third grid data.
[0034] In a possible implementation manner, before performing subdivision processing on the second grid data, the subdivision module is further configured to:
[0035] Determining a processing type of the beautification processing;
[0036] When the processing type is a deformation processing type, subdividing the second mesh data;
[0037] The rendering module is further used for:
[0038] When the processing type is not the deformation processing type, image processing is performed based on the second grid data to obtain a target image after beautification processing corresponding to the image to be processed.
[0039] In a possible implementation manner, before determining the third grid data corresponding to the beautified area in the beautified process in the second grid data, the subdivision module is further configured to:
[0040] Determining a processing type of the beautification processing;
[0041] In a case where the processing type is a target deformation processing type, third mesh data corresponding to the beautification area of the beautification processing is determined in the second mesh data.
[0042] In a possible implementation manner, the gridding processing step, the beautification processing step and the subdivision processing step are executed by a central processing unit, and the image processing step is executed by a graphics processing unit.
[0043] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0044] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.
[0045] In the image processing method, apparatus, computer equipment and storage medium provided by the embodiments of the present disclosure, after the image to be processed is gridded, beautification processing can be performed based on the first grid data, and then after the beautification processing is completed, the second grid data can be subdivided to increase the number of grids, and then image processing can be performed based on the target grid data. In this way, since the number of grids during beautification processing is less than the number of grids during image processing, the beautification efficiency and beautification quality can be balanced to improve the user experience.
[0046] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0048] Figure 1A flowchart of an image processing method provided by an embodiment of the present disclosure is shown;
[0049] Figure 2 A schematic diagram of an image processing device provided by an embodiment of the present disclosure is shown;
[0050] Figure 3 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0052] According to research, at present, when beautifying images, the images are generally processed into grids, and then beautified based on the grids, such as slimming, enlarging eyes, and increasing height. The number of grids in the grid processing will directly affect the beautification effect. However, when the number of grids in the grid processing is large, the beautification efficiency will be affected.
[0053] Taking body beautification (such as long legs, slimming, etc.) as an example, the implementation methods of body beautification in related technologies generally include the following two methods:
[0054] Method 1: Mesh processing is performed in the central processing unit (CPU) to obtain multiple mesh vertices, and then the body beautification process is performed in the graphics processing unit (GPU). This method is relatively simple to implement, but the GPU has a high computing pressure, and because the body beautification process is processed in the GPU, it is impossible to perform background distortion correction or smoothing on the whole.
[0055] Method 2: The mesh after deformation and beautification is calculated completely in the CPU, and the GPU only performs rendering operations based on the calculated mesh. This method has better control over deformation, and the mesh can be corrected or smoothed on the CPU, which has a larger operating space. However, the fineness of the beautification effect depends on the density of the mesh. If the density of the mesh is too high, it will increase the overall processing time.
[0056] Based on the above research, the present disclosure provides an image processing method, apparatus, computer equipment and storage medium, in which, after the image to be processed is gridded, beautification processing can be performed based on the first grid data, and then after the beautification processing is completed, the second grid data is subdivided to increase the number of grids, and then image processing is performed based on the target grid data. In this way, since the number of grids during beautification processing is smaller than the number of grids during image processing, the beautification efficiency and beautification quality can be balanced to improve the user experience.
[0057] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0058] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0059] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0060] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0061] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0062] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0063] To facilitate understanding of the present embodiment, an image processing method disclosed in the present embodiment is first introduced in detail. The execution subject of the image processing method provided in the present embodiment is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the image processing method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0064] See also Figure 1 FIG. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure, wherein the method includes steps 101 to 104, wherein:
[0065] Step 101: Acquire an image to be processed, perform gridding processing on the image to be processed, and obtain first grid data corresponding to the image to be processed.
[0066] Step 102: beautify the first grid data corresponding to the image to be processed to obtain beautified second grid data.
[0067] Step 103: Subdivide the second grid data to obtain target grid data; wherein the number of grids in the target grid data is greater than the number of grids in the first grid data.
[0068] Step 104: Perform image processing based on the target grid data to obtain a beautified target image corresponding to the image to be processed.
[0069] The following is a detailed description of the above steps.
[0070] For step 101,
[0071] The image to be processed may refer to an image to be beautified, and obtaining the image to be processed may refer to obtaining an image uploaded by a user, or obtaining an image taken by a user; or, in another possible implementation, the image to be processed may refer to a video frame in a video.
[0072] The first grid data may be grid data corresponding to a first number of grids, the first number may refer to a preset number, or the first number may be a number matching the size / content of the image to be processed.
[0073] Exemplarily, the image content of the image to be processed can be identified. When the image to be processed contains a human body, the first number can be a number that matches the human body; when the image to be processed does not contain a human body, the first number can be a preset value.
[0074] In a possible implementation, when the image to be processed is gridded, the image to be processed may be gridded according to the first quantity to obtain first grid data corresponding to the image to be processed; or, when the image to be processed is gridded, the image to be processed may be gridded according to a preset size to obtain first grid data corresponding to the image to be processed.
[0075] It should be noted that no matter which method is used to perform gridding processing on the image to be processed, after the image to be processed is gridded, the sizes of the grids can be the same.
[0076] The first grid data may include the position coordinates of the grid vertices and the pixel values within the grid. The data types included in the second grid data and the target grid data described below are the same, but the specific data values are different.
[0077] For step 102,
[0078] The beautifying the first grid data corresponding to the image to be processed may be equivalent to beautifying the image to be processed. Here, the beautifying the image to be processed may include a first beautifying process of the entire image to be processed, such as noise reduction, sharpening, etc.; or may include a second beautifying process of a part of the image to be processed, such as slimming, lengthening legs, etc.
[0079] In a possible implementation, the type of beautification processing to be performed on the image to be processed can be set by the user. When the user uploads / selects the image to be processed, the user can simultaneously set the type of beautification processing to be performed on the image to be processed. Alternatively, the type of beautification processing to be performed on the image to be processed can be determined after identifying the image to be processed. For example, a "smart beautification" function button can be provided on the user side. After the user triggers the "smart beautification" function button, the beautification processing process required for the image to be processed can be automatically identified.
[0080] Optionally, the beautifying processing of the first grid data corresponding to the image to be processed may refer to adjusting position information of each grid in the image to be processed, or changing pixel values in each grid in the image to be processed.
[0081] It should be noted that the sizes of the grids corresponding to the beautified second grid data may be different.
[0082] In another optional implementation, since some beautification processing may not require gridding processing, such as increasing image brightness, after acquiring the image to be processed and before gridding the image to be processed, the processing type of the beautification processing may be determined first. If the processing type of the beautification processing is a processing type that requires gridding processing, gridding is performed on the image to be processed, thereby avoiding redundant processing steps that increase the amount of calculation.
[0083] For step 103 and step 104,
[0084] Here, the purpose of subdividing the second grid data is to increase the number of grids. Exemplarily, the subdivision process can be performed using a Loop subdivision algorithm, a Catmull-Clark Subdivision algorithm, or the like.
[0085] The target grid data may be grid data corresponding to a second number of grids, where the second number may be a preset number, or the second number may be a number corresponding to the first number, for example, the second number may be N times the first number, where N is a preset value.
[0086] In another possible implementation, since the amount of target mesh data after subdivision processing is limited by the processing capability of the GPU, the second amount may be an amount related to the performance of the GPU. The higher the GPU performance, the larger the second amount may be, and the lower the GPU performance, the smaller the second amount may be.
[0087] Specifically, when determining the second number, the performance parameters of the GPU may be determined first, and then the second number may be determined based on the performance parameters (for example, the performance parameters may be M times the second number, where M is a preset positive integer).
[0088] Since the second grid data is subdivided and the purpose of increasing the number of grids is to improve the rendering effect and avoid poor effect after image deformation, therefore, if the beautification processing itself does not include image deformation, such as simply adding a filter to the image, in this case, there is no need to subdivide the second grid data, and rendering can be performed directly based on the second grid data.
[0089] Therefore, before performing subdivision processing on the second grid data, the processing type of the beautification processing can be determined first. If the processing type is a deformation processing type, the second grid data can be further subdivided. If the processing type is not the deformation processing type, image processing (the image processing mentioned here may refer to image rendering) can be performed directly based on the second grid data to obtain a beautified target image corresponding to the image to be processed.
[0090] The deformation processing type may refer to a processing type for beautifying the human body, such as slimming, heightening, thin arms, wide eyes, etc. The non-deformation processing type may refer to a processing type for beautifying the entire image, such as adding filters, noise reduction, etc.
[0091] In a possible implementation manner, when the second grid data is subdivided, all the second grid data may be subdivided.
[0092] In another possible implementation, since the beautification processing may not cause deformation to some background areas, in this case, the rendering effect of rendering these background areas using high-density mesh data is the same as the rendering effect of rendering using low-density mesh data. Therefore, there is no need to subdivide the mesh data of these background areas.
[0093] Specifically, when the second grid data is subdivided to obtain the target grid data, the third grid data corresponding to the beautification area of the beautification processing can be first determined in the second grid data, and then the third grid data is subdivided, and the subdivided third grid data and other grid data in the second grid data except the third grid data constitute the target grid data.
[0094] Optionally, when determining in the second grid data that the third grid data corresponds to the beautified area of the beautification processing, the first grid data and the second grid data can be compared, and the grid data in the second grid data that is different from the first grid data can be used as the third grid data.
[0095] Here, the grid data that is different from the first grid data may include grid data whose position coordinates are different from the first grid data, and / or grid data whose pixel values within the grid are different from the first grid data.
[0096] In another optional implementation, when determining the third grid data corresponding to the beautification area of the beautification processing in the second grid data, the beautification area of the beautification processing can be first determined based on the processing type of the beautification processing, and then the grid data corresponding to the beautification area in the second grid data can be used as the third grid data.
[0097] However, some beautification processes may also cause deformation of the background area. In this case, it is impossible to clearly distinguish which area has been beautified. Different areas need to be subdivided for different beautification processes.
[0098] In one possible implementation, when determining whether to perform subdivision processing on the second mesh data as a whole or to perform subdivision processing on part of the mesh data in the second mesh data, the processing type of the beautification processing can be determined first. When the processing type of the beautification processing is a target deformation processing type, the third mesh data in the second mesh data can be determined and the third mesh data can be subdivided. When the processing type of the beautification processing is not the target deformation processing type, the entire data of the second mesh data can be directly subdivided.
[0099] Among them, the target deformation processing type may be exemplarily a deformation-related processing type, such as slimming the whole body, growing taller, etc.; the non-target deformation processing type may be exemplarily a processing type such as big eyes, high nose bridge, etc.
[0100] It should be noted that the gridding processing step, the beautification processing step and the subdivision processing step are executed by the central processing unit, and the image processing step is executed by the graphics processing unit, that is, steps 101 to 103 are executed by the CPU, and step 104 is executed by the GPU. The image processing in step 104 may refer to image rendering.
[0101] In this way, when beautification processing is performed, beautification processing is performed based on a smaller number of grid data, which can improve the image processing speed. When the GPU renders the target image after beautification processing, it renders based on a larger number of grid data after subdivision processing, and the rendering effect is better. Therefore, the image processing speed and image processing effect can be balanced.
[0102] In a possible implementation, the second number may be a non-fixed number. After obtaining a beautified target image corresponding to the image to be processed, an aesthetic evaluation may be performed on the target image based on a pre-trained network model. If the aesthetic evaluation result does not meet the conditions, the value of the second number may be adjusted, and the second grid data may be re-subdivided, and the process may be repeated until the aesthetic evaluation result meets the conditions.
[0103] Among them, when the network model performs aesthetic evaluation on the target image, it can exemplarily combine multiple parameters such as the smoothness of the human body contour and the proportions between various body parts.
[0104] The image processing method provided by the embodiment of the present disclosure can, after gridding the image to be processed, perform beautification processing based on the first grid data, and then, after the beautification processing is completed, subdivide the second grid data to increase the number of grids, and then perform image processing based on the target grid data. In this way, since the number of grids during beautification processing is smaller than the number of grids during image processing, the beautification efficiency and beautification quality can be balanced to improve the user experience.
[0105] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0106] Based on the same inventive concept, an image processing device corresponding to the image processing method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned image processing method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0107] Reference Figure 2 , which is a schematic diagram of the architecture of an image processing device provided by an embodiment of the present disclosure, the device comprises: a gridding module 201, a beautification module 202, a subdivision module 203 and a rendering module 204; wherein,
[0108] The gridding module 201 is used to obtain an image to be processed, perform gridding processing on the image to be processed, and obtain first grid data corresponding to the image to be processed;
[0109] A beautification module 202 is used to beautify the first grid data corresponding to the image to be processed to obtain beautified second grid data;
[0110] A subdivision module 203 is used to perform subdivision processing on the second grid data to obtain target grid data; wherein the number of grids in the target grid data is greater than the number of grids in the first grid data;
[0111] The rendering module 204 is used to perform image processing based on the target grid data to obtain a beautified target image corresponding to the image to be processed.
[0112] In a possible implementation manner, the mesh data includes position coordinates of mesh vertices and pixel values within the mesh; the mesh data includes the first mesh data, the second mesh data, and the target mesh data.
[0113] In a possible implementation manner, the subdivision module 203, when performing subdivision processing on the second grid data to obtain target grid data, is used to:
[0114] Determine third grid data corresponding to the beautification area of the beautification process in the second grid data;
[0115] The third grid data is subdivided, and the subdivided third grid data and other grid data in the second grid data except the third grid data constitute the target grid data.
[0116] In a possible implementation manner, the subdivision module 203, when determining the third grid data corresponding to the beautified area in the second grid data, is configured to:
[0117] The first grid data and the second grid data are compared, and grid data in the second grid data that is different from the first grid data is used as the third grid data.
[0118] In a possible implementation manner, before performing subdivision processing on the second grid data, the subdivision module 203 is further configured to:
[0119] Determining a processing type of the beautification processing;
[0120] When the processing type is a deformation processing type, subdividing the second mesh data;
[0121] The rendering module 204 is further used for:
[0122] When the processing type is not the deformation processing type, image processing is performed based on the second grid data to obtain a target image after beautification processing corresponding to the image to be processed.
[0123] In a possible implementation manner, before determining the third grid data corresponding to the beautified area in the second grid data, the subdivision module 203 is further configured to:
[0124] Determining a processing type of the beautification processing;
[0125] In a case where the processing type is a target deformation processing type, third mesh data corresponding to the beautification area of the beautification processing is determined in the second mesh data.
[0126] In a possible implementation manner, the gridding processing step, the beautification processing step and the subdivision processing step are executed by a central processing unit, and the image processing step is executed by a graphics processing unit.
[0127] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0128] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 3 , which is a schematic diagram of the structure of a computer device 300 provided in an embodiment of the present disclosure. The computer device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters. Figure 3 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0129] like Figure 3 As shown, the computer device 300 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only storage device (ROM) 302 or a program loaded from a storage device 305 to a random access storage device (RAM) 303. In the RAM 303, various programs and data required for the operation of the computer device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0130] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the computer device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The computer device 300 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.
[0131] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the image processing method. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 309, or installed from a storage device 308, or installed from a ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0132] The present disclosure also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the image processing method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0133] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the image processing method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0134] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0135] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0136] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0138] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0139] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An image processing method, characterized in that: include: Acquire an image to be processed, perform gridding processing on the image to be processed, and obtain first grid data corresponding to the image to be processed; beautify the first grid data corresponding to the image to be processed to obtain beautified second grid data; Subdividing the second grid data to obtain target grid data; wherein the number of grids in the target grid data is greater than the number of grids in the first grid data; Image processing is performed based on the target grid data to obtain a beautified target image corresponding to the image to be processed.
2. The method according to claim 1, characterized in that The mesh data includes the position coordinates of mesh vertices and pixel values within the mesh; the mesh data includes the first mesh data, the second mesh data and the target mesh data.
3. The method according to claim 1, characterized in that Subdividing the second grid data to obtain target grid data includes: Determine third grid data corresponding to the beautification area of the beautification process in the second grid data; The third grid data is subdivided, and the subdivided third grid data and other grid data in the second grid data except the third grid data constitute the target grid data.
4. The method according to claim 3, characterized in that Determining third grid data corresponding to the beautified area of the beautification process in the second grid data includes: The first grid data and the second grid data are compared, and grid data in the second grid data that is different from the first grid data is used as the third grid data.
5. The method according to claim 1, characterized in that Before subdividing the second grid data, the method further includes: Determining a processing type of the beautification processing; When the processing type is a deformation processing type, performing subdivision processing on the second mesh data; When the processing type is not the deformation processing type, image processing is performed based on the second grid data to obtain a target image after beautification processing corresponding to the image to be processed.
6. The method according to claim 3, characterized in that Before determining the third grid data corresponding to the beautified area in the beautified process in the second grid data, the method further includes: Determining a processing type of the beautification processing; In a case where the processing type is a target deformation processing type, third mesh data corresponding to the beautification area of the beautification processing is determined in the second mesh data.
7. The method according to any one of claims 1 to 6, characterized in that: The gridding processing step, the beautification processing step and the subdivision processing step are executed by a central processing unit, and the image processing step is executed by a graphics processing unit.
8. An image processing device, characterized in that: include: A gridding module, used for acquiring an image to be processed, performing gridding processing on the image to be processed, and obtaining first grid data corresponding to the image to be processed; A beautification module, used for beautifying the first grid data corresponding to the image to be processed to obtain beautified second grid data; A subdivision module, used for subdividing the second grid data to obtain target grid data; wherein the number of grids in the target grid data is greater than the number of grids in the first grid data; The rendering module is used to perform image processing based on the target grid data to obtain a beautified target image corresponding to the image to be processed.
9. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the image processing method according to any one of claims 1 to 7 are performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 7 are executed.