Image distortion correction processing method and device, storage medium and electronic equipment

By detecting straight lines in the face region to be corrected, distortion correction parameters are determined for local correction, solving the problem of straight line curvature in existing technologies and achieving better image distortion correction results.

CN115205126BActive Publication Date: 2025-11-04GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110384597.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-09
Publication Date
2025-11-04
Estimated Expiration
2041-04-09

AI Technical Summary

Technical Problem

Existing technologies, when correcting image distortion in facial regions with complex straight-line backgrounds, can easily cause the straight lines to bend, affecting image quality.

Method used

By detecting straight lines in the face region to be corrected, distortion correction parameters are determined based on the straight lines, and local distortion correction is performed on the face region to be corrected, thus avoiding the correction of straight lines.

Benefits of technology

It improves the distortion correction effect in the face region, maintains the authenticity of straight lines, reduces image distortion, has a simple calculation process, and is widely applicable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115205126B_ABST
    Figure CN115205126B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image distortion correction processing method, an image distortion correction processing device, a computer readable storage medium and an electronic device, and relates to the technical field of image processing. The image distortion correction processing method comprises: acquiring a to-be-processed image; determining one or more to-be-corrected face regions in the to-be-processed image; detecting straight lines in the to-be-corrected face regions, determining distortion correction parameters of the to-be-corrected face regions according to the detected straight lines; and performing distortion correction processing on the to-be-corrected face regions by using the distortion correction parameters. The present disclosure can accurately and effectively perform distortion correction processing on a face image containing complex straight lines.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of image processing, and particularly relates to an image distortion correction processing method, an image distortion correction processing apparatus, a computer readable storage medium and an electronic device. BACKGROUND

[0002] When a user uses a camera to shoot an image containing a portrait, the portrait often produces large distortion because the portrait is at the edge of the image. The prior art usually adjusts the distortion correction parameter according to the proportion of the portrait region in the image, and then performs global distortion correction processing on the image. However, when the face is in a background region containing complex straight lines, such as the edges of buildings, doors and windows, etc., the above-mentioned global distortion correction processing will cause the straight line part to appear curved, resulting in image distortion and affecting the effect of image distortion correction processing. SUMMARY

[0003] The present disclosure provides an image distortion correction processing method, an image distortion correction processing apparatus, a computer readable storage medium and an electronic device, thereby at least partially solving the problem of poor distortion correction processing effect when the face is in a background region containing complex straight lines in the prior art.

[0004] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.

[0005] According to a first aspect of the present disclosure, an image distortion correction processing method is provided, comprising: acquiring a to-be-processed image; determining one or more to-be-corrected face regions in the to-be-processed image; detecting straight lines in the to-be-corrected face regions, determining distortion correction parameters of the to-be-corrected face regions according to the detected straight lines; and performing distortion correction processing on the to-be-corrected face regions by using the distortion correction parameters.

[0006] According to a second aspect of the present disclosure, an image distortion correction processing apparatus is provided, comprising: an image acquisition module configured to acquire a to-be-processed image; a face determination module configured to determine one or more to-be-corrected face regions in the to-be-processed image; a straight line detection module configured to detect straight lines in the to-be-corrected face regions, and determine distortion correction parameters of the to-be-corrected face regions according to the detected straight lines; and a distortion correction module configured to perform distortion correction processing on the to-be-corrected face regions by using the distortion correction parameters.

[0007] According to a third aspect of the present disclosure, a computer readable storage medium having a computer program stored thereon is provided, the computer program being executed by a processor to implement the image distortion correction processing method of the first aspect and possible implementation manners thereof.

[0008] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing executable instructions of the processor. Wherein the processor is configured to execute the image distortion correction processing method of the first aspect and possible implementation manners thereof via executing the executable instructions.

[0009] The technical solution of the present disclosure has the following beneficial effects:

[0010] The method comprises: acquiring a to-be-processed image; determining one or more to-be-corrected face regions in the to-be-processed image; detecting straight lines in the to-be-corrected face regions, and determining distortion correction parameters of the to-be-corrected face regions according to the detected straight lines; and performing distortion correction processing on the to-be-corrected face regions by using the distortion correction parameters. On the one hand, the present exemplary embodiment proposes a new image distortion correction processing method, which can determine the distortion correction parameters by detecting the straight lines in the to-be-corrected face regions, so as to perform distortion correction processing on the to-be-corrected face regions based on the distortion correction parameters. When the to-be-corrected face regions contain straight lines, the to-be-corrected face regions can be better corrected while the authenticity of the straight lines is maintained, and the problem of image distortion when the to-be-corrected face regions and the straight lines are corrected together is avoided, and the effect of the present exemplary embodiment is better. On the other hand, the present exemplary embodiment can improve the effect of the distortion correction of the to-be-corrected face regions by only detecting and processing the straight lines in the to-be-corrected face regions, the calculation process is simple, the complexity is low, and the present exemplary embodiment has a wide range of applications.

