Image processing method and device and related equipment

By using the reference image taken by the high-magnification lens to transfer details of the photos taken by the low-magnification lens, the problem of low definition and false texture of the photos taken by the low-magnification lens is solved, and higher clarity and stability are achieved.

CN118735792APending Publication Date: 2024-10-01HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310286514.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The clarity of portraits taken with low-magnification lenses is low. Existing algorithms rely on the correlation of image data sets, but are prone to pseudo-texture problems, resulting in limited clarity improvement and low stability.

Method used

By obtaining the second image captured by the high-magnification lens in the same scene as a reference, the first image captured by the low-magnification lens is processed based on the detail transfer strategy to improve the resolution of the target area and avoid pseudo-texture interference.

Benefits of technology

Improved the clarity and stability of portraits taken with low-magnification lenses, ensuring the quality and accuracy of image processing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735792A_ABST
    Figure CN118735792A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method and device and related equipment, and the method comprises the following steps: obtaining a first image and a second image, the first image and the second image are images obtained after the same scene is collected at the same moment, the first image region of the first image comprises the second image region of the second image, and the second image region of the second image comprises the first image region and the second image region; and then detail migration is performed on the target object in the first image based on the second image to obtain a third image, and the resolution of the target object in the image area in the third image is higher than the resolution of the target object outside the image area. The second image serving as the reference image can well provide related textures for the first image, pseudo textures cannot be generated, interference of an image processing result is avoided, and therefore the quality of the third image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence (AI), and in particular to an image processing method, apparatus and related equipment. Background Art

[0002] When users take pictures of a target object, if a high-magnification lens is used, the lens will be zoomed in, reducing the background information of the target object. If a low-magnification lens is used to shoot the target, more background information of the target object can be retained. However, due to the limitations of hardware imaging performance, the resolution of the image taken by a low-magnification lens is low, and algorithms are needed to improve the clarity of the original image.

[0003] However, when using algorithms to process original images taken with low-magnification lenses, textures or structures that match local areas of the original images are usually found in similar image data sets to enhance the details of the original images. The images in the image data set may be downloaded from the Internet, or they may be obtained after data expansion operations are performed on the original image data. The data expansion operations may include but are not limited to flipping, rotation, scaling, random extraction, color jitter, Gaussian noise, random blur, random erasure, etc., which makes this type of algorithm very dependent on the correlation between the expanded image data set and the original image. However, the image data in the image data set is prone to pseudo-textures that are unrelated to the original image, resulting in the algorithm's limited improvement in the clarity of the original image and low stability. Therefore, how to improve the clarity of portraits taken with low-magnification lenses is an urgent problem to be solved. Summary of the invention

[0004] The present application provides an image processing method, apparatus and related equipment for improving the portrait clarity of photos taken with a low-magnification lens.

[0005] In a first aspect, the present application provides an image processing method, which includes the following steps: acquiring a first image and a second image, the first image and the second image are images respectively acquired after capturing the same scene at the same time, a first image region of the first image includes a second image region of the second image, and performing detail migration of a target object in the first image based on the second image to acquire a third image, wherein the resolution within the image region where the target object is located in the third image is higher than the resolution outside the image region where the target object is located.

[0006] The above implementation method is implemented by acquiring a first image and a second image, wherein the first image and the second image are images respectively obtained after being captured at the same time for the same scene, and the first image area of ​​the first image includes the second image area of ​​the second image, and then the details of the target object in the first image are migrated based on the second image to obtain a third image, and the resolution in the image area where the target object is located in the third image is higher than the resolution outside the image area where the target object is located. Since the first image and the second image are images respectively obtained after being captured at the same time for the same scene, the first image and the second image generated in this way have a strong correlation, and the second image as a reference image can well provide relevant texture to the first image, and the second image does not have features that are irrelevant to the first image, and will not generate pseudo textures, thereby avoiding interference in the image processing results, thereby improving the quality of the third image, and having strong stability.

[0007] In one possible implementation, details of an object in a first image are migrated based on a second image. When obtaining a third image, object detection can be first performed on the second image to determine whether the second image includes the object in the first image. Then, if the second image includes the object, the object in the first image can be processed based on a migration strategy and an artificial intelligence (AI) model to obtain a third image.

[0008] By implementing the above-mentioned implementation method, using the above-mentioned migration strategy to select an appropriate method to migrate the details of the first image, a high-quality third image is obtained. The migration strategies are different in different situations, so that the solution provided in this application can meet most application scenarios and improve the universality and stability of the solution.

[0009] In one possible implementation, the migration strategy includes: when the second image completely includes the target object, performing target object detail detection on the first image to obtain a first detail detection result, performing target object detail detection on the second image to obtain a second detail detection result, performing key point matching between the first detail detection result and the second detail detection result to obtain a first matching result, the first matching result including the correspondence between the key points in the first detail detection result and the second detail detection result; inputting the first matching result and the first image into the AI ​​model to obtain a third image.

[0010] When the above-mentioned implementation method is implemented, when the second image completely includes the target object, the second image is used as a reference image to migrate the details of the first image. In this way, the second image as a reference image can provide better detail information for the first image, and the second image does not contain features irrelevant to the first image, and will not produce pseudo textures, thereby avoiding interference in the image processing results.

[0011] In one possible implementation, the migration strategy includes: when the second image partially includes the target object, filling the image area where the target object is located in the second image to obtain a fourth image; performing target object detail detection on the first image to obtain a first detail detection result, performing target object detail detection on the fourth image to obtain a third detail detection result, matching the first detail detection result with the third detail detection result for key points to obtain a second matching result, the second matching result including the correspondence between the key points in the first detail detection result and the third detail detection result; determining a migration area in the first image corresponding to the filled area in the fourth image based on the second matching result; and performing detail migration on the target object in the first image based on the similarity between the migration area and the filled area to obtain a third image.

[0012] By implementing the above implementation method, when the second image includes part of the target object, the second image is filled to obtain a fourth image, and the fourth image is used as a reference image to migrate the details of the first image. This can avoid the problem of poor accuracy of detail migration due to incomplete reference image. At the same time, the target objects in most scenes have a certain symmetry. Therefore, the fourth image obtained by operations such as mirroring, flipping, translation or symmetry can still retain the texture features of the target object, will not produce pseudo texture, and avoid interference in image processing results.

[0013] In one possible implementation, details of the target object in the first image are migrated according to the similarity between the migration area and the filling area to obtain the third image, which includes: when the similarity between the migration area and the filling area is higher than a first threshold, inputting the second matching result and the first image into the AI ​​model to obtain the third image.

[0014] When the above-mentioned implementation method is implemented, when the similarity between the filled area and the migrated area is higher than the first threshold, it means that the filled area has a high correlation with the first image. The fourth image obtained after filling the second image can provide better detail information for the first image. The area part of the fourth image with a similarity higher than the threshold is used to migrate the details of the first image, which will not generate pseudo texture and avoid interference in the image processing results.

[0015] In one possible implementation, the first image is divided into multiple first sub-regions, the filled area of ​​the fourth image is divided into multiple second sub-regions, and multiple similarities between the multiple first sub-regions and the multiple second sub-regions are determined, wherein each of the multiple similarities corresponds to a first sub-region and a second sub-region, and then the first sub-region corresponding to the similarity below the second threshold is input into the portrait super-resolution algorithm model to obtain the sixth image, the second sub-region corresponding to the similarity above the second threshold is matched with the first sub-region for key points to obtain a third matching result, the third matching result and the first sub-region are input into the AI ​​model to obtain a seventh image, and the third image is obtained based on the sixth image and the seventh image.

