CN112702519B - Image processing method and electronic equipment - Google Patents

Image processing method and electronic equipment Download PDF

Info

Publication number
CN112702519B
CN112702519B CN202011554181.4A CN202011554181A CN112702519B CN 112702519 B CN112702519 B CN 112702519B CN 202011554181 A CN202011554181 A CN 202011554181A CN 112702519 B CN112702519 B CN 112702519B
Authority
CN
China
Prior art keywords
acquisition
image
gesture
posture
standard
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.)
Active
Application number
CN202011554181.4A
Other languages
Chinese (zh)
Other versions
CN112702519A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202011554181.4A priority Critical patent/CN112702519B/en
Publication of CN112702519A publication Critical patent/CN112702519A/en
Application granted granted Critical
Publication of CN112702519B publication Critical patent/CN112702519B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/698Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio

Abstract

The application provides an image processing method and electronic equipment, wherein in the panoramic image shooting process, acquisition equipment is controlled to continuously acquire a plurality of first images; acquiring an acquisition gesture when the acquisition equipment acquires the first image; determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image; splicing the corrected second images to generate a panoramic image; according to the method and the device, when the difference condition is met between the acquisition gesture and the standard gesture of the acquisition equipment, namely the acquisition gesture of the acquisition equipment is not proper, the first image for splicing is combined with the acquisition gesture to be corrected, so that the panoramic image spliced by the corrected second image is free of deformation, and the quality of the panoramic image is guaranteed.

Description