[0011] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0012] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained from these drawings without creative labor for those skilled in the art.

[0013] Figure 1 A schematic diagram showing a system architecture in the present exemplary embodiment is shown;

[0014] Figure 2 A structural diagram of an electronic device in the present exemplary embodiment is shown;

[0015] Figure 3 A flowchart of an image distortion correction processing method in the present exemplary embodiment is shown;

[0016] Figure 4A subflowchart showing a method of image distortion correction processing in the present exemplary embodiment is shown.

[0017] Figure 5 A subflowchart showing another method of image distortion correction processing in the present exemplary embodiment is shown.

[0018] Figure 6 A flowchart showing another method of image distortion correction processing in the present exemplary embodiment is shown.

[0019] Figure 7 A block diagram showing a configuration of an image distortion correction processing apparatus in the present exemplary embodiment is shown. DETAILED DESCRIPTION

[0020] Example embodiments now will be described more fully hereinafter with reference to the accompanying drawings; however, these embodiments should not be construed as limiting all example embodiments. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example embodiments to those skilled in the art. Like reference numerals refer to like elements throughout. The applicant hereby gives permission to copy any part of the disclosure documents.

[0021] Moreover, the drawings represent a simplified diagram of the disclosure and are not necessarily to scale. Like reference numerals in the drawings denote like or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities, which do not necessarily have to correspond to physically or logically independent entities. These functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0022] An example embodiment of the present disclosure provides a method of image distortion correction processing. Figure 1 A system architecture diagram showing an operating environment of the present exemplary embodiment is shown. As shown in FIG. 1, the present exemplary embodiment is implemented in a system including a plurality of devices connected to each other via a network. The devices include a server device 100, a client device 200, and a client device 300. The server device 100, the client device 200, and the client device 300 are connected to each other via a network 400. Figure 1As shown, the system architecture 100 can include a server 110 and a terminal 120, which form a communication interaction through a network, for example, the server 110 sends the distortion correction processing result to the terminal 120, and the terminal 120 displays the image after the distortion correction processing. Among them, the server 110 refers to the background server providing Internet service; the terminal 120 can include but is not limited to smart phones, tablet computers, game consoles, wearable devices, etc.

[0023] It should be understood that Figure 1 The number of devices in each of the above embodiments is only exemplary. According to the needs of implementation, any number of terminals can be provided, or the server can be a cluster formed by multiple servers.

[0024] The image distortion correction processing method provided by the embodiment of the present disclosure can be executed by the server 110, for example, after the terminal 110 collects the image to be processed, it is sent to the server 110, and after the server 110 performs distortion correction processing on the image to be processed, it is returned to the terminal 110; It can also be executed by the terminal 120, for example, the terminal 110 collects the image to be processed and directly performs distortion correction processing, etc., which is not limited by the present disclosure.

[0025] The exemplary embodiment of the present disclosure provides an electronic device for implementing the image distortion correction processing method, which can be the server 110 or the terminal 120 in Figure 1 The electronic device at least includes a processor and a memory, the memory is used to store the executable instructions of the processor, and the processor is configured to execute the image distortion correction processing method by executing the executable instructions.

[0026] The following takes the mobile terminal 200 in Figure 2 As an example, the configuration of the above electronic device is exemplarily explained. Those skilled in the art should understand that, in addition to the components specially used for mobile purposes, Figure 2 The configuration in

[0027] As Figure 2As shown, the mobile terminal 200 can specifically include a processor 210, an internal memory 221, an external memory interface 222, a USB (Universal Serial Bus) interface 230, a charge management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 271, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a display screen 290, a camera module 291, an indicator 292, a motor 293, a key 294, and a SIM (Subscriber Identification Module) card interface 295, etc.

[0028] The processor 210 can include one or more processing units, for example: the processor 210 can include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit), etc. The encoder can encode (i.e., compress) image or video data; the decoder can decode (i.e., decompress) the code stream data of the image or video to restore the image or video data.

[0029] In some embodiments, the processor 210 can include one or more interfaces, through which different interfaces and other components of the mobile terminal 200 are connected.

[0030] The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 can include volatile memory, non-volatile memory, etc. The processor 210 executes various functional applications and data processing of the mobile terminal 200 by running the instructions stored in the internal memory 221 and / or the instructions stored in the memory provided in the processor.