[0016] In the above implementation, the first image is divided into multiple sub-regions, and the migration strategy is determined according to the similarity between each sub-region and the corresponding filled region. The migration strategies of different sub-regions are the same or different. Sub-regions with higher similarity use the filled region as a reference image combined with the AI ​​model to migrate details of the sub-regions, while sub-regions with lower similarity do not use the filled region, and directly use the portrait super-resolution algorithm model to migrate details of the sub-regions. In this way, each sub-region can use a reasonable migration strategy to migrate details, thereby improving the quality of detail migration.

[0017] In a possible implementation, the method further includes the following steps: when the similarity between the migration area and the filling area is lower than a first threshold, applying a portrait super-resolution algorithm to the first image to obtain a fifth image.

[0018] In the implementation method described above, when the similarity between the filled area and the migrated area is lower than the first threshold, it means that the filled area has a low correlation with the first image. In this case, the filled area and the second image are not used as reference images, but the portrait super-resolution algorithm is used to migrate the details of the target object in the first image through the portrait super-resolution algorithm model to obtain the fifth image. This avoids using pseudo texture as a reference image to migrate the details of the first image and avoids interference in the image processing results.

[0019] In a possible implementation, the first image is an image taken by a first lens, the second image is an image taken by a second lens, the magnification of the first lens is lower than the magnification of the second lens, and the first lens and the second lens are both located on the same terminal device.

[0020] By implementing the above implementation, when the user uses the terminal device to shoot the target object, after the terminal device receives the user's instruction to trigger the shooting of the target object, the first lens and the second lens are called to shoot the target object to obtain the first image and the second image. That is to say, the user uses the low-magnification lens to shoot the first image while the high-magnification lens shoots the target object to obtain the second image, and then uses the above migration strategy to select a suitable method to migrate the details of the first image to obtain a high-quality third image, so that when the user uses the low-magnification lens to shoot the target object, there will be no problem of low clarity in the area where the target object is located, and when the user enlarges the low-magnification photo of the area where the target object is located, there will be no problem of blurring the area where the target object is located, thereby improving the user experience.

[0021] In a possible implementation, the migration strategy includes: when the second image does not include the target object, using a portrait super-resolution algorithm to enhance the details of the target object in the first image to obtain a fifth image.

[0022] When the above-mentioned implementation method is implemented, when the second image does not include the target object, the second image cannot be used as a reference image of the first image to transfer its details. Therefore, in this case, the portrait super-resolution algorithm is used according to the first image to enhance the details. This can avoid the situation where the second image that has no reference significance is used as a reference image for detail transfer, thereby improving the accuracy of the image processing method provided by the present application.

[0023] In a second aspect, the present application provides an image processing device, which includes: an acquisition unit, used to acquire a first image and a second image, the first image and the second image are images respectively obtained after capturing the same scene at the same time, and a first image area of ​​the first image includes a second image area of ​​the second image; a migration unit, used to migrate details of a target object in the first image based on the second image to obtain a third image, and the resolution in the image area where the target object is located in the third image is higher than the resolution outside the image area where the target object is located.

[0024] The second aspect or any implementation method of the second aspect is a step implementation of the device corresponding to the first aspect or any implementation method of the first aspect. The description in the first aspect or any implementation method of the first aspect is applicable to the second aspect or any implementation method of the second aspect and will not be repeated here.

[0025] In a third aspect, the present application provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster implements the method disclosed in the first aspect and any possible implementation manner of the first aspect.

[0026] In a fourth aspect, the present application provides a computer program product comprising instructions, which, when executed by a computing device cluster, enables the computing device cluster to implement the method disclosed in the first aspect and any possible implementation manner of the first aspect.

[0027] In a fifth aspect, the present application provides a computer-readable storage medium, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method disclosed in the first aspect and any possible implementation of the first aspect.

[0028] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a schematic diagram of the architecture of an image processing device provided by the present application;

[0030] Figure 2 It is a schematic diagram of the structure of the terminal device and the server provided by this application;

[0031] Figure 3 It is a schematic diagram of the steps of the image processing method provided by the present application;

[0032] Figure 4 is a schematic diagram of the steps of the migration strategy in the image processing method provided by the present application;

[0033] Figure 5 is an example diagram of a first image and a second image in the image processing method provided by the present application;

[0034] Figure 6 It is a structural schematic diagram of a computing device provided by the present application;

[0035] Figure 7 It is a structural diagram of a computing device cluster provided by this application. DETAILED DESCRIPTION

[0036] The technical solutions in the embodiments of the present invention will be described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] The terminal devices held by users, such as smart phones, often include multiple lenses with different magnifications to meet the users' various shooting needs. Among them, the photos taken by high-magnification lenses have high clarity, but because the lens needs to be zoomed in to shoot, the background information contained in the photos is too little. The photos taken by low-magnification lenses have low clarity, but can contain more background information. Therefore, when users shoot distant targets, they will use lenses with higher magnifications to zoom in on the target. However, when shooting nearby targets, using a high-magnification lens to zoom in on the target will result in only the target in the entire photo. In order to retain more background information, users will use lenses with lower magnifications to shoot the target. However, due to the limitations of hardware imaging performance, the clarity of photos taken by low-magnification lenses is low, so that the final photos may have blurred areas where the target is located, or when the user needs to zoom in on the area where the target is located, the clarity of the enlarged photos is too low to be used. Therefore, the clarity of photos taken by low-magnification lenses needs to be improved through algorithms.

[0038] However, when using algorithms to process original images taken with low-magnification lenses, textures or structures that match local areas of the original images are usually found in similar data sets to enhance the details of the original images. The data in the data set may be downloaded from the Internet, or may be obtained after data expansion based on the original image, which makes this type of algorithm very dependent on the correlation between the data set and the original image. However, the data in the data set is prone to pseudo-textures that are unrelated to the original image, resulting in limited improvement of the clarity of the original image by the algorithm and low stability. Therefore, how to improve the clarity of portraits taken with low-magnification lenses is an urgent problem to be solved.

[0039] In order to solve the above technical problems, the present application provides an image processing method, by acquiring a first image and a second image, wherein the first image and the second image are images respectively obtained after capturing the same scene at the same time, a first image area of ​​the first image includes a second image area of ​​the second image, and details of a target object in the first image are migrated based on the second image to obtain a third image, in which the resolution within the image area where the target object is located in the third image is higher than the resolution outside the image area where the target object is located.

[0040] It should be noted that the resolution here refers to the ability to distinguish the details of the original object being photographed. The details of adjacent objects can be distinguished and displayed in the image. It is usually used as an indicator to describe the clarity and accuracy of imaging equipment. Higher resolution means that the device can capture more details and finer images. For example, suppose the original object is a paper covered with many lines. There are 10 to 100 black lines in every 1 cm square area of ​​the paper. If the image taken by lens 1 can only recognize 10 lines, and the image taken by lens 2 can recognize 100 lines, then the "resolution" of lens 2 is higher than that of lens 1. The above examples are for illustration only and are not specifically limited in this application.

[0041] In the image processing method provided by the present application, since the first image and the second image are images respectively obtained after capturing the same scene at the same time, the first image and the second image generated in this way have a strong correlation. The second image can provide relevant texture to the first image well as a reference image, and will not generate pseudo texture, thereby avoiding interference in the image processing results, thereby improving the quality of the third image and having strong stability.

[0042] Based on the above image processing method, the present application further provides an image processing device based on the above image processing method, such as Figure 1 As shown, Figure 1 is a schematic diagram of the architecture of an image processing device provided by the present application, the image processing device includes a terminal device 100 ( Figure 1 Taking terminal device 100A, terminal device 100B and terminal device 100C as an example) and server 200, there is a communication connection between the terminal device 100 and the server 200, and the communication connection can be a wired connection or a wireless connection, which is not specifically limited in this application.