Image processing method and electronic equipment
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and an electronic device.
Background
At present, in the panoramic shooting process, the deformation of panoramic images spliced by collected images is easily caused by improper collection angles of collection equipment, so that the quality of the panoramic images is influenced.
Disclosure of Invention
In view of the above, the present invention provides an image processing method and an electronic device to solve the above technical problems.
In order to achieve the purpose, the invention provides the following technical scheme:
an image processing method comprising:
in the panoramic image shooting process, controlling acquisition equipment to continuously acquire a plurality of first images;
acquiring an acquisition gesture when the acquisition equipment acquires the first image;
determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image;
and splicing the corrected second images to generate a panoramic image.
Optionally, the standard gesture corresponds to a gesture in which the collecting direction of the collecting device and a specific plane meet a parallel condition, and a distance from the specific plane is maintained at a fixed value;
the determining that the difference condition is satisfied between the acquisition gesture and the standard gesture includes:
determining that the acquisition direction of the acquisition equipment and the specific plane do not satisfy the parallel condition in the acquisition gesture, and/or determining that a difference condition is satisfied between the acquisition gesture and the standard gesture, wherein the distance between the acquisition direction of the acquisition equipment and the specific plane in the standard gesture is not maintained at a fixed value relative to the distance between the acquisition direction and the specific plane in the standard gesture.
Optionally, the determining that the acquisition direction of the acquisition device and the specific plane do not satisfy the parallel condition in the acquisition posture and/or that the distance from the specific plane is not maintained at a fixed value relative to the distance from the acquisition direction and the specific plane in the standard posture and determining that the acquisition posture and the standard posture satisfy the difference condition includes:
and determining that the difference between the sub-direction information with the specified attribute in the first direction information corresponding to the acquisition gesture and the sub-direction information with the specified attribute in the second direction information corresponding to the standard gesture meets preset difference direction information, and determining that the difference between the acquisition gesture and the standard gesture meets a difference condition.
Optionally, the correcting the first image corresponding to the acquisition posture according to the acquisition posture includes:
generating an inverse perspective change matrix based on first direction information corresponding to the acquisition gesture and second direction information corresponding to the standard gesture;
converting first pixel information of the first image corresponding to the acquisition pose into second pixel information by using the inverse perspective transformation matrix;
and generating a second image by using the second pixel information.
Optionally, the method further includes:
detecting whether a target image area different from the first image before correction exists in the second image;
if so, cutting the second image so that the cut second image does not contain the target image area;
correspondingly, the second images are utilized for splicing to generate a panoramic image, and the method comprises the following steps:
and splicing the second images after being cut to generate a panoramic image.
Optionally, the method further includes:
detecting whether an image area corresponding to the second image in the panoramic image has a target image area different from the first image before correction;
and if so, cutting the panoramic image so that the processed panoramic image does not contain the target image area.
An electronic device, comprising:
the collector is used for collecting images;
the processor is used for controlling the collector to continuously collect a plurality of first images in the panoramic image shooting process; acquiring an acquisition posture of the acquisition device when acquiring the first image; determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image; and splicing the corrected second images to generate a panoramic image.
Optionally, the standard gesture corresponds to a gesture in which the acquisition direction of the acquisition device and a specific plane meet a parallel condition, and the distance from the acquisition direction of the acquisition device to the specific plane maintains a fixed value;
the processor determining that a difference condition is satisfied between the acquisition pose and a standard pose, comprising:
determining that the acquisition direction of the acquisition equipment and the specific plane do not satisfy the parallel condition in the acquisition gesture, and/or determining that a difference condition is satisfied between the acquisition gesture and the standard gesture, wherein the distance between the acquisition direction of the acquisition equipment and the specific plane in the standard gesture is not maintained at a fixed value relative to the distance between the acquisition direction and the specific plane in the standard gesture.
Optionally, the processor determines that the parallel condition is not satisfied by the collecting direction of the collecting device and the specific plane in the collecting posture, and/or the distance from the specific plane is not maintained at a fixed value relative to the distance from the collecting direction to the specific plane in the standard posture, including:
and determining that the difference between the sub-direction information with the specified attribute in the first direction information corresponding to the acquisition gesture and the sub-direction information with the specified attribute in the second direction information corresponding to the standard gesture accords with preset difference direction information.
Optionally, the processor corrects the first image, and includes:
generating an inverse perspective change matrix based on first direction information corresponding to the acquisition gesture and second direction information corresponding to the standard gesture;
converting first pixel information of the first image into second pixel information using the inverse perspective transformation matrix;
and generating a second image by using the second pixel information.
According to the technical scheme, in the panoramic image shooting process, the acquisition equipment is controlled to continuously acquire a plurality of first images, the acquisition posture of the acquisition equipment when acquiring the first images is acquired is obtained, the acquisition posture and the standard posture meet the difference condition, the first images corresponding to the acquisition posture are corrected according to the acquisition posture to generate second images, and the corrected second images are spliced to generate the panoramic image; therefore, when the difference condition is met between the acquisition posture of the acquisition equipment and the standard posture, namely when the acquisition posture of the acquisition equipment is not proper, the first image for splicing is corrected by combining the acquisition posture, so that the panoramic image spliced by the corrected second image is free of deformation, and the quality of the panoramic image is ensured.
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 embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of an acquisition direction and a specific plane of an acquisition device according to a first embodiment of the method of the present application;
FIG. 3a is a deformed panoramic image provided by the present application;
FIG. 3b is an undistorted panoramic image provided by itself;
FIG. 4 is a schematic diagram of the x, y and z axes provided in a second embodiment of the method of the present application;
fig. 5 is a schematic flowchart of an image processing method according to a third embodiment of the present application;
fig. 6 is a schematic flowchart of an image processing method according to a fourth embodiment of the present application;
FIG. 7a is a first image provided in a fourth embodiment of the method of the present application;
FIG. 7b is a second image provided in a fourth embodiment of the method of the present application;
fig. 7c is a schematic diagram of a rectangular area where a target image area is located in a second image provided in the fourth embodiment of the present application;
fig. 8 is a schematic flowchart of an image processing method according to a fifth embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
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.
An embodiment of the present invention provides an image processing method, as shown in fig. 1, the method includes the following steps:
step 101: in the panoramic image shooting process, controlling acquisition equipment to continuously acquire a plurality of first images;
when a user wants to collect a panoramic image, the all-in image shooting function on the collecting equipment can be started, so that the collecting equipment is controlled to continuously collect a plurality of first images in the panoramic image shooting process.
Step 102: acquiring an acquisition gesture when the acquisition equipment acquires the first image;
specifically, in the panoramic image shooting process, the sensor is used for monitoring the acquisition gesture of the acquisition equipment when acquiring the first image, so that the acquisition gesture of the acquisition equipment acquired by the sensor when acquiring the first image can be acquired.
It should be noted that, according to the method and the device for acquiring the first image, when the acquisition device acquires each first image, the acquisition gesture of the acquisition device during acquisition of the first image can be acquired, and the acquisition gesture is utilized to perform processing of subsequent steps. Or after the acquisition equipment acquires all the first images, acquiring the acquisition gesture of each first image acquired by the acquisition equipment respectively, and then processing the subsequent steps by using the acquisition gesture.
Step 103: determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image;
the standard posture is a preset posture, and when the acquisition equipment acquires the first image in the standard posture, the acquired first image can be free of deformation when being spliced into a panoramic image. Therefore, the acquisition posture of the acquisition device can be compared with the standard posture, whether the acquisition posture and the standard posture meet the difference condition is judged, if yes, it is determined that the panoramic image generated by splicing the first images corresponding to the acquisition posture is deformed, and the first image corresponding to the acquisition posture needs to be corrected. And if the difference condition is not met, determining that the panoramic image generated by splicing the first images corresponding to the acquisition postures is not deformed, and correcting the first images corresponding to the acquisition postures is not needed.
In the present application, the standard posture corresponds to a posture in which the collecting direction of the collecting device and a specific plane satisfy the parallel condition and the distance from the specific plane is maintained at a fixed value.
The specific plane is a preset plane, for example, a preset horizontal plane. As shown in fig. 2, the capturing device is used for a black rectangular representation, the capturing direction thereof always satisfies the parallel condition between the specific screens S1, and the distance between the capturing direction thereof and the specific plane is always maintained at a fixed value d1 during the movement of the capturing device, which corresponds to the standard posture.
The fixed value may be any value. That is, the distance between the collecting direction of the collecting device and the specific plane is maintained at a fixed value, which can be characterized in that the distance between the collecting direction of the collecting device and the specific plane is continuously constant.
Specifically, the determining that the acquisition posture and the standard posture meet the difference condition includes:
determining that the acquisition direction of the acquisition equipment and the specific plane do not satisfy the parallel condition in the acquisition gesture, and/or determining that a difference condition is satisfied between the acquisition gesture and the standard gesture, wherein the distance between the acquisition direction of the acquisition equipment and the specific plane in the standard gesture is not maintained at a fixed value relative to the distance between the acquisition direction and the specific plane in the standard gesture.
And if the difference condition is met, correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image. And if the acquisition direction of the acquisition equipment and the specific plane meet the parallel condition in the acquisition gesture, the distance between the acquisition equipment and the specific plane is maintained at a fixed value relative to the distance between the acquisition direction and the specific plane in the standard gesture, and the difference condition is determined not to be met between the acquisition gesture and the standard gesture, the first image corresponding to the acquisition gesture does not need to be corrected, and the first image corresponding to the acquisition gesture can be directly spliced to generate the panoramic image.
Step 104: and splicing the corrected second images to generate a panoramic image.
It can be understood that, in the panoramic image shooting process, the acquisition device continuously acquires a plurality of first images, and all the first images are corrected, none of the first images are corrected, and parts of the first images are corrected. For ease of understanding, the description is given by way of example, but this is not intended to limit the present application. For example, in the panoramic image shooting process, the acquisition equipment is controlled to continuously acquire 3 first images;
the first way is as follows:
when the acquisition equipment acquires the first image 1, acquiring the acquisition posture of the acquisition equipment when acquiring the first image 1; and determining that the acquisition posture and the standard posture meet a difference condition, and correcting the first image 1 corresponding to the acquisition posture according to the acquisition posture to generate a second image 1.
When the acquisition equipment acquires the first image 2, acquiring the acquisition posture of the acquisition equipment when acquiring the first image 2; and determining that the difference condition is not met between the acquisition posture and the standard posture without correcting the first image 2.
When the acquisition equipment acquires the first image 3, acquiring the acquisition posture of the acquisition equipment when acquiring the first image 3; and determining that the acquisition posture and the standard posture meet a difference condition, and correcting the first image 3 to generate a second image 3.
The corrected second image 1, the uncorrected first image 2, and the corrected second image 3 are stitched together to generate a panoramic image.
In the second mode, the process is as follows:
the method comprises the steps that a first image 1, a first image 2 and a first image 3 are continuously acquired by acquisition equipment, after all acquisition is completed, the acquisition posture of the acquisition equipment when the first image 1 is acquired is obtained, it is determined that the acquisition posture and the standard posture meet the difference condition, the first image 1 corresponding to the acquisition posture is corrected according to the acquisition posture, and a second image 1 is generated.
And acquiring the acquisition posture of the acquisition equipment when acquiring the first image 2. And determining that the difference condition is not met between the acquisition posture and the standard posture without correcting the first image 2.
Acquiring an acquisition posture when the acquisition equipment acquires the first image 3; determining that the acquisition attitude and the standard attitude meet a difference condition, and correcting the first image 3 to generate a second image 3;
the corrected second image 1, the uncorrected first image 2, and the corrected second image 3 are stitched together to generate a panoramic image.
Therefore, in the embodiment, in the panoramic image shooting process, the acquisition equipment is controlled to continuously acquire a plurality of first images, the acquisition posture of the acquisition equipment when acquiring the first images is obtained, and the acquisition posture and the standard posture meet the difference condition, the first images corresponding to the acquisition posture are corrected according to the acquisition posture to generate second images, and the corrected second images are spliced to generate the panoramic image; that is to say, this application can combine the collection gesture to rectify being used for the first image of concatenation when satisfying the difference condition between the collection gesture of collection equipment and the standard gesture, promptly when collection equipment's collection gesture is improper for the panoramic picture that the second image concatenation after utilizing to rectify obtains does not have the deformation, has guaranteed panoramic picture's quality.
For the purpose of understanding the present application, fig. 3a and 3b are used for illustration, where fig. 3a shows a panoramic image generated in a case where the capturing angle of the capturing device is not proper, and in particular, a panoramic image generated in a case where the capturing device has a pitch angle, and it is apparent from fig. 3a that the panoramic image is distorted. And fig. 3b is a panoramic image generated under the condition that the acquisition angle of the acquisition device is correct, and it can be seen through comparison that the panoramic image shown in fig. 3b has no deformation. Therefore, in the case that the acquisition angle of the acquisition device is not proper, in order to avoid obtaining a deformed panoramic image similar to that of fig. 3a, the generated panoramic image is free from deformation by the image processing method provided by the application.
In this embodiment, a specific implementation manner that the acquisition posture and the standard posture meet the difference condition is mainly described.
Specifically, the determining that the parallel condition is not satisfied by the collecting direction of the collecting device and the specific plane in the collecting posture, and/or the distance from the specific plane is not maintained at the fixed value relative to the distance from the collecting direction to the specific plane in the standard posture includes:
and determining that the difference between the sub-direction information with the specified attribute in the first direction information corresponding to the acquisition gesture and the sub-direction information with the specified attribute in the second direction information corresponding to the standard gesture meets preset difference direction information, and determining that the difference between the acquisition gesture and the standard gesture meets a difference condition.
In this application, the acquisition attitude of the acquisition device acquired by the sensor may be represented by direction information, and the direction information acquired by the sensor at least includes sub-direction information of three attributes, as shown in fig. 4, which are tilt (pitch) angle information, yaw (yaw) angle information, and roll (roll) angle information, and specifically may be represented by sub-direction information of an x-axis, sub-direction information of a y-axis, and sub-direction information of a z-axis.
As shown in fig. 4, in the case where the capturing direction of the capturing device coincides with the sight line direction of the holder, the x-axis corresponds to the left and right ear direction of the holder, the z-axis corresponds to the front and rear direction of the holder, and the y-axis corresponds to the up and down direction of the holder.
The sub-direction information of at least one attribute is specified in advance for judging the difference condition, and the study finds that the spliced panoramic image is easy to deform due to deviation of the sub-direction information of the x axis and the z axis, so that the sub-direction information of the x axis and the sub-direction information of the z axis can be used as the sub-direction information of the specified attribute optionally.
Under the condition that the sub-direction information of the x axis and the sub-direction information of the z axis are taken as the sub-direction information of the specified attribute, determining that the difference between the sub-direction information with the specified attribute in the first direction information corresponding to the acquisition gesture and the sub-direction information with the specified attribute in the second direction information corresponding to the standard gesture meets preset difference direction information, specifically: determining that a difference between x-axis sub-direction information in first direction information corresponding to the acquisition gesture and x-axis sub-direction information in second direction information corresponding to the standard gesture conforms to preset difference direction information, and/or determining that a difference between z-axis sub-direction information in first direction information corresponding to the acquisition gesture and z-axis sub-direction information in second direction information corresponding to the standard gesture conforms to preset difference direction information.
The preset difference direction information may be an angle value preset based on an actual situation, for example, the preset difference direction information may be 0.
An embodiment of the present application method provides an image processing method, as shown in fig. 5, the method includes the following steps:
step 501: in the panoramic image shooting process, controlling acquisition equipment to continuously acquire a plurality of first images;
step 502: acquiring an acquisition gesture when the acquisition equipment acquires the first image;
step 503: determining that the acquired gesture and the standard gesture meet a difference condition, and generating an inverse perspective change matrix based on first direction information corresponding to the acquired gesture and second direction information corresponding to the standard gesture;
specifically, an inverse perspective change algorithm may be used in generating the inverse perspective change matrix, and the generated inverse perspective change matrix is related to the sub-direction information with the specified attribute mentioned in the second method embodiment.
Step 504: converting first pixel information of the first image corresponding to the acquisition pose into second pixel information by using the inverse perspective transformation matrix;
step 505: generating a second image using the second pixel information;
step 506: and splicing the corrected second images to generate a panoramic image.
Therefore, when the difference condition is met between the acquisition posture of the acquisition equipment and the standard posture, namely when the acquisition posture of the acquisition equipment is not proper, the first image for splicing is corrected by combining the acquisition posture, so that the panoramic image spliced by the corrected second image is free of deformation, and the quality of the panoramic image is ensured.
An embodiment of the method of the present application provides an image processing method, as shown in fig. 6, the method includes the following processes:
step 601: in the panoramic image shooting process, controlling acquisition equipment to continuously acquire a plurality of first images;
step 602: acquiring an acquisition gesture when the acquisition equipment acquires the first image;
step 603: determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image;
step 604: detecting whether a target image area different from the first image before correction exists in the second image;
after the first image is corrected to generate the second image, the second image may have a target image area different from the first image before correction, and therefore, the second image needs to be detected to determine whether the second image includes the target image area.
Step 605: if a target image area different from the first image before correction exists in the second image, cutting the second image so that the cut second image does not contain the target image area;
fig. 7a is a first image before correction, and fig. 7b is a second image after correction, and it can be seen by comparison that the second image includes a target image area different from the first image, i.e. a black area at the lower left corner and a black area at the lower right corner.
In this embodiment, the second image may be cropped before stitching, so that the cropped second image does not include the target image region. Specifically, only the target image region may be cropped, and in order to ensure the integrity of the subsequently stitched panoramic image, the cropped portion may be supplemented based on the other image regions of the second image except the target image region. Alternatively, the rectangular area of the target image area in the second image area may be cut off, as shown in fig. 7c, the image area P21 in the second image is partially cut off, and in order to ensure the integrity of the subsequently stitched panoramic image, the cut-off portion may be supplemented based on the other image areas of the second image except the target image area.
Step 606: and splicing the second images after being cut to generate a panoramic image.
If the second image does not have a target image region different from the first image before correction, the second image does not need to be spliced directly by using the second image.
Fifth embodiment of the present application provides an image processing method, as shown in fig. 8, the method includes the following steps:
step 801: in the panoramic image shooting process, controlling acquisition equipment to continuously acquire a plurality of first images;
step 802: acquiring an acquisition gesture when the acquisition equipment acquires the first image;
step 803: determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image;
step 804: and splicing the corrected second images to generate a panoramic image.
Step 805: detecting whether an image area corresponding to the second image in the panoramic image has a target image area different from the first image before correction;
step 806: and if the image area corresponding to the second image in the panoramic image has a target image area which is different from the first image before correction, cutting the panoramic image so that the processed panoramic image does not contain the target image area.
In this embodiment, the second images after correction are first stitched to generate a panoramic image, and then it is determined whether an image area corresponding to the second image in the panoramic image has a target image area different from the first image before correction, and if so, the panoramic image is cropped. In another mode, a rectangular area where the target image area is located in the panoramic image may also be cut out.
Corresponding to the above image processing method, an embodiment of the apparatus of the present application further provides an electronic device, and specifically, as shown in fig. 9, is a schematic structural diagram of an electronic device provided in an embodiment of the apparatus of the present application, where the electronic device includes: a collector 910 and a processor 920; wherein:
a collector 910 for collecting images;
the processor 920 is configured to control the collector to continuously collect a plurality of first images in a panoramic image shooting process; acquiring an acquisition posture of the acquisition device when acquiring the first image; determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image; and splicing the corrected second images to generate a panoramic image.
Optionally, the electronic device may further include a sensor, and in the panoramic image shooting process, the sensor is used to monitor the collecting posture of the collecting device when collecting the first image, so that the processor 720 may obtain the collecting posture of the collecting device collected by the sensor when collecting the first image.
The standard posture is a preset posture, and when the acquisition equipment acquires the first image in the standard posture, the acquired first image can be free of deformation when being spliced into a panoramic image. Therefore, the processor 920 may compare the capture pose of the capture device with the standard pose, determine whether a difference condition is satisfied between the capture pose and the standard pose, and if so, determine that a panoramic image generated by stitching the first images corresponding to the capture pose is deformed, and need to correct the first image corresponding to the capture pose. And if the difference condition is not met, determining that the panoramic image generated by splicing the first images corresponding to the acquisition postures is not deformed, and correcting the first images corresponding to the acquisition postures is not needed.
The standard posture corresponds to a posture in which the acquisition direction of the acquisition equipment and a specific plane meet a parallel condition and the distance from the specific plane is maintained at a fixed value.
The fixed value may be any value. That is, the distance between the collecting direction of the collecting device and the specific plane is maintained at a fixed value, which can be characterized in that the distance between the collecting direction of the collecting device and the specific plane is continuously constant.
Specifically, the processor 920 determines that the difference condition between the acquisition gesture and the standard gesture is satisfied, including: determining that the acquisition direction of the acquisition equipment and the specific plane do not satisfy the parallel condition in the acquisition gesture, and/or determining that a difference condition is satisfied between the acquisition gesture and the standard gesture, wherein the distance between the acquisition direction of the acquisition equipment and the specific plane in the standard gesture is not maintained at a fixed value relative to the distance between the acquisition direction and the specific plane in the standard gesture.
And if the difference condition is met, correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image. And if the acquisition direction of the acquisition equipment and the specific plane meet the parallel condition in the acquisition gesture, the distance between the acquisition equipment and the specific plane is maintained at a fixed value relative to the distance between the acquisition direction and the specific plane in the standard gesture, and the difference condition is determined not to be met between the acquisition gesture and the standard gesture, the first image corresponding to the acquisition gesture does not need to be corrected, and the first image corresponding to the acquisition gesture can be directly spliced to generate the panoramic image.
Therefore, in the embodiment, in the panoramic image shooting process, the acquisition equipment is controlled to continuously acquire a plurality of first images, the acquisition posture of the acquisition equipment when acquiring the first images is obtained, and the acquisition posture and the standard posture meet the difference condition, the first images corresponding to the acquisition posture are corrected according to the acquisition posture to generate second images, and the corrected second images are spliced to generate the panoramic image; that is to say, this application can combine the collection gesture to rectify being used for the first image of concatenation when satisfying the difference condition between the collection gesture of collection equipment and the standard gesture, promptly when collection equipment's collection gesture is improper for the panoramic picture that the second image concatenation after utilizing to rectify obtains does not have the deformation, has guaranteed panoramic picture's quality.
In an embodiment of the apparatus of the present application, the processor determines that, in the collecting posture, the collecting direction of the collecting device and the specific plane do not satisfy the parallel condition, and/or the distance from the specific plane is not maintained at a fixed value relative to the distance from the collecting direction and the specific plane in the standard posture, including:
and determining that the difference between the sub-direction information with the specified attribute in the first direction information corresponding to the acquisition gesture and the sub-direction information with the specified attribute in the second direction information corresponding to the standard gesture accords with preset difference direction information.
In this application, the collection gesture of the collection equipment that the sensor gathered can pass through the direction information characterization, and the direction information that the sensor gathered includes the sub direction information of three attributes at least, is slope pitch angle information, driftage yaw angle information and roll angle information respectively, specifically can characterize as the sub direction information of x-axis, the sub direction information of y-axis and the sub direction information of z-axis.
The sub-direction information of at least one attribute is specified in advance for judging the difference condition, and the study finds that the spliced panoramic image is easy to deform due to deviation of the sub-direction information of the x axis and the z axis, so that the sub-direction information of the x axis and the sub-direction information of the z axis can be used as the sub-direction information of the specified attribute optionally.
Under the condition that the sub-direction information of the x axis and the sub-direction information of the z axis are taken as the sub-direction information of the specified attribute, determining that the difference between the sub-direction information with the specified attribute in the first direction information corresponding to the acquisition gesture and the sub-direction information with the specified attribute in the second direction information corresponding to the standard gesture meets preset difference direction information, specifically: determining that a difference between x-axis sub-direction information in first direction information corresponding to the acquisition gesture and x-axis sub-direction information in second direction information corresponding to the standard gesture conforms to preset difference direction information, and/or determining that a difference between z-axis sub-direction information in first direction information corresponding to the acquisition gesture and z-axis sub-direction information in second direction information corresponding to the standard gesture conforms to preset difference direction information.
The preset difference direction information may be an angle value preset based on an actual situation, for example, the preset difference direction information may be 0.
In the third embodiment of the device, the processor corrects the first image and comprises the steps of generating an inverse perspective change matrix based on first direction information corresponding to the acquisition gesture and second direction information corresponding to a standard gesture; converting first pixel information of the first image into second pixel information using the inverse perspective transformation matrix; and generating a second image by using the second pixel information.
In a fourth embodiment of the apparatus of the present application, the processor is further configured to detect whether a target image area different from the first image before correction exists in the second image; if so, cutting the second image so that the cut second image does not contain the target image area; correspondingly, the processor performs stitching by using the second image to generate a panoramic image, and the stitching comprises: and splicing the second images after being cut to generate a panoramic image.
In this embodiment, the second image may be cropped before stitching, so that the cropped second image does not include the target image region. Specifically, only the target image region may be cropped, and in order to ensure the integrity of the subsequently stitched panoramic image, the cropped portion may be supplemented based on the other image regions of the second image except the target image region. Or, the rectangular area where the target image area is located in the second image area may be cut, and in order to ensure the integrity of the subsequently stitched panoramic image, the cut-out portion may be supplemented based on other image areas of the second image except the target image area.
In a fifth embodiment of the apparatus of the present application, the processor is further configured to detect whether an image area corresponding to the second image in the panoramic image has a target image area that is different from the first image before correction; and if so, cutting the panoramic image so that the processed panoramic image does not contain the target image area.
In this embodiment, the second images after correction are first stitched to generate a panoramic image, and then it is determined whether an image area corresponding to the second image in the panoramic image has a target image area different from the first image before correction, and if so, the panoramic image is cropped. In another mode, a rectangular area where the target image area is located in the panoramic image may also be cut out.
Features described in the embodiments in the present specification may be replaced with or combined with each other, each embodiment is described with a focus on differences from other embodiments, and the same and similar portions among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An image processing method comprising:
in the panoramic image shooting process, controlling acquisition equipment to continuously acquire a plurality of first images;
acquiring an acquisition gesture when the acquisition equipment acquires the first image;
determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image;
splicing the corrected second images to generate a panoramic image;
the standard posture corresponds to a posture that the acquisition direction of the acquisition equipment and a specific plane meet the parallel condition and the distance between the acquisition direction of the acquisition equipment and the specific plane is maintained at a fixed value.
2. The method of claim 1, wherein the first and second light sources are selected from the group consisting of,
the determining that the difference condition is satisfied between the acquisition gesture and the standard gesture includes:
determining that the acquisition direction of the acquisition equipment and the specific plane do not satisfy the parallel condition in the acquisition gesture, and/or determining that a difference condition is satisfied between the acquisition gesture and the standard gesture, wherein the distance between the acquisition direction of the acquisition equipment and the specific plane in the standard gesture is not maintained at a fixed value relative to the distance between the acquisition direction and the specific plane in the standard gesture.
3. The method of claim 2, the determining that the acquisition pose with which the acquisition direction of the acquisition device and the particular plane do not satisfy the parallelism condition and/or that the distance to a particular plane is not maintained at a fixed value relative to the distance of the acquisition direction and the particular plane in the standard pose, the determining that the difference condition is satisfied between the acquisition pose and the standard pose, comprising:
and determining that the difference between the sub-direction information with the specified attribute in the first direction information corresponding to the acquisition gesture and the sub-direction information with the specified attribute in the second direction information corresponding to the standard gesture meets preset difference direction information, and determining that the difference between the acquisition gesture and the standard gesture meets a difference condition.
4. The method of claim 1, the correcting the first image corresponding to the acquisition pose according to the acquisition pose, comprising:
generating an inverse perspective change matrix based on first direction information corresponding to the acquisition gesture and second direction information corresponding to the standard gesture;
converting first pixel information of the first image corresponding to the acquisition pose into second pixel information by using the inverse perspective transformation matrix;
and generating a second image by using the second pixel information.
5. The method of claim 1, further comprising:
detecting whether a target image area different from the first image before correction exists in the second image;
if so, cutting the second image so that the cut second image does not contain the target image area;
correspondingly, the second images are utilized for splicing to generate a panoramic image, and the method comprises the following steps:
and splicing the second images after being cut to generate a panoramic image.
6. The method of claim 1, further comprising:
detecting whether an image area corresponding to the second image in the panoramic image has a target image area different from the first image before correction;
and if so, cutting the panoramic image so that the processed panoramic image does not contain the target image area.
7. An electronic device, comprising:
the collector is used for collecting images;
the processor is used for controlling the collector to continuously collect a plurality of first images in the panoramic image shooting process; acquiring an acquisition posture of the acquisition device when acquiring the first image; determining that the acquisition posture and a standard posture meet a difference condition, and correcting the first image corresponding to the acquisition posture according to the acquisition posture to generate a second image; splicing the corrected second images to generate a panoramic image;
the standard posture corresponds to a posture that the acquisition direction of the acquisition equipment and a specific plane meet the parallel condition and the distance between the acquisition direction of the acquisition equipment and the specific plane maintains a fixed value.
8. The electronic device of claim 7, wherein the electronic device,
the processor determining that a difference condition is satisfied between the acquisition pose and a standard pose, comprising:
determining that the acquisition direction of the acquisition equipment and the specific plane do not satisfy the parallel condition in the acquisition gesture, and/or determining that a difference condition is satisfied between the acquisition gesture and the standard gesture, wherein the distance between the acquisition direction of the acquisition equipment and the specific plane in the standard gesture is not maintained at a fixed value relative to the distance between the acquisition direction and the specific plane in the standard gesture.
9. The electronic device of claim 8, the processor determining that the acquisition direction of the acquisition device does not satisfy the parallelism condition with the particular plane in the acquisition pose, and/or that the distance from a particular plane is not maintained at a fixed value relative to the distance from the acquisition direction to the particular plane in the standard pose, comprising:
and determining that the difference between the sub-direction information with the specified attribute in the first direction information corresponding to the acquisition gesture and the sub-direction information with the specified attribute in the second direction information corresponding to the standard gesture accords with preset difference direction information.
10. The electronic device of claim 7, the processor correcting the first image, comprising:
generating an inverse perspective change matrix based on first direction information corresponding to the acquisition gesture and second direction information corresponding to the standard gesture;
converting first pixel information of the first image into second pixel information using the inverse perspective transformation matrix;
and generating a second image by using the second pixel information.
CN202011554181.4A 2020-12-24 2020-12-24 Image processing method and electronic equipment Active CN112702519B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011554181.4A CN112702519B (en) 2020-12-24 2020-12-24 Image processing method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011554181.4A CN112702519B (en) 2020-12-24 2020-12-24 Image processing method and electronic equipment