[0031] The external memory interface 222 can be used to connect an external memory, such as a Micro SD card, to expand the storage capacity of the mobile terminal 200. The external memory communicates with the processor 210 through the external memory interface 222 to realize data storage functions, such as storing music, video, etc.

[0032] The USB interface 230 is an interface in compliance with the USB standard specification, and can be used to connect a charger to charge the mobile terminal 200, or to connect a headset or other electronic device.

[0033] The charging management module 240 is configured to receive charging input from a charger. The charging management module 240 can supply power to the device through the power management module 241 while charging the battery 242; the power management module 241 can also monitor the state of the battery.

[0034] The wireless communication function of the mobile terminal 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor, etc. The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 250 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the mobile terminal 200. The wireless communication module 260 can provide a wireless communication solution including WLAN (Wireless Local Area Networks) such as Wi-Fi (Wireless Fidelity) network, BT (Bluetooth), GNSS (Global Navigation Satellite System), FM (Frequency Modulation), NFC (Near Field Communication), IR (Infrared), etc. applied to the mobile terminal 200.

[0035] The mobile terminal 200 can realize the display function through the GPU, the display screen 290, and the AP, etc. to display the user interface. The mobile terminal 200 can realize the shooting function through the ISP, the camera module 291, the encoder, the decoder, the GPU, the display screen 290, and the AP, etc. and can also realize the audio function through the audio module 270, the speaker 271, the receiver 272, the microphone 273, the earphone interface 274, and the AP, etc.

[0036] The sensor module 280 can include a depth sensor 2801, a pressure sensor 2802, a gyroscope sensor 2803, an air pressure sensor 2804, etc. to realize different sensing and detecting functions.

[0037] The indicator 292 can be an indicator light, which can be used to indicate the charging state, the power change, and can also be used to indicate messages, missed calls, notifications, etc. The motor 293 can generate a vibration prompt, and can also be used for touch vibration feedback, etc. The keys 294 include the power key, the volume key, etc.

[0038] The mobile terminal 200 can support one or more SIM card interfaces 295 for connecting a SIM card to implement functions such as calling and data communication.

[0039] Figure 3 An exemplary flow of the image distortion correction processing method can be executed by the server 110 or the terminal 120, and includes the following steps S310-S340.

[0040] In step S310, a to-be-processed image is obtained.

[0041] The to-be-processed image refers to an image that can be used for distortion correction processing, which can be a portrait image that needs to be processed for face distortion correction. In this exemplary embodiment, the to-be-processed image can be obtained in real time by a camera or an image sensor configured by a terminal device, for example, an original image containing a face is directly photographed by a mobile phone camera as a to-be-processed image; it can also be obtained from other specific image sources, such as from a local stored album or a historically photographed image; it can also be downloaded from the cloud or the network, and so on.

[0042] In step S320, one or more to-be-corrected face regions in the to-be-processed image are determined.

[0043] When the to-be-processed image includes a portrait, the region where the face is located is the face region, for example, in the scene of a group photo, the to-be-processed image includes the face regions of multiple people, and among the multiple face regions, there can be face regions that do not need to be processed for distortion correction, for example, the face region close to the center of the image is often not affected by the lens distortion, so it does not need to be processed for distortion correction; there can also be face regions that need to be processed for distortion correction, for example, the face region close to the edge of the image can be distorted, and this exemplary embodiment can regard the distorted face region as a to-be-corrected face region. In actual applications, the to-be-processed image can include one or more to-be-corrected face regions, for example, in the scene of a group photo, the to-be-processed image includes face regions at the left edge and the right edge of the image, and the face regions are affected by the lens distortion and need to be processed for distortion correction, so the to-be-processed image includes at least two to-be-corrected face regions.

[0044] In this exemplary embodiment, before step S320, the image distortion correction processing method can further include the following steps:

[0045] It is determined whether the to-be-processed image includes a face region;

[0046] If the to-be-processed image includes a face region, it is determined whether the face image is a to-be-corrected face region;

[0047] If the face region is not included in the to-be-processed image, the subsequent distortion correction process is not needed.

[0048] Specifically, the example embodiment can extract various image features, such as texture features, color features, or

[0049] In the example embodiment, whether the face region is included in the to-be-processed image can be identified by extracting specific image features, such as color features, texture features, shape features, or spatial relationship features, etc. from the to-be-processed image. In view of the fact that the example embodiment is to identify the face region, the image features can be feature data capable of reflecting the features of the face region, such as the face shape, the feature shape, the feature structure, the face brightness, the face color, the face texture, the face orientation, or the face size, etc. of the face region. Specifically, the extraction of the image features can be performed in various ways, such as traversing the to-be-processed image using a plurality of Haar feature templates to determine the feature values, so as to extract the corresponding image features, etc. The disclosure does not make a specific limitation on the extraction of the image features.