[0043] Among them, the terminal device 100 may be a smart phone, a handheld processing device, a tablet computer, a mobile notebook, an augmented reality (AR) device, a virtual reality (VR) device, an integrated handheld device, a wearable device, a vehicle-mounted device, a smart conference device, a smart advertising device, a smart home appliance, a robot, a smart vehicle, etc., which are deployed with one or more image sensors. It can also be a smart camera, which is not specifically limited here. Among them, one or more image sensors may include a camera, a camera, etc. It should be understood that the above-mentioned sensors are used for exemplary description and do not constitute specific limitations.

[0044] Optionally, the terminal device 100 may be equipped with a first sensor and a second sensor, such as Figure 1The terminal device 100A in the embodiment of the present invention is a terminal device 100A, wherein the definition of the image captured by the second sensor is higher than the definition of the image captured by the first sensor. For example, if the terminal device 100 is a smart phone, the first sensor may be a low-power lens, and the second sensor may be a high-power lens camera. It should be understood that the above examples are for illustration only and are not specifically limited in this application.

[0045] Optionally, the number of terminal devices 100 may be multiple, the first terminal device may be deployed with a first sensor, and the second terminal device may be deployed with a second sensor, for example Figure 1 The terminal device 100B and the terminal device 100C in the embodiment of the present invention are characterized in that the resolution of the image collected by the second sensor is higher than the resolution of the image collected by the first sensor, and the time and space of the images collected by the first terminal device and the second terminal device are synchronized. For example, two cameras with different magnifications deployed in the same area, such as a binocular imaging system in a smart car scene, etc., are not specifically limited in this application.

[0046] The server 200 may be a physical server, a virtual machine, a container, an edge computing device, etc., wherein a physical server may include but is not limited to an ARM server, an X86 server, etc.; a virtual machine refers to a complete computer system with complete hardware system functions implemented by network function virtualization (NFV) technology and simulated by software, running in a completely isolated environment; a container refers to a group of processes that are resource-constrained and isolated from each other. Multiple servers 200 may form a computer cluster, such as a centralized cluster or a distributed cluster, or a cloud data center, which is not specifically limited in this application. An edge computing device refers to a computing device that is close to the terminal device 100 and has computing power.

[0047] It should be understood that the deployment of the above-mentioned image processing device is very flexible and can be determined according to the application scenario and the computing power resources of the device. Figure 1 This is an exemplary implementation method, that is, the image processing device can be deployed on the end and cloud sides to implement the solution. Optionally, the above-mentioned image processing device can also be deployed only on the end side. The AI ​​model can be trained in the cloud environment and then sent to each terminal device 100. The intelligent analysis process of all image processing devices is fully implemented by the terminal device.

[0048] In order to make the present application more understandable, the image processing device is further explained below by taking cloud deployment as an example.

[0049] Furthermore, the terminal device 100 and the server 200 may be further divided into a plurality of unit modules, for example, Figure 2 As shown, Figure 21 is a schematic diagram of the structure of the terminal device and the server provided in the present application, wherein the terminal device 100 includes a first acquisition unit 110 and a second acquisition unit 120, and the server 200 (also referred to as an image processing device) includes an acquisition unit 210, a detection unit 220, a determination unit 230, and a migration unit 240. The migration unit 240 can be further divided into a first migration unit 250, a matching unit 260, a filling unit 270, and a second migration unit 280. It should be understood that Figure 2 This is an exemplary division method. The terminal device 100 and the server 200 may also include more or fewer units, which is not specifically limited in this application.

[0050] Among them, the first acquisition unit 110 of the terminal device 100 is used to acquire the first image, and the second acquisition unit 120 is used to acquire the second image, wherein the first image and the second image can be a single image or a video frame in a video, and the first image and the second image are images obtained after acquiring the same scene at the same time, and the first image area of ​​the first image includes the second image area of ​​the second image.

[0051] Optionally, the resolution of the second image is higher than the resolution of the first image.

[0052] Optionally, the above scene may include one or more targets, which may be human bodies, animals, objects, etc. The target may be determined according to the actual application scenario. For example, in the scene of taking travel photos of people, it is necessary to improve the clarity of human faces, so the target here may be human faces; in the scene of vehicle recognition, it is necessary to improve the clarity of the photographed vehicles, so the target here may be vehicles. It should be understood that the above examples are for illustration only and are not specifically limited in this application.

[0053] Optionally, the acquisition angle of the first image may be the same as or similar to the acquisition angle of the second image. It should be understood that the present application uses the second image to perform detail migration on the target object in the first image, so the higher the correlation between the first image and the second image, the better the detail migration effect, so the acquisition angle of the first image may be the same as or similar to the acquisition angle of the second image. For example, the first image and the second image may be photos taken by two lenses of the same camera, or the first image and the second image may be photos taken by two cameras in a binocular imaging device, which is not specifically limited in the present application.

[0054] Optionally, the first sensor and the second sensor are both lenses, and the lens magnification of the first sensor for collecting the first image is lower than the lens magnification of the second sensor for collecting the second image. For example, when the terminal device 100 is a smart phone, the first acquisition unit 110 can be a low-magnification lens of the smart phone, and the second acquisition unit 120 can be a high-magnification lens of the smart phone. The high-magnification lens here can be a telephoto lens (tele lens), such as a TELE-2X lens, a TELE-5X lens, etc., which is not specifically limited in this application. The first image can be obtained by shooting the target object using the 1X mode, and the second image can be obtained by magnifying and shooting the target object using the 2X mode. Among them, the 1X mode in the smart phone refers to the normal photo size mode, and the 2X mode refers to shortening the shooting distance, and the object is magnified to twice the original. The 1X mode can be shooting using a low-magnification lens, and the 2X mode can be shooting using a high-magnification lens. The above examples are for illustration and are not specifically limited in this application.

[0055] It should be noted that in the embodiment of the present application, the first image includes a complete image of the target object, and the second image may include a partial image of the target object, or may not include the target object.

[0056] It should be understood that Figure 2 So Figure 1 The terminal device 100A including the first sensor and the second sensor is taken as an example for illustration. In other possible implementations, the terminal device may include only the first acquisition unit 110, or only the second acquisition unit 120, for example Figure 1 The terminal device 100B and the terminal device 100C in the example are, that is, the terminal device 100B is deployed with a first sensor, and the terminal device 100C is deployed with a second sensor. For example, the terminal device 100B is a low-definition camera, and the terminal device 100C is a high-definition camera that shoots the same scene at the same time as the terminal device 100B. This application does not make specific limitations. It should be noted that in this application scenario, the terminal device 100B and the terminal device 100C need to be time synchronized so that the first image and the second image finally obtained are images obtained after capturing the same scene at the same time.

[0057] In order to make the present application more understandable, the following unified example is given in which the first acquisition unit 110 in the terminal device is implemented by a low-magnification lens, the second acquisition unit 120 is implemented by a high-magnification lens, and the target object is a portrait.

[0058] The acquisition unit 210 of the server 200 is used to acquire the above-mentioned first image and second image. The detection unit 220 is used to perform target detection on the first image to obtain a first detection result, and to perform target detection on the second image to obtain a second detection result, wherein the first detection result includes the position information of the target in the first image, and the second detection result includes the position information of the target in the second image. In a specific implementation, the above-mentioned position information may be expressed in a form including but not limited to a target detection frame, target coordinates, etc. The target detection frame is used to indicate the area of ​​the target in the image, and may specifically be a rectangular frame, a circular frame, an irregular shape frame, etc., which is not specifically limited in this application.

