Image processing method, device, storage medium and electronic device
By performing super-resolution processing and foreground background separation on low-resolution images, combining the processing of background fusion parameters and foreground fusion parameters, the problems of texture loss and artistic style change in animation images or videos in super-resolution processing are solved, and clearness is achieved Improvement and style retention.
Patent Information
- Application Number
- CN202210387277.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-04-13
AI Technical Summary
Existing super-resolution algorithms can easily lead to texture loss and artistic style changes when processing cartoon images or videos, and cannot effectively retain the artistic style of the original image.
After obtaining low-resolution images for super-resolution processing, the foreground background separation is performed, and each area is fused according to the background fusion parameters and foreground fusion parameters to ensure that the artistic style of the original image is retained while improving the image clarity.
It realizes the artistic style of retaining the original image while enhancing the sharpness of the image, improving the texture retention effect and user viewing of the image.
Smart Images

Figure CN114972020B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular, to an image processing method, device, storage medium, and electronic device. Background Art
[0002] Super-resolution algorithms are used to upgrade low-resolution images to high-resolution, enhance image clarity, and eliminate blur. Due to limitations of shooting equipment, images or videos taken earlier have problems such as blurry images, high noise, and low resolution. Super-resolution algorithms can be used to process images or videos taken earlier to obtain high-resolution images or videos.
[0003] However, since some images / videos have unique styles and strong artistic sense, such as animation images or videos, different animations can have different styles. When using the same super-resolution algorithm to process different types of images / videos, there is a problem of texture loss and change in the artistic style of the original image / video. Summary of the invention
[0004] The embodiments of the present disclosure provide an image processing method, device, storage medium, and electronic device to achieve the goal of enhancing the clarity of an image while retaining the artistic style of the original image.
[0005] In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
[0006] Acquire a low-resolution original image, and perform super-resolution processing on the original image to obtain an initial super-resolution image;
[0007] Separating the foreground and background of the original image and the initial super-resolution image respectively to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image;
[0008] Based on the background fusion parameters and the foreground fusion parameters, the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area are fused to obtain a super-resolution image.
[0009] In a second aspect, the present disclosure also provides an image processing device, including:
[0010] A super-resolution processing module is used to obtain a low-resolution original image and perform super-resolution processing on the original image to obtain an initial super-resolution image;
[0011] An image separation module is used to perform foreground and background separation on the original image and the initial super-resolution image, respectively, to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image;
[0012] The regional fusion module is used to fuse the original foreground region, the original background region, the super-resolution foreground region and the super-resolution background region based on the background fusion parameter and the foreground fusion parameter to obtain a super-resolution image.
[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any one of the embodiments of the present disclosure.
[0017] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the image processing method as described in any one of the embodiments of the present disclosure.
[0018] The technical solution of the disclosed embodiment acquires a low-resolution original image, performs super-resolution processing on the low-resolution original image to obtain an initial super-resolution image, thereby achieving image clarity enhancement; further, the foreground and background are separated from the original image and the initial super-resolution image, respectively, to obtain the original foreground area and the original background area of the original image, and the super-resolution foreground area and the super-resolution background area of the initial super-resolution image, and the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area are fused according to background fusion parameters and foreground fusion parameters, thereby achieving separate fusion processing of the foreground area and the background area, so that the artistic style of the original image is retained while the image clarity is enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of an image processing method provided by an embodiment of the present disclosure;
[0022] Figure 3 is a flowchart of an image processing method provided by an embodiment of the present disclosure;
[0023] Figure 4 is a flowchart of an image processing method provided by an embodiment of the present disclosure;
[0024] Figure 5 is a structural schematic diagram of an image processing device provided by an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0028] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0031] Figure 1 This is a flow chart of an image processing method provided in an embodiment of the present disclosure. The embodiment of the present disclosure is suitable for performing super-resolution post-processing in images or videos. The method can be executed by an image processing device provided in an embodiment of the present disclosure. The image processing device can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal or a PC, etc.
[0032] like Figure 1 , the method of this embodiment includes:
[0033] S110 , obtaining a low-resolution original image, and performing super-resolution processing on the original image to obtain an initial super-resolution image.
[0034] S120, performing foreground and background separation on the original image and the initial super-resolution image respectively to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image.
[0035] S130 , based on the background fusion parameter and the foreground fusion parameter, the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area are fused to obtain a super-resolution image.
[0036] In this embodiment, the low-resolution original image refers to an image with a lower image resolution, that is, an image with unclear image quality, such as a picture in a video with a resolution of 360P, 480P, 720P, etc.
[0037] Specifically, the low-resolution original image can be obtained from the storage location of the electronic device or other devices. The low-resolution original image can be one or more video frames extracted from a video, and the video can be a low-resolution animation video, a painting teaching video, etc.; it can also be a separately stored picture, which is not limited here.
[0038] In this embodiment, super-resolution processing refers to an algorithm for converting a low-resolution image into a high-resolution image. In other words, through super-resolution processing, a low-resolution original image can be converted into a high-resolution initial super-resolution image. It can be understood that the resolution of the initial super-resolution image is greater than the resolution of the original image, and the image quality is relatively clear.
[0039] In some embodiments, the super-resolution processing algorithm may be an image super-resolution algorithm based on difference, and the interpolation algorithm includes but is not limited to the nearest neighbor method, bilinear interpolation method, cubic interpolation method, etc.; in some embodiments, the super-resolution processing algorithm may also be an image super-resolution algorithm based on reconstruction, and the reconstruction algorithm includes but is not limited to the convex set projection method, Bayesian analysis method, etc. This embodiment does not limit the method of the super-resolution processing algorithm.
[0040] After obtaining the initial super-resolution image, in order to solve the problem of texture loss and artistic style change of the initial super-resolution image, this embodiment separates the foreground and background of the original image and the initial super-resolution image, and fuses the foreground and background separation results of the original image and the initial super-resolution image to obtain a super-resolution image with enhanced clarity and texture retaining the artistic style of the original image.
[0041] In this embodiment, foreground and background separation refers to separating the foreground and background of an image to obtain a foreground area and a background area of the image, wherein the foreground area may include at least one target subject, and the background area may be a portion of the image other than the target subject. For example, the target subject may be a person, a pet, a cartoon character, etc., which is not limited here.
[0042] Specifically, the original image and the initial super-resolution image can be respectively input into the image separation network model, and the target subject in the original image and the initial super-resolution image can be identified through the image separation network model, and the original image can be segmented into an original background area and an original foreground area containing the target subject, and the initial super-resolution image can be segmented into a super-resolution background area and a super-resolution foreground area containing the target subject, so as to achieve separate processing of the image foreground area and the background area. Among them, the image separation network model can be a neural network model, and the network architecture of the image separation network model is not limited here, such as U-Net, ResNet, etc.
[0043] Furthermore, after obtaining the foreground and background separation results of the original image and the initial super-resolution image, the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area can be fused according to the background fusion parameters and the foreground fusion parameters to obtain a super-resolution image.
[0044] Among them, the foreground fusion parameter refers to the adjustable parameter used for foreground area fusion, that is, the foreground fusion parameter can be used to fuse the original foreground area and the super-resolution foreground area to enhance the clarity of the foreground area. The background fusion parameter refers to the adjustable parameter used for background area fusion, that is, the background fusion parameter can be used to fuse the original background area and the super-resolution background area to make the texture of the background area retain the artistic style of the original image.
[0045] Specifically, the fusion process includes foreground fusion, background fusion and foreground-background splicing. In other words, after the fusion of the original background area and the super-resolution background area is completed according to the background fusion parameters, and the fusion of the original foreground area and the super-resolution foreground area is completed according to the foreground fusion parameters, the foreground fusion result and the background fusion result are spliced to obtain a complete super-resolution image, in which the foreground area is clear and the texture of the background area retains the artistic style of the original image, which improves the user's viewing experience.
[0046] The technical solution of the disclosed embodiment acquires a low-resolution original image, performs super-resolution processing on the low-resolution original image to obtain an initial super-resolution image, thereby achieving image clarity enhancement; further, performs foreground and background separation on the original image and the initial super-resolution image, respectively, to obtain an original foreground area and an original background area of the original image, and a super-resolution foreground area and a super-resolution background area of the initial super-resolution image; based on background fusion parameters and foreground fusion parameters, the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area are fused to obtain a super-resolution image, thereby achieving separate fusion processing of the foreground area and the background area, so that the artistic style of the original image is retained while enhancing the image clarity.
[0047] refer to Figure 2 , Figure 2 A flowchart of an image processing method provided in an embodiment of the present disclosure, wherein the method of this embodiment can be combined with the various optional schemes in the image processing method provided in the above-mentioned embodiment. The image processing method provided in this embodiment is further optimized. Optionally, the foreground and background separation of the original image and the initial super-resolution image respectively comprises: performing semantic segmentation and edge detection on the original image to obtain a mask image for separating the foreground and background of the original image; and separating the foreground and background of the original image and the initial super-resolution image based on the mask image.
[0048] like Figure 2 , the method of this embodiment includes:
[0049] S210: Acquire a low-resolution original image, and perform super-resolution processing on the original image to obtain an initial super-resolution image.
[0050] S220 , performing semantic segmentation and edge detection on the original image to obtain a mask image for separating the foreground and background of the original image.
[0051] S230, performing foreground and background separation on the original image and the initial super-resolution image based on the mask image to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image.
[0052] S240 , based on the background fusion parameter and the foreground fusion parameter, the original foreground region, the original background region, the super-resolution foreground region and the super-resolution background region are fused to obtain a super-resolution image.
[0053] In this embodiment, a binary mask image can be obtained by performing semantic segmentation on the original image. The binary mask image is a mask image with a rough contour. In order to obtain a mask image with a fine contour shape, the binary mask image can be further edge detected to detect the edge position of the target object. A mask image with a fine contour shape can be determined based on the edge position of the target object. Then, the foreground and background of the original image and the initial super-resolution image can be separated based on the mask image with the fine contour shape to improve the separation accuracy of the image foreground and background and retain more texture.
[0054] Exemplarily, the original image can be semantically segmented by a semantic segmentation network model, which can be a neural network model. The network architecture of the semantic segmentation network model is not limited here, such as U-Net, ResNet, etc. After the original image is semantically segmented, the obtained binary mask image is subjected to canny edge detection to obtain a high-precision mask image. The high-precision mask image can be used to separate the foreground and background of the original image to improve the separation accuracy of the image foreground and background.
[0055] On the basis of the above embodiments, the foreground and background separation of the original image and the initial super-resolution image based on the mask map includes: upsampling the original image and the mask map to obtain an upsampled image and an upsampled mask map, wherein the upsampled image, the upsampled mask map and the initial super-resolution image have the same resolution; and separating the foreground and background of the upsampled image and the initial super-resolution image based on the upsampled mask map.
[0056] In this embodiment, through upsampling processing, the resolution of the original image and the mask image is adjusted to the same resolution as the initial super-resolution image, so that the upsampled mask image can accurately separate the foreground and background of the upsampled image and the initial super-resolution image of the same resolution, thereby improving the accuracy of foreground and background separation.
[0057] Optionally, the foreground fusion parameter and the background fusion parameter may be intensity parameters, and the parameter value range is between 0 and 1, that is, the foreground fusion parameter is the foreground edge intensity, and the background fusion parameter is the background intensity.
[0058] Exemplarily, the fusion formula of super-resolution image is as follows:
[0059] Super-resolution image = a×fr+A×(1-fr)+b×br+B×(1-br)
[0060] Among them, fr represents the foreground fusion parameter, br represents the background fusion parameter, a represents the original foreground area, b represents the original background area, A represents the super-resolution foreground area, and B represents the super-resolution background area.
[0061] The technical solution of the disclosed embodiment performs semantic segmentation and edge detection on the original image to obtain a mask image with a fine contour shape, and then separates the foreground and background of the original image and the initial super-resolution image according to the mask image with the fine contour shape, thereby improving the separation accuracy of the image foreground and background and retaining more texture.
[0062] refer to Figure 3 , Figure 3 A flow chart of an image processing method provided for an embodiment of the present disclosure, wherein the method of this embodiment can be combined with the various optional schemes in the image processing method provided in the above-mentioned embodiments. The image processing method provided in this embodiment is further optimized. Optionally, after obtaining the super-resolution image, the method further includes: identifying the target object area in the original image; when the target object area is the background target object area, upsampling the background target object area in the original image, and then fusing it with the corresponding fused target object area in the super-resolution image to obtain a target super-resolution image.
[0063] like Figure 3 , the method of this embodiment includes:
[0064] S310: Acquire a low-resolution original image, and perform super-resolution processing on the original image to obtain an initial super-resolution image.
[0065] S320, performing foreground and background separation on the original image and the initial super-resolution image respectively to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image.
[0066] S330 , based on the background fusion parameter and the foreground fusion parameter, the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area are fused to obtain a super-resolution image.
[0067] S340: Identify a target object region in the original image.
[0068] S350. When the target object region is a background target object region, upsample the background target object region in the original image and then fuse it with the corresponding fused target object region in the super-resolution image to obtain a target super-resolution image.
[0069] In this embodiment, the target object area refers to the area where the target object is located in the original image. For example, the target object may include a body part such as a face. The original image may include one or more target object areas. The target object area can be divided into a background target object area and a foreground target object area according to the distance of the picture. The background target object refers to the distant target object in the original image, and the foreground target object refers to the near target object in the original image.
[0070] Specifically, the target object can be identified by the target object detection algorithm to obtain one or more target object regions in the original image. The target object detection algorithm may include a recognition algorithm based on target object feature points, a recognition algorithm based on templates, and a recognition algorithm based on neural networks, etc., which are not limited in this embodiment.
[0071] Furthermore, in the case where the target object region is a background target object region, the background target object region in the original image can be upsampled so that the resolution of the background target object region in the original image is the same as that of the corresponding fused target object region in the super-resolution image, and the upsampled background target object region is fused with the corresponding fused target object region in the super-resolution image according to the target object fusion parameter, so that the background target object region in the obtained target super-resolution image maintains the original artistic style. The target object fusion parameter can be set according to experience and is used to adjust the clarity of the background target object region.
[0072] For example, the original image may be an anime image, in which the foreground face structure is clear and the background face is relatively blurred. If the foreground face and the background face in the same scene are enhanced in the same way, the hazy and blurred feeling of the face itself will be destroyed, and the artistic style of the original image cannot be preserved. In this embodiment, the background face area in the anime image may be upsampled, and the upsampled background face area may be fused with the corresponding fused face area in the super-resolution image to obtain an anime image that maintains the original artistic style.
[0073] It should be noted that the clarity of the background target object area in the target super-resolution image can be between the upsampled background target object area and the corresponding fused target object area in the super-resolution image. In other words, through the above fusion processing, the clarity of the background target object area is improved while maintaining the original artistic style.
[0074] Exemplarily, the fusion formula of the target super-resolution image is as follows:
[0075] Target super-resolution image = c×r+C×(1-r)
[0076] Among them, r represents the face fusion parameter, c represents the background face area in the upsampled original image, and C represents the corresponding fused face area in the super-resolution image.
[0077] Based on the above embodiments, after identifying the target object area in the original image, it also includes: determining the area ratio of the target object area in the original image, and when the area ratio is less than a preset perspective threshold, determining that the target object area is a background target object area.
[0078] Exemplarily, the area of the identified target object region can be determined according to the number of pixels in the target object region, and the overall area can be determined according to the number of pixels in the original image, and the two can be divided to obtain the area ratio of the target object region in the original image. If the area ratio is less than a preset distant view threshold, the target object region is determined as a background target object region; if the area ratio is greater than or equal to the preset distant view threshold, the target object region is determined as a foreground target object region, and the target object region is filtered. The preset distant view threshold can be set based on experience and is used to determine whether the identified target object region is a background target object region.
[0079] The technical solution of the disclosed embodiment, by identifying the target object area in the original image, when the target object area is the background target object area, can up-sample the background target object area in the original image, so that the resolution of the background target object area in the original image is the same as that of the corresponding fused target object area in the super-resolution image, and according to the target object fusion parameter, the up-sampled background target object area is fused with the corresponding fused target object area in the super-resolution image, so that the background target object area in the obtained target super-resolution image maintains the original artistic style, thereby improving the user's viewing experience.
[0080] refer to Figure 4 , Figure 4 The present invention provides a flowchart of an image processing method according to an embodiment of the present invention. The method according to this embodiment can be combined with the various optional schemes in the image processing method provided in the above-mentioned embodiment. The image processing method provided in this embodiment is further optimized. Optionally, the super-resolution processing of the original image to obtain an initial super-resolution image includes: determining an image clarity index of the original image, calling a super-resolution model of corresponding processing strength based on the image clarity index, and performing super-resolution processing on the original image based on the called super-resolution model.
[0081] like Figure 4 , the method of this embodiment includes:
[0082] S410: Acquire a low-resolution original image, determine an image clarity index of the original image, and call a super-resolution model of corresponding processing strength based on the image clarity index.
[0083] S420 , performing super-resolution processing on the original image based on the called super-resolution model to obtain an initial super-resolution image.
[0084] S430, performing foreground and background separation on the original image and the initial super-resolution image respectively to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image.
[0085] S440 , based on the background fusion parameter and the foreground fusion parameter, the original foreground region, the original background region, the super-resolution foreground region and the super-resolution background region are fused to obtain a super-resolution image.
[0086] In this embodiment, the image clarity index can be used to evaluate the image clarity. It is understandable that the higher the image clarity, the greater the value of the image clarity index. In order to prevent artifacts from being generated in the image, a super-resolution model of corresponding processing strength can be called according to the image clarity index to achieve adaptive matching of the super-resolution model. Further, the original image is super-resolution processed based on the adapted super-resolution model to improve the display effect of the initial super-resolution image.
[0087] Exemplarily, the super-resolution model can be a neural network model, and the training process of the super-resolution model includes: obtaining training data, the training data can include low-resolution original images and corresponding high-definition images, the low-resolution original images can be original images that have been blurred and downsampled, the types of blur processing include Gaussian isotropic and anisotropic blur, etc., and the downsampling types include bilinear interpolation, cubic linear interpolation and nearest neighbor difference. Further, the initial super-resolution model is trained based on the training data until the convergence condition is met to obtain a super-resolution model. Among them, the blur intensity of the blur processing can be determined by the Gaussian blur kernel size. The larger the blur kernel, the blurrier the corresponding training data, and the greater the strength of the trained super-resolution model.
[0088] Based on the above embodiments, before performing super-resolution processing on the original image to obtain an initial super-resolution image, the method also includes: determining an image evaluation index of the original image, calling at least one preprocessing model of corresponding intensity based on the image evaluation index, and preprocessing the original image based on the preprocessing model.
[0089] Among them, image evaluation indicators can be used to evaluate image quality, including but not limited to noise indicators and compression distortion indicators. The noise indicator is used to evaluate the noise level in the image, and the compression distortion indicator is used to evaluate the compression distortion level in the image. Correspondingly, the preprocessing model includes but is not limited to a denoising model and a compression model. It can be understood that the larger the value of the noise indicator, the greater the noise level in the original image, and the larger the compression distortion index, the greater the compression level of the original image.
[0090] Specifically, a denoising model of corresponding strength can be called according to the noise index. Denoising models of different strengths can be obtained by training the initial neural network model based on training data containing different noise levels. The greater the noise intensity of the training data, the greater the strength of the denoising model. In addition, a compression model of corresponding strength can be called according to the compression distortion index. Compression models of different strengths can be obtained by training the initial neural network model based on training data containing different compression degrees. The greater the compression degree of the training data, the greater the strength of the compression model.
[0091] The technical solution of the disclosed embodiment can call a super-resolution model of corresponding processing intensity according to the image clarity index to produce artifacts in the image, thereby realizing adaptive matching of the super-resolution model, and performing super-resolution processing on the original image based on the adapted super-resolution model to improve the display effect of the initial super-resolution image.
[0092] Figure 5 Schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure. Figure 5 As shown, the device comprises:
[0093] The super-resolution processing module 510 is used to obtain a low-resolution original image and perform super-resolution processing on the original image to obtain an initial super-resolution image;
[0094] An image separation module 520 is used to perform foreground and background separation on the original image and the initial super-resolution image, respectively, to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image;
[0095] The region fusion module 530 is used to fuse the original foreground region, the original background region, the super-resolution foreground region and the super-resolution background region based on the background fusion parameter and the foreground fusion parameter to obtain a super-resolution image.
[0096] In some optional implementations of the embodiments of the present disclosure, the image separation module 520 includes:
[0097] A mask image generating unit, used for performing semantic segmentation and edge detection on the original image to obtain a mask image for separating the foreground and background of the original image;
[0098] A foreground-background separation unit is used to perform foreground-background separation on the original image and the initial super-resolution image based on the mask image.
[0099] In some optional implementations of the embodiments of the present disclosure, the foreground-background separation unit is specifically used to:
[0100] Upsampling the original image and the mask image to obtain an upsampled image and an upsampled mask image, wherein the upsampled image, the upsampled mask image and the initial super-resolution image have the same resolution;
[0101] The foreground and background of the up-sampled image and the initial super-resolution image are separated based on the up-sampled mask image.
[0102] In some optional implementations of the embodiments of the present disclosure, the device further includes:
[0103] A target object recognition module, used to recognize a target object region in the original image;
[0104] The target object fusion module is used to, when the target object area is a background target object area, upsample the background target object area in the original image and then fuse it with the corresponding fused target object area in the super-resolution image to obtain a target super-resolution image.
[0105] In some optional implementations of the embodiments of the present disclosure, the device further includes:
[0106] The background target object region determination module is used to determine the area ratio of the target object region in the original image, and when the area ratio is less than a preset perspective threshold, determine that the target object region is a background target object region.
[0107] In some optional implementations of the embodiments of the present disclosure, the super-resolution processing module 510 is specifically configured to:
[0108] An image clarity index of the original image is determined, a super-resolution model of corresponding processing strength is called based on the image clarity index, and super-resolution processing is performed on the original image based on the called super-resolution model.
[0109] In some optional implementations of the embodiments of the present disclosure, the device further includes:
[0110] The image preprocessing module is used to determine the image evaluation index of the original image, call at least one preprocessing model of the corresponding intensity based on the image evaluation index, and preprocess the original image based on the preprocessing model.
[0111] The image processing device provided in the embodiments of the present disclosure can execute the image processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the image processing method.
[0112] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0113] Reference below Figure 6 , which shows an electronic device (eg, Figure 6 The terminal 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. Figure 6 The electronic 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.
[0114] like Figure 6 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0115] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0116] 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 non-transitory computer-readable medium, and the computer program contains 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 through the communication device 409, or installed from the storage device 408, or installed from the ROM402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0117] The electronic device provided by the embodiment of the present disclosure and the image processing method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0118] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the image processing method provided by the above embodiments is implemented.
[0119] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit 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 of the above.
[0120] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0121] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0122] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0123] Acquire a low-resolution original image, and perform super-resolution processing on the original image to obtain an initial super-resolution image;
[0124] Separating the foreground and background of the original image and the initial super-resolution image respectively to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image;
[0125] Based on the background fusion parameters and the foreground fusion parameters, the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area are fused to obtain a super-resolution image.
[0126] 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, but not limited to, 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 separate 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., through the Internet using an Internet service provider).
[0127] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0128] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit / module does not, in some cases, constitute a limitation on the unit itself.
[0129] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, 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 chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0130] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may 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 may 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.
[0131] According to one or more embodiments of the present disclosure, [Example 1] provides an image processing method, the method comprising:
[0132] Acquire a low-resolution original image, and perform super-resolution processing on the original image to obtain an initial super-resolution image;
[0133] Separating the foreground and background of the original image and the initial super-resolution image respectively to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image;
[0134] Based on the background fusion parameters and the foreground fusion parameters, the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area are fused to obtain a super-resolution image.
[0135] According to one or more embodiments of the present disclosure, [Example 2] provides an image processing method, further comprising:
[0136] Separating the foreground and background of the original image and the initial super-resolution image respectively includes:
[0137] Performing semantic segmentation and edge detection on the original image to obtain a mask image for separating the foreground and background of the original image;
[0138] The foreground and background of the original image and the initial super-resolution image are separated based on the mask image.
[0139] According to one or more embodiments of the present disclosure, [Example 3] provides an image processing method, further comprising:
[0140] The foreground and background separation of the original image and the initial super-resolution image is performed based on the mask image, comprising:
[0141] Upsampling the original image and the mask image to obtain an upsampled image and an upsampled mask image, wherein the upsampled image, the upsampled mask image and the initial super-resolution image have the same resolution;
[0142] The foreground and background of the up-sampled image and the initial super-resolution image are separated based on the up-sampled mask image.
[0143] According to one or more embodiments of the present disclosure, [Example 4] provides an image processing method, further comprising:
[0144] After obtaining the super-resolution image, the method further includes:
[0145] Identifying a target object region in the original image;
[0146] In the case where the target object region is a background target object region, after upsampling the background target object region in the original image, fusion processing is performed with the corresponding fusion target object region in the super-resolution image to obtain a target super-resolution image.
[0147] According to one or more embodiments of the present disclosure, [Example 5] provides an image processing method, further comprising:
[0148] After identifying the target object area in the original image, the method further includes:
[0149] The area ratio of the target object region in the original image is determined, and when the area ratio is less than a preset distant view threshold, the target object region is determined to be a background target object region.
[0150] According to one or more embodiments of the present disclosure, [Example 6] provides an image processing method, further comprising:
[0151] Performing super-resolution processing on the original image to obtain an initial super-resolution image includes:
[0152] An image clarity index of the original image is determined, a super-resolution model of corresponding processing strength is called based on the image clarity index, and super-resolution processing is performed on the original image based on the called super-resolution model.
[0153] According to one or more embodiments of the present disclosure, [Example 7] provides an image processing method, further comprising:
[0154] Before performing super-resolution processing on the original image to obtain an initial super-resolution image, the method further includes:
[0155] An image evaluation index of the original image is determined, at least one preprocessing model of corresponding intensity is called based on the image evaluation index, and the original image is preprocessed based on the preprocessing model.
[0156] According to one or more embodiments of the present disclosure, [Example 8] provides an image processing device, the device comprising:
[0157] A super-resolution processing module is used to obtain a low-resolution original image and perform super-resolution processing on the original image to obtain an initial super-resolution image;
[0158] An image separation module is used to perform foreground and background separation on the original image and the initial super-resolution image, respectively, to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image;
[0159] The regional fusion module is used to fuse the original foreground region, the original background region, the super-resolution foreground region and the super-resolution background region based on the background fusion parameter and the foreground fusion parameter to obtain a super-resolution image.
[0160] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0161] 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 are 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.
[0162] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An image processing method, characterized in that: include: Acquire a low-resolution original image, and perform super-resolution processing on the original image to obtain an initial super-resolution image; Separating the foreground and background of the original image and the initial super-resolution image respectively to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image; Based on the background fusion parameter and the foreground fusion parameter, the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area are fused to obtain a super-resolution image; The method of fusing the original foreground area, the original background area, the super-resolution foreground area and the super-resolution background area based on the background fusion parameters and the foreground fusion parameters to obtain a super-resolution image includes: completing the fusion of the original background area and the super-resolution background area according to the background fusion parameters to obtain a background fusion result, and completing the fusion of the original foreground area and the super-resolution foreground area according to the foreground fusion parameters to obtain a foreground fusion result; The foreground fusion result and the background fusion result are spliced to obtain a complete super-resolution image.
2. The method according to claim 1, characterized in that The foreground and background separation of the original image and the initial super-resolution image respectively includes: Performing semantic segmentation and edge detection on the original image to obtain a mask image for separating the foreground and background of the original image; The foreground and background of the original image and the initial super-resolution image are separated based on the mask image.
3. The method according to claim 2, characterized in that The performing foreground and background separation on the original image and the initial super-resolution image based on the mask image comprises: Upsampling the original image and the mask image to obtain an upsampled image and an upsampled mask image, wherein the upsampled image, the upsampled mask image and the initial super-resolution image have the same resolution; The foreground and background of the up-sampled image and the initial super-resolution image are separated based on the up-sampled mask image.
4. The method according to claim 1, characterized in that After obtaining the super-resolution image, the method further includes: Identifying a target object region in the original image; In the case where the target object region is a background target object region, after upsampling the background target object region in the original image, fusion processing is performed with the corresponding fusion target object region in the super-resolution image to obtain a target super-resolution image.
5. The method according to claim 4, characterized in that After identifying the target object area in the original image, the method further includes: The area ratio of the target object region in the original image is determined, and when the area ratio is less than a preset distant view threshold, the target object region is determined to be a background target object region.
6. The method according to claim 1, characterized in that The step of performing super-resolution processing on the original image to obtain an initial super-resolution image comprises: An image clarity index of the original image is determined, a super-resolution model of corresponding processing strength is called based on the image clarity index, and super-resolution processing is performed on the original image based on the called super-resolution model.
7. The method according to claim 1, characterized in that Before performing super-resolution processing on the original image to obtain an initial super-resolution image, the method further includes: An image evaluation index of the original image is determined, at least one preprocessing model of corresponding intensity is called based on the image evaluation index, and the original image is preprocessed based on the preprocessing model.
8. An image processing device, characterized in that: include: A super-resolution processing module is used to obtain a low-resolution original image and perform super-resolution processing on the original image to obtain an initial super-resolution image; An image separation module is used to perform foreground and background separation on the original image and the initial super-resolution image, respectively, to obtain an original foreground region and an original background region of the original image, and a super-resolution foreground region and a super-resolution background region of the initial super-resolution image; A regional fusion module is used to fuse the original foreground region, the original background region, the super-resolution foreground region and the super-resolution background region based on the background fusion parameter and the foreground fusion parameter to obtain a super-resolution image; The regional fusion module is specifically used to: complete the fusion of the original background region and the super-resolution background region according to the background fusion parameter to obtain a background fusion result, and complete the fusion of the original foreground region and the super-resolution foreground region according to the foreground fusion parameter to obtain a foreground fusion result; The foreground fusion result and the background fusion result are spliced to obtain a complete super-resolution image.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any one of claims 1 to 7.
10. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the image processing method according to any one of claims 1 to 7 when executed by a computer processor.