[0050] Further, when the face region is included in the to-be-processed image, it is also needed to detect whether the face region needs to be processed by the distortion correction, i.e. to determine whether the face region or the face regions included in the to-be-processed image is or are the to-be-corrected face region or regions. If not, it means that the face region included in the to-be-processed image does not need to be processed by the distortion correction, and the to-be-processed image can be directly output. If yes, it means that the face region included in the to-be-processed image needs to be processed by the distortion correction. Specifically, in an example embodiment, the step S320 can include the following steps:

[0051] When the face region is detected in the to-be-processed image, the area and the position information of the face region are determined.

[0052] According to the area and the position information of the face region, it is determined whether the face region is the to-be-corrected face region.

[0053] In the example embodiment, when the face region is detected in the to-be-processed image, the area and the position information of the face region can be obtained. It is to be noted that when the to-be-processed image includes a plurality of face regions, the area and the position information of different face regions can be obtained. The area and the position information can reflect the position of the face region in the to-be-processed image and the area occupied by the face region. Then, according to the area and the position information of the face region, it is determined whether the face region is the to-be-corrected face region when the area and the position information satisfy the preset condition.

[0054] In the present example embodiment, the face regions with different area and position information can have different preset conditions, i.e. after the area and position information of the face region is determined, it can be determined whether it is a face region to be corrected according to the corresponding preset condition. Specifically, the preset condition can be determined by pre-experimenting on the image according to prior information, for example, according to prior information, it is determined that the circular region range with the center of the image as the origin and the radius of 500 pixel units (the circular region range is only illustrative, in other embodiments, other shape ranges can also be included, which are not specifically limited by the present disclosure), when the face region is within the circular region range, the face region will not be distorted, i.e. when the area and position information of the face region meets the preset condition within the circular region range, it is determined that it is not a face region to be corrected; when the face region is outside the circular region range and the area meets certain conditions, the face region will be distorted, i.e. when the area and position information of the face region meets the preset condition outside the circular region range, it is determined that it is a face region to be corrected. It should be noted that in actual application, when the face region is a face region to be corrected, since the area and position information of the face region are different, the correction degree is also different, for example, when the face region is between 500 pixel units and 600 pixel units, the area is greater than the first threshold and less than the second threshold (the second threshold is greater than the first threshold), the correction degree of the face region to be corrected is the first degree; and when the face region is between 600 pixel units and 700 pixel units, the area is greater than the second threshold, the correction degree of the face region to be corrected is the second degree, wherein the second degree is greater than the first degree. Based on this, the present example embodiment can determine whether each face region contained in the image to be processed is a face region to be corrected according to the area and position information of the face region, and when the face region is determined to be a face region to be corrected, what is the correction degree, etc.

[0055] In step S330, a straight line in the face region to be corrected is detected, and the distortion correction parameter of the face region to be corrected is determined according to the detected straight line.

[0056] The straight line in the face region to be corrected refers to a straight line element existing in a region other than the face in the face region to be corrected or a background region. For example, when a person is in a photo with a building or a door and window, or the person takes a photo with the building or the door and window as the background, the wall or the corner edge of the building, the door frame or the partition of the door and window all have straight line elements. In the prior art, when the face region to be corrected is corrected for distortion, the straight line elements outside the face region to be corrected are often not taken into account, and the straight line is also corrected when the face region is corrected, resulting in bending of the straight line and affecting the presentation effect of the final image. Based on this, the present example embodiment can detect the straight line in the face region to be corrected. For example, an algorithm in Masthematica (scientific calculation software) can be used to detect the image to be processed to determine or extract all the straight lines included in the face region to be corrected. Further, the distortion correction parameters of the face region to be corrected are determined according to all the straight lines included in the face region to be corrected.

[0057] In step S340, the face region to be corrected is corrected for distortion by using the distortion correction parameters.

[0058] The distortion correction parameters refer to parameters for correcting the face region to be corrected for distortion. Based on the distortion correction parameters and a pre-established formula or equation, the face region to be corrected can be dynamically updated or adjusted to achieve the distortion correction of the image to be processed.

[0059] In an example embodiment, as shown in FIG. 4, the step S330 can include the following steps: Figure 4

[0060] In step S410, the straight line in the face region to be corrected is detected, and the straight line with a length greater than a preset length threshold is determined as a long straight line.