[0059] Among them, the detection unit 220 can perform target detection on the first image and the second image through a target detection method, and the target detection method may include but is not limited to a one-stage unified real-time target detection (You Only Look Once: Unified, Real-Time Object Detection, Yolo) model, a single shot multi-box detector (Single Shot multi box Detector, SSD) model, a regional convolutional neural network (Region Convolutional Neural Network, RCNN) model or a fast regional convolutional neural network (Fast Region Convolutional Neural Network, Fast-RCNN) model, etc., and may also include other types of target detection methods, which are not specifically limited in this application.

[0060] The determination unit 230 of the server 200 is used to determine whether the second image includes the target object in the first image according to the second detection result. If the second image does not include the target object, the first detection result can be sent to the first migration unit 250. If the second image includes the target object, the target object in the first image is processed based on the migration strategy and the AI ​​model to obtain a third image. Specifically, if the target object exists completely in the second image, the first detection result and the second detection result can be sent to the matching unit 260. If the target object exists partially in the second image, the second detection result can be sent to the filling unit 270.

[0061] The first migration unit 250 of the server 200 is used to migrate the details of the target object in the first image according to the first detection result of the first image when the second image does not include the target object, so as to enhance the image details of the target object and obtain a third image. The detail migration refers to enhancing the clarity of the first image, or it may be enhancing the clarity of the area where the target object is located in the first image, which is not specifically limited in this application. The third image has higher clarity and higher pixel density than the first image, and can provide more details.

[0062] In a specific implementation, the first migration unit 250 may input the first image into a portrait super-resolution algorithm model and output a fifth image. The portrait super-resolution algorithm model is obtained by training the portrait super-resolution algorithm network using a first sample set, wherein the first sample set includes a known first image and a corresponding known fifth image.

[0063] Among them, the third image is obtained by using the second image to migrate the details of the first image, and the fifth image is obtained based on the first image combined with the portrait super-resolution algorithm. The resolution of the target object in the fifth image is higher than the resolution outside the image area where the target object is located.

[0064] Optionally, the above-mentioned portrait super-resolution algorithm network can be obtained using a portrait super-resolution algorithm, and specifically can be created by a single image super resolution (SISR) algorithm. The above-mentioned SISR algorithm may include but is not limited to a deep face dictionary network (DFDNet), a generative facial prior-generative adversarial network (GFP-GAN), an enhanced super-resolution generative adversarial networks (ESRGAN) method, a GAN prior embedded network (GAN Prior Embedded Network, GPEN) method, etc., and this application does not make specific limitations.

[0065] The matching unit 260 of the server is used to perform target detail detection on the first image to obtain a first detail detection result when the second image includes a complete target object, perform target detail detection on the second image to obtain a second detail detection result, perform key point matching between the first detail detection result and the second detail detection result to obtain a first matching result, the first matching result including the correspondence between the key points in the first detail detection result and the second detail detection result, and finally the second migration unit 280 inputs the first matching result and the first image into the AI ​​model to obtain a third image.

[0066] It should be noted that the matching unit 260 can also determine the first matching result based on the first detection result and the second detection result. In other words, the first detection result and the second detection result of the detected target object are directly input into the key point matching model to obtain the first matching result between the two; or, the first image and the second image are first subjected to target object detail detection, and the target is detected as a key point in the first image and the second image, that is, the first detail detection result and the second detail detection result, and then they are input into the key point matching model to obtain the first matching result. The key point matching model can be trained according to actual business processing requirements, and this application does not make any specific limitations.

[0067] In a specific implementation, the above-mentioned first matching result includes the correspondence between the key points in the first detail detection result and the second detail detection result, and the key points with the corresponding relationship describe the same feature of the target object. For example, when the target object is a human face, the key points may include but are not limited to the key points of facial organs, the key points of the oriented fast and rotated brief (ORB) feature detection algorithm, etc., which are not specifically limited in this application. For example, assuming that the key point includes the left eye of the target person, the position of the left eye of the target person in the first image is the first coordinate, and the position of the left eye of the target person in the second image is the second coordinate, then the first matching result may include the correspondence between the first coordinate and the second coordinate. It should be understood that the above examples are for illustration and are not specifically limited in this application.

[0068] Optionally, the second migration unit 280 can input the first matching result and the first image into an AI model and output a third image, wherein the above-mentioned AI model is obtained after training the AI ​​network using a second sample set, wherein the second sample set includes input samples and labels, wherein the input samples are a known first image and a known first matching result, and the label is the corresponding known third image.

[0069] In a specific implementation, the above-mentioned AI network is created based on a super-resolution algorithm (reference based superresolution, RefSR) of a reference image. The above-mentioned RefSR algorithm can determine the similarity between the characteristic texture of the target object in the second image and the characteristic texture of the first image according to the first matching result, extract the characteristic texture with higher similarity from the second image and migrate it to the first image to fill in the details, thereby adaptively migrating the high-definition texture of the second image to the first image.

[0070] It should be understood that the RefSR algorithm uses the rich texture of the reference image to compensate for the lost details in the low-definition input image, and can produce more detailed and realistic textures, but the requirements for the reference image are high. If the correlation between the reference image and the input image is low, the reference image cannot provide relevant textures, and even pseudo textures may appear to affect the image processing results, resulting in limited performance of the RefSR algorithm. In the image processing device provided by the present application, the first sensor and the second sensor deployed on the terminal device 100 can capture images of the same scene at the same time, so that the generated first image and the second image have a strong correlation. The second image can provide relevant textures to the first image as a reference image, and the second image does not have features that are irrelevant to the first image, and will not produce pseudo textures, thereby avoiding interference in the image processing results.

[0071] Optionally, the above-mentioned RefSR algorithm may include but is not limited to a super-resolution by neural texture transfer (SRNTT) method, a Ref-SR method based on matching acceleration and spatial adaptation (MASA-SR) and the like, which is not specifically limited in this application.

[0072] The filling unit 270 of the server 200 is used to receive the first matching result and the second image sent by the determination unit 230 when the second image partially includes the target object, and fill the image area where the target object is located in the second image to obtain a fourth image.

[0073] Optionally, the filling unit 270 can fill the image area where the target object is located in the second image by mirroring, flipping, translating or symmetric operation according to the image area where the target object is located in the second image. The specific operation can be determined according to the type of the target object. For example, when the target object is a portrait, the image area where the target object is located can be filled by mirroring operation using the symmetry of the face. It should be understood that the above examples are for illustration and are not specifically limited in this application.

[0074] The filling unit 270 is also used to send the fourth image and the first image to the matching unit 260. The matching unit 260 performs target object detail detection on the first image to obtain a first detail detection result, performs target object detail detection on the fourth image to obtain a third detail detection result, performs key point matching on the first detail detection result and the third detail detection result to obtain a second matching result. The second matching result includes a correspondence between key points in the first detail detection result and the third detail detection result. A migration area in the first image corresponding to the filling area in the fourth image is determined according to the second matching result. The second migration unit 280 performs detail migration on the target object in the first image according to the similarity between the migration area and the filling area to obtain a third image.

[0075] In a specific implementation, the second matching result may include a correspondence between key points in the migration area in the first image and key points in the filling area in the fourth image, and the key points with a corresponding relationship describe the same feature of the target object. For details, please refer to the description of the first matching result in the foregoing content, which will not be repeated here.

[0076] In one embodiment, the second migration unit 280 may input the second matching result and the first image into an AI model and output a third image, wherein the AI ​​model may refer to the description of the aforementioned content and will not be repeated here.

