CN108040210B - Local distortion correction method, mobile terminal and related medium product - Google Patents

Local distortion correction method, mobile terminal and related medium product Download PDF

Info

Publication number
CN108040210B
CN108040210B CN201810062100.5A CN201810062100A CN108040210B CN 108040210 B CN108040210 B CN 108040210B CN 201810062100 A CN201810062100 A CN 201810062100A CN 108040210 B CN108040210 B CN 108040210B
Authority
CN
China
Prior art keywords
image
corrected
distortion
image area
mobile terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201810062100.5A
Other languages
Chinese (zh)
Other versions
CN108040210A (en
Inventor
李龙佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810062100.5A priority Critical patent/CN108040210B/en
Publication of CN108040210A publication Critical patent/CN108040210A/en
Application granted granted Critical
Publication of CN108040210B publication Critical patent/CN108040210B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

The invention discloses a method for correcting local distortion, which further comprises the following steps: acquiring an image shot by a large-view-angle lens of the mobile terminal; acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter; acquiring a central pixel grid of the image according to a preset size; dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2; correcting the N pixel grids with the central pixel grid as a distortion correction reference to obtain a corrected image. The embodiment of the invention also provides the mobile terminal. The embodiment of the invention can correct the distortion of the image shot by the large-visual-angle lens to a certain degree.

Description

Local distortion correction method, mobile terminal and related medium product
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a distortion correction method, a mobile terminal, and a related medium product.
Background
Due to the physical non-linear characteristics of the camera lens, the distortion of the shape of the real object on the image is inevitably caused in the imaging process, and the concrete expression of the distortion can be classified into pincushion distortion, barrel distortion and linear distortion. The distortion not only affects the visual effect of the collected image, but also reduces the measurement precision of the camera if the distortion is directly applied to industrial close-range measurement, thereby affecting the result. The reason why the wide-angle lens has a large distortion with respect to the normal lens is that the distortion is related only to the object height (or the size of the field angle), and the wide-angle lens has a large field angle with respect to the normal lens and further has a large degree of distortion with respect to the normal lens.
Therefore, it is becoming increasingly important to develop a correction method for distorting an image photographed by a wide-angle lens.
Disclosure of Invention
The embodiment of the invention provides a local distortion correction method and a mobile terminal, which are used for correcting distortion of an image shot by a large-view-angle lens to a certain degree.
The first aspect of the present invention provides a method for correcting local distortion, including:
acquiring an image shot by a large-view-angle lens of the mobile terminal;
acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter;
acquiring a central pixel grid of the image according to a preset size;
dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2;
correcting the N pixel grids with the central pixel grid as a distortion correction reference to obtain a corrected image.
With reference to the first aspect of the present invention, in a first possible implementation manner of the first aspect, the acquiring an image region to be corrected in the image includes:
analyzing the image to obtain an image area with a distortion degree parameter greater than or equal to a preset distortion degree parameter;
displaying the image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal, and prompting a user to select the image area to be corrected;
if a selection instruction input by a user is received, acquiring an image area to be corrected corresponding to the selection instruction to obtain the image area to be corrected.
With reference to the first aspect of the present invention, in a first possible implementation manner of the first aspect, the acquiring an image region to be corrected in the image includes:
analyzing the image to obtain all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are image areas to be corrected.
With reference to the first aspect, the first or second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the correcting the N pixel grids with the central pixel grid as a distortion correction reference includes:
acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid;
according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids;
and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
With reference to the first aspect and the first to third possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the dividing the image into N pixel grids having the same size as the central pixel grid includes:
and gridding the image area to be corrected according to a preset size to obtain N pixel grids with the same size as the central pixel grid.
A second aspect of the present invention provides a mobile terminal, including:
the first acquisition unit is used for acquiring an image shot by a large-angle-of-view lens of the mobile terminal.
The second acquisition unit is used for acquiring an image area to be corrected in the image acquired by the first acquisition unit, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter;
a third obtaining unit, configured to obtain, according to a preset size, a central pixel grid of the image obtained by the first obtaining unit;
a dividing unit, configured to divide the image area to be corrected acquired by the second acquiring unit into N pixel grids having the same size as the central pixel grid, where N is an integer greater than or equal to 2;
and a correction unit configured to correct the N pixel grids using the central pixel grid acquired by the third acquisition unit as a distortion correction reference to obtain a corrected image.
With reference to the second aspect of the present invention, in a first possible implementation manner of the second aspect, the second obtaining unit is specifically configured to:
analyzing the image to obtain an image area with a distortion degree parameter greater than or equal to a preset distortion degree parameter;
displaying the image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal, and prompting a user to select the image area to be corrected;
if a selection instruction input by a user is received, acquiring an image area to be corrected corresponding to the selection instruction to obtain the image area to be corrected.
With reference to the second aspect of the present invention, in a first possible implementation manner of the second aspect, the second obtaining unit is specifically configured to:
analyzing the image to obtain all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are image areas to be corrected.
With reference to the second aspect and the first or second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the correcting unit is specifically configured to:
acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid;
according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids;
and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
With reference to the second aspect of the present invention and the first to third possible implementation manners of the second aspect, in a fourth possible implementation manner of the second aspect, the image area to be corrected is subjected to gridding processing according to a preset size, so as to obtain N pixel grids having the same size as the central pixel grid.
The embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, because the lens distortion is a general term of the intrinsic perspective distortion of the optical lens actually, namely the distortion caused by perspective reasons is the intrinsic defect of the optical lens, the distortion can only be reduced but cannot be eliminated, therefore, the image shot through the optical lens has distortion which is just the problem of the distortion degree, the distortion degree of the edge of the image shot through the large-angle lens is larger, the distortion is smaller as the image is closer to the middle, and the distortion of the image area close to the middle is negligible, therefore, the image shot through the large-angle lens of the mobile terminal is obtained firstly; acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter; acquiring a central pixel grid of the image according to a preset size; dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2; and correcting the N pixel grids by taking the central pixel grid as a distortion correction reference to obtain a corrected image, so that the distortion of the image shot by the large-view-angle lens can be corrected to a certain degree.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for correcting local distortion according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for correcting local distortion according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for correcting local distortion according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a mobile terminal according to a first embodiment of the present invention;
fig. 5 is a schematic structural diagram of a mobile terminal according to a second embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a local distortion correction method and a mobile terminal, which are used for correcting distortion of an image shot by a large-view-angle lens to a certain degree.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following are detailed below.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
One embodiment of the present invention is a method for correcting local distortion. The method for correcting the local distortion comprises the following steps: acquiring an image shot by a large-view-angle lens of the mobile terminal; acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter; acquiring a central pixel grid of the image according to a preset size; dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2; correcting the N pixel grids with the central pixel grid as a distortion correction reference to obtain a corrected image.
Referring to fig. 1, fig. 1 is a flowchart of a method for correcting local distortion according to a first embodiment of the present invention. As shown in fig. 1, a method for correcting local distortion according to an embodiment of the present invention may include steps S101 to S105:
s101, acquiring an image shot by a large-view-angle lens of the mobile terminal.
In an embodiment, a specific implementation of acquiring an image captured by a large-angle lens of a mobile terminal may be that the mobile terminal directly acquires an image captured by the large-angle lens stored in a local area of the mobile terminal, or that the mobile terminal acquires an image captured by the large-angle lens from a cloud server.
In another embodiment, a specific implementation of acquiring an image captured by a large-view-angle lens of a mobile terminal may be that the mobile terminal starts a large-view-angle camera of the mobile terminal, and captures a target object through the large-view-angle camera to obtain a captured image.
The large-view-angle lens of the mobile terminal can be, for example, a large-view-angle lens module consisting of a wide-angle lens, a fisheye lens and two cameras, the large-view-angle lens can be arranged at the top of the mobile terminal and used as a rear camera or a front camera, and can also be arranged on a rotating mechanism of the mobile terminal to form a rotary large-view-angle lens module, and the lens view angle of the large-view-angle lens can be, for example, 120 degrees, so that a wide-angle effect can be achieved.
The mobile terminal may be, for example, any or all of a smart phone, a wearable device (personal hub), a personal or mobile multimedia player, a Personal Digital Assistant (PDA), a laptop computer, a tablet computer, a smartbook, a palmtop computer, and similar personal electronic devices, may include a network interface, a processor, a memory, an audio processing circuit, a microphone, a camera, a flash light, and may include an audio amplifier that may be internal or external and a speaker unit connected to the audio amplifier.
S102, acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter.
The image area to be corrected in the image may be a part of the image area with the distortion degree parameter greater than or equal to the preset distortion degree parameter, or may be the whole image area with the distortion degree parameter greater than or equal to the preset distortion degree parameter.
In an embodiment, the specific implementation of acquiring the image region to be corrected in the image may be: analyzing the image shot by the wide-angle lens to obtain an image area with a distortion degree parameter greater than or equal to a preset distortion degree parameter; displaying the image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal, and prompting a user to select the image area to be corrected; if a selection instruction input by a user is received, acquiring an image area to be corrected corresponding to the selection instruction to obtain the image area to be corrected.
In another embodiment, a specific implementation of acquiring the image region to be corrected in the image may also be: analyzing the image to obtain all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are image areas to be corrected.
And S103, acquiring a central pixel grid of the image according to a preset size.
The predetermined size may be, for example, 100 × 100 pixels, 200 × 200 pixels, 400 × 400 pixels, 500 × 500 pixels, or other values.
In this embodiment of the present invention, if the preset size is 100 × 100 pixels, the mobile terminal obtains the central pixel grid of the image obtained in step S101 according to 100 × 100 pixels. The central pixel grid may be the basis of distortion correction because the distortion of the image area closer to the middle point is less and negligible due to the inherent characteristics of the optical lens, and the mobile terminal may correct pixel grids other than itself according to the central pixel grid. The pixel grid is a cell formed by a plurality of pixel points; the central pixel grid is a cell dotted out in the middle of the image.
S104, dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer larger than or equal to 2.
In the embodiment of the present invention, since the distortion correction is performed on the image area of which the distortion degree parameter is greater than or equal to the preset distortion degree parameter in the image, and the image area is based on the central pixel grid, the image area of which the distortion degree is greater than or equal to the preset distortion degree parameter needs to be divided into a plurality of pixel grids with the same size as the central pixel grid, where the preset distortion degree parameter may be: 0.2, 0.4, 0.8, 1, 2 or other values. A specific implementation of dividing the image area to be corrected into N pixel grids having the same size as the central pixel grid may be to perform a meshing process on the image area to be corrected according to a preset size to obtain N pixel grids having the same size as the central pixel grid.
And S105, correcting the N pixel grids by taking the central pixel grid as a distortion correction reference to obtain a corrected image.
In the embodiment of the present invention, the mobile terminal uses the central pixel grid obtained in step S103 as a distortion correction reference, corrects the N pixel grids obtained in step S104 according to a preset distortion correction algorithm, and then integrates the N pixel grids after correction and the central pixel grid to obtain a corrected image. The preset distortion correction algorithm may include, for example: a polynomial coordinate transformation algorithm, a polynomial piece approximation algorithm, a grid template algorithm, an equivalent spherical model method, a grid template piece algorithm or other distortion correction algorithms.
In an embodiment, a specific implementation of correcting the N pixel grids with the central pixel grid as a distortion correction reference may be: acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids; and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
In another embodiment, the distortion correction of the N pixel grids according to the distortion degree parameter corresponding to the N pixel grids may be implemented by determining a horizontal distortion correction amount and a vertical distortion correction amount corresponding to the N pixel grids according to a preset distortion model and the horizontal distortion degree parameter and the vertical distortion degree parameter corresponding to the N pixel grids; and carrying out distortion correction on the N pixel grids according to the transverse distortion correction amount and the longitudinal distortion correction amount corresponding to the N pixel grids.
In the embodiment of the invention, because the lens distortion is a general term of the intrinsic perspective distortion of the optical lens actually, namely the distortion caused by perspective reasons is the intrinsic defect of the optical lens, the distortion can only be reduced but cannot be eliminated, therefore, the image shot through the optical lens has distortion which is just the problem of the distortion degree, the distortion degree of the edge of the image shot through the large-angle lens is larger, the distortion is smaller as the image is closer to the middle, and the distortion of the image area close to the middle is negligible, therefore, the image shot through the large-angle lens of the mobile terminal is obtained firstly; acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter; acquiring a central pixel grid of the image according to a preset size; dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2; and correcting the N pixel grids by taking the central pixel grid as a distortion correction reference to obtain a corrected image, so that the distortion of the image shot by the large-view-angle lens can be corrected to a certain degree.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for correcting local distortion according to a second embodiment of the present invention. As shown in fig. 2, a method for correcting local distortion according to an embodiment of the present invention may include steps S201 to S209:
s201, acquiring an image shot by a large-view-angle lens of the mobile terminal.
In an embodiment, a specific implementation of acquiring an image captured by a large-angle lens of a mobile terminal may be that the mobile terminal directly acquires an image captured by the large-angle lens stored in a local area of the mobile terminal, or that the mobile terminal acquires an image captured by the large-angle lens from a cloud server.
In another embodiment, a specific implementation of acquiring an image captured by a large-view-angle lens of a mobile terminal may be that the mobile terminal starts a large-view-angle camera of the mobile terminal, and captures a target object through the large-view-angle camera to obtain a captured image.
The large-view-angle lens of the mobile terminal can be, for example, a large-view-angle lens module consisting of a wide-angle lens, a fisheye lens and two cameras, the large-view-angle lens can be arranged at the top of the mobile terminal and used as a rear camera or a front camera, and can also be arranged on a rotating mechanism of the mobile terminal to form a rotary large-view-angle lens module, and the lens view angle of the large-view-angle lens can be, for example, 120 degrees, so that a wide-angle effect can be achieved.
The mobile terminal may be, for example, any or all of a smart phone, a wearable device (personal hub), a personal or mobile multimedia player, a Personal Digital Assistant (PDA), a laptop computer, a tablet computer, a smartbook, a palmtop computer, and similar personal electronic devices, may include a network interface, a processor, a memory, an audio processing circuit, a microphone, a camera, a flash light, and may include an audio amplifier that may be internal or external and a speaker unit connected to the audio amplifier.
S202, analyzing the image to obtain an image area with the distortion degree parameter larger than or equal to a preset distortion degree parameter.
S203, displaying the image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal, and prompting a user to select the image area to be corrected.
S204, if a selection instruction input by a user is received, acquiring an image area to be corrected corresponding to the selection instruction to obtain the image area to be corrected.
Specifically, substituting the image into a preset model to obtain an image area with a distortion degree parameter greater than or equal to a preset distortion degree parameter; the mobile terminal displays the acquired image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal in a blocking mode for a user to view; prompting the user to select the image area to be corrected, wherein the prompting mode can be that prompting information prompting the user to select the image area to be corrected is displayed on a display interface of the mobile terminal, or the prompting mode can be that the user is prompted to select the image area to be corrected through voice, or other modes can be used for prompting the user to select the image area to be corrected; if the mobile terminal receives a selection instruction input by a user, the mobile terminal acquires an image area to be corrected corresponding to the selection instruction, so that the image area required to be corrected in the distortion correction is obtained.
And S205, acquiring a central pixel grid of the image according to a preset size.
S206, carrying out gridding processing on the image area to be corrected according to a preset size to obtain N pixel grids with the same size as the central pixel grid.
S207, acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid.
S208, according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids.
S209, distortion correction is carried out on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
Specifically, the mobile terminal first obtains a central pixel grid of the image captured by the large-angle lens obtained in step S201 according to a preset size (for example, 100 × 100 pixels); then, the mobile terminal performs gridding processing on the image area to be corrected acquired in the step S204 according to 100 × 100 pixels to obtain N pixel grids with the same size as the central pixel grid; then the mobile terminal takes the central pixel grid as a central point to obtain two-dimensional coordinates of the N pixel grids, namely the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; the mobile terminal converts the transverse distortion degree parameter and the longitudinal distortion degree parameter corresponding to the N pixel grids according to the preset ratio of the distance and the distortion degree parameter and the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; the mobile terminal substitutes the transverse distortion degree parameter and the longitudinal distortion degree parameter corresponding to the N pixel grids into a preset distortion correction model to determine a transverse distortion correction value and a longitudinal distortion correction value corresponding to the N pixel grids; and finally, the mobile terminal substitutes the determined transverse distortion correction value and the determined longitudinal distortion correction value corresponding to the N pixel grids into a preset distortion algorithm (such as a grid template slicing algorithm) to correct the N pixel grids, and then integrates the corrected N pixel grids and the central pixel grid to obtain a corrected image.
The distortion parameter represents a quantized value of the distortion of the current position with respect to the center pixel grid.
According to the coordinates of the shot distorted image, the coordinates corresponding to the image are calculated according to a distortion model, namely, the mapping relation between the coordinates of the distorted image and the coordinates of the corrected image is established, and the difference value between the two coordinates is the pixel coordinate offset (namely the distortion correction amount) during the distortion correction.
In the embodiment of the invention, because the lens distortion is a general term of the intrinsic perspective distortion of the optical lens actually, namely the distortion caused by perspective reasons is the intrinsic defect of the optical lens, the distortion can only be reduced but cannot be eliminated, therefore, the image shot through the optical lens has distortion which is just the problem of the distortion degree, the distortion degree of the edge of the image shot through the large-angle lens is larger, the distortion is smaller as the image is closer to the middle, and the distortion of the image area close to the middle is negligible, therefore, the image shot through the large-angle lens of the mobile terminal is obtained firstly; acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter; acquiring a central pixel grid of the image according to a preset size; dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2; acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids; and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids to obtain a corrected image, so that the distortion of the image shot by the large-view-angle lens can be corrected to a certain degree.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for correcting local distortion according to a third embodiment of the present invention. As shown in fig. 3, a method for correcting local distortion according to an embodiment of the present invention may include steps S301 to S307:
s301, acquiring an image shot by a large-view-angle lens of the mobile terminal.
In an embodiment, a specific implementation of acquiring an image captured by a large-angle lens of a mobile terminal may be that the mobile terminal directly acquires an image captured by the large-angle lens stored in a local area of the mobile terminal, or that the mobile terminal acquires an image captured by the large-angle lens from a cloud server.
In another embodiment, a specific implementation of acquiring an image captured by a large-view-angle lens of a mobile terminal may be that the mobile terminal starts a large-view-angle camera of the mobile terminal, and captures a target object through the large-view-angle camera to obtain a captured image.
The large-view-angle lens of the mobile terminal can be, for example, a large-view-angle lens module consisting of a wide-angle lens, a fisheye lens and two cameras, the large-view-angle lens can be arranged at the top of the mobile terminal and used as a rear camera or a front camera, and can also be arranged on a rotating mechanism of the mobile terminal to form a rotary large-view-angle lens module, and the lens view angle of the large-view-angle lens can be, for example, 120 degrees, so that a wide-angle effect can be achieved.
The mobile terminal may be, for example, any or all of a smart phone, a wearable device (personal hub), a personal or mobile multimedia player, a Personal Digital Assistant (PDA), a laptop computer, a tablet computer, a smartbook, a palmtop computer, and similar personal electronic devices, may include a network interface, a processor, a memory, an audio processing circuit, a microphone, a camera, a flash light, and may include an audio amplifier that may be internal or external and a speaker unit connected to the audio amplifier.
S302, analyzing the image to obtain all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are to-be-corrected image areas.
And S303, acquiring a central pixel grid of the image according to a preset size.
S304, gridding the image area to be corrected according to a preset size to obtain N pixel grids with the same size as the central pixel grid.
S305, acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid.
S306, according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids.
S307, distortion correction is carried out on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
Specifically, the mobile terminal first obtains the central pixel grid of the image captured by the large-angle lens obtained in step S301 according to a preset size (for example, 100 × 100 pixels); then, the mobile terminal performs gridding processing on all image areas of which the distortion degree parameters are greater than or equal to the preset distortion degree parameters in the image acquired in the step S302 according to 100 × 100 pixels to obtain N pixel grids with the same size as the central pixel grid; then the mobile terminal takes the central pixel grid as a central point to obtain two-dimensional coordinates of the N pixel grids, namely the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; the mobile terminal converts the transverse distortion degree parameter and the longitudinal distortion degree parameter corresponding to the N pixel grids according to the preset ratio of the distance and the distortion degree parameter and the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; the mobile terminal substitutes the transverse distortion degree parameter and the longitudinal distortion degree parameter corresponding to the N pixel grids into a preset distortion correction model to determine a transverse distortion correction value and a longitudinal distortion correction value corresponding to the N pixel grids; and finally, the mobile terminal substitutes the determined transverse distortion correction value and the determined longitudinal distortion correction value corresponding to the N pixel grids into a preset distortion algorithm (such as a grid template slicing algorithm) to correct the N pixel grids, and then integrates the corrected N pixel grids and the central pixel grid to obtain a corrected image.
In the embodiment of the invention, because the lens distortion is a general term of the intrinsic perspective distortion of the optical lens actually, namely the distortion caused by perspective reasons is the intrinsic defect of the optical lens, the distortion can only be reduced but cannot be eliminated, therefore, the image shot through the optical lens has distortion which is just the problem of the distortion degree, the distortion degree of the edge of the image shot through the large-angle lens is larger, the distortion is smaller as the image is closer to the middle, and the distortion of the image area close to the middle is negligible, therefore, the image shot through the large-angle lens of the mobile terminal is obtained firstly; acquiring all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are to-be-corrected image areas; acquiring a central pixel grid of the image according to a preset size; dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2; acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids; and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids to obtain a corrected image, so that the distortion of the image shot by the large-view-angle lens can be corrected to a certain degree.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a mobile terminal 400 according to an embodiment of the present invention, where the mobile terminal includes:
a first acquiring unit 401, configured to acquire an image captured by a large-angle lens of a mobile terminal.
A second obtaining unit 402, configured to obtain an image region to be corrected in the image obtained by the first obtaining unit, where a distortion degree parameter of the image region to be corrected is greater than or equal to a preset distortion degree parameter.
A third obtaining unit 403, configured to obtain, according to a preset size, a central pixel grid of the image obtained by the first obtaining unit.
A dividing unit 404, configured to divide the image area to be corrected acquired by the second acquiring unit into N pixel grids having the same size as the central pixel grid, where N is an integer greater than or equal to 2.
A correcting unit 405, configured to correct the N pixel grids by using the central pixel grid acquired by the third acquiring unit as a distortion correction reference, so as to obtain a corrected image.
The second obtaining unit 402 is specifically configured to:
analyzing the image to obtain an image area with a distortion degree parameter greater than or equal to a preset distortion degree parameter;
displaying the image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal, and prompting a user to select the image area to be corrected;
if a selection instruction input by a user is received, acquiring an image area to be corrected corresponding to the selection instruction to obtain the image area to be corrected.
The second obtaining unit 402 is specifically configured to:
analyzing the image to obtain all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are image areas to be corrected.
The correction unit 405 is specifically configured to:
acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid;
according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids;
and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
The dividing unit 404 is specifically configured to:
and gridding the image area to be corrected according to a preset size to obtain N pixel grids with the same size as the central pixel grid.
It can be understood that the functions of the functional modules of the mobile terminal 400 in this embodiment may be specifically implemented according to the method in the method embodiment, and the specific implementation process may refer to the relevant description of the method embodiment, which is not described herein again.
In the embodiment of the present invention, since the lens distortion is actually a generic term of the intrinsic perspective distortion of the optical lens, that is, the distortion is caused by the perspective, that is, the distortion is an intrinsic defect of the optical lens, and the distortion can only be reduced but cannot be eliminated, therefore, the image shot through the optical lens has distortion, which is only a problem of the distortion degree, and the distortion degree of the edge of the image shot through the large-angle lens is larger, and the distortion is smaller closer to the middle, so the distortion of the image area close to the middle is negligible, therefore, the first obtaining unit 401 of the present invention first obtains the image shot through the large-angle lens of the mobile terminal; a second obtaining unit 402 obtains an image area to be corrected in the image, wherein a distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter; the third obtaining unit 403 obtains a central pixel grid of the image according to a preset size; the dividing unit 404 divides the image area to be corrected into N pixel grids having the same size as the central pixel grid, where N is an integer greater than or equal to 2; the correction unit 405 corrects the N pixel grids using the central pixel grid as a distortion correction reference to obtain a corrected image, so that distortion of an image captured by the large-angle lens can be corrected to some extent.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a mobile terminal 500 according to an embodiment of the present invention, where the mobile terminal includes: at least one input device 501; at least one output device 502; at least one processor 503, such as a CPU; and a memory 504, the input device 501, the output device 502, the processor 503 and the memory 504 being connected by a bus 505.
The input device 501 may be a touch panel of a mobile terminal, and includes a touch screen and a touch screen, and is configured to detect an operation instruction on the touch panel of the terminal.
The output device 502 may specifically be a display screen of the mobile terminal, and is configured to output and display information.
The memory 504 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 504 is used for storing a set of program codes, and the input device 501, the output device 502 and the processor 503 are used for calling the program codes stored in the memory 504, and performing the following operations:
the above processing 503 is configured to obtain an image captured by a large-angle lens of the mobile terminal;
acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter;
acquiring a central pixel grid of the image according to a preset size;
dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2;
correcting the N pixel grids with the central pixel grid as a distortion correction reference to obtain a corrected image.
In some possible embodiments, the above process 503 is further specifically used for:
analyzing the image to obtain an image area with a distortion degree parameter greater than or equal to a preset distortion degree parameter;
displaying the image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal, and prompting a user to select the image area to be corrected;
if a selection instruction input by a user is received, acquiring an image area to be corrected corresponding to the selection instruction to obtain the image area to be corrected.
In some possible embodiments, the above process 503 is further specifically used for:
analyzing the image to obtain all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are image areas to be corrected.
In some possible embodiments, the above process 503 is further specifically used for:
acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid;
according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids;
and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
In some possible embodiments, the above process 503 is further specifically used for:
and gridding the image area to be corrected according to a preset size to obtain N pixel grids with the same size as the central pixel grid.
In a specific implementation, the input device 501, the output device 502, and the processor 503 described in this embodiment of the present invention may execute the implementation described in each embodiment of the local distortion correction method provided in this embodiment of the present invention, or may execute the implementation of the terminal described in the first embodiment of the mobile terminal provided in this embodiment of the present invention, which is not described herein again.
The elements of all embodiments of the present invention may be implemented by a general purpose integrated circuit, such as a CPU (central processing Unit), or an ASIC (Application Specific integrated circuit).
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs.
The modules or units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. A method for correcting local distortion, comprising:
acquiring an image shot by a large-view-angle lens of the mobile terminal;
acquiring an image area to be corrected in the image, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter;
acquiring a central pixel grid of the image according to a preset size;
dividing the image area to be corrected into N pixel grids with the same size as the central pixel grid, wherein N is an integer greater than or equal to 2;
correcting the N pixel grids with the central pixel grid as a distortion correction reference to obtain a corrected image;
wherein said correcting said N pixel grids with said central pixel grid as a distortion correction reference comprises:
acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids; and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
2. The correction method according to claim 1, wherein the acquiring an image area to be corrected in the image comprises:
analyzing the image to obtain an image area with a distortion degree parameter greater than or equal to a preset distortion degree parameter;
displaying the image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal, and prompting a user to select the image area to be corrected;
if a selection instruction input by a user is received, acquiring an image area to be corrected corresponding to the selection instruction to obtain the image area to be corrected.
3. The correction method according to claim 1, wherein the acquiring an image area to be corrected in the image comprises:
analyzing the image to obtain all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are image areas to be corrected.
4. The correction method according to any one of claims 1 to 3, wherein the dividing the image area to be corrected into N pixel grids having the same size as the central pixel grid comprises:
and gridding the image area to be corrected according to a preset size to obtain N pixel grids with the same size as the central pixel grid.
5. A mobile terminal, comprising:
the first acquisition unit is used for acquiring an image shot by a large-view-angle lens of the mobile terminal;
the second acquisition unit is used for acquiring an image area to be corrected in the image acquired by the first acquisition unit, wherein the distortion degree parameter of the image area to be corrected is greater than or equal to a preset distortion degree parameter;
a third obtaining unit, configured to obtain, according to a preset size, a central pixel grid of the image obtained by the first obtaining unit;
a dividing unit, configured to divide the image area to be corrected acquired by the second acquiring unit into N pixel grids having the same size as the central pixel grid, where N is an integer greater than or equal to 2;
a correction unit configured to correct the N pixel grids using the central pixel grid acquired by the third acquisition unit as a distortion correction reference to obtain a corrected image;
wherein the correction unit is specifically configured to: acquiring the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid; according to the transverse distance and the longitudinal distance from the N pixel grids to the central pixel grid, converting transverse distortion degree parameters and longitudinal distortion degrees corresponding to the N pixel grids; and carrying out distortion correction on the N pixel grids according to the distortion degree parameters corresponding to the N pixel grids.
6. The mobile terminal according to claim 5, wherein the second obtaining unit is specifically configured to:
analyzing the image to obtain an image area with a distortion degree parameter greater than or equal to a preset distortion degree parameter;
displaying the image area with the distortion degree parameter larger than or equal to the preset distortion degree parameter on a display interface of the mobile terminal, and prompting a user to select the image area to be corrected;
if a selection instruction input by a user is received, acquiring an image area to be corrected corresponding to the selection instruction to obtain the image area to be corrected.
7. The mobile terminal according to claim 5, wherein the second obtaining unit is specifically configured to:
analyzing the image to obtain all image areas of which the distortion degree parameters are greater than or equal to preset distortion degree parameters in the image, wherein all the image areas are image areas to be corrected.
8. The mobile terminal according to any of claims 5 to 7, wherein the dividing unit is specifically configured to:
and gridding the image area to be corrected according to a preset size to obtain N pixel grids with the same size as the central pixel grid.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising instructions for a processor to perform the method of any of claims 1 to 4.
10. A mobile terminal comprising a processor and a memory; wherein the processor is configured to call program code stored in the memory to perform performing the method of any of claims 1 to 4.
CN201810062100.5A 2015-06-30 2015-06-30 Local distortion correction method, mobile terminal and related medium product Expired - Fee Related CN108040210B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810062100.5A CN108040210B (en) 2015-06-30 2015-06-30 Local distortion correction method, mobile terminal and related medium product

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810062100.5A CN108040210B (en) 2015-06-30 2015-06-30 Local distortion correction method, mobile terminal and related medium product
CN201510381724.XA CN104994283B (en) 2015-06-30 2015-06-30 A kind of bearing calibration of local distortion and mobile terminal

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201510381724.XA Division CN104994283B (en) 2015-06-30 2015-06-30 A kind of bearing calibration of local distortion and mobile terminal

Publications (2)

Publication Number Publication Date
CN108040210A CN108040210A (en) 2018-05-15
CN108040210B true CN108040210B (en) 2020-03-10

Family

ID=54306033

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201510381724.XA Expired - Fee Related CN104994283B (en) 2015-06-30 2015-06-30 A kind of bearing calibration of local distortion and mobile terminal
CN201810062100.5A Expired - Fee Related CN108040210B (en) 2015-06-30 2015-06-30 Local distortion correction method, mobile terminal and related medium product

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201510381724.XA Expired - Fee Related CN104994283B (en) 2015-06-30 2015-06-30 A kind of bearing calibration of local distortion and mobile terminal

Country Status (1)

Country Link
CN (2) CN104994283B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106358034A (en) * 2016-10-19 2017-01-25 深圳市麦极客图像技术有限公司 Device and equipment for recording and watching VR videos and VR video recording and playing system
CN106488099A (en) * 2016-10-19 2017-03-08 深圳市麦极客图像技术有限公司 Device, equipment and the VR video recording/reproducing system record, watched VR video
CN107220930B (en) * 2017-08-02 2020-08-07 珠海全志科技股份有限公司 Fisheye image processing method, computer device and computer readable storage medium
CN108932698B (en) * 2017-11-17 2021-07-23 北京猎户星空科技有限公司 Image distortion correction method, device, electronic equipment and storage medium
CN108648254B (en) * 2018-04-27 2022-05-17 中科创达软件股份有限公司 Image rendering method and device
CN110809781B (en) * 2018-11-15 2024-02-27 深圳市大疆创新科技有限公司 Image processing method, control terminal and storage medium
KR102575130B1 (en) * 2018-12-26 2023-09-05 주식회사 엘엑스세미콘 Dmura compensation driver
CN109636715B (en) * 2019-02-01 2023-06-13 京东方科技集团股份有限公司 Image data transmission method, device and storage medium
CN110225247B (en) * 2019-05-29 2021-06-15 联想(北京)有限公司 Image processing method and electronic equipment
CN110807076B (en) * 2019-09-12 2021-01-01 拉扎斯网络科技(上海)有限公司 Unit adjusting method, device, server and storage medium
CN110611749A (en) * 2019-09-30 2019-12-24 深圳市大拿科技有限公司 Image processing method and device
CN111105366B (en) * 2019-12-09 2023-11-24 Oppo广东移动通信有限公司 Image processing method and device, terminal equipment and storage medium
CN111008947B (en) * 2019-12-09 2024-05-07 Oppo广东移动通信有限公司 Image processing method and device, terminal equipment and storage medium
CN111050083B (en) * 2019-12-31 2022-02-18 联想(北京)有限公司 Electronic equipment and processing method
CN111476729B (en) * 2020-03-31 2023-06-09 北京三快在线科技有限公司 Target identification method and device
CN113222943B (en) * 2021-05-18 2022-05-03 宁波智能装备研究院有限公司 Image deformation estimation method based on mixed grid transformation model
CN117111046B (en) * 2023-10-25 2024-01-12 深圳市安思疆科技有限公司 Distortion correction method, system, device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101513035A (en) * 2006-09-06 2009-08-19 伊斯曼柯达公司 Color correction method
CN103247031A (en) * 2013-04-19 2013-08-14 华为技术有限公司 Method, terminal and system for correcting aberrant image
CN104537616A (en) * 2014-12-20 2015-04-22 中国科学院西安光学精密机械研究所 Correction method for fisheye image distortion

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8326077B2 (en) * 2008-10-31 2012-12-04 General Instrument Corporation Method and apparatus for transforming a non-linear lens-distorted image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101513035A (en) * 2006-09-06 2009-08-19 伊斯曼柯达公司 Color correction method
CN103247031A (en) * 2013-04-19 2013-08-14 华为技术有限公司 Method, terminal and system for correcting aberrant image
CN104537616A (en) * 2014-12-20 2015-04-22 中国科学院西安光学精密机械研究所 Correction method for fisheye image distortion

Also Published As

Publication number Publication date
CN104994283A (en) 2015-10-21
CN104994283B (en) 2018-01-23
CN108040210A (en) 2018-05-15

Similar Documents

Publication Publication Date Title
CN108040210B (en) Local distortion correction method, mobile terminal and related medium product
CN107657595B (en) Distortion correction method, mobile terminal and related medium product
CN110012209B (en) Panoramic image generation method and device, storage medium and electronic equipment
CN105005972A (en) Shooting distance based distortion correction method and mobile terminal
CN109151442B (en) Image shooting method and terminal
CN110796600B (en) Image super-resolution reconstruction method, image super-resolution reconstruction device and electronic equipment
CN107566749B (en) Shooting method and mobile terminal
CN111107333B (en) Brightness correction method, system, equipment and computer readable storage medium
CN110796664B (en) Image processing method, device, electronic equipment and computer readable storage medium
US9615040B2 (en) Determining a maximum inscribed size of a rectangle
CN110930336B (en) Image processing method and device, electronic equipment and storage medium
CN111080571A (en) Camera shielding state detection method and device, terminal and storage medium
US20220360707A1 (en) Photographing method, photographing device, storage medium and electronic device
CN113920083A (en) Image-based size measurement method and device, electronic equipment and storage medium
CN112351271A (en) Camera shielding detection method and device, storage medium and electronic equipment
CN110874814B (en) Image processing method, image processing device and terminal equipment
CN110942064A (en) Image processing method and device and electronic equipment
CN103929584B (en) Method for correcting image and image calibrating circuit
CN115760585A (en) Image correction method, image correction device, storage medium and electronic equipment
CN111766947A (en) Display method, display device, wearable device and medium
CN111353929A (en) Image processing method and device and electronic equipment
CN113628095B (en) Portrait area grid point information storage method and related product
CN107742275B (en) Information processing method and electronic equipment
CN112070681B (en) Image processing method and device
CN113379843A (en) Parameter calibration method, device and equipment for imaging system of camera module

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200310