[0061] In step S420, the distortion correction parameters of the face region to be corrected are determined according to the number of long straight lines.

[0062] ​It is considered that not all straight lines are affected when the distortion correction processing is performed on the face region to be corrected. For example, for a shorter straight line, the influence of distortion on the overall image to be processed is small. Therefore, after detecting the straight line in the face region to be corrected, the example embodiment can first determine whether the straight line is a long straight line, which refers to a straight line with a length greater than a preset length threshold. When the length of the straight line is less than the preset length threshold, it can be considered that the influence of distortion on the straight line is small and no processing is required. When the length of the straight line is greater than the preset length threshold, it can be considered that the influence of distortion on the straight line is large and further analysis can be performed. In the image, the example embodiment can represent the preset length threshold based on a preset pixel unit. For example, in an image to be processed with a resolution of 640*480, 20 pixel units can be set as the preset length threshold, and a straight line with a length greater than 20 pixel units is determined as a long straight line. It should be noted that the preset length threshold can be different in images with different resolutions, and can be customized according to actual needs. The present disclosure does not make specific limitations thereto.

[0063] After determining the long straight line in the face region to be corrected, the long straight line can be filtered with the face region to be corrected, and the distortion correction parameter of the face region to be corrected is determined according to the number of long straight lines. The example embodiment can determine the scene complexity of the current face region to be corrected by judging the number of long straight lines, and determine the distortion correction parameter according to different scene complexities.

[0064] In an example embodiment, the distortion correction parameter includes a scene complexity coefficient of the face region to be corrected; and the step S420 can include the following steps:

[0065] When the number of long straight lines in the face region to be corrected is greater than a preset number threshold, the scene complexity coefficient of the face region to be corrected is determined as a first value;

[0066] When the number of long straight lines in the face region to be corrected is less than the preset number threshold, the scene complexity coefficient of the face region to be corrected is determined as a second value.

[0067] The scene complexity coefficient can reflect complexity of a scene where the face region to be corrected is located. Specifically, the complexity coefficient can be determined according to a number of long straight lines contained in the face region to be corrected. The preset number threshold is a standard threshold for judging whether the number of long straight lines in the face region to be corrected exceeds a certain degree. When the number of long straight lines exceeds the preset number threshold, it is indicated that there are many long straight lines in the face region to be corrected, and the scene complexity is high. Therefore, the scene complexity coefficient can be determined as a first value. When the number of long straight lines does not exceed the preset number threshold, it is indicated that the scene complexity of the face region to be corrected is low. Therefore, the scene complexity coefficient can be determined as a second value, where the second value can be less than the first value.

[0068] Further, in an example embodiment, the step S340 can include the following steps:

[0069] The scale factor is corrected according to the scene complexity coefficient to obtain a correction strength;

[0070] The face region to be corrected is subjected to distortion correction processing by using the correction strength.

[0071] In the example embodiment, the correction strength of the face region to be corrected can be determined by the following formula:

[0072]

[0073] r u The correction strength is greater, and r u The correction degree is greater, and r u The correction degree is smaller, and r0 represents the scale factor, and r p represents a radial distance of each point of the face region to be corrected to the center under perspective projection, and f represents a focal length.

[0074] The scale factor r0 can be determined based on image size and focal length, and can be specifically represented as:

[0075]

[0076] Where d is an image size related parameter, and can be specifically represented as d = min(W, H), where W represents a width value of the image, and H represents a height value of the image.

[0077] In the example embodiment, when the number of long straight lines in the face region to be corrected is greater than the preset number threshold, the scene complexity coefficient of the face region to be corrected is determined as a first value, for example, t r = 0.6. When the number of long straight lines in the face region to be corrected is less than the preset number threshold, the scene complexity coefficient of the face region to be corrected is determined as a second value, for example, tr = 0.5, and the first and second numerical values can be customized as needed, and the present disclosure does not make specific limitations thereon.

[0078] In summary, in the example embodiment, a to-be-processed image is obtained, one or more to-be-corrected face regions are determined in the to-be-processed image, a straight line in the to-be-corrected face region is detected, a distortion correction parameter of the to-be-corrected face region is determined according to the detected straight line, and the to-be-corrected face region is subjected to distortion correction processing by using the distortion correction parameter. On the one hand, the example embodiment proposes a new image distortion correction processing method, which can determine the distortion correction parameter by detecting the straight line in the to-be-corrected face region, and thus can perform distortion correction processing on the to-be-corrected face region based on the distortion correction parameter. When the to-be-corrected face region contains a straight line, the to-be-corrected face region can be better corrected while the authenticity of the straight line part is maintained, and the problem of image distortion when the to-be-corrected face region and the straight line are corrected together is avoided, and the effect is better. On the other hand, the example embodiment can improve the effect of distortion correction of the to-be-corrected face region by only detecting and processing the straight line in the to-be-corrected face region, and the calculation process is simple and has low complexity, and has a wide range of applications.