[0077] Optionally, the second migration unit 280 can migrate details of the target object in the first image according to the similarity between the migration area and the filling area to obtain a third image. Specifically, when the similarity is higher than the first threshold, the second matching result and the first image are input into the AI ​​model to obtain the third image; when the similarity is lower than the first threshold, the portrait super-resolution algorithm is applied to the first image, in other words, the first image is input into the portrait super-resolution algorithm model to obtain the fifth image.

[0078] It is understandable that if the similarity between the filling area of ​​the fourth image and the migration area of ​​the first image is low, using the second image as the reference image to migrate the details of the target object in the first image may cause pseudo-texture problems, resulting in poor third image effects and failure to enhance the details of the target object in the first image. Therefore, in this case, the second image is not used as the reference image to enhance the first image, but the first image is input into the portrait super-resolution algorithm model, and the portrait super-resolution algorithm is used to migrate the details, which can avoid pseudo-texture interference with the migration of details of the target object in the first image.

[0079] Optionally, the second migration unit 280 may also divide the first image into multiple first sub-regions according to the local texture, and divide the filling area of ​​the fourth image into multiple second sub-regions according to the local texture, and then determine the similarity between each first sub-region and each second sub-region, input the first sub-region whose similarity is lower than the second threshold into the portrait super-resolution algorithm model to obtain the sixth image, match the first sub-region and the second sub-region whose similarity is higher than the second threshold to obtain a third matching result, input the third matching result and the first sub-region into the AI ​​model to obtain the seventh image, and finally combine the sixth image and the seventh image to determine the third image.

[0080] It can be understood that by searching for textures similar to the first image in the filled area, the textures with high similarity are migrated to the first image, and the areas with low similarity are not migrated, but the portrait super-resolution algorithm is used to enhance the details, thereby achieving adaptive texture migration. The filled area with low similarity may be a pseudo-texture. Not using the filled area with low similarity as a reference image to migrate the details of the target object in the first image can avoid the pseudo-texture from interfering with the final third image, and improve the detail migration effect of the target object in the first image.

[0081] In one embodiment, if there are multiple targets in the first image, the detection unit 220 may first detect each target in the first image and the second image, and then perform matching to determine the corresponding relationship between the same target in the first image and the second image, and then perform detail migration on the area where each target in the first image is located through the determination unit 230, the first migration unit 250, the matching unit 260, the filling unit 270, and the second migration unit 280. It should be noted that the detail migration may be performed for each target in sequence, or for multiple targets at the same time, or for some targets in sequence, or for some targets at the same time, which may be determined according to the application scenario and the processing capability of the image processing device, and is not specifically limited in this application.

[0082] In summary, the image processing device provided by the present application obtains a first image and a second image, wherein the first image and the second image are images respectively obtained after being collected at the same time for the same scene, and the first image area of ​​the first image includes the second image area of ​​the second image, and then the details of the target object in the first image are migrated based on the second image to obtain a third image, and the resolution in the image area where the target object is located in the third image is higher than the resolution outside the image area where the target object is located. Since the first image and the second image are images respectively obtained after being collected at the same time for the same scene, the first image and the second image have a strong correlation, and the second image as a reference image can well provide relevant texture to the first image, and the second image does not have features that are irrelevant to the first image, and will not generate pseudo textures, thereby avoiding interference in the image processing results, improving the quality of the third image, and having strong stability.

[0083] Figure 3 is a schematic diagram of the steps of the image processing method provided by the present application, which can be applied to Figure 1 and Figure 2 In the image processing device shown in Figure 3 As shown, the method may include the following steps:

[0084] Step S310: The terminal device uses the first sensor and the second sensor to capture the same scene at the same time to obtain a first image and a second image.

[0085] In a specific implementation, the first image and the second image are images respectively obtained after being captured at the same time for the same scene, and the first image area of ​​the first image includes the second image area of ​​the second image. Therefore, when the first image includes the target object, the second image may have three situations: the second image does not include the target object, the second image includes the complete target object, or the second image includes part of the target object.

[0086] Optionally, the acquisition angle of the first image may be the same as or similar to the acquisition angle of the second image. For example, the first image and the second image may be two photos taken by two lenses of the same camera, and the acquisition angles of the two photos are the same or similar; for another example, the first image and the second image are photos taken by two cameras in a binocular imaging device, and the acquisition angles of the two photos are the same or similar. The above examples are for illustration only and are not specifically limited in this application.

[0087] Optionally, the first sensor may be a first lens on the terminal device, the second sensor may be a second lens on the terminal device, the first image is an image taken by the first lens, the second image is an image taken by the second lens, and the lens magnification of the first lens is lower than the lens magnification of the second lens.

[0088] For example, when the terminal device 100 is a smart phone, the first sensor may be a low-magnification lens in the smart phone, and the second sensor may be a high-magnification lens in the smart phone. The high-magnification lens here may be a TELE lens, such as a TELE-2X lens, a TELE-5X lens, etc., and this application does not make specific limitations. The first image may be obtained by shooting the target object using the 1X mode, and the second image may be obtained by magnifying and shooting the target object using the 2X mode. Among them, the 1X mode in the smart phone refers to the normal photo size mode, and the 2X mode refers to shortening the shooting distance and magnifying the object to twice the original size. The 1X mode may be shooting with a low-magnification lens, and the 2X mode may be shooting with a high-magnification lens. The above examples are for illustration only and are not specifically limited in this application.

[0089] Simply put, when a user takes a photo of an object, if the user enables a low-magnification lens to take a photo of the object, the high-magnification lens will also be enabled at the same time to take a photo of the object. While the user uses the low-magnification lens to take a photo of the object to obtain a first image, the high-magnification lens takes a photo of the object to obtain a second image. The second image is then used to migrate the details of the object in the first image, and then the third image is displayed to the user.

[0090] Optionally, the first sensor and the second sensor may also be sensors on different devices. For example, in some application scenarios, the binocular imaging device needs to install two cameras on terminals at different positions, such as stereo medical imaging, virtual reality and other fields. The first sensor and the second sensor here may be two cameras in the binocular program device, wherein the clarity of the first sensor is lower than that of the second sensor. It should be noted that in this application scenario, the first sensor and the second sensor need to be time-synchronized so that the final image and the second image are images obtained after collecting the same target object at the same time.

[0091] It should be noted that the specific description of the first sensor, the second sensor, the target, the first image and the second image can be referred to in Figure 1 and Figure 2 The description in the embodiments will not be repeated here.

[0092] Step S320: The terminal device sends the first image and the second image to the server.

[0093] Step S330: The server performs target object detection on the second image to obtain a second detection result.

[0094] The first detection result includes the location information of the target in the first image, and the second detection result includes the location information of the target in the second image. In a specific implementation, the above location information may be expressed in the form of, but not limited to, a target detection frame, target coordinates, etc. The target detection frame is used to indicate the area of ​​the target in the image, and may be a rectangular frame, a circular frame, an irregular shape frame, etc., which is not specifically limited in this application. In a specific implementation, the target detection algorithm can refer to Figure 1 and Figure 2 The description of the embodiments will not be repeated here.

[0095] Optionally, step S330 may be implemented by a server or a terminal device, which is not specifically limited in this application.

[0096] Step S340: The server determines a migration strategy according to the second detection result.

[0097] In the specific implementation, Figure 4 is a schematic diagram of the steps of the migration strategy in the image processing method provided by the present application. The migration strategy may include: Figure 4 Steps S341 to S349 are shown.

[0098] Step S341: Determine whether the second image includes the target object in the first image.

[0099] In a specific implementation, step S342 is performed when the target object is not included, and step S343 is performed when the target object is included.

