Image processing method and device, and storage medium and program product
By designing the target area in the human image, the mask processing is performed, and the image processing model is used to generate the target image of different shapes of the characteristics, which solves the problem of the target regional deformation of the African target in existing technology, and improves the visual effects and characteristics of the image improvement ability. Essence
Patent Information
- Application Number
- PCT/CN2024/107665
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-25
- Filing Date
- 2024-07-25
- Publication Date
- 2025-01-30
AI Technical Summary
When the prior art beautifies human body images, it is easy to cause adjacent non-target areas to also deform, resulting in distortion of the picture and poor visual effects.
By designated the target area in the image to be processed, the mask processing is performed, a local mask image is generated, and the input image processing model is required to generate target images with different shape characteristics to avoid non -target regional deformation.
The visual effects of the target image after the processing are improved, the screen is avoided, and the richer image feature improvement is achieved.
Smart Images

Figure CN2024107665_30012025_PF_FP_ABST
Abstract
Description
Image processing method, device, storage medium and program product
[0001] This application claims priority to the Chinese invention patent application entitled “Image processing method, device, storage medium and program product” filed on July 25, 2023, with application number 202310921031X, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present disclosure relate to the field of artificial intelligence technology, and in particular to an image processing method, device, storage medium, and program product. Background Art
[0003] With the development of science and technology, people can perform various processing on images to obtain more satisfactory results. For example, people can beautify the body image.
[0004] In related technologies, a target area of a human body image can usually be deformed based on a deformation method. However, the deformation method easily causes deformation of adjacent non-target areas, resulting in image distortion and poor visual effects.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure provide an image processing method, device, storage medium, and program product to improve the visual effect of a processed target image.
[0007] In a first aspect, an embodiment of the present disclosure provides an image processing method, comprising: acquiring an image to be processed; determining a target area corresponding to a target part in the image to be processed; performing masking on the target area in the image to be processed to obtain a local mask image; inputting the local mask image into an image processing model to obtain a target image; the target part of the target image has different characteristics from the target part of the image to be processed.
[0008] In a second aspect, an embodiment of the present disclosure provides an image processing device, comprising: an acquisition module for acquiring an image to be processed; a determination module for determining a target area corresponding to a target part in the image to be processed; a processing module for performing masking on the target area in the image to be processed to obtain a local mask image; an input module for inputting the local mask image into an image processing model to obtain a target image; the shape features of the target image are different from the shape features of the image to be processed.
[0009] In a third aspect, an embodiment of the present disclosure provides an electronic device comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the image processing method described in the first aspect and various possible designs of the first aspect.
[0010] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the image processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0011] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the image processing method described in the first aspect and various possible designs of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] FIG1 is a schematic diagram of an application scenario of an image processing method provided by an embodiment of the present disclosure;
[0014] FIG2 is a flowchart of an image processing method according to an embodiment of the present disclosure;
[0015] FIG3 is a schematic diagram showing the distribution of contour points of a target object provided by an embodiment of the present disclosure;
[0016] FIG4a is a schematic diagram of an image to be processed provided by an embodiment of the present disclosure;
[0017] FIG4 b is a schematic diagram of a local mask image provided by an embodiment of the present disclosure;
[0018] FIG4c is a schematic diagram of a target image provided by an embodiment of the present disclosure;
[0019] FIG5 is a second flow chart of the image processing method provided by an embodiment of the present disclosure;
[0020] FIG6 is a structural block diagram of an image processing device provided by an embodiment of the present disclosure;
[0021] FIG7 is a schematic diagram of the hardware structure of the image processing device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0023] In the era of self-media, with the development of technology, users have higher and higher requirements for image effects, resulting in more and more image editing needs, such as the need to beautify human body images.
[0024] Related technologies typically use deformation methods to deform target areas of human images, for example, to make the waist curve more pronounced or the chest area more rounded. However, these methods can easily cause deformation of adjacent non-target areas, resulting in image distortion and poor visual effects. Furthermore, these methods can only achieve expansion or contraction effects, limiting their functionality.
[0025] In order to solve the above technical problems, the inventors of the present disclosure have discovered that it is possible to first delineate a target area in the image to be processed, and then regenerate an image of the target area based on demand. Specifically, the target area in the image to be processed can be blocked, and then based on the image processing model, a new image with different shape features can be generated in the blocked area to avoid deformation of the non-target area, so that the obtained target image has a better visual effect. In addition, generating a new image through the image processing model can improve image features from multiple directions and provide richer functions. Based on this, the embodiment of the present disclosure provides an image processing method.
[0026] Referring to Figure 1 , which illustrates an application scenario for the image processing method provided by an embodiment of the present disclosure, a terminal device 101 is in communication with a server 102. Terminal device 101 can be a computer, laptop, tablet, mobile phone, or other device. Server 102 can be a cloud server or a local server.
[0027] In a specific implementation process, the terminal device 101 can capture and obtain an image to be processed in response to a user's touch operation, and send the image to be processed to the server 102. The server 102 obtains the image to be processed, determines the target area corresponding to the target part in the image to be processed, performs mask processing on the target area in the image to be processed, obtains a local mask image, and inputs the local mask image into the image processing model to obtain a target image, wherein the mask area is a corresponding area determined based on the target area in the local mask image, and the shape features of the target image have different feature values from the shape features of the image to be processed. The image processing method provided in the embodiment of the present disclosure masks the target area in the image to be processed, and then generates a new image with different shape features in the masked area based on the image processing model, thereby avoiding deformation of the non-target area, so that the obtained target image has a better visual effect, and generating a new image through the image processing model can improve image features from multiple directions, and has richer functions.
[0028] It should be noted that the scenario diagram shown in Figure 1 is only an example. The image processing method and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided by the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the system and the emergence of new business scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.
[0029] Refer to Figure 2, which is a flowchart of an image processing method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device or a server, and the image processing method includes:
[0030] 201. Obtain an image to be processed.
[0031] The image to be processed may include a partial or full-body image of a human body.
[0032] 202. Determine a target area corresponding to the target part in the image to be processed.
[0033] The target part can be a body part with external physical features, such as the head, neck, arms, hands, chest, waist, abdominal muscles, and legs. The image within the target area includes the image of the target part. Of course, when the human body in the image to be processed is in different postures or wearing different clothing, the target part may be obscured. In this case, the image to be processed only contains the image of part of the target part, and the corresponding target area is the area containing the image of the part of the target part.
[0034] There are multiple ways to determine the target area. In one implementation, to improve computational efficiency, the target area can be directly identified through a deep learning network. In another implementation, to save computing power, the target object contour points of the human body in the image can be first identified. The target area can then be determined based on the target object contour points. In yet another implementation, to improve the accuracy of determining the target area while ensuring computational power savings, the target object contour points of the human body in the image can be first identified, and then an initial area can be determined based on the target object contour points, and then the target area can be determined based on the initial area.
[0035] In some embodiments, determining the target area corresponding to the target part in the image to be processed may include: identifying the image to be processed to obtain target object contour points; determining an initial area based on the target object contour points; and determining the target area where the target part is located based on the initial area.
[0036] Specifically, the image to be processed can be input into a deep learning model to identify and obtain the target object contour points of the human body in the image to be processed. After obtaining the target object contour points, based on the corresponding association relationship between each contour point and the body part, it can be determined whether the contour point corresponding to the target part exists in the image. If so, an initial region can be further determined based on the coordinates of the contour point. After determining the initial region, the initial region can be directly determined as the target region. The initial region can also be processed to obtain the target region, for example, the initial region can be dilated to ensure that the image corresponding to the target part is contained in the target region.
[0037] In some embodiments, determining the initial area based on the target object contour points may include: selecting target key points corresponding to the target part from the target object contour points based on the correspondence between the body part and the target object contour points; and determining the initial area based on the minimum circumscribed frame of the target key points.
[0038] In some embodiments, the minimum bounding box may be a polygonal box obtained by connecting the target key points, or may be a minimum bounding rectangular box corresponding to the target key points.
[0039] For example, as shown in FIG3 , the target object contour points may include contour points from 0 to 62, 63. The distribution of the contour points reflects the external contours of various body parts. For example, target object contour points 12, 13, 14, 44, 45, and 46 correspond to the chest, i.e., the target key points corresponding to the chest; target object contour points 18 to 22 and 25 to 29 correspond to the right leg, i.e., the target key points corresponding to the right leg. Taking the chest as an example, after determining the target key points 12, 13, 14, 44, 45, and 46 corresponding to the chest, the minimum bounding rectangle of the target key points 12, 13, 14, 44, 45, and 46 can be calculated, and the minimum bounding rectangle can be determined as the initial region.
[0040] In some embodiments, determining the target region where the target part is located based on the initial region may include: performing expansion processing on the initial region to obtain the target region where the target part is located.
[0041] Specifically, considering that the target object's contour points are only a few key points on the relatively sparse edge of the human body contour, the initial region determined by connecting these key points may not completely include the target part. For example, for the contour points of the hand region shown in Figure 3, the initial region determined based on 6 to 8 contour points may only include the palm portion of the hand region, while excluding the fingers. Therefore, in order to ensure that the target region contains all images related to the target part in the image to be processed, after determining the initial region, the initial region can be expanded, that is, expanded to expand the scope of the initial region, thereby obtaining a target region with a larger scope than the initial region.
[0042] There are many ways to expand the material, including horizontal expansion, vertical expansion, or expansion to the surrounding area at the same time.
[0043] In some embodiments, the initial area is expanded to obtain the target area where the target part is located, which may include: determining the extension direction of the target part; the existence of other body parts connected to the target part in the extension direction; and expanding the initial area in the extension direction to obtain the target area where the target part is located.
[0044] Specifically, when the set contour points are all the outermost contour points of the body, as shown in Figure 1, taking the chest as an example, contour points 12, 13, 14, 44, 45, and 46 are the contour points of the outermost edges on both sides of the chest. Therefore, in the horizontal direction, there is no situation where the image of the target part is incomplete. Then, it can be only in the vertical direction, that is, in the extension direction of other body parts connected to the target part. For example, the upper part of the chest is the shoulder and neck, and the lower part is the abdomen. Then, the direction from the chest to the shoulder and neck, and from the chest to the abdomen are both extension directions. Expansion can be performed in this extension direction. The expansion distance can be set according to actual conditions.
[0045] 203. Perform masking processing on the target area in the image to be processed to obtain a local mask image.
[0046] Specifically, after determining the target area in the image to be processed, the target area can be blocked. For example, the pixels in the target area can be set to a specific value, such as zero, and then a local mask image can be obtained. The difference between the mask image and the image to be processed lies in whether the target area is blocked.
[0047] In some embodiments, performing masking on the target area in the image to be processed to obtain a local mask image may include: setting pixel values in the target area in the image to be processed to black to obtain the local mask image.
[0048] For example, using the chest as the target area, Figure 4a is a schematic diagram of an image to be processed according to an embodiment of the present disclosure, Figure 4b is a schematic diagram of a local mask image according to an embodiment of the present disclosure, and Figure 4c is a schematic diagram of a target image according to an embodiment of the present disclosure. Figure 4a is an original image of a human body, in which the chest contour is poorly focused, as shown in Figure 4b. Therefore, the target area can be determined and the pixels within the target area are set to zero, i.e., black, to obtain a local mask image.
[0049] 204. Input the local mask image into an image processing model to obtain a target image; the target portion of the target image has different features from the target portion of the image to be processed.
[0050] Specifically, after obtaining a local mask image, the mask image can be input into a trained image processing model, and a target image with different shape features from the image to be processed can be obtained through the image processing model. Different shape features can be weakening or strengthening of a certain shape feature. The shape feature can be one or more. For example, the shape feature includes a first shape feature and a second shape feature. Then, the image processing model can simultaneously strengthen the first shape feature and weaken the second shape feature. Or both the first shape feature and the second shape feature can be strengthened at the same time. Taking the target part as the abdominal muscle as an example, the abdominal muscle texture of the first image in the image to be processed is not obvious, and the abdominal muscle texture of the second image generated after inputting the image processing model is more obvious. At the same time, the skin color of the abdominal muscles in the first image is light, and the skin color of the abdominal muscles in the second image is dark.
[0051] For example, as shown in FIG4c , after inputting the mask image shown in FIG4b into the image processing model, a target image as shown within the dashed box in FIG4c can be obtained. The dashed box indicates the masked area. The chest gathering effect in the second image of the chest generated within the dashed box is more pronounced than the chest gathering effect in the first image of the chest within the target area indicated by the dashed box in the unprocessed image to be processed shown in FIG4a . Of course, the above is merely an example. Conversely, the image processing model can be trained to weaken the chest gathering effect in the image to be processed. This depends on actual needs and is not limited in this embodiment.
[0052] From the above description, it can be seen that by blocking the target area in the image to be processed, and then generating a new image with different shape features in the blocked area based on the image processing model, deformation of the non-target area is avoided, so that the obtained target image has a better visual effect. In addition, generating a new image through the image processing model can improve image features from multiple directions and make the functions richer.
[0053] In some embodiments, step 204 may specifically include: inputting the local mask image into an image processing model, and generating an initial image through the image processing model; wherein the image in the area corresponding to the mask area in the local mask image in the initial image meets preset characteristics; based on the mask area, the initial image and the image to be processed are fused to obtain a fused target image.
[0054] Specifically, after generating the initial image, the image within the masked area of the image to be processed can be replaced with an image generated within the masked area that meets the preset characteristics, using the masked area as a boundary. For example, as shown in Figures 4a to 4c, based on the masked area shown in Figure 4b, the image corresponding to the masked area in Figure 4a can be replaced with an image generated within the masked area by the image processing model that meets the preset characteristics, thereby obtaining the fused target image shown in Figure 4c.
[0055] In some embodiments, before applying the image processing model, an image processing model with corresponding functions can be obtained by performing model training. Based on the embodiment of Figure 2 above, before step 204, the following steps may also be included: obtaining multiple image samples; the shape features of the image corresponding to the target part in the image sample have consistent feature values with the initial shape features; based on the multiple image samples, the model to be trained is iteratively trained until the loss function converges to obtain the image processing model; for each round of training, the image samples of the round are input into the model to be trained of the round, and the image samples are subjected to multiple denoising processes by the model to be trained to obtain the corresponding training images; the loss function is determined based on the shape features of the training image and the shape features of the image samples; and the parameters of the model to be trained are adjusted based on the loss function.
[0056] For example, taking the target body area as the chest and the adjustment requirement as enhancing the gathering effect of the chest, a plurality of human body images including the chest can be prepared as samples, and the degree of chest gathering in the plurality of samples is relatively high. The plurality of samples are sequentially input into the model to be trained so that the model to be trained learns the chest gathering features. In each round of training, multiple denoising processes are performed to obtain a generated training image. Based on the degree of chest gathering in the training image, it is judged whether the loss function determined based on the chest gathering features of the training image and the image sample converges. If not, the next sample can be input for the next round of training until the loss function converges, and the image processing model is obtained.
[0057] Referring to FIG5 , FIG5 is a second flow chart of the image processing method provided by an embodiment of the present disclosure. In this embodiment, an edge texture image of an image within a target area is added to make the image generated by the image processing model more realistic. The image processing method includes:
[0058] 501. Obtain an image to be processed.
[0059] 502. Determine a target area corresponding to the target part in the image to be processed.
[0060] 503. Perform masking processing on the target area in the image to be processed to obtain a local mask image.
[0061] Steps 501 to 503 in this embodiment are similar to steps 201 to 203 in the above embodiment, and are not described again here.
[0062] 504. Obtain an edge texture map of the target area.
[0063] 505. Input the local mask image into an image processing model, and generate an initial image through the image processing model; wherein, the image in the area of the initial image corresponding to the mask area in the local mask image meets the preset characteristics, and based on the mask area, the initial image and the image to be processed are fused to obtain a fused target image; the target part of the target image and the target part of the image to be processed have different characteristics.
[0064] Specifically, the image processing model usually introduces more features when generating an image. In order to improve the visual effect and avoid the inconsistency between the features introduced by the image processing model when generating the initial image and the original image to be processed, constraints can be performed based on the edge texture map corresponding to the target area. Therefore, after determining the target area in the image to be processed, edge texture recognition can be performed on the first image in the target area to obtain the edge texture map corresponding to the first image. After obtaining the edge texture image, after inputting the mask image into the image processing model, the image processing model can be subjected to multiple rounds of denoising, using the edge texture map as a constraint, so that the image corresponding to the target part generated by the image processing model in the mask area corresponding to the target area in the mask image conforms to the texture characteristics of the edge texture image, making the generated image more realistic.
[0065] For example, the chest image within the virtual box in Figure 4a includes the texture features of the bra. By using the edge texture image corresponding to the chest image as a constraint for denoising in the image processing model, the texture features of the bra can be retained in the generated initial image, thereby achieving better connection with the bra straps in the non-target area of the image to be processed, thereby improving the visual effect of the generated image.
[0066] In some embodiments, generating an initial image through the image processing model under the constraint of the edge texture map may include: generating an initial image through the image processing model using the edge texture map as a constraint in each denoising process of the image within the mask area in the local mask image.
[0067] Specifically, the denoising process of the image processing model has multiple rounds. In order to improve the accuracy, the constraint of the edge texture map can be added to each round of the denoising process.
[0068] From the above description, it can be seen that the image processing method provided by the embodiment of the present disclosure uses the edge texture map corresponding to the target area as a constraint in the denoising process of the image processing model, so as to generate a more realistic image of the target part in the target area.
[0069] Corresponding to the image processing method described in the preceding embodiment, FIG6 is a block diagram of the image processing device provided in an embodiment of the present disclosure. For ease of illustration, only the portions relevant to the embodiment of the present disclosure are shown. Referring to FIG6 , the device 60 includes an acquisition module 601, a determination module 602, a processing module 603, and an input module 604.
[0070] The acquisition module 601 is used to acquire the image to be processed.
[0071] The determination module 602 is configured to determine a target region corresponding to a target part in the image to be processed.
[0072] The processing module 603 is configured to perform masking on the target area in the image to be processed to obtain a local mask image.
[0073] The input module 604 is used to input the local mask image into the image processing model to obtain a target image; the shape features of the target image are different from the shape features of the image to be processed.
[0074] In some embodiments, the determination module 602 is specifically configured to: identify the image to be processed to obtain target object contour points; determine an initial region based on the target object contour points; and determine a target region where the target part is located based on the initial region.
[0075] In some embodiments, the determination module 602 is specifically used to: select target key points corresponding to the target part from the target object contour points according to the correspondence between the body part and the target object contour points; and determine the initial area according to the minimum bounding box of the target key points.
[0076] In some embodiments, the determination module 602 is specifically used to: determine the extension direction of the target part; whether there are other body parts connected to the target part in the extension direction; and expand the initial area in the extension direction to obtain the target area where the target part is located.
[0077] In some embodiments, the processing module 603 is specifically configured to black out pixel values within a target area in the image to be processed to obtain a local mask image.
[0078] In some embodiments, the acquisition module 601 is further used to: acquire an edge texture map of the target area; and the input module 604 is specifically used to: generate an initial image through the image processing model under the constraint of the edge texture map.
[0079] In some embodiments, the device 60 further includes a fusion module 604, which is configured to: fuse the initial image with the image to be processed based on the mask area to obtain a fused target image.
[0080] In some embodiments, the input module 604 is specifically configured to: generate an initial image by using the image processing model and taking the edge texture map as a constraint in each denoising process of the image within the masked area of the local mask image.
[0081] In some embodiments, the device 60 also includes a training module (not shown), which is used to obtain multiple image samples; the shape features of the image corresponding to the target part in the image sample have consistent feature values with the shape features of the target image; based on the multiple image samples, the to-be-trained model is iteratively trained until the loss function converges to obtain an image processing model; for each round of training, the image samples of the round are input into the to-be-trained model of the round, and the image samples are subjected to multiple denoising processes by the to-be-trained model to obtain corresponding training images; the loss function is determined based on the shape features of the training image and the shape features of the image sample; and the parameters of the to-be-trained model are adjusted based on the loss function.
[0082] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.
[0083] In order to implement the above embodiment, the embodiment of the present disclosure further provides an electronic device.
[0084] Referring to FIG7 , a schematic diagram of the structure of an electronic device 700 suitable for implementing an embodiment of the present disclosure is shown. The electronic device 700 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG7 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0085] As shown in FIG7 , the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the electronic device 700 are also stored in the RAM 703. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0086] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 7 shows an electronic device 700 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0087] 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 includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0088] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0089] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0090] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0091] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0092] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0093] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0094] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0095] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0096] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0097] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. An image processing method, comprising: Get the image to be processed; Determine a target area corresponding to a target part in the image to be processed; Performing mask processing on the target area in the image to be processed to obtain a local mask image; The local mask image is input into an image processing model to obtain a target image; the target part of the target image has different features from the target part of the image to be processed.
2. The method according to claim 1, wherein: The determining of the target area corresponding to the target part in the image to be processed includes: Identify the image to be processed to obtain contour points of the target object; Determine an initial area according to the target object contour points; A target region where the target part is located is determined according to the initial region.
3. The method according to claim 2, wherein: The step of determining the initial area according to the target object contour points includes: According to the correspondence between the body parts and the contour points of the target object, a target key point corresponding to the target part is selected from the contour points of the target object; An initial region is determined according to a minimum bounding box of the target key points.
4. The method according to claim 2, wherein: Determining the target area where the target part is located according to the initial area includes: Determine an extension direction of the target part; in the extension direction, there are other body parts connected to the target part; The initial area is expanded in the extension direction to obtain a target area where the target part is located.
5. The method according to claim 1, wherein: The step of performing mask processing on the target area in the image to be processed to obtain a local mask image includes: The pixel values in the target area of the image to be processed are set to black to obtain a local mask image.
6. The method according to any one of claims 1 to 5, wherein: The step of inputting the local mask image into an image processing model to obtain a target image comprises: The local mask image is input into an image processing model, and an initial image is generated by the image processing model; wherein the area in the initial image corresponding to the mask area in the local mask image The images in the image meet the preset characteristics; Based on the mask area, the initial image and the image to be processed are fused to obtain a fused target image.
7. The method according to claim 6, wherein: Before inputting the local mask image into the image processing model, the method further includes: Acquire an edge texture map of the target area; The generating an initial image by using the image processing model comprises: An initial image is generated through the image processing model under the constraint of the edge texture map.
8. The method according to claim 7, wherein: The generating of the initial image by the image processing model under the constraint of the edge texture map comprises: Through the image processing model, an initial image is generated by taking the edge texture map as a constraint in each denoising process of an image in a masked area of the local mask image.
9. The method according to any one of claims 1 to 5, wherein: The method of determining the image processing model includes: Acquire multiple image samples; the shape features of the image corresponding to the target part in the image samples have consistent feature values with the shape features of the target image; According to the plurality of image samples, iteratively train the model to be trained until the loss function converges to obtain an image processing model; Among them, for each round of training, the image samples of the round are input into the model to be trained of the round, and the image samples are subjected to multiple denoising processes by the model to be trained to obtain corresponding training images; the loss function is determined according to the shape features of the training image and the shape features of the image samples; and the parameters of the model to be trained are adjusted based on the loss function.
10. An image processing device, comprising: An acquisition module, used for acquiring an image to be processed; A determination module, used to determine a target area corresponding to a target part in the image to be processed; A processing module, used for performing mask processing on the target area in the image to be processed to obtain a local mask image; The input module is used to input the local mask image into the image processing model to obtain a target image; the shape features of the target image are different from the shape features of the image to be processed.
11. An electronic device, comprising: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the image processing method according to any one of claims 1 to 9.
12. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the image processing method according to any one of claims 1 to 9 is implemented.
13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the image processing method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Road image-based shelter coverage area filling method and device
CN111476213A
Image processing method, device and equipment and computer storage medium
CN111861863A
Image processing method and device, electronic equipment and readable storage medium
CN113066005A
Interactive image editing method, system, readable storage medium and electronic equipment
CN113487475A
Image processing method and device, model training method and device, body shaping processing method and device and storage medium
CN115082384A