[0079] In an example embodiment, the step S330 described above can include:

[0080] The straight line in the to-be-corrected face region is detected, and the distortion correction parameter of the to-be-corrected face region is determined according to the complexity of the detected straight line and the face position or face size in the to-be-corrected face region.

[0081] The complexity of the straight line can be used to reflect whether the to-be-corrected face region is in a scene containing a long straight line, or whether the contained long straight line exceeds a certain degree. According to the complexity of the straight line, it can be determined whether the to-be-corrected face region is currently in a complex scene of a long straight line.

[0082] It is considered that when the face position or face size in the to-be-corrected face region is different, even in the same complexity of the straight line, it may have different distortion states and need different degrees of distortion correction processing. Therefore, the example embodiment can determine the distortion correction parameter of the to-be-corrected face region according to the complexity of the straight line and the face position or face size in the to-be-corrected face region, for example, when the number of long straight lines in the to-be-corrected face region is greater than a preset number threshold, the scene complexity coefficient t of the to-be-corrected face region is determined to be 0.6, and further according to the size of the to-be-corrected face region, the scene complexity coefficient or the correction strength is dynamically adjusted to determine the optimal distortion correction effect. r = 0.5, and the first and second numerical values can be customized as needed, and the present disclosure does not make specific limitations thereon.

[0083] In an example embodiment, as Figure 5As shown, the step S340 can include the following steps:

[0084] In step S510, the pre-correction grid information of the face region to be corrected is determined based on the grid divided in the image to be processed.

[0085] In step S520, the pre-correction grid information of the face region to be corrected is corrected by using the distortion correction parameter to obtain the post-correction grid information of the face region to be corrected.

[0086] In step S530, the post-correction grid information of the face region to be corrected is interpolated to obtain the correction result of the face region to be corrected.

[0087] In the example embodiment, the grid in the image to be processed is established, for example, a low-resolution grid is used to represent the coordinate points of each position in the image to be processed, based on which the pre-correction grid information of the face region to be corrected is determined, the pre-correction grid information of the face region to be corrected is corrected by using the distortion correction parameter to obtain the post-correction grid information of the face region to be corrected, that is, the grid information is optimized by using the distortion correction parameter, and finally the correction result of the face region to be corrected is obtained by interpolating the original image to be processed and the optimized grid information.

[0088] In addition, when the face region to be corrected in the image to be processed is locally corrected, as shown, Figure 6 the image distortion correction method in the example embodiment can also be implemented by the following steps: in order to facilitate the correction of the grid information, first, step S610 is performed to perform semantic segmentation on the image to be processed to determine the edge data of the face region to be corrected to obtain the face mask information of the face image to be corrected; step S620 is performed to establish the grid in the image to be processed to determine the pre-correction grid information of the face region to be corrected; step S630 is performed to calculate the scale information of the face region to be corrected according to the face detection result (i.e., the result of whether the image to be processed contains a face), the semantic segmentation result, and the spherical polar projection, the scale information can be calculated according to the area of the face region in the image to be processed and the area of the face region in the spherical polar projection; step S640 is performed to correct the pre-correction grid information, i.e., optimize the grid information, according to the scale information, the perspective projection, and the spherical polar projection; finally, step S650 is performed to interpolate the image to be processed and the corrected grid information to obtain the result of locally correcting the face region to be corrected in the image to be processed.

[0089] It should be noted that the above process of locally correcting the to-be-corrected face region can be applied to a scene in which the to-be-corrected face region has no straight lines, or a complex scene in which the to-be-corrected face region includes multiple straight lines. When in the complex scene, the distortion correction parameter can be determined in combination with the length and number of the straight lines in the scene, so as to correct the grid information, and the like.

[0090] Exemplary embodiments of the present disclosure also provide an image distortion correction processing apparatus. As shown in Figure 7 The image distortion correction processing apparatus 700 can include: an image acquisition module 710, configured to acquire a to-be-processed image; a face determination module 720, configured to determine one or more to-be-corrected face regions in the to-be-processed image; a straight line detection module 730, configured to detect straight lines in the to-be-corrected face region, and determine a distortion correction parameter of the to-be-corrected face region according to the detected straight lines; and a distortion correction module 740, configured to perform distortion correction processing on the to-be-corrected face region by using the distortion correction parameter.