[0100] Step S342: input the first image into the portrait super-resolution algorithm model to obtain a fifth image of the first image.

[0101] In a specific implementation, the third image may be a whole image with a higher definition than the first image, or the definition of the area where the target object is located in the third image is higher than the first image, which is not specifically limited in this application. The third image has a higher definition and a higher pixel density than the first image and can provide more details.

[0102] Optionally, the portrait super-resolution algorithm model may be obtained by training the portrait super-resolution algorithm network using a first sample set, wherein the first sample set includes a known first image and a corresponding known fifth image. In a specific implementation, the portrait super-resolution algorithm model may be created using a portrait super-resolution algorithm, and the description of the portrait super-resolution algorithm may refer to the description of the portrait super-resolution algorithm model in the aforementioned embodiment, and examples will not be repeated here.

[0103] Step S343: Determine whether the second image completely includes the target object.

[0104] In a specific implementation, if the complete target is not included, steps S346 to S349 are performed, and if the complete target is included, steps S344 to S345 are performed. Including the complete target means that the target is completely present in the second image, and not including the complete target means that the target is partially present in the second image and partially not present in the second image.

[0105] It should be noted that if the first image and the second image include multiple targets, then when the server performs target detection on the second image, it can also perform target detection on the first image to obtain a first detection result, and then determine the correspondence between the same target in the first image and the second image, and then execute steps S341 to S349 for each target to determine its migration strategy. Different targets in the first image can use the same or different migration strategies, which can be determined according to the actual application scenario.

[0106] For example, Figure 5 As shown, Figure 5 is an example diagram of a first image and a second image in an image processing method provided by the present application. Figure 5 In the application scenario shown, the user uses a terminal device to photograph target A, target B and target C. The terminal device includes a low-magnification first lens and a high-magnification second lens. The first lens photographs the scene at time 1 to obtain a first image, and the second lens simultaneously photographs the scene at time 1 to obtain a second image. After performing object detection on the first image and the second image, a first detection result and a second detection result are obtained, wherein the first detection result includes detection frames of three targets, and the second detection result includes detection frames of two targets. It can be determined that the first image includes target A, target B and target C, and the second image includes target B and half of target C.

[0107] Therefore, if Figure 5 As shown, target A belongs to the case where the second detection result does not include the target, and the migration strategy can refer to the description of step S342. Target B belongs to the case where the second detection result includes the complete target, and the migration strategy can refer to steps S344 to S345. Target C belongs to the case where the second detection result does not include the complete target, and the migration strategy can refer to steps S346 to S349.

[0108] Need to explain, Figure 5 In the example shown, the second image is located at the center of the first image. In a specific implementation, the second image may not be located at the center of the first image. This may be determined based on the structure of multiple lenses in the terminal device, and this application does not make any specific limitation.

[0109] Step S344: Obtain a first matching result through key point matching.

[0110] In a specific implementation, the target object detail detection can be performed on the first image to obtain a first detail detection result, and then the target object detail detection can be performed on the second image to obtain a second detail detection result. Then, the first detail detection result and the second detail detection result are matched for key points to obtain a first matching result. The first matching result includes the correspondence between the key points in the first detail detection result and the second detail detection result.

[0111] Among them, the key points with corresponding relationships describe the same feature of the target object. For example, when the target object is a human face, the key points may include but are not limited to facial organ key points, ORB key points, etc., which are not specifically limited in this application. For example, assuming that the key points include the left eye of the target person, the position of the left eye of the target person in the first image is the first coordinate, and the position of the left eye of the target person in the second image is the second coordinate, then the first matching result may include the corresponding relationship between the first coordinate and the second coordinate. It should be understood that the above examples are for illustration and are not specifically limited in this application.

[0112] It should be understood that the correspondence between the key points in the first image and the second image can be obtained through key point matching. In this way, when migrating the details of the target object in the first image, the details of the area where the same key point in the first image is located can be migrated according to the area where the key point in the second image is located. Since the correlation between the two is high, the quality of detail migration is improved.

[0113] Step S345: Input the first matching result and the first image into the AI ​​model to obtain a third image.

[0114] Optionally, the AI ​​model is obtained after training the AI ​​network using a second sample set, wherein the second sample set includes input samples and labels, wherein the input sample is a known first image and a known first matching result, and the label is a corresponding known third image.

[0115] In a specific implementation, the above-mentioned AI network is created based on RefSR. The above-mentioned RefSR algorithm can determine the similarity between the characteristic texture of the target object in the second image and the characteristic texture of the first image according to the first matching result, extract the characteristic texture with higher similarity from the second image and migrate it to the first image to fill in the details, thereby adaptively migrating the high-definition texture of the second image to the first image.

[0116] It should be understood that the RefSR algorithm uses the rich texture of the reference image to compensate for the lost details in the low-definition input image, and can produce more detailed and realistic textures. However, it has high requirements for the reference image. If the correlation coefficient between the reference image and the input image is low, the reference image cannot provide relevant texture, and even pseudo-texture may appear, affecting the image processing results, resulting in limited performance of the RefSR algorithm. In the image processing device provided in the present application, the first image and the second image are obtained by shooting the same target at the same time. The first image and the second image have a strong correlation. The second image can provide relevant texture to the first image as a reference image. The second image does not have features that are irrelevant to the first image, and will not produce pseudo-texture, thereby avoiding interference in the image processing results. It should be noted that the content not described in the above RefSR algorithm can refer to the aforementioned Figure 1 and Figure 2 The embodiments are not repeated here.

[0117] Step S346: Fill the image area where the target is located in the second image to obtain a fourth image.

[0118] In a specific implementation, the area where the target is located in the second image can be filled by mirroring, flipping, translating or symmetric operations according to the image area where the target is located in the second image. The specific method can be determined according to the type of target. For example, when the target is a portrait, the area where the target is located can be filled by mirroring operations using the symmetry of the face. For example, when the target is a vehicle, the area where the target is located can be filled by mirroring or translating operations based on the symmetry of the vehicle. It should be understood that the above examples are for illustration and are not specifically limited in this application. Optionally, the image area where the target is located can be input into a filling model to obtain a fourth image. The filling model here can also be obtained by training the AI ​​model with a sample set, which will not be elaborated here.

[0119] Step S347: Obtain a second matching result through key point matching.

[0120] In a specific implementation, the first image may be subjected to target object detail detection to obtain a first detail detection result, and then the fourth image may be subjected to target object detail detection to obtain a third detail detection result, and then the first detail detection result and the third detail detection result may be subjected to key point matching to obtain a second matching result, wherein the second matching result includes a correspondence between the key points in the first detail detection result and the third detail detection result. The key points with a corresponding relationship describe the same feature of the target object. The key points may be specifically referred to in the foregoing content, and will not be repeated here.

[0121] Step S348: determining a migration area in the first image corresponding to the filling area of ​​the fourth image according to the second matching result.

[0122] Step S349: performing detail migration on the target object in the first image according to the similarity between the migration area of ​​the first image and the filling area of ​​the fourth image to obtain a third image.

[0123] Optionally, when the similarity between the migration area of ​​the first image and the filling area of ​​the fourth image is high, the correlation between the filling area and the first image is high, so the method described in step S344-step S345 can be used to use the fourth image containing the above filling area as a reference image, and use the AI ​​model to migrate the details of the target object in the first image to obtain a third image. When the similarity between the migration area and the filling area of ​​the first image is low, the correlation between the filling area and the first image is low. At this time, the filling area and the second image are not used as reference images, but the method described in step S342 is used to enhance the details of the first image through the portrait super-resolution algorithm model to obtain a fifth image.

