Image processing method, device, electronic device and storage medium
By performing line-retaining distortion correction and conformal network processing on the target image, a conformal distortion correction map is generated, which solves the problems of slow image processing speed and limited conformal effect in the prior art, and achieves efficient image processing and excellent conformal effect.
Patent Information
- Application Number
- CN202111222781.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-10-20
AI Technical Summary
The prior art is slow in image processing due to multiple iterations, and the conformal effect of the image is affected by the accuracy of the portrait segmentation model.
By performing line-retaining distortion correction on the target image, the target line-retaining distortion correction image is obtained and input it into the conformal network to generate a target conformal distortion correction map, and the image is corrected using this map.
This method does not require multiple iterations, significantly improves image processing speed, and is not affected by the accuracy of the portrait segmentation model, achieving better conformal effect.
Smart Images

Figure CN114155157B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and specifically to an image processing method, device, electronic device and storage medium. Background Art
[0002] The processing of images such as those taken by a wide-angle lens often includes conformal distortion correction. The current conformal distortion correction algorithm requires multiple iterations to generate a conformal distortion correction map for conformal distortion correction. Before the conformal distortion correction algorithm is used to process the image, the position of the human body in the image needs to be determined by a portrait segmentation model to provide the determined position of the human body to the conformal distortion correction algorithm.
[0003] The processing method adopted by the prior art, on the one hand, multiple iterations lead to slow image processing speed. On the other hand, the shape preservation effect of the image is affected not only by the accuracy of the shape preservation distortion correction algorithm, but also by the accuracy of the portrait segmentation model. Summary of the invention
[0004] Embodiments of the present application provide an image processing method, apparatus, electronic device, storage medium, and computer program product to solve the problems of slow image processing speed and image conformal effect being affected by the accuracy of a portrait segmentation model.
[0005] The present application provides an image processing method, including:
[0006] Performing line-preserving distortion correction on the target image to obtain a target line-preserving distortion corrected image corresponding to the target image;
[0007] Inputting the target line-preserving distortion-corrected image into a shape-preserving network to obtain a target shape-preserving distortion-corrected mapping image corresponding to the target image;
[0008] The target shape-preserving distortion correction map is used to perform shape-preserving distortion correction on the target line-preserving distortion correction image to obtain a corrected image.
[0009] The present application provides an image processing device, including:
[0010] A first correction unit is configured to perform line-preserving distortion correction on a target image to obtain a target line-preserving distortion corrected image corresponding to the target image;
[0011] an acquisition unit, configured to input the target line-preserving distortion-corrected image into a conformal network to obtain a target conformal distortion-corrected map corresponding to the target image;
[0012] The second correction unit is configured to perform shape-preserving distortion correction on the target line-preserving distortion-corrected image by using the target shape-preserving distortion correction map to obtain a corrected image.
[0013] An embodiment of the present application provides an electronic device, including:
[0014] processor;
[0015] a memory for storing instructions executable by the processor;
[0016] The processor is configured to execute the instructions to implement the above-mentioned image processing method.
[0017] An embodiment of the present application provides a storage medium, in which instructions are stored. When the instructions in the storage medium are executed by a processor, the above-mentioned image processing method can be implemented.
[0018] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned image processing method is implemented.
[0019] The image processing method, device, electronic device and storage medium provided in the embodiments of the present application perform line-preserving distortion correction on the target image to obtain a target line-preserving distortion corrected image corresponding to the target image; input the target line-preserving distortion corrected image into a conformal network to obtain a target conformal distortion corrected mapping map corresponding to the target image; and perform conformal distortion correction on the target line-preserving distortion corrected image using the target conformal distortion corrected mapping map to obtain a corrected image. The corrected image obtained has line-preserving effect and conformal effect. The target conformal distortion corrected mapping map corresponding to the target image is obtained through the conformal network without multiple iterations, thereby improving the speed of the image processing process. At the same time, there is no need to determine the position of the human body in the image through a portrait segmentation model, and the conformal effect is not affected by the accuracy of the portrait segmentation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0021] Figure 1 A flowchart of an image processing method provided by an embodiment of the present application is shown;
[0022] Figure 2 A structural block diagram of an image processing device provided in an embodiment of the present application is shown;
[0023] Figure 3 A structural block diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0026] In recent years, research on computer vision, deep learning, machine learning, image processing, image recognition and other technologies based on artificial intelligence has made important progress. Artificial Intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies and application systems for simulating and extending human intelligence. Artificial intelligence is a comprehensive discipline involving many types of technologies such as chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, neural networks, etc. Computer vision, as an important branch of artificial intelligence, specifically allows machines to recognize the world. Computer vision technology usually includes face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, target detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, behavior recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, robot navigation and positioning and other technologies. With the research and advancement of artificial intelligence technology, this technology has been applied in many fields, such as security, urban management, traffic management, building management, park management, facial access, facial attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone imaging, cloud services, smart homes, wearable devices, unmanned driving, automatic driving, smart medical care, facial payment, facial unlocking, fingerprint unlocking, identity verification, smart screens, smart TVs, cameras, mobile Internet, live streaming, beauty, makeup, medical beauty, and smart temperature measurement.
[0027] Figure 1 A flowchart of an image processing method provided by an embodiment of the present application is shown, and the method includes:
[0028] Step 101 , performing line-preserving distortion correction on a target image to obtain a target line-preserving distortion corrected image corresponding to the target image.
[0029] The image processing method provided in the embodiment of the present application can be used to process the portrait taken by the user through the terminal. The code of the image processing method provided in the embodiment of the present application can be encapsulated in a plug-in. The plug-in can be run when the shooting interface is opened, for example, when the user clicks the button representing the camera, the plug-in is run. The image processing method provided in the embodiment of the present application can be triggered to execute based on the relevant operation of the user. For example, when the user clicks the photo button in the shooting interface, the image of the person being photographed captured by the camera on the terminal can be obtained, the image processing method provided in the embodiment of the present application is executed, the image of the person being photographed is processed, and the corrected image is obtained. The corrected image is displayed in the shooting interface, so that the user can see the corrected image with line preservation effect and shape preservation effect. For example, after the user clicks the photo button in the shooting interface, the image of the person being photographed captured by the camera on the terminal is displayed in the shooting interface, and at the same time, a button indicating that the line and shape can be preserved is displayed in the shooting interface. The user can click the button indicating that the line and shape can be preserved to trigger the execution of the image processing method provided in the embodiment of the present application, process the image of the person being photographed, obtain the corrected image, and display the corrected image in the shooting interface.
[0030] In the present application, any existing line-preserving distortion correction algorithm may be used to perform line-preserving distortion correction on the target image to obtain a target line-preserving distortion corrected image corresponding to the target image.
[0031] Step 102: input the target line-preserving distortion-corrected image into a shape-preserving network to obtain a target shape-preserving distortion-corrected map corresponding to the target image.
[0032] In the present application, the conformal distortion correction map may be referred to as a conformal distortion correction map. Each first pixel in the target conformal distortion correction map corresponding to the target image corresponds to a second pixel in the target line-preserving distortion correction image corresponding to the target image. For each first pixel, the position of the first pixel in the target conformal distortion correction map corresponding to the target image is the same as the position of the second pixel corresponding to the first pixel in the target line-preserving distortion correction image.
[0033] In the present application, when conformal distortion correction is performed on a target line-preserving distortion correction image corresponding to a target image, the pixel that needs to be replaced in the target line-preserving distortion correction image corresponding to the target image is referred to as a second pixel associated with conformal distortion. For a second pixel associated with conformal distortion in the target line-preserving distortion correction image corresponding to the target image, the second pixel associated with conformal distortion is replaced with another second pixel in the target line-preserving distortion correction image corresponding to the target image, and the pixel value of the first pixel corresponding to the second pixel associated with conformal distortion in the target conformal distortion correction mapping corresponding to the target image is the position of the other second pixel.
[0034] In the present application, the conformal network includes a unit for feature extraction and a unit for generating a conformal distortion correction map. The unit for feature extraction in the conformal network extracts features for describing the distortion of the conformal object from the line-preserving distortion-corrected image input into the conformal network, and the unit for generating a conformal distortion correction map in the conformal network generates a conformal distortion correction map based on the features for describing the distortion of the conformal object.
[0035] The conformal network may include a convolutional neural network as a unit for feature extraction, and a multi-layer perceptron as a unit for generating a conformal distortion correction map. The conformal network may also be an encoder-decoder type neural network, and the conformal network includes an encoder as a unit for feature extraction, and a decoder as a unit for generating a conformal distortion correction map.
[0036] In the present application, a conformal network is pre-trained. When the conformal network is pre-trained, the unit for feature extraction in the conformal network and the unit for generating a conformal distortion correction map in the conformal network can be pre-trained separately. After completing the training of the unit for feature extraction and the training of the unit for generating a conformal distortion correction map, the trained conformal network is used to process the target image.
[0037] In a training for a unit for feature extraction, a line-preserving distortion-corrected image for training and first annotation information corresponding to the line-preserving distortion-corrected image for training are used to train the unit for feature extraction, wherein the first annotation information corresponding to the line-preserving distortion-corrected image for training is annotated features for describing the distortion of a shape-preserving object in the line-preserving distortion-corrected image for training. The line-preserving distortion-corrected image for training is input into the unit for feature extraction, and the unit for feature extraction outputs a predicted feature, which is a predicted feature for describing the distortion of a shape-preserving object in the line-preserving distortion-corrected image for training. A loss between the predicted feature and the first annotation information is calculated, and according to the loss, parameters of the unit for feature extraction are updated.
[0038] In a training of a unit for generating a conformal distortion correction map, the unit for generating a conformal distortion correction map is trained using first annotation information corresponding to a line-preserving distortion correction image for training and second annotation information corresponding to the line-preserving distortion correction image for training. The second annotation information corresponding to the line-preserving distortion correction image for training is a labeled conformal distortion correction map. The first annotation information corresponding to the line-preserving distortion correction image for training is input into the unit for generating a conformal distortion correction map, the unit for generating a conformal distortion correction map outputs a prediction result, the prediction result is a predicted conformal distortion correction map, a loss between the prediction result and the second annotation information is calculated, and parameters of the unit for generating a conformal distortion correction map are updated according to the loss.
[0039] Step 103: perform shape-preserving distortion correction on the target line-preserving distortion-corrected image using the target shape-preserving distortion correction map to obtain a corrected image.
[0040] In the present application, when performing conformal distortion correction on a target line-preserving distortion corrected image corresponding to a target image using a target conformal distortion correction map corresponding to the target image, the first pixel in the target conformal distortion correction map corresponding to the target image is traversed. Each first pixel in the target conformal distortion correction map corresponding to the target image corresponds to a second pixel in the target line-preserving distortion corrected image corresponding to the target image. For each first pixel, the position of the first pixel in the target conformal distortion correction map corresponding to the target image is the same as the position of the second pixel corresponding to the first pixel in the target line-preserving distortion corrected image. In the present application, the position of the first pixel refers to the position of the first pixel in the target conformal distortion correction map corresponding to the target image, and the position of the second pixel refers to the position of the second pixel in the target line-preserving distortion corrected image corresponding to the target image. When performing conformal distortion correction on a target line-preserving distortion correction image corresponding to the target image using a target conformal distortion correction map corresponding to the target image, the first pixel in the target conformal distortion correction map corresponding to the target image can be traversed. For a traversed first pixel, if the pixel value of the first pixel is the position of the second pixel corresponding to the first pixel, it can be determined that the second pixel corresponding to the first pixel does not participate in conformal preservation. For a traversed first pixel, if the pixel value of the first pixel is not the position of the second pixel corresponding to the first pixel, it can be determined that the second pixel corresponding to the first pixel is related to conformal preservation, and another second pixel in the target line-preserving distortion correction image corresponding to the target image whose position is the pixel value of the first pixel is found, and the second pixel corresponding to the first pixel is replaced by the other second pixel.
[0041] For example, the position of a pixel is represented by coordinates (x, y), where x represents the row where the pixel is located, and y represents the column where the pixel is located. The pixel value of each first pixel in the target conformal distortion correction map corresponding to the target image is a coordinate.
[0042] In the process of traversing the first pixel in the target conformal distortion correction map corresponding to the target image, the first pixel at position (1,1) in the target conformal distortion correction map corresponding to the target image is first accessed, and the second pixel corresponding to the first pixel at position (1,1) is the second pixel at position (1,1) in the target line-preserving distortion correction image corresponding to the target image.
[0043] If the pixel value of the first pixel at position (1,1) in the target conformal distortion correction map corresponding to the target image is (1,1), then it is determined that the second pixel corresponding to the first pixel at position (1,1) in the target line-preserving distortion correction image corresponding to the target image, that is, the second pixel at position (1,1) in the target line-preserving distortion correction image corresponding to the target image does not participate in the conformal preservation, and the first pixel at position (1,2) in the target conformal distortion correction map corresponding to the target image is continued to be accessed.
[0044] If the pixel value of the first pixel at position (1,1) in the target shape-preserving distortion correction map corresponding to the target image is not (1,1), and the pixel value of the first pixel at position (1,1) is (2,3), find another second pixel at position (2,3) in the target line-preserving distortion correction image corresponding to the target image, and use the other second pixel at position (2,3) to replace the second pixel at position (1,1) in the target line-preserving distortion correction image corresponding to the target image. Then, continue to access the first pixel at position (1,2) in the target shape-preserving distortion correction map corresponding to the target image.
[0045] The operation performed when accessing each first pixel is the same as the operation performed when accessing the first pixel at position (1,1) as mentioned above. After each second pixel participating in shape preservation in the target line-preserving distortion correction image corresponding to the target image is replaced by corresponding other second pixels, a corrected image is obtained.
[0046] In the present application, a target image is subjected to line-preserving distortion correction to obtain a target line-preserving distortion-corrected image corresponding to the target image; the target line-preserving distortion-corrected image is input into a conformal network to obtain a target conformal distortion-corrected mapping map corresponding to the target image; the target conformal distortion-corrected image is subjected to conformal distortion correction using the target conformal distortion-corrected mapping map to obtain a corrected image. The corrected image obtained has line-preserving and conformal effects. The target conformal distortion-corrected mapping map corresponding to the target image is obtained through the conformal network without multiple iterations, thereby improving the speed of the image processing process. At the same time, there is no need to determine the position of the human body in the image through a portrait segmentation model, and the conformal effect is not affected by the accuracy of the portrait segmentation model.
[0047] In some embodiments, before performing line-preserving distortion correction on the target image, it also includes: generating training data; wherein the training data includes: multiple line-preserving distortion correction sample images, and a conformal distortion correction annotation mapping map corresponding to each line-preserving distortion correction sample image; training a conformal network based on multiple line-preserving distortion correction sample images, and the conformal distortion correction annotation mapping maps corresponding to each line-preserving distortion correction sample image.
[0048] In the present application, before inputting the target line-preserving distortion-corrected image corresponding to the target image into the conformal network, the conformal network is pre-trained with training data. The training data includes: a plurality of line-preserving distortion-corrected sample images, and a conformal-preserving distortion-corrected annotation mapping corresponding to each line-preserving distortion-corrected sample image.
[0049] The conformal distortion correction annotation map can be called the conformal distortion correction annotation map. The conformal distortion correction annotation map is used as the target output of the conformal network when training the conformal network, namely, the Ground Truth, which is referred to as GT.
[0050] In the present application, multiple images that have undergone line-preserving distortion correction and have not undergone shape-preserving distortion correction can be acquired in advance, and each image that has undergone line-preserving distortion correction and has not undergone shape-preserving distortion correction is used as a line-preserving distortion correction sample image. The acquired line-preserving distortion correction sample image can be obtained by performing line-preserving distortion correction on an image taken by a camera without any processing, and the image without any processing can be a portrait.
[0051] In the present application, for each line-preserving distortion correction sample image, a conformal distortion correction algorithm can be used to generate a conformal distortion correction map for conformal distortion correction of the line-preserving distortion correction sample image, and the generated target conformal distortion correction map is used as the conformal distortion correction annotation map corresponding to the line-preserving distortion correction sample image. The conformal distortion correction algorithm can be any existing conformal distortion correction algorithm.
[0052] In the present application, each time the conformal network is trained, a line-preserving distortion correction sample image can be input into the conformal network to obtain a conformal distortion correction prediction map corresponding to the line-preserving distortion correction sample image output by the conformal network. Each time the conformal network is trained, the loss between the conformal distortion correction prediction map corresponding to the line-preserving distortion correction sample image and the conformal distortion correction annotation map corresponding to the line-preserving distortion correction sample image can be calculated, and the parameters of the conformal network are updated based on the calculated loss.
[0053] In the present application, a conformal network can be trained using multiple line-preserving distortion correction sample images and shape-preserving distortion correction annotation mapping maps corresponding to each line-preserving distortion correction sample image, so that the conformal network can directly learn the association between the line-preserving distortion correction image and the shape-preserving distortion correction annotation map.
[0054] In some embodiments, generating training data includes: acquiring a set of original images; performing line-preserving distortion correction on each original image in the set of original images using a line-preserving distortion correction algorithm to obtain a line-preserving distortion corrected image corresponding to the original image; generating a conformal distortion correction map corresponding to each original image based on the conformal distortion correction algorithm and the line-preserving distortion corrected image corresponding to each original image; screening out a corresponding conformal distortion correction map having a conformal accuracy greater than an accuracy threshold from the conformal distortion correction map corresponding to each original image; using the line-preserving distortion corrected image corresponding to the screened conformal distortion correction map as a line-preserving distortion correction sample image, and using the screened conformal distortion correction map as a conformal distortion correction annotation map corresponding to the line-preserving distortion correction sample image.
[0055] In the present application, the original image in the original image set is an image that has not undergone line-preserving distortion correction and shape-preserving distortion correction, and the original image may be a portrait.
[0056] In the present application, for each of the multiple original images, a line-preserving distortion correction algorithm may be used to perform line-preserving distortion correction on the image to obtain a line-preserving distortion corrected image corresponding to the original image.
[0057] In the present application, for each line-preserving distortion corrected image corresponding to an original image, when a conformal distortion correction mapping map corresponding to the original image is obtained based on a conformal distortion correction algorithm and the line-preserving distortion corrected image corresponding to the original image, the conformal distortion correction algorithm can be used to generate a conformal distortion correction mapping map for performing conformal distortion correction on the line-preserving distortion corrected image corresponding to the original image, and the generated conformal distortion correction mapping map is used as the conformal distortion correction mapping map corresponding to the original image.
[0058] In the present application, after obtaining the conformal distortion correction map corresponding to each original image, a conformal distortion correction map having a corresponding conformal accuracy greater than an accuracy threshold can be screened out from the conformal distortion correction map corresponding to each original image.
[0059] In the present application, the conformal accuracy corresponding to any conformal distortion correction map can be determined in the following manner: using the target conformal distortion correction map, the original image corresponding to the target conformal distortion correction map is subjected to conformal distortion correction to obtain a conformal distortion corrected image; calculating the similarity between the contour of the human body in the conformal distortion corrected image and the expected contour of the human body after conformal correction, and using the similarity as the conformal accuracy corresponding to the target conformal distortion correction map. The expected contour of the human body after conformal correction may refer to the contour of the human body expected to be obtained by conformal correction, and the expected contour of the human body after conformal correction may be obtained by engineers performing an operation for adjusting the contour based on prior experience and the contour of the human body in the original image corresponding to the target conformal distortion correction map.
[0060] In the present application, for each corresponding conformal distortion correction map with a conformal accuracy greater than the accuracy threshold, the line-preserving distortion correction image corresponding to the corresponding conformal distortion correction map with a conformal accuracy greater than the accuracy threshold can be used as a line-preserving distortion correction sample image, and the corresponding conformal distortion correction map with a conformal accuracy greater than the accuracy threshold can be used as a conformal distortion correction annotation map corresponding to the line-preserving distortion correction sample image. For each corresponding conformal distortion correction map with a conformal accuracy greater than the accuracy threshold, the line-preserving distortion correction image corresponding to the corresponding conformal distortion correction map with a conformal accuracy greater than the accuracy threshold is a line-preserving distortion correction image corresponding to the original image corresponding to the corresponding conformal distortion correction map with a conformal accuracy greater than the accuracy threshold.
[0061] In the present application, a conformal distortion correction mapping map whose corresponding conformal accuracy is greater than an accuracy threshold is screened out from the conformal distortion correction mapping map corresponding to each original image, which is equivalent to selecting a conformal distortion correction mapping map that can achieve better conformal effect. The conformal distortion correction mapping map that can achieve better conformal effect is used as the conformal distortion correction annotation mapping map corresponding to the line-preserving distortion correction sample image to participate in the training of the conformal network, which can improve the training accuracy of the conformal network, and further improve the accuracy of the conformal distortion correction mapping map generated by the conformal network after the training is completed.
[0062] In some embodiments, obtaining a set of original images includes: for each of a plurality of different shooting conditions, capturing an original image corresponding to the shooting condition with the shooting condition, the shooting condition including at least one of a terminal model, a focal length, and light intensity; and combining the original images corresponding to each shooting condition into a set of original images.
[0063] For each of the multiple different shooting conditions, the shooting condition includes at least one item not included by other shooting conditions. For each of the multiple different shooting conditions, the original image corresponding to the shooting condition is shot with the shooting condition, and the shot image is used as the original image corresponding to the shooting condition. If the shooting condition includes a terminal model, when the original image corresponding to the shooting condition is shot with the shooting condition, a terminal whose model is the terminal model in the shooting condition is used for shooting. If the shooting condition includes light intensity, when the original image corresponding to the shooting condition is shot with the shooting condition, if the shooting condition includes focal length, when the original image corresponding to the shooting condition is shot with the shooting condition, the focal length uses the focal length in the shooting condition. For each of the multiple different shooting conditions, multiple different people can be shot with the shooting condition respectively, so that multiple original images corresponding to the shooting condition can be obtained. When the original images corresponding to each shooting condition are combined into an original image set, all the original images corresponding to each shooting condition can be combined to obtain an original image set. For each shooting condition, the original image set includes all the original images corresponding to the shooting condition.
[0064] In the present application, a conformal network can be trained using line-preserving distortion correction images corresponding to multiple original images shot under multiple different shooting conditions and target shape-preserving distortion correction maps corresponding to multiple original images shot under multiple different shooting conditions. Thus, after the training of the conformal network is completed, the conformal network is applicable to target images captured in any of multiple scenes, and line-preserving distortion correction and shape-preserving distortion correction can be performed on the target images, thereby improving the applicability of the conformal network after the training of the conformal network is completed.
[0065] In some embodiments, for each original image, the line-preserving distortion corrected image corresponding to the original image includes a human body, and the conformal distortion corrected mapping diagram corresponding to the original image includes: sub-mapping diagrams corresponding to each part of the human body to be conformed; and based on the conformal distortion correction algorithm and the line-preserving distortion corrected image corresponding to each original image, a conformal distortion corrected mapping diagram corresponding to each original image is generated, including: based on the annotation boxes of each part of the human body to be conformed, each part of the human body to be conformed is determined, and each part to be conformed is one of the following: the head of the human body, the torso of the human body, and the foot of the human body; for each part to be conformed, a sub-mapping diagram corresponding to the part to be conformed is generated by using the conformal distortion correction algorithm, wherein each third pixel in the sub-mapping diagram corresponding to the part to be conformed corresponds to a fourth pixel belonging to the part to be conformed, and the pixel value of the third pixel is the position of the pixel used to replace the fourth pixel corresponding to the third pixel or the position of the fourth pixel corresponding to the third pixel in the line-preserving distortion corrected image corresponding to the original image.
[0066] In the present application, for each original image, each part of the human body to be conformed can be first determined based on the annotation box of each part of the human body to be conformed in the line-preserving distortion correction image corresponding to the original image. For each part of the human body to be conformed, the annotation result of the part to be conformed is obtained by pre-annotating the part to be conformed. After determining each part of the human body to be conformed, for each part of the human body to be conformed, the position information of the part to be conformed can be used as an input parameter of the conformal distortion correction algorithm, so that the conformal distortion correction algorithm locates the part to be conformed and generates a sub-map corresponding to the part to be conformed, and the sub-map corresponding to the part to be conformed can be used to conform the part to be conformed. The sub-maps corresponding to all the generated parts to be conformed constitute the conformal distortion correction map corresponding to the original image, and the conformal distortion correction map corresponding to the original image includes: a sub-map corresponding to the head of the human body, a sub-map corresponding to the torso of the human body, and a sub-map corresponding to the feet of the human body.
[0067] For any part of the human body to be conformed in the line-preserving distortion corrected image corresponding to the original image, if the sub-map corresponding to the part to be conformed is used to conform the part to be conformed, the third pixel in the sub-map corresponding to the part to be conformed can be traversed, and for a traversed third pixel, if the pixel value of the third pixel is the position of the fourth pixel corresponding to the third pixel, it can be determined that the fourth pixel corresponding to the third pixel does not participate in the conformation. For a traversed third pixel, if the pixel value of the third pixel is the position of the pixel in the line-preserving distortion corrected image corresponding to the original image that is used to replace the fourth pixel corresponding to the third pixel, it can be determined that the fourth pixel corresponding to the third pixel is related to the conformation, and according to the position of the pixel that is used to replace the fourth pixel corresponding to the third pixel, the position of the pixel that is used to replace the fourth pixel corresponding to the third pixel is found, and the fourth pixel corresponding to the third pixel is replaced by the position of the pixel that is used to replace the fourth pixel corresponding to the third pixel.
[0068] In the present application, the conformal distortion correction mapping map corresponding to the original image includes a sub-mapping map corresponding to each part to be conformed. The conformal distortion correction mapping map corresponding to the original image can be used to conform multiple different parts of a human body to be conformed in the line-preserving distortion correction image corresponding to the original image. The conformal network is trained using the conformal distortion correction mapping map corresponding to the original image, so that the conformal network can learn how to generate conformal distortion correction mapping maps that can conform multiple different parts of a human body to be conformed. After training, the conformal network can learn to generate conformal distortion correction mapping maps that can conform multiple different parts of a human body to be conformed in a target image. The conformal network can conform multiple different parts of a human body to be conformed in a target image.
[0069] In some embodiments, for any part of a human body to be conformed in a line-preserving distortion corrected image corresponding to an original image, generating a sub-mapping diagram corresponding to the part to be conformed using a conformal distortion correction algorithm includes: determining a conformal weight corresponding to the part to be conformed, wherein the conformal weight corresponding to the part to be conformed is related to the conformal strength of the conformal distortion correction algorithm for the part to be conformed; and generating a sub-mapping diagram corresponding to the part to be conformed based on the conformal weight corresponding to the part to be conformed using the conformal distortion correction algorithm.
[0070] In the present application, the conformal distortion correction algorithm used in the present application may be an existing conformal distortion correction algorithm based on weights for conformal preservation. For any part of the human body to be conformed in the line-preserving distortion correction image corresponding to the original image, the conformal weight corresponding to the part to be conformed may be determined. The conformal weight corresponding to the part to be conformed is related to the conformal strength of the conformal distortion correction algorithm for the part to be conformed. The default weight of the part to be conformed may be used as the conformal weight corresponding to the part to be conformed. The default weight of the part to be conformed is the default weight used for the straight line type line segment when the conformal distortion correction algorithm performs conformal distortion correction. The weight for the part to be conformed that is pre-set by relevant personnel, such as engineers in the field of machine learning, may also be used as the conformal weight corresponding to the part to be conformed.
[0071] For each part of the human body to be conformed, the position information of the part to be conformed is used as an input parameter of the conformal distortion correction algorithm, so that the conformal distortion correction algorithm locates the part to be conformed. At the same time, the conformal weight corresponding to the part to be conformed is used as an input parameter of the conformal distortion correction algorithm, so that the conformal distortion correction algorithm generates a sub-mapping image corresponding to the part to be conformed based on the conformal weight corresponding to the part to be conformed. The conformal strength corresponding to the conformal weight corresponding to the part to be conformed can be understood as the conformal strength required for the part to be conformed. Accordingly, the sub-mapping image corresponding to the part to be conformed can be used to: conform the part to be conformed with the conformal strength required for the part to be conformed.
[0072] In the present application, each sub-map corresponding to the part to be conformed can be used to conform the part to be conformed with the required conformal strength of the part to be conformed, and then the conformal distortion correction map corresponding to the original image including the sub-map corresponding to each part to be conformed can be used to train the conformal network, so that the conformal network learns how to generate conformal distortion correction maps that can conform the multiple different parts to be conformed of the human body in the image input into the conformal network with the required conformal strength, and then after the training of the conformal network is completed, the conformal network learns to generate conformal distortion correction maps that can conform the multiple different parts to be conformed of the human body in the target image with the required conformal strength, and conform the multiple different parts to be conformed of the human body in the target image with the required conformal strength.
[0073] In some embodiments, for any part of a human body to be conformed in a line-preserving distortion corrected image corresponding to an original image, the conformal weight corresponding to the part to be conformed includes: the conformal weight corresponding to the line segment on the contour of the part to be conformed; and determining the weight of the part to be conformed includes: determining the line segment of the straight line type in the part to be conformed based on the annotation result of the line segment of the straight line type in the part to be conformed; determining the conformal weight corresponding to the line segment of the straight line type based on the default weight of the line segment of the straight line type, wherein the default weight is the weight used by default for the line segment of the straight line type when the conformal distortion correction algorithm performs conformal distortion correction, the conformal weight corresponding to the line segment of the straight line type is greater than the default weight, and the size of the conformal weight corresponding to the line segment of the straight line type is inversely proportional to the size of the conformal strength for the line segment of the straight line type.
[0074] In the present application, the conformal distortion correction algorithm used in the present application may be an existing conformal distortion correction algorithm that simultaneously considers the conformal weights corresponding to the straight line type segments and the conformal weights corresponding to the curve type segments. The conformal weights corresponding to the straight line type segments may be referred to as the straight line item weights. For the conformal distortion correction algorithm that simultaneously considers the conformal weights corresponding to the straight line type segments and the conformal weights corresponding to the curve type segments, the size of the conformal weights corresponding to the straight line type segments is inversely proportional to the size of the conformal strength for the straight line type segments, and the size of the conformal weights corresponding to the curve type segments is proportional to the size of the conformal strength for the curve type segments. If the default weight of the straight line type segments is small, then the straight line type segments are conformed with a larger conformal strength, which may cause at least a portion of the straight line to be bent and become an arc. The annotation result of the straight line type segments on the contour of the part to be conformed is obtained by pre-annotation by relevant personnel. For example, the annotation result of the straight line type segments is the straight line type segments that are bolded. The line segments of the straight line type on the contour of the part to be conformed can be determined according to the marking results of the line segments of the straight line type on the contour of the part to be conformed. For any line segment of the straight line type on the contour of the part to be conformed, the default weight of the line segment of the straight line type can be added to the preset increase to obtain the conformal weight corresponding to the line segment of the straight line type, that is, the conformal weight corresponding to the line segment of the straight line type is the sum of the default weight of the line segment of the straight line type and the preset increase.
[0075] In the present application, it is considered that the default weight of the straight line segment in the part to be conformed is small. If the default weight of the straight line segment is directly used to conform the straight line segment in the conforming process of the part to be conformed, it may cause a part of the straight line segment to be bent and become an arc. Accordingly, if the conformal distortion correction algorithm generates a sub-map corresponding to the part to be conformed based on the default weight of the straight line segment, the generated sub-map corresponding to the part to be conformed is a sub-map that will cause a part of the straight line segment in the part to be conformed to be bent when it is used to conform the part to be conformed. Further, using a sub-map with a part of the straight line segment in the part to be conformed to be bent to participate in the training of the conformal network, it may result in that after the training is completed, the sub-map corresponding to the part to be conformed in the target conformal distortion correction map corresponding to the target image generated by the conformal network is a sub-map that will cause a part of the straight line segment in the part to be conformed in the target image to be bent when it is used to conform the part to be conformed in the target image.
[0076] In the present application, the conformal weight corresponding to the line segment of the straight line type is greater than the default weight of the line segment of the straight line type, which can ensure that the conformal strength of the conformal distortion correction algorithm for the line segment of the straight line type is a smaller conformal strength, and the sub-map corresponding to the part to be conformed generated by the conformal distortion correction algorithm based on the conformal weight corresponding to the line segment of the straight line type is a sub-map that can avoid bending of a part of the line segment of the straight line type in the part to be conformed when it is used to conform the part to be conformed. Furthermore, the sub-map that will cause bending of a part of the line segment of the straight line type in the part to be conformed when it is used to conform the part to be conformed participates in the training of the conformal network, ensuring that after the training is completed, when the sub-map corresponding to the part to be conformed in the target conformal distortion correction map corresponding to the target image generated by the conformal network is used to conform the part to be conformed in the target image, it will not cause bending of a part of the line segment of the straight line type in the part to be conformed in the target image.
[0077] In some embodiments, a target conformal distortion correction map is used to perform conformal distortion correction on a target line-preserving distortion corrected image to obtain a corrected image, including: traversing the first pixel in the target conformal distortion correction map; when traversing to the first pixel whose pixel value is not the target value, searching for a second pixel in the target line-preserving distortion corrected image whose position is the pixel value of the first pixel, and using the found second pixel to replace the second pixel corresponding to the position of the first pixel, wherein the second pixel corresponding to the position of the first pixel whose pixel value is the target value does not participate in conformal preservation, the position of the found second pixel is different from the position of the second pixel corresponding to the position of the first pixel, the pixel value of the first pixel whose pixel value is not the target value is the position of another target second pixel, and the other target second pixel is used to replace the second pixel corresponding to the position of the first pixel whose pixel value is not the target value.
[0078] In the present application, the position of each first pixel in the target conformal distortion correction mapping image corresponding to the target image corresponds to a second pixel in the target line-preserving distortion correction image corresponding to the target image, and the position of the first pixel is the same as the position of the second pixel corresponding to the position of the first pixel.
[0079] For a first pixel in the target conformal distortion correction mapping image corresponding to the target image, if the second pixel corresponding to the position of the first pixel does not participate in conformal preservation, that is, the second pixel corresponding to the position of the first pixel does not need to be replaced by other second pixels except the second pixel corresponding to the position of the first pixel, then the pixel value of the first pixel is the target value, for example 0; if the second pixel corresponding to the position of the first pixel participates in conformal preservation, then the pixel value of the first pixel is the position of the target other second pixel in the target line-preserving distortion correction image corresponding to the target image, which is used to replace the second pixel corresponding to the position of the first pixel.
[0080] When the target line-preserving distortion correction image corresponding to the target image is subjected to conformal distortion correction using the target conformal distortion correction map corresponding to the target image to obtain the corrected image, the first pixel in the target conformal distortion correction map corresponding to the target image is traversed. When the pixel value of the traversed first pixel is not the target value, such as 0, it can be determined that the second pixel corresponding to the position of the first pixel participates in the conformal preservation, and the second pixel whose position is the pixel value of the first pixel in the target line-preserving distortion correction image corresponding to the target image is searched, and the second pixel found is a target other second pixel, and the second pixel corresponding to the position of the first pixel is replaced by the second pixel found. After the traversal is completed, each second pixel that needs to be replaced in the target line-preserving distortion correction image corresponding to each target image is replaced by the corresponding other second pixel, thereby obtaining the corrected image.
[0081] In the present application, for the second pixel that does not participate in the shape preservation, since the pixel value of the first pixel whose position corresponds to the second pixel that does not participate in the shape preservation in the target shape preservation distortion correction mapping map corresponding to the target image is the target value, the second pixel that does not participate in the shape preservation can be determined to be not involved in the shape preservation directly according to the pixel value of the first pixel whose position corresponds to the second pixel that does not participate in the shape preservation being the target value. There is no need to compare the pixel value of the first pixel whose position corresponds to the second pixel that does not participate in the shape preservation with the position of the second pixel that does not participate in the shape preservation to determine that the second pixel that does not participate in the shape preservation does not participate in the shape preservation, thereby improving the speed of the process of performing shape preservation distortion correction on the line-preserving distortion correction image using the shape preservation distortion correction mapping map.
[0082] Please refer to Figure 2 , which shows a structural block diagram of an image processing device provided in an embodiment of the present application. The image processing device comprises: a first correction unit 201, an acquisition unit 202, and a second correction unit 203.
[0083] The first correction unit 201 is configured to perform line-preserving distortion correction on the target image to obtain a target line-preserving distortion corrected image corresponding to the target image;
[0084] The acquisition unit 202 is configured to input the target line-preserving distortion-corrected image into a conformal network to obtain a target conformal distortion-corrected map corresponding to the target image;
[0085] The second correction unit 203 is configured to perform shape-preserving distortion correction on the target line-preserving distortion-corrected image by using the target shape-preserving distortion correction map to obtain a corrected image.
[0086] In some embodiments, the second correction unit 203 is further configured to traverse the first pixel in the target conformal distortion correction mapping image; when traversing to the first pixel whose pixel value is not the target value, search for the second pixel in the target line-preserving distortion correction image whose position is the pixel value of the first pixel, and use the found second pixel to replace the second pixel corresponding to the position of the first pixel, wherein the second pixel corresponding to the position of the first pixel whose pixel value is the target value does not participate in conformal preservation, the position of the found second pixel is different from the position of the second pixel corresponding to the position of the first pixel, the pixel value of the first pixel whose pixel value is not the target value is the position of another target second pixel, and the other target second pixel is used to replace the second pixel corresponding to the position of the first pixel whose pixel value is not the target value.
[0087] In some embodiments, the image processing apparatus further comprises:
[0088] A training unit is configured to generate training data; wherein the training data includes: a plurality of line-preserving distortion correction sample images, and a conformal distortion correction annotation map corresponding to each line-preserving distortion correction sample image; and the conformal network is trained based on the plurality of line-preserving distortion correction sample images, and the conformal distortion correction annotation map corresponding to each of the line-preserving distortion correction sample images.
[0089] In some embodiments, the training unit is further configured to obtain a set of original images; perform line-preserving distortion correction on each original image in the set of original images using a line-preserving distortion correction algorithm to obtain a line-preserving distortion corrected image corresponding to the original image; generate a conformal distortion correction map corresponding to each original image based on the conformal distortion correction algorithm and each of the line-preserving distortion corrected images; filter out a corresponding conformal distortion correction map whose conformal accuracy is greater than an accuracy threshold from the conformal distortion correction map corresponding to each original image; use the line-preserving distortion correction image corresponding to the filtered conformal distortion correction map as the line-preserving distortion correction sample image, and use the filtered conformal distortion correction map as the conformal distortion correction annotation map corresponding to the line-preserving distortion correction sample image.
[0090] In some embodiments, the line-preserving distortion corrected image corresponding to the original image includes a human body, and the conformal distortion corrected mapping diagram corresponding to the original image includes: sub-mapping diagrams corresponding to each part to be conformed of the human body; the training unit is further configured to determine each part to be conformed of the human body based on the annotation boxes of each part to be conformed of the human body, and the part to be conformed is one of the following: the head of the human body, the torso of the human body, and the foot of the human body; for each part to be conformed, the conformal distortion correction algorithm is used to generate a sub-mapping diagram corresponding to the part to be conformed, wherein each third pixel in the sub-mapping diagram corresponding to the part to be conformed corresponds to a fourth pixel belonging to the part to be conformed, and the pixel value of the third pixel is the position of the pixel used to replace the fourth pixel corresponding to the third pixel or the position of the pixel of the fourth pixel corresponding to the third pixel in the line-preserving distortion corrected image corresponding to the original image.
[0091] In some embodiments, the training unit is further configured to determine a conformal weight corresponding to the part to be conformed, wherein the conformal weight corresponding to the part to be conformed is related to the conformal strength of the conformal distortion correction algorithm for the part to be conformed; and generate a sub-mapping map corresponding to the part to be conformed based on the conformal weight corresponding to the part to be conformed using the conformal distortion correction algorithm.
[0092] In some embodiments, the conformal weights corresponding to the part to be conformal include: conformal weights corresponding to line segments on the contour of the part to be conformal; the training unit is further configured to determine the straight line segments in the part to be conformal based on the labeling results of the straight line segments in the part to be conformal; and determine the conformal weights corresponding to the straight line segments based on the default weights of the straight line segments, wherein the default weight is the weight used by default for the straight line segments when the conformal distortion correction algorithm performs conformal distortion correction, the conformal weights corresponding to the straight line segments are greater than the default weight, and the size of the conformal weights corresponding to the straight line segments is inversely proportional to the size of the conformal strength for the straight line segments.
[0093] In some embodiments, the training unit is further configured to acquire images under different shooting conditions, where the shooting conditions include: at least one of terminal model, focal length, and light intensity; and combine the images under different shooting conditions into the original image set.
[0094] Any step in the embodiment of the image processing method provided in this application and the specific operation in any step can be completed by the corresponding unit in the image processing device. The process of the corresponding operation completed by each unit in the image processing device refers to the process of the corresponding operation described in the embodiment of the image processing method.
[0095] Through the image processing device, a corrected image is obtained, and the corrected image has line-preserving effect and shape-preserving effect. Through the shape-preserving network, a target shape-preserving distortion correction mapping map corresponding to the target image is obtained without multiple iterations, thereby improving the speed of the image processing process. At the same time, there is no need to determine the position of the human body in the image through a portrait segmentation model, and the shape-preserving effect is not affected by the accuracy of the portrait segmentation model.
[0096] Figure 3 3 is a block diagram of a structure of an electronic device provided by this embodiment. The electronic device includes a processing component 322, which further includes one or more processors, and a memory resource represented by a memory 332, which is used to store instructions executable by the processing component 322, such as an application. The application stored in the memory 332 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 322 is configured to execute instructions to perform the above method.
[0097] The electronic device may also include a power supply component 326 configured to perform power management of the electronic device, a wired or wireless network interface 350 configured to connect the electronic device to a network, and an input / output (I / O) interface 358. The electronic device may operate based on an operating system stored in the memory 332, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™ or the like.
[0098] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by an electronic device to complete the above-mentioned image processing method. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0099] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0100] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. An image processing method, characterized in that: The method comprises: Performing line-preserving distortion correction on the target image to obtain a target line-preserving distortion corrected image corresponding to the target image; Inputting the target line-preserving distortion-corrected image into a shape-preserving network to obtain a target shape-preserving distortion-corrected mapping image corresponding to the target image; Using the target shape-preserving distortion correction map, the target line-preserving distortion correction image is subjected to shape-preserving distortion correction to obtain a corrected image; The method of performing shape-preserving distortion correction on the target line-preserving distortion-corrected image using the target shape-preserving distortion-corrected map to obtain a corrected image includes: Traversing a first pixel in the target conformal distortion correction map; When a first pixel whose pixel value is not the target value is traversed, a second pixel whose position is the pixel value of the first pixel in the target line-preserving distortion-corrected image is searched, and the second pixel corresponding to the position of the first pixel is replaced with the searched second pixel.
2. The method according to claim 1, characterized in that The second pixel corresponding to the position of the first pixel whose pixel value is the target value does not participate in the shape preservation. The position of the found second pixel is different from the position of the second pixel corresponding to the position of the first pixel. The pixel value of the first pixel whose pixel value is not the target value is the position of the target other second pixel. The target other second pixel is used to replace the second pixel corresponding to the position of the first pixel whose pixel value is not the target value.
3. The method according to claim 1 or 2, characterized in that: Before performing line-preserving distortion correction on the target image, the method further includes: Generate training data; wherein the training data includes: a plurality of line-preserving distortion correction sample images, and a shape-preserving distortion correction annotation map corresponding to each line-preserving distortion correction sample image; The conformal network is trained based on the multiple line-preserving distortion-corrected sample images and the conformal distortion-corrected annotation maps corresponding to the line-preserving distortion-corrected sample images.
4. The method according to claim 3, characterized in that The generating of training data comprises: Get the original image set; For each original image in the original image set, a line-preserving distortion correction is performed on the original image using a line-preserving distortion correction algorithm to obtain a line-preserving distortion corrected image corresponding to the original image; Based on a shape-preserving distortion correction algorithm and each of the line-preserving distortion corrected images, generating a shape-preserving distortion correction map corresponding to each of the original images; Filtering out a corresponding conformal distortion correction map whose conformal accuracy is greater than an accuracy threshold from the conformal distortion correction map corresponding to each original image; The line-preserving distortion corrected image corresponding to the screened shape-preserving distortion correction map is used as the line-preserving distortion correction sample image, and the screened shape-preserving distortion correction map is used as the shape-preserving distortion correction annotation map corresponding to the line-preserving distortion correction sample image.
5. The method according to claim 4, characterized in that The line-preserving distortion correction image corresponding to the original image includes a human body, the shape-preserving distortion correction map corresponding to the original image includes: sub-maps corresponding to each part of the human body to be shape-preserving; and based on the shape-preserving distortion correction algorithm and each of the line-preserving distortion correction images, generating shape-preserving distortion correction maps corresponding to each of the original images, including: Determine each of the parts to be shaped according to the marked boxes of the parts to be shaped, wherein the parts to be shaped according are one of the following: the head of the human body, the torso of the human body, and the feet of the human body; For each of the parts to be conformal, the conformal distortion correction algorithm is used to generate a sub-map corresponding to the part to be conformal, wherein each third pixel in the sub-map corresponding to the part to be conformal corresponds to each fourth pixel belonging to the part to be conformal, and the pixel value of the third pixel is the position of the pixel used to replace the fourth pixel corresponding to the third pixel or the position of the fourth pixel corresponding to the third pixel in the line-preserving distortion correction image corresponding to the original image.
6. The method according to claim 5, characterized in that Generating a sub-map corresponding to the part to be conformed by using the conformal distortion correction algorithm includes: Determining a shape-preserving weight corresponding to the portion to be shape-preserving, wherein the shape-preserving weight corresponding to the portion to be shape-preserving is related to a shape-preserving strength of the shape-preserving distortion correction algorithm for the portion to be shape-preserving; The conformal distortion correction algorithm is used to generate a sub-map corresponding to the part to be conformed based on the conformal weight corresponding to the part to be conformed.
7. The method according to claim 6, characterized in that The shape-keeping weight corresponding to the part to be shape-keeping includes: the shape-keeping weight corresponding to the line segment on the contour of the part to be shape-keeping; and determining the weight of the part to be shape-keeping includes: Determining the line segments of the straight line type in the portion to be conformed based on the labeling results of the line segments of the straight line type in the portion to be conformed; Based on the default weight of the straight line type line segment, determine the conformal weight corresponding to the straight line type line segment, wherein the default weight is the weight used by default for the straight line type line segment when the conformal distortion correction algorithm performs conformal distortion correction, the conformal weight corresponding to the straight line type line segment is greater than the default weight, and the size of the conformal weight corresponding to the straight line type line segment is inversely proportional to the size of the conformal strength for the straight line type line segment.
8. The method according to claim 4, characterized in that Getting the original image collection includes: Acquire images under different shooting conditions, where the shooting conditions include: at least one of terminal model, focal length, and light intensity; The images under different shooting conditions are combined into the original image set.
9. An image processing device, characterized in that: The device comprises: A first correction unit is configured to perform line-preserving distortion correction on a target image to obtain a target line-preserving distortion corrected image corresponding to the target image; an acquisition unit, configured to input the target line-preserving distortion-corrected image into a conformal network to obtain a target conformal distortion-corrected map corresponding to the target image; A second correction unit is configured to perform conformal distortion correction on the target line-preserving distortion-corrected image using the target conformal distortion correction map to obtain a corrected image; Among them, the second correction unit is further configured to traverse the first pixel in the target conformal distortion correction map; when traversing to the first pixel whose pixel value is not the target value, search for the second pixel in the target line-preserving distortion correction image whose position is the pixel value of the first pixel, and use the found second pixel to replace the second pixel corresponding to the position of the first pixel.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 8.
11. A storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Image correction method, device, electronic equipment and computer readable medium
CN112686824A