Publications (2)

Publication Number Publication Date
CN112702519A CN112702519A (en) 2021-04-23
CN112702519B true CN112702519B (en) 2022-04-22

Family

ID=75510017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011554181.4A Active CN112702519B (en) 2020-12-24 2020-12-24 Image processing method and electronic equipment

Country Status (1)

Country Link
CN (1) CN112702519B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001136431A (en) * 1999-11-05 2001-05-18 Canon Inc Camera controller and camera control method and storage medium
CN110266956A (en) * 2019-07-08 2019-09-20 北京邮电大学 Image pickup method, device, electronic equipment and storage medium based on posture information

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103514450B (en) * 2012-06-29 2017-02-15 华为技术有限公司 Image feature extracting method and image correcting method and equipment
CN103945043A (en) * 2013-01-21 2014-07-23 联想(北京)有限公司 Photographic method and electronic device
CN103118230B (en) * 2013-02-28 2016-06-22 腾讯科技(深圳)有限公司 A kind of panorama acquisition, device and system
CN105991924A (en) * 2015-03-04 2016-10-05 珠海金山办公软件有限公司 Shooting assisting method and device
JP6685843B2 (en) * 2016-06-06 2020-04-22 オリンパス株式会社 Imaging device
CN106476696A (en) * 2016-10-10 2017-03-08 深圳市前海视微科学有限责任公司 A kind of reverse guidance system and method
CN107481292B (en) * 2017-09-05 2020-07-28 百度在线网络技术(北京)有限公司 Attitude error estimation method and device for vehicle-mounted camera
CN109963031B (en) * 2017-12-25 2022-02-18 海能达通信股份有限公司 Shooting terminal and shooting positioning method based on shooting terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001136431A (en) * 1999-11-05 2001-05-18 Canon Inc Camera controller and camera control method and storage medium
CN110266956A (en) * 2019-07-08 2019-09-20 北京邮电大学 Image pickup method, device, electronic equipment and storage medium based on posture information