[0124] In the specific implementation, when the similarity is lower than the first threshold, the portrait super-resolution algorithm is used to input the first image into the portrait super-resolution algorithm model to obtain the third image; when the similarity is higher than the first threshold, the second matching result and the first image are input into the AI ​​model to obtain the third image.

[0125] Optionally, the first image can also be divided into multiple sub-regions, and the migration strategy can be determined based on the similarity between each sub-region and the corresponding filled region. The migration strategies of different sub-regions are the same or different. Sub-regions with higher similarity use the filled region as a reference image combined with the AI ​​model to migrate details of the sub-regions, while sub-regions with lower similarity do not use the filled region, and directly use the portrait super-resolution algorithm model to migrate details of the sub-regions. In this way, each sub-region can use a reasonable migration strategy to migrate details, thereby improving the quality of detail migration.

[0126] In a specific implementation, the first image is divided into multiple first sub-regions, the filling area of ​​the fourth image is divided into multiple second sub-regions, and multiple similarities between the multiple first sub-regions and the multiple second sub-regions are determined, wherein each of the multiple similarities corresponds to a first sub-region and a second sub-region, and then the first sub-region corresponding to the similarity lower than the second threshold is input into the portrait super-resolution algorithm model to obtain the sixth image, the second sub-region corresponding to the similarity not lower than the second threshold is matched with the first sub-region for key points to obtain a third matching result, the third matching result and the first sub-region are input into the AI ​​model to obtain a seventh image, and the third image is obtained based on the sixth image and the seventh image.

[0127] Step S350: The server uses a migration strategy to migrate details of the target object in the first image to obtain a third image.

[0128] In summary, at least the migration strategy provided by this application includes:

[0129] When the second image does not include the target object, the portrait super-resolution algorithm is used to migrate the details of the target object in the first image based on the migration strategy of the portrait super-resolution algorithm model.

[0130] In the case where the second image includes the target object, if the second image includes the complete target object, a migration strategy based on an AI model is used to migrate the details of the target object in the first image using the second image as a reference image.

[0131] In the case where the second image includes the target object, if the second image does not include the complete target object but only includes part of the target object, the missing part of the target object in the second image can be filled to obtain a filled area, and then the migration area of ​​the first image corresponding to the filled area in the first image is determined, and then the portrait super-resolution algorithm model or AI model is selected based on the similarity between the migration area of ​​the first image and the filled area.

[0132] Optionally, when the similarity is higher than a first threshold, a second image containing a filled area is used as a reference image, and the details of the target object in the first image are migrated through the AI ​​model; when the similarity is lower than the first threshold, the second image is not used as a reference image, and the details of the first image are migrated using the first model through a portrait super-resolution algorithm.

[0133] Optionally, the first image is divided into multiple sub-regions, and the migration strategy is determined according to the similarity between each sub-region and the corresponding filled region. The migration strategies of different sub-regions are the same or different. Sub-regions with higher similarity use the filled region as a reference image combined with the AI ​​model to migrate details of the sub-regions, while sub-regions with lower similarity do not use the filled region, and directly use the portrait super-resolution algorithm model to migrate details of the sub-regions. In this way, each sub-region can use a reasonable migration strategy to migrate details, thereby improving the quality of detail migration.

[0134] In this way, when the user uses the terminal device to shoot the target object, after the terminal device receives the instruction triggered by the user to shoot the target object using the first sensor, it calls the first sensor and the second sensor to shoot the target object to obtain the first image and the second image. In other words, the user uses the low-magnification lens to shoot the first image while the high-magnification lens shoots the target to obtain the second image, and then uses the above migration strategy to select a suitable method to migrate the details of the first image to obtain a high-quality third image, so that when the user uses the low-magnification lens to shoot the target object, there will be no problem of low clarity in the area where the target object is located, and when the user enlarges the low-magnification photo of the area where the target object is located, there will be no problem of blurring the area where the target object is located, thereby improving the user experience.

[0135] In summary, the image processing method provided by the present application obtains a first image and a second image, wherein the first image and the second image are images respectively obtained after being collected at the same time for the same scene, and the first image area of ​​the first image includes the second image area of ​​the second image, and then the details of the target object in the first image are migrated based on the second image to obtain a third image, and the resolution in the image area where the target object is located in the third image is higher than the resolution outside the image area where the target object is located. Since the first image and the second image are images respectively obtained after being collected at the same time for the same scene, the first image and the second image generated in this way have a strong correlation, and the second image as a reference image can well provide relevant texture to the first image, and the second image does not have features that are irrelevant to the first image, and will not generate pseudo textures, thereby avoiding interference in the image processing results, improving the quality of the third image, and having strong stability.

[0136] Figure 6 It is a structural diagram of a computing device provided in the present application. The computing device 600 may be the terminal device 100 or the server 200 in the aforementioned content, and the present application does not limit this.

[0137] Furthermore, the computing device 600 includes a processor 601, a memory 602 and a communication interface 603, wherein the processor 601, the memory 602 and the communication interface 603 communicate via a bus 605, and may also communicate via other means such as wireless transmission.

[0138] The processor 601 may be composed of at least one general-purpose processor, such as a CPU, an NPU, or a combination of a CPU and a hardware chip. The hardware chip may be an Application-Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a Field-Programmable Gate Array (FPGA), a Generic Array Logic (GAL), or any combination thereof. The processor 601 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 602, which enables the computing device 600 to provide a wide variety of services.

[0139] In a specific implementation, as an embodiment, the processor 601 may include one or more CPUs, such as Figure 6 CPU0 and CPU1 are shown in the figure.

[0140] In a specific implementation, as an embodiment, the computing device 600 may also include multiple processors, such as Figure 6 601 and processor 604 are shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0141] The memory 602 is used to store program codes, and the execution is controlled by the processor 601. The program codes may include one or more software modules.

[0142] When the computing device 600 is a terminal device, the one or more software modules may be Figure 2 In the embodiment, the first acquisition unit and the second acquisition unit are used to acquire the first image, and the second acquisition unit is used to acquire the second image. The first image and the second image are acquired after acquiring the same target at the same time. The above specific implementation method can refer to Figure 1 to Figure 5 The description in the embodiments will not be repeated here.

[0143] When the computing device 600 is a server, the one or more software modules may be Figure 2 The acquisition unit and the migration unit in the embodiment, wherein the acquisition unit 210 is used to acquire the first image and the second image, and the migration unit is used to output a third image, wherein the resolution of the image region where the target object is located in the third image is higher than the resolution of the image region where the target object is located, and the third image is obtained after the details of the target object in the first image are migrated according to the second image. The above specific implementation method can refer to Figure 1 to Figure 5 The description in the embodiments will not be repeated here.

[0144] The memory 602 may include a read-only memory and a random access memory, and provide instructions and data to the processor 601. The memory 602 may also include a non-volatile random access memory. For example, the memory 602 may also store information of a device type.

[0145] The memory 602 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM). It can also be a hard disk, a universal serial bus (USB), a flash memory, a secure digital memory card (SD card), a memory stick, etc. The hard disk can be a hard disk drive (HDD), a solid state disk (SSD), a mechanical hard disk (HDD), etc., and this application does not make specific limitations.

[0146] The communication interface 603 can be a wired interface (such as an Ethernet interface), an internal interface (such as a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface), which is used to communicate with other servers or modules. In a specific implementation, the communication interface 603 can be used to receive messages for the processor 601 or the processor 604 to process the messages.

[0147] The bus 605 may be a Peripheral Component Interconnect Express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 605 may be divided into an address bus, a data bus, a control bus, etc.