[0091] In an exemplary embodiment, the straight line detection module includes: a long straight line determination unit, configured to detect straight lines in the to-be-corrected face region, and determine a straight line with a length greater than a preset length threshold as a long straight line; and a correction parameter determination unit, configured to determine the distortion correction parameter of the to-be-corrected face region according to the number of long straight lines.

[0092] In an exemplary embodiment, the distortion correction parameter includes a scene complexity coefficient of the to-be-corrected face region; and the correction parameter determination unit includes: a first determination subunit, configured to determine the scene complexity coefficient of the to-be-corrected face region as a first value when the number of long straight lines in the to-be-corrected face region is greater than a preset number threshold; and a second determination subunit, configured to determine the scene complexity coefficient of the to-be-corrected face region as a second value when the number of long straight lines in the to-be-corrected face region is less than the preset number threshold.

[0093] In an exemplary embodiment, the distortion correction module includes: a correction strength acquisition unit, configured to correct a scale factor according to the scene complexity coefficient to obtain a correction strength; and a correction processing unit, configured to perform distortion correction processing on the to-be-corrected face region by using the correction strength.

[0094] In an exemplary embodiment, the face determination module includes: an information determination unit, configured to determine area and position information of a face region when the face region is detected in the to-be-processed image; and a face region determination unit, configured to determine whether the face region is a to-be-corrected face region according to the area and position information of the face region.

[0095] In an exemplary embodiment, the straight line detection module comprises: a distortion correction parameter determination unit configured to detect a straight line in the face region to be corrected, and determine the distortion correction parameter of the face region to be corrected according to the complexity of the detected straight line and the face position or face size in the face region to be corrected.

[0096] In an exemplary embodiment, the distortion correction module comprises: a pre-correction grid information determination unit configured to determine the pre-correction grid information of the face region to be corrected based on the grid divided on the image to be processed; a post-correction grid information determination unit configured to perform distortion correction processing on the pre-correction grid information of the face region to be corrected by using the distortion correction parameter, to obtain the post-correction grid information of the face region to be corrected; and a correction result obtaining unit configured to perform interpolation on the post-correction grid information of the face region to be corrected, to obtain the correction result of the face region to be corrected.

[0097] The specific details of the above-mentioned parts are described in detail in the method part embodiments, and thus will not be described again.

[0098] The exemplary embodiments of the present disclosure also provide a computer readable storage medium, which can be implemented in the form of a program product, comprising program codes, when the program product is run on a terminal device, the program codes are used to make the terminal device execute the steps according to various exemplary embodiments of the present disclosure described in the above "exemplary method" part of the specification, for example, can execute any one or more steps in the above "exemplary method" part. Figure 3 , Figure 4 , Figure 5 or Figure 6 The program product can be in the form of a portable compact disc read-only memory (CD-ROM) and comprises program codes, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or apparatus.

[0099] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory, a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0100] A computer readable signal medium can include a propagated data signal with computer executable code embodied therein. For example, a propagated signal can be an electromagnetic signal, an optical signal, and / or any other suitable type of signal. Such a propagated signal can be in the form of electrical magnetic waves, optical waves, and / or any other suitable type of waves upon which computer executable code is embodied. A suitable medium for storing and / or transmitting computer readable code includes one or more types of random access memory (RAM), magnetic RAM (MRAM), one or more types of ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), one or more types of flash memory, one or more types of volatile memory, one or more types of nonvolatile memory, and / or any other suitable type of memory. The computer readable signal medium can also include any suitable type of data storage medium and / or transmission medium which is suitable for storing and / or transmitting computer executable code.

[0101] The program code embodied on the computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0102] Computer readable program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider.

[0103] Those skilled in the art will recognize improvements and / or modifications to the embodiments of the present disclosure. In particular, those skilled in the art will recognize and / or appreciate that the herein disclosed aspects of the present disclosure can be practiced with a variety of computer-implemented processes, apparatus, systems, and / or articles of manufacture. Therefore, the true scope of the present disclosure is not to be limited to the embodiments described herein, but is to be accorded the full scope that consists of the embodiments, and the full scope of equivalents to each of the embodiments.

[0104] It is to be understood that the present disclosure is not limited to the precise construction herein described and as shown in the attached drawings, and that changes and modifications can be effected therein by those skilled in the art without departing from the scope of the disclosure. The scope of the present disclosure is defined by the claims appended hereto.

Claims