Also Published As

Publication number Publication date
CN112702519A (en) 2021-04-23

Similar Documents

Publication Publication Date Title
US10306165B2 (en) Image generating method and dual-lens device
CN101841657B (en) Camera having image correction function, apparatus and image correction method
JP4529837B2 (en) Imaging apparatus, image correction method, and program
US20120328152A1 (en) Image processing apparatus, image processing method and storage medium
US8441541B2 (en) Control apparatus and control method therefor
US20150123990A1 (en) Image processing device, image processing method, image processing program, and storage medium
WO2016112704A1 (en) Method and device for adjusting focal length of projector, and computer storage medium
US8274572B2 (en) Electronic camera capturing a group of a plurality of specific objects
US20100085442A1 (en) Imaging apparatus, imaging method, and program
US8873881B2 (en) Dust detection system and digital camera
JP4717863B2 (en) Calibration method and apparatus for compound eye imaging apparatus and calibration chart used therefor
US20090059030A1 (en) Image Processing Apparatus, Image Processing Method, and Image Processing System
US10810712B2 (en) Apparatus for monitoring surroundings of vehicle and method of calibrating the same
US20110311150A1 (en) Image processing apparatus
US20120092514A1 (en) Image-capture device, a method of correcting images, and a non-transitory computer-readable storage medium
US20130329019A1 (en) Image processing apparatus that estimates distance information, method of controlling the same, and storage medium
CN114007054B (en) Method and device for correcting projection of vehicle-mounted screen picture
JP5959311B2 (en) Data deriving apparatus and data deriving method
JP5173552B2 (en) Vehicle perimeter monitoring apparatus and distortion correction value setting correction method applied thereto
JP5173551B2 (en) Vehicle perimeter monitoring apparatus and camera mounting position / posture information setting correction method applied thereto
CN112702519B (en) Image processing method and electronic equipment
JP2014127773A5 (en)
CN108648218B (en) Matching method and system for fuzzy checkerboard in automobile panoramic view
EP3117758A1 (en) Image processing device and operating method for image processing device
US20100103274A1 (en) Image distortion compensation method and apparatus

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
GR01 Patent grant
GR01 Patent grant