[0148] Need to explain, Figure 6 This is only one possible implementation of the embodiment of the present application. In practical applications, the computing device 600 may also include more or fewer components, which is not limited here. For contents not shown or described in the embodiment of the present application, please refer to the aforementioned Figure 1-Figure 5 The relevant explanations in the embodiments will not be repeated here.

[0149] See below Figure 7 , Figure 7 7 is a schematic diagram of a structure of a computing device cluster provided by the present application. The computing device cluster may be the image processing system in the aforementioned content, and the computing device cluster includes at least one computing device 700. The memory 702 in one or more computing devices 700 in the computing device cluster may store the same instructions for executing the image processing method provided by the present application.

[0150] In some possible implementations, one or more computing devices 700 in the computing device cluster may also be used to execute some instructions of the image processing method provided in the present application. In other words, a combination of one or more computing devices 700 may jointly execute the instructions of the image processing method provided in the present application.

[0151] It should be noted that the memory 702 in different computing devices 700 in the computing device cluster may store different instructions for executing part of the functions of the image processing apparatus in the above content. That is, the instructions stored in the memory 702 in different computing devices 700 may implement Figure 2 The embodiment describes the functions of one or more modules of the acquisition unit 210 , the detection unit 220 , the determination unit 230 , the first migration unit 250 , the matching unit 260 , the filling unit 270 , and the second migration unit 280 .

[0152] It should be noted that Figure 7Each computing device 700 in the computing device cluster shown may include at least a memory 702, a processor 701, a communication interface 703, and a bus 704, wherein the memory 702 may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The description of the volatile memory and the non-volatile memory may refer to Figure 6 The description of the memory 602 in the embodiment is not repeated here. The processor 701 can be composed of at least one general-purpose processor, such as a CPU, an NPU, or a combination of a CPU and a hardware chip. The description of the above hardware chip can be referred to Figure 6 The description of the processor 601 and the processor 604 in the embodiment is not repeated here. The communication interface 703 can be referred to in Figure 6 For the description of the communication interface 603 in the embodiment, the bus 704 can refer to Figure 6 The description of bus 605 in the embodiment will not be repeated here.

[0153] The embodiment of the present invention also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the image processing method.

[0154] The embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The above-mentioned available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned image processing method.

[0155] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes at least one computer instruction. When the computer program instruction is loaded or executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instruction can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage node such as a server or data center that contains at least one available medium set. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD), or a semiconductor medium. The semiconductor medium may be an SSD.

[0156] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent repairs or replacements within the technical scope disclosed by the present invention, and these repairs or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. An image processing method, characterized in that: The method comprises: Acquire a first image and a second image, where the first image and the second image are images respectively acquired after capturing the same scene at the same time, and a first image region of the first image includes a second image region of the second image; Based on the second image, details of the target object in the first image are migrated to obtain a third image, in which the resolution within the image area where the target object is located in the third image is higher than the resolution outside the image area where the target object is located.

2. The method according to claim 1, characterized in that The performing detail migration on the target object in the first image based on the second image to obtain the third image comprises: Performing object detection on the second image to determine whether the second image includes the object in the first image; In the case where the second image includes the target object, the target object in the first image is processed based on the migration strategy and the artificial intelligence AI model to obtain the third image.

3. The method according to claim 2, characterized in that The migration strategy includes: In a case where the second image completely includes the target object, performing target object detail detection on the first image to obtain a first detail detection result, performing target object detail detection on the second image to obtain a second detail detection result, and performing key point matching on the first detail detection result and the second detail detection result to obtain a first matching result, wherein the first matching result includes a correspondence between key points in the first detail detection result and the second detail detection result; The first matching result and the first image are input into the AI ​​model to obtain the third image.

4. The method according to claim 2 or 3, characterized in that: The migration strategy includes: In a case where the second image partially includes the target object, filling an image region in the second image where the target object is located to obtain a fourth image; Performing target object detail detection on the first image to obtain a first detail detection result, performing target object detail detection on the fourth image to obtain a third detail detection result, performing key point matching on the first detail detection result and the third detail detection result to obtain a second matching result, wherein the second matching result includes a correspondence between key points in the first detail detection result and the third detail detection result; Determine, according to the second matching result, a migration area in the first image corresponding to a filling area in the fourth image; The target object in the first image is migrated in detail according to the similarity between the migration area and the filling area to obtain the third image.

5. The method according to claim 4, characterized in that The step of performing detail migration on the target object in the first image according to the similarity between the migration area and the filling area to obtain the third image comprises: When the similarity between the migration area and the filling area is higher than a first threshold, the second matching result and the first image are input into the AI ​​model to obtain the third image.

6. The method according to claim 5, characterized in that The method further comprises: When the similarity between the migration area and the filling area is lower than the first threshold, a portrait super-resolution algorithm is applied to the first image to obtain a fifth image.

7. The method according to any one of claims 1 to 6, characterized in that: The first image is an image taken by a first lens, the second image is an image taken by a second lens, the magnification of the first lens is lower than the magnification of the second lens, and the first lens and the second lens are both located on the same terminal device.

8. An image processing device, characterized in that: The device comprises: An acquisition unit, configured to acquire a first image and a second image, wherein the first image and the second image are images respectively acquired after acquisition of the same scene at the same time, and a first image region of the first image includes a second image region of the second image; A migration unit is used to migrate details of the target object in the first image based on the second image to obtain a third image, in which the resolution within the image area where the target object is located is higher than the resolution outside the image area where the target object is located.

9. The device according to claim 8, characterized in that The device further includes a detection unit, the detection unit being configured to perform target object detection on the second image to determine whether the second image includes the target object in the first image; In the case where the second image includes the target object, the target object in the first image is processed based on the migration strategy and the artificial intelligence AI model to obtain the third image.

10. The device according to claim 9, characterized in that The migration unit is configured to, when the second image completely includes the target object, perform target object detail detection on the first image to obtain a first detail detection result, perform target object detail detection on the second image to obtain a second detail detection result, perform key point matching on the first detail detection result and the second detail detection result to obtain a first matching result, wherein the first matching result includes a correspondence between key points in the first detail detection result and the second detail detection result; The migration unit is used to input the first matching result and the first image into the AI ​​model to obtain the third image.

11. The device according to claim 9 or 10, characterized in that The migration unit is configured to fill the image region where the target object is located in the second image to obtain a fourth image when the second image partially includes the target object; The migration unit is configured to perform target object detail detection on the first image to obtain a first detail detection result, perform target object detail detection on the fourth image to obtain a third detail detection result, perform key point matching on the first detail detection result and the third detail detection result to obtain a second matching result, wherein the second matching result includes a correspondence between key points in the first detail detection result and the third detail detection result; The migration unit is used to determine a migration area in the first image corresponding to the filling area in the fourth image according to the second matching result; The migration unit is used to migrate details of the target object in the first image according to the similarity between the migration area and the filling area to obtain the third image.

12. The device according to claim 11, characterized in that The migration unit is used to input the second matching result and the first image into the AI ​​model to obtain the third image when the similarity between the migration area and the filling area is higher than a first threshold.

13. The device according to claim 12, characterized in that The migration unit is used to apply a portrait super-resolution algorithm to the first image to obtain a fifth image when the similarity between the migration area and the filling area is lower than the first threshold.

14. The device according to any one of claims 8 to 13, characterized in that The first image is an image taken by a first lens, the second image is an image taken by a second lens, the magnification of the first lens is lower than the magnification of the second lens, and the first lens and the second lens are both located on the same terminal device.

15. A computing device cluster, characterized in that: It includes at least one computing device, each computing device includes a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.

16. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 7.

17. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 7.