1. An image distortion correction processing method characterized by comprising: The method comprises the following steps: acquiring an image to be processed; determining one or more face regions to be corrected in the image to be processed; detecting straight lines in the face region to be corrected, and determining distortion correction parameters of the face region to be corrected according to the detected straight lines; performing distortion correction processing on the face region to be corrected by using the distortion correction parameters. The step of detecting straight lines in the face region to be corrected and determining distortion correction parameters of the face region to be corrected according to the detected straight lines comprises the following steps: detecting straight lines in the face region to be corrected, and determining long straight lines according to the length of the straight lines; determining distortion correction parameters of the face region to be corrected according to the number of the long straight lines. The distortion correction parameters comprise a scene complexity coefficient of the face region to be corrected, which is used to reflect the complexity of the scene where the face region to be corrected is located. The step of determining distortion correction parameters of the face region to be corrected according to the number of the long straight lines comprises the following steps: when the number of the long straight lines in the face region to be corrected is greater than a preset number threshold, determining the scene complexity coefficient of the face region to be corrected as a first value; when the number of the long straight lines in the face region to be corrected is less than the preset number threshold, determining the scene complexity coefficient of the face region to be corrected as a second value. The first value or the second value is used to participate in the calculation of a correction intensity, which is used to perform distortion correction processing on the face region to be corrected. The step of performing distortion correction processing on the face region to be corrected by using the distortion correction parameters comprises the following steps: correcting a scale factor according to the scene complexity coefficient to obtain a correction intensity; 2. The method of claim 1, wherein, performing distortion correction processing on the face region to be corrected by using the correction intensity. The step of determining one or more face regions to be corrected in the image to be processed comprises the following steps: when a face region is detected in the image to be processed, determining area and position information of the face region; 3. The method of claim 1, wherein, determining whether the face region is a face region to be corrected according to the area and position information of the face region. The step of detecting straight lines in the face region to be corrected and determining distortion correction parameters of the face region to be corrected according to the detected straight lines comprises the following steps:

4. The method of claim 1, wherein, detecting straight lines in the face region to be corrected, and determining distortion correction parameters of the face region to be corrected according to the complexity of the detected straight lines and the position or size of the face in the face region to be corrected. The step of performing distortion correction processing on the face region to be corrected by using the distortion correction parameters comprises the following steps: determining pre-correction grid information of the face region to be corrected based on a grid divided in the image to be processed; performing distortion correction processing on the pre-correction grid information of the face region to be corrected by using the distortion correction parameters to obtain post-correction grid information of the face region to be corrected; 5. An image distortion correction processing apparatus characterized by comprising: performing interpolation on the post-correction grid information of the face region to be corrected to obtain a correction result of the face region to be corrected. The method comprises the following steps: an image acquisition module, configured to acquire an image to be processed; a face determination module, configured to determine one or more face regions to be corrected in the image to be processed; The straight line detection module is configured to: detect straight lines in the face region to be corrected, and determine the distortion correction parameter of the face region to be corrected according to the detected straight lines; The distortion correction module is configured to: perform distortion correction processing on the face region to be corrected by using the distortion correction parameter. The straight line detection module is configured to: detect straight lines in the face region to be corrected, and determine the distortion correction parameter of the face region to be corrected according to the detected straight lines; The distortion correction parameter includes a scene complexity coefficient of the face region to be corrected, and the scene complexity coefficient is used to reflect the complexity of a scene in which the face region to be corrected is located. The distortion correction parameter is determined according to the number of long straight lines in the face region to be corrected. When the number of long straight lines in the face region to be corrected is greater than a preset number threshold, the scene complexity coefficient of the face region to be corrected is determined as a first value. When the number of long straight lines in the face region to be corrected is less than the preset number threshold, the scene complexity coefficient of the face region to be corrected is determined as a second value. The first value or the second value is used to participate in the calculation of a correction intensity, and the correction intensity is used to perform distortion correction processing on the face region to be corrected. The distortion correction parameter is used to perform distortion correction processing on the face region to be corrected.

6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The distortion correction parameter is used to perform distortion correction processing on the face region to be corrected.

7. An electronic device, comprising: The computer program is executed by the processor to implement the method of any one of claims 1 to 4. The computer program is executed by the processor to implement the method of any one of claims 1 to 4. The computer program is executed by the processor to implement the method of any one of claims 1 to 4. The computer program is executed by the processor to implement the method of any one of claims 1 to 4. The computer program is executed by the processor to implement the method of any one of claims 1 to 4. The computer program is executed by the processor to implement the method of any one of claims 1 to 4. The computer program is executed by the processor to implement the method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Linear processing method and device in face image, terminal equipment and storage medium

    CN111008605A

  • Image-based face distortion correction method and apparatus, and electronic device

    CN111080544A