[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN108476286A - A kind of image output method and electronic equipment - Google Patents

A kind of image output method and electronic equipment Download PDF

Info

Publication number
CN108476286A
CN108476286A CN201680075969.2A CN201680075969A CN108476286A CN 108476286 A CN108476286 A CN 108476286A CN 201680075969 A CN201680075969 A CN 201680075969A CN 108476286 A CN108476286 A CN 108476286A
Authority
CN
China
Prior art keywords
target
jitter
data
amount
frame image
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.)
Granted
Application number
CN201680075969.2A
Other languages
Chinese (zh)
Other versions
CN108476286B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN108476286A publication Critical patent/CN108476286A/en
Application granted granted Critical
Publication of CN108476286B publication Critical patent/CN108476286B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

A kind of image output method and electronic equipment, the method includes obtaining sampled data corresponding with destination sample time point, judge whether first object amount of jitter is less than or equal to preset value, the first object amount of jitter is the amount of jitter of first object frame image, if the first object amount of jitter is less than or equal to the preset value, the first object frame image is exported.The method is not necessarily to carry out accessed all frame images the calculating of contrast, it only needs to calculate the amount of jitter of current first object frame image, if the amount of jitter for calculating current first object frame image is less than or equal to preset value, then directly export the current first object frame image, without calculating the amount of jitter by end exposure time-sequencing in the current subsequent frame image of the first object frame image, in the case where having ensured that electronic equipment exports the clarity of image, the efficiency of output image is improved.

Description

Image output method and electronic equipment
The present application claims priority from the chinese patent application filed by the chinese patent office on 17/10/2016 under the name of 201610901195.6 entitled "a method and terminal for taking pictures", the entire contents of which are incorporated herein by reference.
Technical Field
The present invention relates to the field of image processing, and in particular, to an image output method and an electronic device.
Background
With the increasing improvement of the functions of the electronic device, the requirement of the definition of an image output after a user takes a picture of the lens of the electronic device is higher and higher.
When the electronic equipment is used for shooting, the user holds the electronic equipment and shakes inevitably, for example, the body of the user shakes naturally, the natural shaking can be heartbeat, pulse, respiration and the like of the user, when the electronic equipment shoots, the shaking of the user can cause vibration at the moment of shooting, under the condition of vibration, the definition of an image shot by the electronic equipment is greatly influenced, and in order to avoid the influence of shaking on the definition of the image, in the prior art, multi-frame images continuously obtained by the electronic equipment can be subjected to high-pass filtering so as to obtain the contrast of all images in the multi-frame images, and the electronic equipment can output the image with the highest contrast.
However, with the solutions shown in the prior art, when the electronic device performs contrast calculation on multiple frames of images, a relatively long time delay is required, so that the electronic device cannot output images quickly, thereby reducing the efficiency of image output of the electronic device.
Disclosure of Invention
The invention provides an image output method and electronic equipment, which can ensure that the electronic equipment outputs clear images and can improve the efficiency of the electronic equipment for outputting the images.
A first aspect of an embodiment of the present invention provides an image output method, including:
and A, acquiring sampling data corresponding to a target sampling time point.
The electronic device shown in this embodiment may be periodically provided with sampling time points in advance.
By adopting the method shown in this embodiment, the electronic device can acquire a frame image sequence which is reported by the sensor and is ordered according to time, wherein the frame image sequence comprises a plurality of frame images which are ordered according to the sequence of the exposure ending time.
The first target frame image is any frame image in the frame image sequence.
Specifically, the electronic device shown in this embodiment acquires the data reported by the sensor at the sampling time point, and the electronic device can acquire the exposure time, the frame rate FR, the maximum frame rate, and the like of each frame image included in the frame image sequence.
And determining a target sampling time point within the exposure time of the first target frame image, wherein the target sampling time point is any one of at least one sampling time point within the exposure time of the first target frame image.
The sampling data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image.
And B, judging whether the first target jitter amount is smaller than or equal to a preset value, and if so, executing the step C.
The first target shaking amount is a shaking amount of a first target frame image determined according to the target sampling time point and the sampling data.
In this embodiment, the preset value may be preset in the process of executing the method shown in this embodiment by the electronic device, and the size of the preset value is not limited in this embodiment, as long as when the first target shake amount of the first target frame image output by the electronic device is less than or equal to the preset value, the first target frame image can meet a certain definition, so that a user can obtain a clear image.
In this embodiment, the smaller the preset value is, the higher the definition of the output first target frame image is when the shake amount of the first target frame image is smaller than or equal to the preset value, and different preset values may be set according to different requirements on image definition.
And C, outputting the first target frame image.
In the method shown in this embodiment, when it is determined that the jitter amount of the first target frame picture is less than or equal to the preset value, the first target frame picture may be directly output.
By using the method of this embodiment, the electronic device first calculates a first target shake amount of a first target frame image in an acquired image frame sequence, and directly outputs the first target frame image when the first target shake amount is smaller than a preset value, and the electronic device calculates shake amounts of frame images ordered behind the first target frame image in the image frame sequence, thereby saving time consumed for calculating shake amounts of frame images ordered behind the first target frame image, improving image output efficiency, and reducing image output time delay.
With reference to the first aspect of the embodiment of the present invention, in a first implementation manner of the first aspect of the embodiment of the present invention, the step B further includes: if the first target jitter amount is judged to be larger than the preset value, the method shown in the embodiment further comprises the following steps;
and D1, determining a second target frame image.
In this embodiment, when the first target jitter amount is greater than the preset value, a second target frame picture ordered after the first target frame picture is determined in the picture frame sequence.
Specifically, the exposure end time of the second target frame image is later than that of the first target frame image, N target frame images are spaced between the first target frame image and the second target frame image, and N is a natural number greater than or equal to 0;
more specifically, when N is equal to 0, the second target frame image is a next target frame image of the first target frame image, and if N is a positive integer greater than 1, N target frame images are spaced between the second target frame image and the first target frame image.
And D2, judging whether the second target jitter amount is less than or equal to the preset value.
Wherein the second target shaking amount is a shaking amount of the second target frame picture.
For a specific process of acquiring the second target jitter amount, please refer to a specific process of acquiring the first target jitter amount, which is not described in detail in this embodiment.
In step D, if the second target shaking amount is determined to be less than or equal to the preset value, step D3 is executed.
And D3, outputting the second target frame image.
In this embodiment, if the second target shaking amount is less than or equal to the preset value, the second target frame image is directly output.
With the method described in this embodiment, in an obtained image frame sequence, the electronic device first calculates a first target shake amount of a first target frame image, and when the first target shake amount is greater than or equal to a preset value, it indicates that the resolution of the current first target frame image does not meet a requirement, if the first target frame image is output, and the resolution of a frame image displayed by the electronic device cannot meet a requirement of a user, the electronic device determines, in the frame image sequence, a second target frame image whose exposure time is later than that of the first target frame image, and when the shake amount of the second target frame image is less than or equal to the preset value, directly outputs a second target frame image whose resolution meets the requirement of the user, and with the method described in this embodiment, it is avoided to calculate a shake amount of a frame image located after the second target frame image, therefore, the time consumption for calculating the jitter amount of the frame image sequenced at the back of the second target frame image is saved, the image output efficiency is improved, and the image output time delay is reduced.
With reference to the first implementation manner of the first aspect of the embodiment of the present invention, in a second implementation manner of the first aspect of the embodiment of the present invention, the step B further includes: if the first target jitter amount is judged to be larger than the preset value, the method shown in the embodiment further comprises the following steps;
and D4, outputting a third target frame image.
In this embodiment, if the second jitter amount of the second target frame image is greater than the preset value, which indicates that the second target frame image has lower definition, the third target frame image is determined.
Specifically, the third target frame picture is any frame picture in a frame picture sequence, the frame picture sequence includes the first target frame picture and the determined at least one second target frame picture, and the jitter amount of the third target frame picture is the minimum value of the jitter amounts of all frame pictures in the frame picture sequence.
Before step D4 of this embodiment is executed, if the determined shake amounts of the first target frame picture and all the second target frame pictures are greater than the preset value, the target frame picture with the smallest shake amount is determined to be the third target frame picture in the determined first target frame picture and all the second target frame pictures.
By adopting the method of this embodiment, when the shake amounts of the first target frame image and all the second target frame images in the obtained image frame sequence are greater than the preset value, the electronic device selects the third target frame image with the highest definition in the image frame sequence, so as to output the third target frame image.
With reference to the first aspect of the embodiment of the present invention to the second implementation manner of the first aspect of the embodiment of the present invention, as shown in any one of the second implementation manner of the first aspect of the embodiment of the present invention, in a third implementation manner of the first aspect of the embodiment of the present invention,
the step A specifically comprises the following steps:
and step A11, acquiring target sampling data of the target pixel.
The target pixel is any pixel located in a target pixel line, the exposure time of the target pixel is the target sampling time point, the target pixel line is any pixel line included in the first target frame image, and the target sampling data is jitter data of the target pixel at the target sampling time point.
With the method of this embodiment, in order to improve the efficiency of outputting an image and reduce the time delay of the output image, when calculating the shake amount of the target frame image, the target pixel meeting the condition is determined first, and the shake amount of the target frame image can be determined according to the determined target pixel, so that all pixels included in the target frame image do not need to be processed, and the efficiency of calculating the shake amount of the frame image is effectively improved.
With reference to the third implementation manner of the first aspect of the embodiment of the present invention, in the fourth implementation manner of the first aspect of the embodiment of the present invention,
before the step a, the method according to the embodiment of the present invention further includes:
step a01, acquiring the time for starting exposure of any line of pixels included in the first target frame image.
In this embodiment, the same dithering has different influences on different pixel rows, and it can be seen that the dithering amount is only effective for a single row of pixels in the frame image, and in order to accurately determine the influence of the dithering on the whole frame image, it is necessary to determine the influence of the dithering on a single pixel row of the frame image.
However, when the shake amount of the target frame picture is acquired, it is necessary to determine a target pixel line that can be used for shake amount calculation among all pixel lines included in the target frame picture because all pixel lines included in the target frame picture cannot be calculated in consideration of picture output efficiency.
In the process of determining the target pixel row, the electronic device shown in this embodiment first determines the time for starting exposure of any row of pixels included in the first target frame image.
And step A02, determining the target pixel row.
Wherein the time of starting exposure of the target pixel row is the target sampling time point.
The more the target pixel rows are determined by the method in this embodiment, the more accurate the shake amount obtained by calculating the image frame, and as the target pixel row threshold may be preset in this embodiment, the target pixel rows with the number of the target pixel row threshold may be obtained when determining the target pixel rows.
And adopting the pixel behavior with the exposure starting time as the target sampling time point to serve as the target pixel row, so that the accuracy of the shake amount calculation of the target frame image can be improved, and the electronic equipment can acquire the accurate shake amount of the target frame image when the shake amount calculation is carried out according to the target pixel row.
With reference to the third implementation manner of the first aspect of the embodiment of the present invention or the fourth implementation manner of the first aspect of the embodiment of the present invention, in a fifth implementation manner of the first aspect of the embodiment of the present invention,
before the step B, the method further includes:
and step B01, calculating the sub-target jitter amount of the target pixel row.
The sub-target shaking amount is an influence of shaking on a target pixel row, and the target pixel row shown in this embodiment is any row of pixels included in the first target frame image.
If a plurality of target pixels are determined in the target pixel line, the sub-target shaking amount can be calculated by selecting the target pixels with the target number when specifically calculating the sub-target shaking amount. The present embodiment does not limit the specific value of the selected target number.
Step B02, determining the number of the target pixel rows;
step B03, if the number of the target pixel rows is 1, the first target shaking amount is equal to the sub-target shaking amount;
and step B04, if the number of the target pixel rows is a natural number greater than 1, calculating all the sub-target shaking amounts by an average algorithm to obtain the first target shaking amount.
The averaging algorithm is not limited in this embodiment, as long as the sub-target jitter amount can be calculated to obtain an average value, for example, the averaging algorithm may be a moving average algorithm MA, an exponential smoothing average EMA, a parameter average SMA, a weight average DMA, or the like.
By adopting the method shown in this embodiment, when calculating the shake of the target frame image, the sub-target shake amount of the target pixel row included in the target frame image can be determined first, and after the sub-target shake amount is determined, the shake amount of the target frame image can be determined.
With reference to the fifth implementation manner of the first aspect of the embodiment of the present invention, in a sixth implementation manner of the first aspect of the embodiment of the present invention,
the step B01 includes:
and step B011, calculating the target coordinate of any target pixel in the target pixel line.
In this embodiment, the target coordinates are calculated according to the target sampling time point and the target sampling data.
And step B012, if the number of the target pixels in the target pixel row is one, the sub-target shaking amount is a distance between the target coordinate and the origin coordinate.
Specifically, in the target pixel row, the number of the target pixels is one, and the target coordinate of P1 can be represented in a two-dimensional coordinate system.
The target distance is the distance between the origin coordinates (0,0) and P1 in the two-dimensional coordinate system.
And step B013, if the number of the target pixels in the target pixel row is at least two, setting a target set.
The target set comprises a plurality of target distances, the target distances are distances between any two target coordinates in all the target coordinates, and the target distances are distances between any one target coordinate and the origin coordinate.
Specifically, in the target pixel row, taking the number of the target pixels as three as an example, the target coordinate of P1, the target coordinate of P2, and the target coordinate of P3 may be expressed in a two-dimensional coordinate system.
The target distance is a distance between P1 and P2, a distance between P2 and P3, a distance between P1 and P3, a distance between origin coordinates (0,0) and P1, a distance between origin coordinates (0,0) and P2, and a distance between origin coordinates (0,0) and P3 in a two-dimensional coordinate system.
The electronic device sets the acquired target distance in a target set.
And B014, acquiring the sub-target jitter amount.
Specifically, the sub-target jitter amount is a maximum value of all the target distances located in the target set.
In this embodiment, the target distance obtained in the two-dimensional coordinate system is further obtained by representing the target coordinate of the target pixel in the two-dimensional coordinate system, so that the sub-target jitter amount is quickly calculated, the image output efficiency is improved, and the time delay in the image output process is reduced.
With reference to the sixth implementation manner of the first aspect of the embodiment of the present invention, in the seventh implementation manner of the first aspect of the embodiment of the present invention,
the step B011 specifically includes:
b0111, acquiring first jitter data of any target pixel in the target pixel line translated along the X axis at the target sampling time point;
specifically, the electronic device according to this embodiment obtains target sampling data through a target sampling time point corresponding to a target pixel, and obtains a target coordinate of the target pixel according to the target sampling data.
In this embodiment, the jitter of the electronic device is divided into a three-dimensional coordinate system, which is divided into an X axis, a Y axis, and a Z axis, wherein the X axis is a direction in which the electronic device translates along an up-down direction, the Y axis is perpendicular to the X axis, the Y axis is a direction in which the electronic device translates along an inside-outside direction, the Z axis is perpendicular to the X axis and the Y axis, and the Z axis is a direction in which the electronic device translates along a left-right direction.
The dither of the target pixel shown in this embodiment includes first point spread function data of the target pixel translated along the X axis, second point spread function data of the target pixel translated along the Y axis, third point spread function data of the target pixel translated along the Z axis, fourth point spread function data of the target pixel rotated about the X axis, fifth point spread function data of the target pixel rotated about the Y axis, and sixth point spread function data of the target pixel rotated about the Z axis at the target sampling time point.
In this embodiment, the target coordinates of the target pixel may be determined by the first point spread function data and the second point spread function data in the point spread function data.
In the present embodiment, when the lens of the electronic apparatus is translated in the direction of the X axis, the first point spread function data PSF1 is (a/b) d 1.
Wherein, a is the distance between the lens of the electronic device and the sensor, b is the distance between the shot object and the lens, namely b is the object distance; d1 is a lens shift amount, and d1 is a distance in the X-axis direction between the position after the lens shift and the position before the shift.
B0112, carrying out integral operation on the first jitter data to obtain first coordinate data;
the sensor shown in this embodiment can acquire the first jitter data x (t) ═ PSF1 at the target sampling points, limt < t < limx.
Taking the target pixel as an a-th target pixel in the target pixel row as an example, where the a-th target pixel is any target pixel included in the target pixel row, limt is a time interval between a time when the target pixel row starts to be exposed and an exposure time of the a-th target pixel, if the a-th target pixel is not a last pixel in the target pixel row, limx is within an a-s line, and if the a-th target pixel is a last pixel in the target pixel row, limx is an exposure end time ex-time of the target pixel row.
After the electronic equipment acquires the sampling data, integral operation can be performed to acquire first coordinate data.
Specifically, the first coordinate data
B0113, acquiring second jitter data of any target pixel in the target pixel line translated along the Y axis at the target sampling time point;
in the present embodiment, when the lens of the electronic apparatus is translated in the direction of the Y axis, the second point spread function data PSF2 is (a/b) d 1.
Wherein, a is the distance between the lens of the electronic device and the sensor, b is the distance between the shot object and the lens, namely b is the object distance; d1 is a lens shift amount d1 is a distance in the Y-axis direction between the position after the lens shift and the position before the shift.
B0114, carrying out integral operation on the second jitter data to obtain second coordinate data;
and B0115, the target coordinate of any target pixel in the target pixel row comprises a target abscissa and a target ordinate, and the target abscissa is determined as the first coordinate data, and the target ordinate is determined as the second coordinate data.
In this embodiment, after the electronic device obtains the sampling data, an integral operation may be performed to obtain second coordinate data.
Specifically, the second coordinate data
By adopting the image output method shown in this embodiment, the electronic device does not need to calculate the contrast of all the acquired frame images in the frame image sequence, only needs to calculate the shake amount of the frame images in the frame image sequence in sequence according to the sequence of the exposure end time, and directly outputs the current frame image without calculating the frame images sequenced after the current frame image if the shake amount of the current frame image is calculated to be less than or equal to the preset value, so that the time consumed for calculating the frame images is saved, and the efficiency of outputting the images is improved under the condition that the definition of the images output by the electronic device is ensured.
A second aspect of an embodiment of the present invention provides an electronic device, including:
a first obtaining unit, configured to obtain sampling data corresponding to a target sampling time point, where the target sampling time point is any one of at least one sampling time point located within an exposure time of a first target frame image, and the sampling data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image;
the first obtaining unit shown in this embodiment is configured to execute step a shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail.
A first determining unit, configured to determine whether a first target jitter amount is smaller than or equal to a preset value, where the first target jitter amount is a jitter amount of a first target frame image determined according to the target sampling time point and the sampling data;
the first determining unit shown in this embodiment is configured to execute step B shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail.
A first output unit, configured to output the first target frame picture if the first target jitter amount is less than or equal to the preset value.
The first output unit shown in this embodiment is configured to execute step C shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail.
With the electronic device according to this embodiment, in an obtained image frame sequence, the electronic device first calculates a first target shake amount of a first target frame image, and directly outputs the first target frame image when the first target shake amount is smaller than a preset value, and the electronic device calculates shake amounts of frame images ordered behind the first target frame image in the image frame sequence, so that time consumption for calculating shake amounts of frame images ordered behind the first target frame image is saved, efficiency of image output is improved, and time delay of image output is reduced.
With reference to the second aspect of the embodiments, in a first implementation manner of the second aspect of the embodiments,
the electronic device further includes:
a first determining unit, configured to determine a second target frame picture if the first target jitter amount is greater than the preset value, where an exposure end time of the second target frame picture is later than an exposure end time of the first target frame picture, N target frame pictures are spaced between the first target frame picture and the second target frame picture, and N is a natural number greater than or equal to 0;
the first determining unit shown in this embodiment is configured to execute step D1 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
A second determining unit, configured to determine whether a second target shaking amount is smaller than or equal to the preset value, where the second target shaking amount is a shaking amount of the second target frame image;
the second determining unit shown in this embodiment is configured to execute step D2 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
And a second output unit, configured to output the second target image frame if the second target shaking amount is less than or equal to the preset value.
The second output unit shown in this embodiment is configured to execute step D3 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
With the electronic device described in this embodiment, in an obtained image frame sequence, first a first target shake amount of a first target frame image is calculated, where if the first target shake amount is greater than or equal to a preset value, it indicates that the resolution of the current first target frame image does not meet a requirement, if the first target frame image is output, and the resolution of a frame image displayed by the electronic device cannot meet a requirement of a user, the electronic device determines, in the frame image sequence, a second target frame image whose exposure time is later than that of the first target frame image, and if the shake amount of the second target frame image is less than or equal to the preset value, directly outputs a second target frame image whose resolution meets the requirement of the user, with the method described in this embodiment, calculation of a shake amount of a frame image located behind the second target frame image is avoided, therefore, the time consumption for calculating the jitter amount of the frame image sequenced at the back of the second target frame image is saved, the image output efficiency is improved, and the image output time delay is reduced.
With reference to the first implementation manner of the second aspect of the embodiment of the present invention, in the second implementation manner of the second aspect of the embodiment of the present invention,
the second output unit is further configured to output a third target frame picture if the second target shake amount is greater than the preset value, where the third target frame picture is any one of frame pictures in a frame picture sequence, the frame picture sequence includes the first target frame picture and the second target frame picture, and the shake amount of the third target frame picture is a minimum value of shake amounts of all frame pictures in the frame picture sequence.
The second output unit shown in this embodiment is configured to execute step D4 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
By adopting the electronic device of this embodiment, in an obtained image frame sequence, when the shake amounts of a first target frame image and all second target frame images are greater than the preset value, a third target frame image with the highest definition is selected in the frame image sequence, so as to output the third target frame image.
With reference to the electronic device according to any one of the second aspect of the embodiment of the present invention and the second implementation manner of the second aspect of the embodiment of the present invention, in a third implementation manner of the second aspect of the embodiment of the present invention,
the first obtaining unit is further configured to obtain target sampling data of a target pixel, where the target pixel is any pixel located in a target pixel row, an exposure time of the target pixel is the target sampling time point, the target pixel row is any pixel row included in the first target frame image, and the target sampling data is jitter data of the target pixel at the target sampling time point.
The first obtaining unit shown in this embodiment is configured to execute step a11 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
With the electronic device shown in this embodiment, in order to improve the efficiency of outputting an image and reduce the time delay of the output image, when calculating the shake amount of the target frame image, the target pixel meeting the condition is determined first, and the shake amount of the target frame image can be determined according to the determined target pixel, so that all pixels included in the target frame image do not need to be processed, and the efficiency of calculating the shake amount of the frame image is effectively improved.
With reference to the third implementation manner of the second aspect of the embodiment of the present invention, in the fourth implementation manner of the second aspect of the embodiment of the present invention,
the electronic device further includes:
a second acquiring unit, configured to acquire a time for starting exposure of any line of pixels included in the first target frame image;
the second obtaining unit shown in this embodiment is configured to execute step a01 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
And the second determining unit is used for determining the target pixel row, wherein the time for starting exposure of the target pixel row is the target sampling time point.
The second determining unit shown in this embodiment is configured to execute step a02 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
With reference to the third implementation manner of the second aspect of the embodiment of the present invention or the fourth implementation manner of the second aspect of the embodiment of the present invention, in a fifth implementation manner of the second aspect of the embodiment of the present invention,
the electronic device further includes:
a first calculating unit, configured to calculate a sub-target jitter amount of a target pixel row according to the target sampling time point and the target sampling data;
the first calculating unit shown in this embodiment is configured to execute step B01 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
A third determination unit configured to determine the number of the target pixel rows;
the third determining unit shown in this embodiment is configured to execute step B02 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail again.
A second calculation unit, configured to, if the number of the target pixel rows is 1, determine that the first target shaking amount is equal to the sub-target shaking amount; and if the number of the target pixel rows is a natural number greater than 1, calculating all the sub-target shaking amounts through an average algorithm to obtain the first target shaking amount.
The second calculating unit shown in this embodiment is configured to execute step B03 and step B04 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and will not be described in detail.
By using the electronic device shown in this embodiment, when calculating the shake of the target frame image, a sub-target shake amount of a target pixel row included in the target frame image may be determined first, and after determining the sub-target shake amount, the shake amount of the target frame image may be determined.
With reference to the fifth implementation manner of the second aspect of the embodiment of the present invention, in a sixth implementation manner of the second aspect of the embodiment of the present invention,
the second calculation unit includes:
the calculation module is used for calculating the target coordinate of any target pixel in the target pixel line according to the target sampling time point and the target sampling data;
the calculating module shown in this embodiment is configured to execute step B011 shown in the first aspect of the embodiment of the present invention, and the specific executing process is shown in the foregoing for details and is not described in detail.
A first determining module, configured to determine, if the number of the target pixels located in the target pixel row is one, that the sub-target shaking amount is a distance between the target coordinate and an origin coordinate;
the first determining module shown in this embodiment is configured to execute step B012 shown in the first aspect of the embodiment of the present invention, and for details, details of the executing process are shown in the foregoing description and are not described again.
A second determining module, configured to set a target set if the number of target pixels located in the target pixel row is at least two, where the target set includes a plurality of target distances, the target distance is a distance between any two target coordinates in all the target coordinates, and the target distance is also a distance between any one target coordinate and the origin coordinate;
the second determining module shown in this embodiment is configured to execute step B013 shown in the first aspect of the embodiment of the present invention, and details of the specific execution process are shown in the foregoing description and are not described again.
A third determining module, configured to obtain the sub-target jitter amount, where the sub-target jitter amount is a maximum value of all the target distances located in the target set.
The third determining module shown in this embodiment is configured to execute step B014 shown in the first aspect of the embodiment of the present invention, and the specific execution process is shown in the foregoing description and is not described in detail.
With reference to the sixth implementation manner of the second aspect of the embodiment of the present invention, in a seventh implementation manner of the second aspect of the embodiment of the present invention, the calculation module includes:
the first acquisition sub-module is used for acquiring first jitter data of any target pixel in the target pixel line, which is translated along the X axis at the target sampling time point;
the first obtaining submodule shown in this embodiment is configured to execute step B0111 shown in the first aspect of the embodiment of the present invention, and a specific execution process is shown in the foregoing description and is not described in detail.
The first calculation submodule is used for carrying out integral operation on the first jitter data to obtain first coordinate data;
the first calculating submodule shown in this embodiment is configured to execute step B0112 shown in the first aspect of the embodiment of the present invention, and a specific execution process is shown in the foregoing description and is not described in detail.
The second obtaining submodule is used for obtaining second jitter data of any target pixel in the target pixel line, which is translated along the Y axis at the target sampling time point;
the second obtaining submodule shown in this embodiment is configured to execute step B0113 shown in the first aspect of the embodiment of the present invention, and a specific execution process is shown in the foregoing description and is not described in detail.
The second calculation submodule is used for carrying out integral operation on the second jitter data to obtain second coordinate data;
the second calculating submodule shown in this embodiment is configured to execute step B0114 shown in the first aspect of the embodiment of the present invention, and a specific execution process is shown in the foregoing description and is not described in detail.
And the determining submodule is used for determining that the target coordinate of any target pixel in the target pixel line comprises a target abscissa and a target ordinate, the target abscissa is determined to be the first coordinate data, and the target ordinate is determined to be the second coordinate data.
The determining submodule shown in this embodiment is configured to execute step B0115 shown in the first aspect of the embodiment of the present invention, and a specific execution process is shown in the foregoing description and is not described in detail.
A third aspect of an embodiment of the present invention provides an electronic device, including:
one or more microcomputers, an image memory, a bus system, and one or more programs, the microcomputers and the image memory being connected by the bus system;
wherein the one or more programs are stored in the image memory, the one or more programs comprising instructions which, when executed by the electronic device, cause the electronic device to perform the method according to any one of the first aspect of an embodiment of the present invention to the seventh implementation of the first aspect of an embodiment of the present invention.
A fourth aspect of embodiments of the present invention provides a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by an electronic device, cause the electronic device to perform the method according to any one of the first aspect of embodiments of the present invention to the seventh implementation manner of the first aspect of embodiments of the present invention.
The embodiment provides an image output method and an electronic device, and with the method shown in the embodiment, it is not necessary to calculate contrast of all acquired frame images, but only necessary to calculate the shake amount of a current first target frame image, and if the shake amount of the current first target frame image is calculated to be less than or equal to a preset value, the current first target frame image is directly output without calculating the shake amount of a frame image after the current first target frame image according to exposure end time, so that time consumed for calculating the frame image is saved, and efficiency of outputting the image is improved under the condition that definition of an image output by the electronic device is guaranteed.
Drawings
Fig. 1 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention;
FIG. 2 is a schematic diagram of an embodiment of an original image captured by an electronic device according to the present invention;
FIG. 3 is a diagram illustrating a relationship between an angular velocity of an electronic device and an exposure time in a test environment according to the present invention;
FIG. 4 is a diagram illustrating the relationship between the angular velocity of the electronic device and the exposure time in another testing environment provided by the present invention;
FIG. 5 is a schematic diagram of an embodiment of an output image provided by the present invention;
FIG. 6 is a schematic diagram of another embodiment of an output image provided by the present invention;
FIG. 7 is a schematic diagram illustrating an embodiment of an image output method according to the present invention;
FIG. 8 is a timing diagram illustrating an exemplary embodiment of an image output according to the present invention;
FIG. 9 is a schematic diagram of one embodiment of a frame image and an exposure function provided by the present invention;
FIG. 10 is a schematic structural diagram of an embodiment of a method before and after dithering according to the present invention;
FIG. 11 is a schematic structural diagram of another embodiment before and after dithering according to the present invention;
FIG. 12 is a schematic diagram of an embodiment of the present invention for illustrating the effect of lens translation shake and rotation shake on the quality of an image;
FIG. 13 is a timing diagram illustrating an alternative embodiment of an image output provided by the present invention;
FIG. 14 is a schematic diagram of one embodiment of a coordinate system for representing target coordinates provided by the present invention;
fig. 15 is a schematic structural diagram of another embodiment of an electronic device provided in the present invention;
FIG. 16 is a schematic diagram illustrating an image output method according to another embodiment of the present invention;
FIG. 17 is a timing diagram of an image output according to another embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an image output method which can ensure that the electronic equipment can output clear images and can improve the efficiency of the electronic equipment for outputting the images.
To better explain the method provided by the embodiment of the present invention, the structure of an electronic device capable of implementing the method shown by the embodiment of the present invention is first described with reference to fig. 1.
The electronic device is not limited in this embodiment as long as the electronic device can capture an image and process the image, for example, the electronic device may be a smart phone, a computer, a tablet computer, a digital camera, and the like, and is not limited in this embodiment.
Fig. 1 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention.
The image pickup optical system 101 forms an object image (not shown) on the image sensor 102.
Among them, fig. 1 shows an image pickup optical system 101 composed of a single lens, but the image pickup optical system 101 generally includes a plurality of lenses such as a zoom lens and a focus lens, and a diaphragm and the like to enable control of zooming, focusing, an amount of incident light, and the like.
The image sensor 102 of the present embodiment is a CMOS image sensor including a plurality of photoelectric conversion elements arranged two-dimensionally, and charges accumulated at different timings for respective lines during respective frames are sequentially output from an upper portion to a lower portion of the image sensor 102.
As mentioned above, the driving method is called Rolling Shutter (RS). The image sensor 102 converts an object image formed with the imaging optical system 101 into an electrical signal serving as an image signal using a rolling shutter method, and supplies the converted electrical signal to the signal processing unit 103.
In recent years, CMOS image sensors used as image sensors used in electronic devices have become rapidly widespread. In the case of photographing a moving image using a CMOS image sensor, a readout method of sequentially reading out accumulated charges row by row from an upper portion to a lower portion of the CMOS image sensor is widely used. This readout method is called a rolling shutter method, and has a feature that readout timings between upper and lower portions of an image sensor are different. Due to this feature, in a case where the electronic apparatus is shaken and the position of the object on the image pickup surface is moved, distortion (rolling shutter distortion) caused by a difference in charge readout timing of the image sensor is generated in the picked-up image.
The image output method shown in the present embodiment can correct such rolling shutter distortion using image processing. The details are shown in the following examples.
The signal processing unit 103 generates a video signal conforming to, for example, the NTSC format from the image signal obtained by the image sensor 102, and supplies the generated video signal to the image memory 104.
The angular velocity sensor 111 detects shake of the electronic apparatus 100 as an angular velocity signal, and supplies the angular velocity signal to the a/D converter 112.
The a/D converter 112 digitizes the angular velocity signal from the angular velocity sensor 111, and supplies the digitized signal, which is angular shake data, to a microcomputer 110 provided therein.
The microcomputer 110 calculates the digitized signal and transmits the calculated related data to the metadata generation unit 116.
The metadata generation unit 116 generates metadata based on the data supplied from the microcomputer 110, and records the generated metadata in the recording medium 108.
The recording medium 108 may be, for example, a magnetic recording medium such as a hard disk or an information recording medium such as a semiconductor image memory, but is not limited thereto.
A display device 106, the display device 106 including, for example, a liquid crystal display element (LCD) or the like, and displaying an image output from the microcomputer 110.
The following describes the influence of shaking on the image definition during the photographing process of the electronic device.
Referring first to fig. 2, fig. 2 shows an original clear image, and the original value of the width of the point spread function PSF of the original image shown in this embodiment is infinitesimal.
The point spread function PSF is used to measure the resolution of the image, and the smaller the PSF width of the image is, the clearer the image is.
The electronic device shown in this embodiment can shoot the original image to generate a shot image, and in order to better explain the application of the shake to the image definition, the electronic device is placed on a test bench, where the test bench shown in this embodiment refers to a device capable of simulating a shake process.
The test environment of the embodiment is a scene with normal focusing and normal exposure.
First, a first test is performed on the electronic device, which is shown in fig. 3 and 4, in the coordinate system of fig. 3 and 4, the abscissa is the exposure time in milliseconds, and the ordinate is the angular velocity acquired by the angular velocity sensor of the electronic device.
In the fig. 3 and 4, the electronic device is placed in the same environment with shaking, i.e. in the different tests shown in fig. 3 and 4, the angular velocity acquired by the angular velocity sensor is the same.
In the test environment shown in fig. 3, the exposure start time of the current frame image is start, and the exposure end time is end, and then the exposure time of the frame image shown in fig. 3 is end-start.
In the test environment shown in fig. 4, the exposure start time of the current frame image is start, and the exposure end time is end, and then the exposure time of the frame image shown in fig. 4 is end-start.
As can be seen from fig. 3 and 4, the frame exposure time of fig. 3 is longer than that of fig. 4, the image output with the exposure time of fig. 3 is shown in fig. 5, the image output with the exposure time of fig. 4 is shown in fig. 6, and comparing fig. 5 and 6, the image of fig. 6 has a higher definition than that of the image of fig. 5, i.e., the PSF width of fig. 6 is smaller than that of fig. 5.
It can be seen that in the same jitter test environment, the longer the exposure time, the larger the width of the PSF of the image, i.e., the longer the exposure time, the lower the sharpness of the image.
Similarly, the electronic device may be placed in an environment with the same exposure time but different jitters, and the specific test process is not described in detail in this embodiment, and in the test environment with the same exposure time, the larger the jitter is, the larger the PSF width of the image is, that is, the larger the jitter is, the lower the definition of the image is.
As can be seen from the above description, the sharpness of the image depends on the intensity of the electronic equipment shaking and the length of the exposure time during the exposure process. Meanwhile, the influence of different motion forms of the electronic equipment on the image quality is not completely consistent.
The image output method shown in this embodiment is capable of outputting a clear image by analyzing the exposure time and the jitter of the frame image, and a detailed description is provided below with reference to fig. 7 for a specific flow of the image output method provided in this embodiment, where fig. 7 is a flow chart of steps of an embodiment of the image output method provided in the present invention.
And 701, determining a target sampling time point.
The electronic device shown in this embodiment may be preset with a sampling time point.
Specifically, the sampling time points shown in this embodiment may be periodically set, and the length of the sampling period in this embodiment is not limited, and the sampling period shown in this embodiment is an interval between any two adjacent sampling time points.
For example, in this embodiment, the sampling period is 10 milliseconds as an example, and the sampling time point is set every 10 milliseconds in this embodiment.
By adopting the method shown in this embodiment, the electronic device can acquire a frame image sequence which is reported by the sensor and is ordered according to time, wherein the frame image sequence comprises a plurality of frame images which are ordered according to the sequence of the exposure ending time.
The electronic device shown in this embodiment first determines whether the current first target frame image satisfies the output condition.
Optionally, when the method according to the embodiment of the present invention is executed for the first time, the first target frame image may be a frame image that is chronologically arranged at the first position in the frame image sequence.
Optionally, the frame image shown in this embodiment may also be a frame image randomly selected by the electronic device in the frame image sequence, and thus, this embodiment does not limit the specific position of the first target frame image in the frame image sequence, as long as the first target frame image may be any frame image in the frame image sequence.
This embodiment takes as an example that the first target frame image may be a frame image that is arranged at the first position in the frame image sequence according to time sequence.
In this embodiment, in order to determine whether to output the first target frame image, it is first necessary to determine the exposure time of the first target frame image.
Specifically, the electronic device shown in this embodiment acquires the data reported by the sensor at the sampling time point.
The data reported by the sensor is explained below.
Taking fig. 8 as an example, fig. 8 is a timing diagram of an embodiment of image output provided by the present invention.
In this embodiment, the electronic device can acquire the exposure time, the frame rate FR, the maximum frame rate, and the like of each frame image included in the sequence of frame images.
The frame rate FR shown in the present embodiment is the number of frames displayed per second, that is, the frame rate shown in the present embodiment is used to indicate the number of times the frame synchronization signal EOF appears per second.
As can be seen, the electronic device can determine the image frames appearing every second and the time point at which the exposure of each image frame ends, according to the frame rate reported by the sensor.
Taking fig. 8 as an example, wherein fig. 8 exemplifies that the exposed frame image is the first target frame image and the second target frame image.
It should be clear that, in this embodiment, the number of the frame images to be specifically exposed is not limited, and the description of the exposure time of the frame images and the time of the frame synchronization signal EOF in this embodiment is an optional example and is not limited.
Taking fig. 8 as an example, the abscissa shown in fig. 8 is time in milliseconds, and the ordinate is the row number of the pixel array of the first target frame image formed on the sensor die.
Specifically, if the size of the negative formed on the sensor shown in this embodiment is 12M and includes 4000 × 3000 pixels, the ordinate has 4000 rows each having 3000 pixels.
The method application shown in this embodiment can be applied to a rolling shutter mechanism, taking a first target frame image formed by a sensor as an example, where a function 71 is a frame exposure start time of each pixel row of the first target frame image, a function 72 is a frame exposure end time of each pixel row of the first target frame image, and taking a second target frame image formed by a sensor as an example, a function 73 is a frame exposure start time of each pixel row of the second target frame image, and a function 74 is a frame exposure end time of each pixel row of the second target frame image.
It can be seen that, in the present embodiment, the exposure start time of each pixel row of the frame image formed on the sensor is sequentially increased, and the exposure end time of each pixel row of the frame image formed on the sensor is also sequentially increased, and as shown in fig. 8, the functions formed by the first target frame image and the second target frame image in the coordinate system shown in fig. 8 in the present embodiment are in a parallelogram structure.
The sensor shown in this embodiment issues a first frame synchronization signal EOF when the exposure of the last pixel in the last pixel row of the first target frame image ends, where the first EOF is used to indicate the frame exposure end time of the first target frame image.
The sensor shown in this embodiment sends out the second frame synchronization signal EOF when the exposure of the last pixel in the last pixel row of the second target frame image is finished, and the second EOF is used for indicating the frame exposure end time of the second target frame image.
In this embodiment, in a sequence of frame images formed on a sensor, in any two adjacent frame images at a time, an exposure interval gap time exists between an exposure end time of a frame image located at a previous time and a frame exposure start time of a frame image located at a next time.
In this embodiment, a target sampling time point is determined within the exposure time of the first target frame image, where the target sampling time point is any one of at least one sampling time point located within the exposure time of the first target frame image.
As shown in fig. 8, the exposure time of the first target frame image is T1, and the target sampling time point is located within the time period of T1.
As shown in fig. 8 as an example, the sampling time points T1, T2, T3, T4 and T5 shown in the present embodiment are within the exposure time T1 of the first target frame image.
The sampling time points t1, t2, t3, t4, and t5 shown in the present embodiment are the target sampling time points.
The sampling interval shown in this embodiment is 10 ms, i.e. the time interval between t1 and t2 is 10 ms, and so on, and the time interval between t4 and t5 is 10 ms.
Step 702, determine the target pixel row.
The electronic device shown in this embodiment acquires the sampling data at the target sampling time point.
In this embodiment, the electronic device collects sampling data every other sampling period, and specifically, the sampling data shown in this embodiment is data reported by a sensor at the sampling time point.
It should be clear that the present embodiment does not limit the sampling time point and the sampling interval set in the process of outputting the image, and the present embodiment is only described as an optional example.
The electronic device shown in this embodiment acquires data reported by the sensor at target sampling time points t1, t2, t3, t4, and t5, respectively.
For a better understanding of the embodiments of the present invention, the effect of dithering on a frame image will be described below with reference to the drawings.
Fig. 9 is a schematic diagram of an embodiment of a frame image and an exposure function provided by the present invention. For a detailed description of the frame image 801 being a parallelogram, please refer to the above embodiments, which are not described in detail in this embodiment.
It should be clear that, in this embodiment, a scene with stable jitter is taken as an example shown in fig. 9, and in a case that the jitter is stable, the jitter function 802 described in this embodiment has a quadrilateral structure.
For the dithering function 802 to appear dithered only during the time period 803, the dithering has an effect only on the pixels in the frame image 801 that were exposed during the time period 803.
The dithering function 802 shown in this embodiment has different effects on different pixel lines in a frame image, specifically, two pixel lines in a frame image, namely, a pixel line1 and a pixel line2, are taken as examples, and it should be clear that the embodiment does not limit specific line numbers of the line1 and the line2 in the frame image.
As shown in fig. 9, if the influence of the dithering function 802 on the line1 is a first overlapping area of the dithering function 802 and the line1, and the influence of the dithering function 802 on the line2 is a second overlapping area of the dithering function 802 and the line2, the same dithering function 802 has different influences on different pixel lines of the same frame image.
In a scene with stable jitter, the same jitter can have different effects on different pixel lines in the frame image, and in a scene with unstable jitter, the jitter can have different effects on different pixel lines in the frame image.
It can be seen that the amount of jitter is only effective for a single line of pixels in a frame image, and in order to accurately determine the effect of jitter on the entire frame image, the effect of jitter on a single line of pixels in the frame image needs to be determined.
How to obtain the sub-target shaking amount of the target pixel row is described below, where the sub-target shaking amount is an influence of shaking on the target pixel row, and the target pixel row shown in this embodiment is any row of pixels included in the first target frame image.
Optionally, in order to accurately calculate the jitter amount of the target pixel row, a time at which any row of pixels included in the first target frame image starts to be exposed may be determined, and the target pixel row is determined, where the time at which the target pixel row starts to be exposed coincides with the target sampling time point.
Continuing with fig. 8, the present embodiment is described by taking the target pixel behaviors line1 and line2 as examples, and the time of starting exposure of line1 coincides with the sampling time point t1, and the time of starting exposure of line2 coincides with the sampling time point t 2.
It should be clear that, in this embodiment, the description of the target pixel row is an optional example, and is not limited, as long as the target pixel row is a pixel row included in the first frame image.
It should be clear that, the more target pixel rows are determined by the method in this embodiment, the more accurate the shake amount obtained by calculating the image frame, and a target pixel row threshold may be preset in this embodiment, so that when determining the target pixel rows, the target pixel rows whose number is the target pixel row threshold may be obtained.
In a specific application, different target pixel row thresholds can be set according to different requirements on the precision of an output image, and the higher the target pixel row threshold is, the higher the definition of the output image is.
Step 703, determining the target pixel in the target pixel line.
The target pixel shown in this embodiment is a pixel whose exposure time is the target sampling time point.
In this embodiment, as shown in fig. 8, the target pixels in the line1 are pixels P1, P2 and P3, the exposure time of P1 is t1, the exposure time of P2 is t2, and the exposure time of P3 is t3, and the number of the target pixels included in the target pixel row is not limited in this embodiment, and this embodiment takes 3 as an example.
It should be further understood that, if a plurality of target pixels are determined in the target pixel line, when the sub-target shaking amount is specifically calculated, the sub-target shaking amount may be calculated by selecting a target number of target pixels. The present embodiment does not limit the specific value of the selected target number.
Step 704, determining the target coordinates of the target pixel.
Specifically, the electronic device according to this embodiment obtains target sampling data through a target sampling time point corresponding to a target pixel, and obtains a target coordinate of the target pixel according to the target sampling data.
Specifically, as shown in fig. 8, for example, the target pixel P1, the electronic device obtains the sampling data reported by the sensor at the target sampling time point t1, and specifically, the sampling data shown in this embodiment is jitter data of the target pixel.
In this embodiment, the jitter of the electronic device is divided into a three-dimensional coordinate system, which is divided into an X axis, a Y axis, and a Z axis, wherein the X axis is a direction in which the electronic device translates along an up-down direction, the Y axis is perpendicular to the X axis, the Y axis is a direction in which the electronic device translates along an inside-outside direction, the Z axis is perpendicular to the X axis and the Y axis, and the Z axis is a direction in which the electronic device translates along a left-right direction.
The dither of the target pixel shown in this embodiment includes first point spread function data of the target pixel translated along the X axis, second point spread function data of the target pixel translated along the Y axis, third point spread function data of the target pixel translated along the Z axis, fourth point spread function data of the target pixel rotated about the X axis, fifth point spread function data of the target pixel rotated about the Y axis, and sixth point spread function data of the target pixel rotated about the Z axis at the target sampling time point.
In this embodiment, the target coordinates of the target pixel may be determined by the first point spread function data and the second point spread function data in the point spread function data.
It should be clear that, this embodiment takes the example of determining the target coordinate by using the first point spread function data and the second point spread function data as an example, which is not limited, and in other embodiments, the process of determining the target coordinate may also be performed by using other point spread function data, which is not described in detail in this embodiment.
How the sensor specifically acquires the first point spread function data and the second point spread function data is explained below:
in the present embodiment, when the lens of the electronic device is translated in the X-axis direction, as shown in fig. 10, when the lens is translated from the position 901 at the first time point in the X-axis direction to the position 902 at the second time point, the first point spread function data PSF1 is (a/b) d 1.
It should be clear that, in the electronic device shown in this embodiment, the lens diameters of the lenses overlap in the X direction before and after the lens is translated along X, and the lens diameters of the lens of the electronic device shown in fig. 10 are staggered from each other before and after the lens is translated along X in order to better explain the movement of the lens in the position before and after the lens is translated along X, and fig. 10 is a schematic diagram, and is not limited.
Where a is a distance between a lens 903 and a sensor 904 of the electronic device, and b is a distance between a subject 905 and the lens 903, that is, b is an object distance; d1 is a lens shift amount, and d1 is a distance in the X-axis direction between the position 902 after the lens shift and the position 901 before the shift.
And f is the focal length of the lens of the electronic equipment.
For the process of acquiring the second point spread function data PSF2, please refer to the process of acquiring the first point spread function data in detail when the lens of the electronic device translates along the Y-axis direction, which is not described in detail in this embodiment specifically, in the process of acquiring the second point spread function data, the lens offset d1 is a distance between the position after the lens is moved and the position before the lens is moved along the Y-axis direction.
For better understanding of the embodiment of the present invention, the following describes, with reference to fig. 11, a process of acquiring point spread function data PSF during lens rotational shake of an electronic device according to the embodiment of the present invention:
in the present embodiment, when the lens of the electronic device is rotated around the Z axis, as shown in fig. 11, when the lens is rotated from the position 1001 at the first time point to the position 1002 at the second time point along the Z axis direction, the sixth point spread function data PSF6 is a × tan θ.
Where a is a distance between a lens of the electronic apparatus and the sensor 1004, b is a distance between the object 1005 and the lens, and θ is a rotation angle amount of the lens, specifically, θ is a difference between an angle at the start of exposure and an angle at the end of exposure.
The following describes the effect of lens translational shake and rotational shake of an electronic device on the quality of an image, with reference to fig. 12:
in the present embodiment, in both the scene of the lens rotational shake and the scene of the translational shake, the distance a between the lens and the sensor of the electronic apparatus is set to 3mm, the lens shift amount d1 is set to 3mm, and θ is set to 1 degree, and the abscissa shown in fig. 12 is the object distance, that is, the distance b between the subject and the lens, in millimeters, and the ordinate is the width of the PSF.
As shown in fig. 12, a curve 1101 is used to indicate the PSF when the lens of the electronic device is translated, and a straight line 1102 is used to indicate the PSF when the electronic device is rotated.
It can be seen that in the case of electronic device translational dithering, the PSF is inversely proportional to the object distance, whereas in the case of electronic device rotational dithering, the PSF is independent of the object distance.
Based on the above description, in the present embodiment, the sensor can acquire the first shaking data of the target pixel translated along the X-axis at the target sampling time point.
Specifically, the sensor shown in this embodiment may acquire the first jitter data x (t) ═ PSF1 at the target sampling point, limt < t < limx.
Taking the target pixel as an a-th target pixel in the target pixel row as an example, where the a-th target pixel is any target pixel included in the target pixel row, limt is a time interval between a time when the target pixel row starts to be exposed and an exposure time of the a-th target pixel, if the a-th target pixel is not a last pixel in the target pixel row, limx is within an a-s line, and if the a-th target pixel is a last pixel in the target pixel row, limx is an exposure end time ex-time of the target pixel row.
Specifically, the sensor shown in this embodiment acquires corresponding jitter data between time points limt to limx, and a specific acquiring process of the jitter data is shown in the above embodiments and will not be described in detail.
More specifically, taking fig. 8 as an example, for the target pixel line1, the sensor may acquire the first shake data x (t) at the target sampling points t1, t2, and t3, respectively.
At the target sampling point t1, for the first target pixel P1 in the target pixel line1, the first shake data x (t) ═ PSF1 acquired by the sensor, 0 < t ≦ S.
At the target sampling point t2, for the second target pixel P2 in the target pixel line1, the first shake data x (t) ═ PSF1 acquired by the sensor, S < t ≦ 2S.
At the target sampling point t3, for the third target pixel P3 in the target pixel line1, the first dither data x (t) acquired by the sensor is PSF1, 2S < t ≦ ex-time.
More specifically, for the target pixel line1, the sensor may acquire the second shake data y (t) at the target sampling points t1, t2, and t3, respectively.
At the target sampling point t1, for the first target pixel P1 in the target pixel line1, the second shake data y (t) acquired by the sensor is PSF2, 0 < t ≦ S.
At the target sampling point t2, for the second target pixel P2 in the target pixel line1, the second shake data y (t) acquired by the sensor is PSF2, S < t ≦ 2S.
At the target sampling point t3, for the third target pixel P3 in the target pixel line1, the second dither data y (t) acquired by the sensor is PSF2, 2S < t ≦ ex-time.
The electronic device shown in the embodiment acquires Data1 at a target sampling point t1, where Data1 includes Data1x and Data1y, where Data1x is x (t) ═ PSF1, and 0 < t ≦ S; data1y is y (t) ═ PSF2, 0 < t ≦ S;
the electronic device obtains sampling Data at a target sampling point t2 as Data2, the Data2 comprises Data2x and Data2y, wherein Data2x is x (t) ═ PSF1, and S < t ≦ 2S; data2y is y (t) PSF2, S < t ≦ 2S;
the electronic device obtains sampling Data at a target sampling point t2 as Data3, the Data3 comprises Data3x and Data3y, wherein Data3x is x (t) ═ PSF1, and 2S < t ≦ ex-time; data3y is y (t) PSF2, 2S < t ≦ ex-time;
in this embodiment, after the electronic device obtains the sampling data, an integral operation may be performed to obtain the first coordinate data.
Specifically, the first coordinate data
More specifically, at the target sampling point t1, for the first target pixel P1 in the target pixel line1, the first coordinate Data x (t) ═ t Data1x acquired by the sensor, 0 < t ≦ S.
For details of Data1x, please refer to the above description, which is not repeated.
At a target sampling point t2, for a second target pixel P2 in the target pixel line1, the first coordinate Data x (t) acquired by the sensor is S Data1x + t Data2x, and S < t is less than or equal to 2S;
for details of Data1x and Data2x, the description is given above, and details are not repeated.
At a target sampling point t3, for a third target pixel P3 in the target pixel line1, the first coordinate Data x (t) acquired by the sensor is S × Data1x + S × Data2x + t × Data3x, and 2S < t is less than or equal to ex-time;
for details of Data1x, Data2x, and Data3x, the description is omitted here for brevity.
After the electronic device obtains the sampling data, integral operation can be performed to obtain second coordinate data.
More specifically, at the target sampling point t1, for the first target pixel P1 in the target pixel line1, the second coordinate Data y (t) ═ t Data1y acquired by the sensor, 0 < t ≦ S.
For details of Data1y, please refer to the above description, which is not repeated.
At the target sampling point t2, for the second target pixel P2 in the target pixel line1, the second coordinate Data y (t) acquired by the sensor is S Data1y + t Data2y, and S < t is less than or equal to 2S;
for details of Data1y and Data2y, the description is given above, and details are not repeated.
At the target sampling point t3, for the third target pixel P3 in the target pixel line1, the second coordinate Data y (t) acquired by the sensor is S × Data1y + S × Data2y + t × Data3y, and 2S < t is less than or equal to ex-time;
for details of Data1y, Data2y, and Data3y, the description is omitted here for brevity.
In the target pixel line1, the target coordinates of the target pixel P1 are (x (t) ═ t × Data1x, and y (t) ═ t × Data1y), in the target pixel line1, the target coordinates of the target pixel P2 are (x) (t) ═ S × Data1x + t × Data2x, y (t) ═ S × Data1y + t × Data2y, and in the target pixel line1, the target coordinates of the target pixel P3 are (x) (t) ═ S Data1x + S × Data2x + t × Data3x, and y (t) ═ S Data1y + S × Data2y + t Data3 y.
For the process of acquiring the target coordinates of each target pixel in the target pixel line2 shown in fig. 8, please refer to the process of acquiring the target coordinates of each target pixel in the line1 in detail, which is not described in detail in the embodiment.
In the above description, a case where a plurality of target pixels are included in the target pixel line is described, and how to acquire target coordinates when only one target pixel is included in the target pixel line will be described below.
If there is only one target pixel in the target pixel row, it indicates that the exposure time of the target pixel row is less than the sampling interval preset by the electronic device, and if the sampling interval is 10 milliseconds in this embodiment, in this case, the exposure time of the target pixel row is less than 10 millimeters, so that there is only one target pixel in the target pixel row.
Taking fig. 13 as an example, in the first target frame image, there is only one target pixel P4 in the target pixel line1, and the exposure time of the target pixel line1 is smaller than the sampling interval, which is the time difference between t2 and t 1.
The sensor shown in this embodiment can acquire the first jitter data x (t) ═ PSF1 at the target sampling point, limt < t < ex-time.
And limt is the time between the time of starting exposure of the target pixel row and the exposure time of the target pixel, and ex-time is the exposure end time of the target pixel row.
Specifically, the sensor shown in this embodiment acquires corresponding jitter data between time limt and time ex-time, and a detailed process of acquiring the jitter data is shown in the above embodiment and will not be described in detail.
More specifically, taking fig. 13 as an example, for the target pixel line3, the sensor may acquire the first shaking data x (t) at the target sampling point t 1.
At the target sampling point t1, for the target pixel P4 in the target pixel line3, the first shake data x (t) acquired by the sensor is PSF1, 0 < t < ex-time.
The sensor may also acquire second jitter data y (t) at target sampling point t 1.
At the target sampling point t1, for the target pixel P1 in the target pixel line3, the second shake data y (t) acquired by the sensor is PSF2, 0 < t < ex-time.
The electronic device shown in this embodiment obtains sample Data at a target sampling point t1 as Data1, where Data1 includes Data1x and Data1y, where Data1x is x (t) ═ PSF1, and 0 < t < ex-time; data1y is y (t) ═ PSF2, 0 < t < ex-time;
in this embodiment, after the electronic device obtains the sampling data, an integral operation may be performed to obtain the first coordinate data.
Specifically, the first coordinate data
More specifically, at the target sampling point t1, for the target pixel P4 in the target pixel line3, the first coordinate Data x (t) ═ t Data1x acquired by the sensor, 0 < t < ex-time.
For details of Data1x, please refer to the above description, which is not repeated.
More specifically, at the target sampling point t1, for the target pixel P4 in the target pixel line3, the second coordinate Data y (t) ═ t Data1y acquired by the sensor, 0 < t < ex-time.
For details of Data1y, please refer to the above description, which is not repeated.
In the target pixel line1, the target coordinates of the target pixel P4 are (x (t) ═ t Data1x, and y (t) ═ t Data1 y).
Step 705, determining the sub-target jitter amount.
Specifically, the electronic device shown in this embodiment needs to determine the number of the target pixels in the target pixel row first.
If the number of the target pixels in the target pixel row is at least two, setting a target set, wherein the target set comprises a plurality of target distances, the target distances are distances between any two target coordinates in all the target coordinates, and the target distances are distances between any one target coordinate and the origin coordinate.
When determining the sub-target shaking amount, a two-dimensional coordinate system may be created, and the target coordinates of each target pixel in the same row of target pixels are represented in the two-dimensional coordinate system.
In the example shown in fig. 8 and 14, in the target pixel line1, the number of the target pixels is three, and the target coordinates of P1, the target coordinates of P2, and the target coordinates of P3 can be represented in the coordinate system shown in fig. 14.
The target distance is a distance between P1 and P2, a distance between P2 and P3, a distance between P1 and P3, a distance between origin coordinates (0,0) and P1, a distance between origin coordinates (0,0) and P2, and a distance between origin coordinates (0,0) and P3 in the two-dimensional coordinate system as shown in fig. 14.
The electronic device sets the acquired target distance in a target set.
In this case, then the sub-target jitter amount is the maximum of all the target distances located within the target set.
Continuing with the example shown in fig. 8 and 14, the sub-target shaking amount of the target pixel line1 is the distance between the origin coordinate and P3.
If the number of the target pixels in the target pixel row is one, the sub-target shaking amount is the distance between the target coordinate and the origin coordinate;
as shown in fig. 13, there is only one target pixel P4 in the target pixel line3, and the sub-target shaking amount of the target pixel line is the distance between the target coordinate and the origin coordinate of P4.
Step 706, calculate a first target jitter amount of the first target frame picture.
Specifically, if the number of the target pixel rows located in the first target frame image determined in this embodiment is a natural number greater than 1, all the sub-target shaking amounts are calculated by an averaging algorithm to obtain the first target shaking amount.
The specific process of determining the number of target pixel rows in this step is shown in the above embodiments, and is not described in detail in this embodiment.
The averaging algorithm is not limited in this embodiment, as long as the sub-target jitter amount can be calculated to obtain an average value, for example, the averaging algorithm may be a moving average algorithm MA, an exponential smoothing average EMA, a parameter average SMA, a weight average DMA, or the like.
If the number of the target pixel rows is 1, the first target dithering amount is equal to the sub-target dithering amount.
Step 707, determining whether the first target jitter amount is less than or equal to a preset value, if so, executing step 708, and if not, executing step 709.
In this embodiment, the preset value may be preset in the process of executing the method shown in this embodiment by the electronic device, and the size of the preset value is not limited in this embodiment, as long as when the first target shake amount of the first target frame image output by the electronic device is less than or equal to the preset value, the first target frame image can meet a certain definition, so that a user can obtain a clear image.
Optionally, when the preset value is set in this embodiment, the following manner may be adopted, it should be clear that the description of the setting manner of the preset value in this embodiment is an optional example, and is not limited, and in a specific application, the preset value may be set in another manner as long as it is ensured that an image is clear when the first target jitter amount is less than or equal to the preset value.
The following is described in conjunction with table 1:
TABLE 1
In this embodiment, the electronic device is in different application scenarios, and then applies different standards, and the description of the standard in this embodiment is an optional example, and in a specific application, a standard that can apply more application scenarios may also be created.
Taking scene "6 inches of electronic equipment directly sees" as an example, if the electronic equipment is required to output a clear image, corresponding standard C needs to be executed, and in the standard C, the first blur parameter is: the length of the consecutive 10 pixels is 14 um.
In a specific application, if a clear image is output, the length of 10 continuous pixels in the image needs to be less than or equal to 14um, and then the clear image is output.
In this embodiment, the preset value and the blur parameter are proportional parameters, and the preset value may be set with reference to the blur parameter, so that the electronic device can output an image with a sharpness meeting the requirement when the shake amount of the image is smaller than or equal to the preset value.
And 708, outputting the first target frame image.
In this embodiment, if the first target jitter amount of the first target frame image is less than or equal to the preset value, it indicates that when the electronic device outputs the first target frame image, the first target frame image is an image whose definition meets a condition, that is, a user can obtain the clear first target frame image.
And step 709, determining a second target frame image.
The method shown in this embodiment may sequentially determine the second target frame image, that is, after step 708 is executed and step 709 is executed for the first time, the second target frame image is the next target frame image of the first target frame image.
Step 710, determining whether the second target jitter amount is less than or equal to the preset value, if so, executing step 711, otherwise, returning to execute step 709 or executing step 712.
Wherein the second target shaking amount is a shaking amount of the second target frame picture.
Specifically, please refer to the specific process of obtaining the first target jitter amount for details of the specific process of obtaining the second target jitter amount, which is not described in detail in this embodiment.
Please refer to the above embodiments for details of the explanation of the preset value in this step, which is not described in detail in this embodiment.
In this step, if the second jitter amount of the second target frame picture is greater than the preset value, which indicates that the sharpness of the second target frame picture is relatively low, the process returns to step 709 to re-determine the second target frame picture, when step 710 is executed in a second loop, a frame picture is separated between the second target frame picture and the first target frame picture, and after the second frame picture is re-determined, step 710 is continuously executed.
It can be seen that the exposure end time of the second target frame image shown in the embodiment is later than that of the first target frame image, and N target frame images are spaced between the first target frame image and the second target frame image, where N is a natural number greater than or equal to 0;
if N is equal to 0, it indicates that the second target frame image is the next target frame image of the first target frame image, if N is equal to 1, it indicates that the second target frame image is the next two target frame images of the first target frame image, and so on.
In this embodiment, if the second target shaking amount is greater than the preset value, it needs to be determined whether the current second target frame picture is the last frame picture in a frame picture sequence sorted according to the exposure end time, and if not, it indicates that there is a frame picture for which the shaking amount has not been calculated in the frame picture sequence.
If yes, it indicates that all the frame pictures in the frame picture sequence have been calculated, and the jitter amounts of all the frame pictures in the frame picture sequence are greater than the preset value, then step 712 is executed continuously.
And step 711, outputting the second target frame image.
The description of step 711 shown in this embodiment please refer to step 708, which is not described in detail.
And 712, outputting a third target frame image.
Specifically, the third target frame picture is any frame picture in a frame picture sequence, the frame picture sequence includes the first target frame picture and the determined at least one second target frame picture, and the jitter amount of the third target frame picture is the minimum value of the jitter amounts of all frame pictures in the frame picture sequence.
For example, in the above embodiment, it is determined that there are five frame pictures in the frame picture sequence, and the shake amounts of the respective frame pictures are Q1, Q2, Q3, Q4, and Q5, respectively, and the third target frame picture is the frame picture having the minimum value among Q1, Q2, Q3, Q4, and Q5.
The image output method shown in the embodiment has the advantages that:
the electronic equipment does not need to calculate the contrast of all the acquired frame images in the frame image sequence, only needs to calculate the jitter amount of the frame images in the frame image sequence in sequence according to the sequence of the exposure end time, and directly outputs the current frame image without calculating the frame images which are sequenced behind the current frame image according to the exposure end time if the jitter amount of the current frame image is calculated to be less than or equal to the preset value, so that the time consumed by calculating the frame images is saved, and the efficiency of outputting the images is improved under the condition that the definition of the images output by the electronic equipment is guaranteed.
The method shown above is based on the rolling shutter to implement the image output method provided by this embodiment, and how to implement the method shown in this embodiment of the present invention based on the global shutter is described below:
as shown in fig. 16, in the case of the present embodiment based on the global shutter, the image output method includes:
and step 1601, determining a target sampling time point.
For details of the detailed description of the target sampling time point shown in this embodiment, see step 701 shown in fig. 7 of this embodiment, which is not described in detail.
In the global shutter, the electronic device can determine the image frames appearing every second and the time points of the exposure end of each image frame through the data reported by the sensor.
Taking fig. 17 as an example, fig. 17 exemplifies the exposed frame image as the first target frame image and the second target frame image.
In this embodiment, the electronic device can acquire the exposure time, the frame rate FR, the maximum frame rate, and the like of each frame image included in the sequence of frame images.
Taking fig. 17 as an example, fig. 8 exemplifies the exposed frame image as the first target frame image and the second target frame image.
Taking fig. 8 as an example, the abscissa shown in fig. 8 is time in milliseconds, and the ordinate is the row number of the pixel array of the first target frame image formed on the sensor die.
The method of this embodiment can be applied to a global shutter mechanism, taking a first target frame image formed by a sensor as an example, where the initial exposure time of each pixel row of the first target frame image is the same, and the exposure end time of each pixel row of the first target frame image is the same, as shown in fig. 17, a timing chart of row exposure of the first target frame and the second target frame is in a rectangular structure.
Please refer to fig. 8 for details of the description of the other parameters of the first target frame image, which are not described in detail.
As shown in fig. 17, the exposure time of the first target frame image is T1, and the target sampling time point is located within the time period of T1.
As shown in fig. 17 for example, the sampling time points T1 and T2 shown in the present embodiment are within the exposure time T1 of the first target frame image.
The sampling time points t1 and t2 shown in the present embodiment are the target sampling time points.
Step 1602, determine the target pixel row.
Since the initial exposure time of each pixel row is the same and the exposure end time of each pixel row is the same in this embodiment, the target pixel row shown in this embodiment may be any row included in the first target frame image.
Step 1603, determining target pixels in the target pixel row.
The target pixel shown in this embodiment is a pixel whose exposure time is the target sampling time point.
For a detailed description, please refer to step 703 for details, which are not described in detail.
And 1604, determining the target coordinates of the target pixel.
The sensor shown in this embodiment can acquire the first jitter data x (t) ═ PSF1 at the target sampling points, limt < t < limx.
Please refer to the embodiment 704 shown in fig. 7 for details of the PSF1 acquisition process, which is not described in detail.
Specifically, taking the target pixel as the a-th target pixel in the target pixel row as an example, where the a-th target pixel is any target pixel included in the target pixel row, limt is a time interval between a time when the target pixel row starts to be exposed and an exposure time of the a-th target pixel, if the a-th target pixel is not the last pixel in the target pixel row, limx is as-s, and if the a-th target pixel is the last pixel in the target pixel row, limx is an exposure end time ex-time of the target pixel row.
Specifically, the sensor shown in this embodiment acquires corresponding jitter data between time points limt to limx, and a specific acquiring process of the jitter data is shown in the above embodiments and will not be described in detail.
More specifically, taking fig. 17 as an example, for the target pixel line1, the sensor may acquire the first shaking data x (t) at the target sampling points t1 and t2, respectively.
At the target sampling point t1, for the first target pixel P1 in the target pixel line1, the first shake data x (t) ═ PSF1 acquired by the sensor, 0 < t ≦ S.
At the target sampling point t2, for the last target pixel P2 in the target pixel line1, the first dither data x (t) ═ PSF1, x (t) ═ PSF1, s < t ≦ ex-time acquired by the sensor.
More specifically, for the target pixel line1, the sensor may acquire the second shake data y (t) at the target sampling points t1 and t2, respectively.
At the target sampling point t1, for the first target pixel P1 in the target pixel line1, the second shake data y (t) acquired by the sensor is PSF2, 0 < t ≦ S.
At the target sampling point t2, for the last target pixel P2 in the target pixel line1, the second jitter data y (t) acquired by the sensor is PSF2, and s < t ≦ ex-time.
The electronic device shown in the embodiment acquires Data1 at a target sampling point t1, where Data1 includes Data1x and Data1y, where Data1x is x (t) ═ PSF1, and 0 < t ≦ S; data1y is y (t) ═ PSF2, 0 < t ≦ S;
the electronic device obtains sampling Data at a target sampling point t2 as Data2, the Data2 comprises Data2x and Data2y, wherein Data2x is x (t) ═ PSF1, and s < t ≦ ex-time; data2y is y (t) PSF2, s < t ≦ ex-time;
in this embodiment, after the electronic device obtains the sampling data, an integral operation may be performed to obtain the first coordinate data.
Specifically, the first coordinate data
More specifically, at the target sampling point t1, for the first target pixel P1 in the target pixel line1, the first coordinate Data x (t) ═ t Data1x acquired by the sensor, 0 < t ≦ S.
For details of Data1x, please refer to the above description, which is not repeated.
At a target sampling point t2, for a second target pixel P2 in the target pixel line1, the first coordinate Data x (t) acquired by the sensor is S Data1x + t Data2x, and S < t is less than or equal to ex-time;
for details of Data1x and Data2x, the description is given above, and details are not repeated.
More specifically, at the target sampling point t1, for the first target pixel P1 in the target pixel line1, the second coordinate Data y (t) ═ t Data1y acquired by the sensor, 0 < t ≦ S.
For details of Data1y, please refer to the above description, which is not repeated.
At the target sampling point t2, for the second target pixel P2 in the target pixel line1, the second coordinate Data y (t) acquired by the sensor is S Data1y + t Data2y, and S < t is less than or equal to ex-time;
for details of Data1y and Data2y, the description is given above, and details are not repeated.
In the target pixel line1, the target coordinates of the target pixel P1 are (x (t) ═ t Data1x and y (t) ═ t Data1y), and in the target pixel line1, the target coordinates of the target pixel P2 are (x (t) ═ S Data1x + t Data2x and y (t) ═ S Data1y + t Data2 y).
Step 1605, calculating the target jitter amount.
For a specific process of determining the target jitter amount in this embodiment, please refer to the specific process of determining the sub-target jitter amount in step 705 shown in fig. 7.
In this embodiment, since the first target frame picture has a rectangular structure, the same dithering is applied to different pixel rows of the first target frame picture uniformly, and the different pixel rows of the first target frame picture have the same dithering amount in this embodiment, the dithering amount of any one row of the first target frame picture may be used as the dithering amount of the whole first target frame picture.
In step 1606, it is determined whether the first target jitter amount is less than or equal to a predetermined value, if yes, step 1607 is executed, and if not, step 1608 is executed.
And 1607, outputting the first target frame image.
Step 1608, determining the second target frame image.
In step 1609, it is determined whether the second target shaking amount is less than or equal to the predetermined value, if yes, step 1610 is executed, if no, step 1608 is executed or step 1611 is executed.
And a step 1610, outputting the second target frame image.
And step 1611, outputting a third target frame image.
For details of the specific execution process from step 1606 to step 1611 shown in this embodiment, please refer to step 707 to step 712 shown in fig. 7, which is not described in detail.
The image output method shown in the embodiment has the advantages that:
the electronic equipment does not need to calculate the contrast of all the acquired frame images in the frame image sequence, only needs to calculate the jitter amount of the frame images in the frame image sequence in sequence according to the sequence of the exposure end time, and directly outputs the current frame image without calculating the frame images which are sequenced behind the current frame image according to the exposure end time if the jitter amount of the current frame image is calculated to be less than or equal to the preset value, so that the time consumed by calculating the frame images is saved, and the efficiency of outputting the images is improved under the condition that the definition of the images output by the electronic equipment is guaranteed.
The following describes in detail a specific structure of an electronic device capable of implementing the image output method shown in fig. 7 from the perspective of functional modules, with reference to fig. 15:
the process of executing the image output by the electronic device shown in this embodiment is detailed in the embodiment shown in fig. 7, and is not described in detail in this embodiment.
As shown in fig. 15, the electronic apparatus includes:
a second acquisition unit 1501, configured to acquire a time for starting exposure of any line of pixels included in the first target frame image;
a second determining unit 1502, configured to determine the target pixel row, where a time of starting exposure of the target pixel row is the target sampling time point.
A first obtaining unit 1503, configured to obtain sampling data corresponding to a target sampling time point, where the target sampling time point is any one of at least one sampling time point located within an exposure time of a first target frame image, and the sampling data is jitter data of a pixel in the first target frame image corresponding to the target sampling time point;
the first obtaining unit 1503 is further configured to obtain target sampling data of a target pixel, where the target pixel is any pixel located in a target pixel row, an exposure time of the target pixel is the target sampling time point, the target pixel row is any pixel row included in the first target frame image, and the target sampling data is jitter data of the target pixel at the target sampling time point.
A first calculating unit 1504, configured to calculate a sub-target shaking amount of a target pixel row according to the target sampling time point and the target sampling data;
a third determining unit 1505 for determining the number of the target pixel rows;
a second calculating unit 1506, configured to determine that the first target shaking amount is equal to the sub-target shaking amount if the number of the target pixel rows is 1; and if the number of the target pixel rows is a natural number greater than 1, calculating all the sub-target shaking amounts through an average algorithm to obtain the first target shaking amount.
Specifically, the second calculation unit 1506 includes:
a calculating module 15061, configured to calculate a target coordinate of any target pixel located in the target pixel line according to the target sampling time point and the target sampling data;
a first determining module 15062, configured to determine, if the number of the target pixels in the target pixel row is one, the sub-target shaking amount is a distance between the target coordinate and an origin coordinate;
a second determining module 15063, configured to set a target set if the number of target pixels located in the target pixel row is at least two, where the target set includes a plurality of target distances, the target distance is a distance between any two target coordinates in all the target coordinates, and the target distance is a distance between any one target coordinate and the origin coordinate;
a third determining module 15064, configured to obtain the sub-target jitter amount, where the sub-target jitter amount is a maximum value of all the target distances located in the target set.
More specifically, the calculation module 15061 includes:
a first obtaining sub-module 150611, configured to obtain first jitter data of any target pixel in the target pixel line translated along the X-axis at the target sampling time point;
a first calculation submodule 150612, configured to perform an integration operation on the first jitter data to obtain first coordinate data;
a second obtaining sub-module 150613, configured to obtain second jitter data of any target pixel in the target pixel line translated along the Y-axis at the target sampling time point;
a second calculation submodule 150614, configured to perform an integration operation on the second shake data to obtain second coordinate data;
the determining sub-module 150615 is configured to determine that the target coordinate of any target pixel in the target pixel row includes a target abscissa and a target ordinate, where the target abscissa is the first coordinate data and the target ordinate is the second coordinate data.
A first determination unit 1507 configured to determine whether or not a first target shaking amount, which is a shaking amount of a first target frame picture determined based on the target sampling time point and the sampling data, is less than or equal to a preset value;
a first output unit 1508, configured to output the first target frame picture if the first target jitter amount is less than or equal to the preset value.
A first determining unit 1509, configured to determine a second target frame picture if the first target jitter amount is greater than the preset value, where an exposure end time of the second target frame picture is later than an exposure end time of the first target frame picture, and N target frame pictures are spaced between the first target frame picture and the second target frame picture, where N is a natural number greater than or equal to 0;
a second determining unit 1510, configured to determine whether a second target shaking amount is smaller than or equal to the preset value, where the second target shaking amount is a shaking amount of the second target frame image;
a second output unit 1511, configured to output the second target image frame if the second target shaking amount is less than or equal to the preset value.
The second output unit 1511 is further configured to, if the second target shake amount is greater than the preset value, output a third target frame picture, where the third target frame picture is any one of frame pictures in a frame picture sequence, the frame picture sequence includes the first target frame picture and the second target frame picture, and a shake amount of the third target frame picture is a minimum shake amount of all frame pictures in the frame picture sequence.
The electronic equipment shown by the embodiment has the advantages that:
the electronic equipment does not need to calculate the contrast of all the acquired frame images in the frame image sequence, only needs to calculate the jitter amount of the frame images in the frame image sequence in sequence according to the sequence of the exposure end time, and directly outputs the current frame image without calculating the frame images which are sequenced behind the current frame image according to the exposure end time if the jitter amount of the current frame image is calculated to be less than or equal to the preset value, so that the time consumed by calculating the frame images is saved, and the efficiency of outputting the images is improved under the condition that the definition of the images output by the electronic equipment is guaranteed.
Fig. 15 illustrates the structure of the electronic device from the perspective of the functional modules, and the following describes the structure of the electronic device from the perspective of the physical hardware, as shown in fig. 1.
The electronic apparatus includes one or more microcomputers 110, an image memory 104, a bus system through which the microcomputers 110 and the image memory 104 are connected, and one or more programs;
wherein the one or more programs are stored in the image memory 104, the one or more programs comprising instructions which, when executed by the electronic device, cause the electronic device to perform an image output method as shown in fig. 7.
For details, please refer to fig. 7, which is a specific process of the electronic device executing the image output method in this embodiment, and details are not repeated in this embodiment.
The specific structure of the electronic device described in this embodiment may also be referred to as shown in the above embodiments, and details are not described in this embodiment.
Specifically, in this embodiment, the one or more programs include instructions, and when the instructions are executed by the electronic device, the electronic device executes the image output method shown in fig. 7, and a specific flow of the method for executing the image output by the instructions is shown in fig. 7 in detail, and is not described in detail in this embodiment.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (18)

  1. An image output method, comprising:
    acquiring sampling data corresponding to a target sampling time point, wherein the target sampling time point is any one of at least one sampling time point in the exposure time of a first target frame image, and the sampling data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image;
    judging whether a first target jitter amount is smaller than or equal to a preset value, wherein the first target jitter amount is the jitter amount of a first target frame image determined according to the target sampling time point and the sampling data;
    and if the first target jitter amount is less than or equal to the preset value, outputting the first target frame image.
  2. The method of claim 1, wherein after determining whether the first target jitter amount is less than or equal to a predetermined value, the method further comprises:
    if the first target jitter amount is greater than the preset value, determining a second target frame image, wherein the exposure end time of the second target frame image is later than that of the first target frame image, N target frame images are arranged between the first target frame image and the second target frame image at intervals, and N is a natural number greater than or equal to 0;
    judging whether a second target jitter amount is smaller than or equal to the preset value, wherein the second target jitter amount is the jitter amount of the second target frame image;
    and if the second target shaking amount is smaller than or equal to the preset value, outputting the second target image frame.
  3. The method of claim 2, wherein after determining whether the second target jitter amount is less than or equal to the predetermined value, the method further comprises:
    if the second target shaking amount is greater than the preset value, outputting a third target frame picture, where the third target frame picture is any frame picture in a frame picture sequence, the frame picture sequence includes the first target frame picture and the second target frame picture, and the shaking amount of the third target frame picture is the minimum value of the shaking amounts of all the frame pictures in the frame picture sequence.
  4. The method of any one of claims 1 to 3, wherein the acquiring of the sample data corresponding to the target sampling time point comprises:
    acquiring target sampling data of a target pixel, wherein the target pixel is any pixel located in a target pixel line, the exposure time of the target pixel is the target sampling time point, the target pixel line is any pixel line included in the first target frame image, and the target sampling data is jitter data of the target pixel at the target sampling time point.
  5. The method of claim 4, wherein prior to obtaining the target sample data for the target pixel, the method further comprises:
    acquiring the time for starting exposure of any line of pixels included in the first target frame image;
    and determining the target pixel row, wherein the time for starting exposure of the target pixel row is the target sampling time point.
  6. The method according to claim 4 or 5, wherein before determining whether the first target jitter amount is less than or equal to the preset value, the method further comprises:
    calculating the sub-target jitter amount of the target pixel row according to the target sampling time point and the target sampling data;
    determining a number of the target pixel rows;
    if the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount;
    and if the number of the target pixel rows is a natural number greater than 1, calculating all the sub-target shaking amounts through an average algorithm to obtain the first target shaking amount.
  7. The method of claim 6, wherein calculating the sub-target amount of dither for a target row of pixels based on the target sample time point and the target sample data comprises:
    calculating the target coordinate of any target pixel in the target pixel line according to the target sampling time point and the target sampling data;
    if the number of the target pixels in the target pixel row is one, the sub-target shaking amount is the distance between the target coordinate and the origin coordinate;
    if the number of the target pixels in the target pixel row is at least two, setting a target set, wherein the target set comprises a plurality of target distances, the target distances are distances between any two target coordinates in all the target coordinates, and the target distances are distances between any one target coordinate and the origin coordinate;
    and acquiring the sub-target jitter amount, wherein the sub-target jitter amount is the maximum value of all the target distances in the target set.
  8. The method of claim 7, wherein calculating the target coordinates of any target pixel within the target pixel row based on the target sampling time point and the target sampling data comprises:
    acquiring first jitter data of any target pixel in the target pixel line, which is translated along the X axis at the target sampling time point;
    performing integral operation on the first jitter data to obtain first coordinate data;
    acquiring second jitter data of any target pixel in the target pixel line, which is translated along the Y axis at the target sampling time point;
    performing integral operation on the second jitter data to obtain second coordinate data;
    and the target coordinate of any target pixel in the target pixel row comprises a target abscissa and a target ordinate, the target abscissa is determined to be the first coordinate data, and the target ordinate is determined to be the second coordinate data.
  9. An electronic device, comprising:
    a first obtaining unit, configured to obtain sampling data corresponding to a target sampling time point, where the target sampling time point is any one of at least one sampling time point located within an exposure time of a first target frame image, and the sampling data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image;
    a first determining unit, configured to determine whether a first target jitter amount is smaller than or equal to a preset value, where the first target jitter amount is a jitter amount of a first target frame image determined according to the target sampling time point and the sampling data;
    a first output unit, configured to output the first target frame picture if the first target jitter amount is less than or equal to the preset value.
  10. The electronic device of claim 9, further comprising:
    a first determining unit, configured to determine a second target frame picture if the first target jitter amount is greater than the preset value, where an exposure end time of the second target frame picture is later than an exposure end time of the first target frame picture, N target frame pictures are spaced between the first target frame picture and the second target frame picture, and N is a natural number greater than or equal to 0;
    a second determining unit, configured to determine whether a second target shaking amount is smaller than or equal to the preset value, where the second target shaking amount is a shaking amount of the second target frame image;
    and a second output unit, configured to output the second target image frame if the second target shaking amount is less than or equal to the preset value.
  11. The electronic device of claim 10, wherein the second output unit is further configured to output a third target frame picture if the second target amount of jitter is greater than the preset value, wherein the third target frame picture is any one of a sequence of frame pictures, the sequence of frame pictures includes the first target frame picture and the second target frame picture, and the third target frame picture has an amount of jitter that is a minimum of amounts of jitter of all frame pictures in the sequence of frame pictures.
  12. The electronic device according to any one of claims 9 to 11, wherein the first obtaining unit is further configured to obtain target sampling data of a target pixel, the target pixel is any pixel located in a target pixel row, an exposure time of the target pixel is the target sampling time point, the target pixel row is any pixel row included in the first target frame image, and the target sampling data is jitter data of the target pixel at the target sampling time point.
  13. The electronic device of claim 12, further comprising:
    a second acquiring unit, configured to acquire a time for starting exposure of any line of pixels included in the first target frame image;
    and the second determining unit is used for determining the target pixel row, wherein the time for starting exposure of the target pixel row is the target sampling time point.
  14. The electronic device according to claim 12 or 13, characterized in that the electronic device further comprises:
    a first calculating unit, configured to calculate a sub-target jitter amount of a target pixel row according to the target sampling time point and the target sampling data;
    a third determination unit configured to determine the number of the target pixel rows;
    a second calculation unit, configured to, if the number of the target pixel rows is 1, determine that the first target shaking amount is equal to the sub-target shaking amount; and if the number of the target pixel rows is a natural number greater than 1, calculating all the sub-target shaking amounts through an average algorithm to obtain the first target shaking amount.
  15. The electronic device of claim 14, wherein the second computing unit comprises:
    the calculation module is used for calculating the target coordinate of any target pixel in the target pixel line according to the target sampling time point and the target sampling data;
    a first determining module, configured to determine, if the number of the target pixels located in the target pixel row is one, that the sub-target shaking amount is a distance between the target coordinate and an origin coordinate;
    a second determining module, configured to set a target set if the number of target pixels located in the target pixel row is at least two, where the target set includes a plurality of target distances, the target distance is a distance between any two target coordinates in all the target coordinates, and the target distance is also a distance between any one target coordinate and the origin coordinate;
    a third determining module, configured to obtain the sub-target jitter amount, where the sub-target jitter amount is a maximum value of all the target distances located in the target set.
  16. The electronic device of claim 15, wherein the computing module comprises:
    the first acquisition sub-module is used for acquiring first jitter data of any target pixel in the target pixel line, which is translated along the X axis at the target sampling time point;
    the first calculation submodule is used for carrying out integral operation on the first jitter data to obtain first coordinate data;
    the second obtaining submodule is used for obtaining second jitter data of any target pixel in the target pixel line, which is translated along the Y axis at the target sampling time point;
    the second calculation submodule is used for carrying out integral operation on the second jitter data to obtain second coordinate data;
    and the determining submodule is used for determining that the target coordinate of any target pixel in the target pixel line comprises a target abscissa and a target ordinate, the target abscissa is determined to be the first coordinate data, and the target ordinate is determined to be the second coordinate data.
  17. An electronic device, comprising:
    one or more microcomputers, an image memory, a bus system, and one or more programs, the microcomputers and the image memory being connected by the bus system;
    wherein the one or more programs are stored in the image memory, the one or more programs comprising instructions which, when executed by the electronic device, cause the electronic device to perform the method of any of claims 1-8.
  18. A computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by an electronic device, cause the electronic device to perform the method of any of claims 1-8.
CN201680075969.2A 2016-10-17 2016-12-22 Image output method and electronic equipment Active CN108476286B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201610901195 2016-10-17
CN2016109011956 2016-10-17
PCT/CN2016/111452 WO2018072308A1 (en) 2016-10-17 2016-12-22 Image output method and electronic device

Publications (2)

Publication Number Publication Date
CN108476286A true CN108476286A (en) 2018-08-31
CN108476286B CN108476286B (en) 2020-09-08

Family

ID=62018196

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201680075969.2A Active CN108476286B (en) 2016-10-17 2016-12-22 Image output method and electronic equipment

Country Status (2)

Country Link
CN (1) CN108476286B (en)
WO (1) WO2018072308A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114390197A (en) * 2021-12-27 2022-04-22 维沃移动通信有限公司 Shooting method and device, electronic equipment and readable storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12033301B2 (en) 2019-09-09 2024-07-09 Nvidia Corporation Video upsampling using one or more neural networks
CN113225473B (en) * 2020-02-05 2022-07-08 浙江大华技术股份有限公司 Method, apparatus, device and medium for auto-focusing
US20220130013A1 (en) * 2020-10-26 2022-04-28 Nvidia Corporation Training one or more neural networks using synthetic data

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309357A (en) * 2007-05-18 2008-11-19 卡西欧计算机株式会社 Image pickup apparatus equipped with function of detecting image shaking
CN103051836A (en) * 2012-12-14 2013-04-17 中兴通讯股份有限公司 Anti-shake photographing method and anti-shake photographing device for mobile terminal
CN103384309A (en) * 2012-05-02 2013-11-06 佳能株式会社 Image capturing apparatus and control method
CN103650383A (en) * 2012-05-24 2014-03-19 松下电器产业株式会社 Information communication method
CN104618640A (en) * 2014-12-30 2015-05-13 广东欧珀移动通信有限公司 Photographing method and device
CN105049728A (en) * 2015-08-17 2015-11-11 广东欧珀移动通信有限公司 Method and device for acquiring shot image
CN105323420A (en) * 2014-07-29 2016-02-10 腾讯科技(深圳)有限公司 Video image processing method and apparatus
CN105578061A (en) * 2016-02-25 2016-05-11 广东欧珀移动通信有限公司 Anti-shaking method and device for photographing, and mobile terminal
CN105830431A (en) * 2014-06-11 2016-08-03 奥林巴斯株式会社 Image processing device, imaging device equipped with same, image processing method, and image processing program
JP2016152602A (en) * 2015-02-19 2016-08-22 オリンパス株式会社 Imaging apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104104856B (en) * 2013-04-09 2016-08-10 腾讯科技(深圳)有限公司 Image-pickup method, device and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309357A (en) * 2007-05-18 2008-11-19 卡西欧计算机株式会社 Image pickup apparatus equipped with function of detecting image shaking
CN103384309A (en) * 2012-05-02 2013-11-06 佳能株式会社 Image capturing apparatus and control method
CN103650383A (en) * 2012-05-24 2014-03-19 松下电器产业株式会社 Information communication method
CN103051836A (en) * 2012-12-14 2013-04-17 中兴通讯股份有限公司 Anti-shake photographing method and anti-shake photographing device for mobile terminal
CN105830431A (en) * 2014-06-11 2016-08-03 奥林巴斯株式会社 Image processing device, imaging device equipped with same, image processing method, and image processing program
CN105323420A (en) * 2014-07-29 2016-02-10 腾讯科技(深圳)有限公司 Video image processing method and apparatus
CN104618640A (en) * 2014-12-30 2015-05-13 广东欧珀移动通信有限公司 Photographing method and device
JP2016152602A (en) * 2015-02-19 2016-08-22 オリンパス株式会社 Imaging apparatus
CN105049728A (en) * 2015-08-17 2015-11-11 广东欧珀移动通信有限公司 Method and device for acquiring shot image
CN105578061A (en) * 2016-02-25 2016-05-11 广东欧珀移动通信有限公司 Anti-shaking method and device for photographing, and mobile terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114390197A (en) * 2021-12-27 2022-04-22 维沃移动通信有限公司 Shooting method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
WO2018072308A1 (en) 2018-04-26
CN108476286B (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN109194876B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP5917054B2 (en) Imaging apparatus, image data processing method, and program
JP5794705B2 (en) Imaging apparatus, control method thereof, and program
CN110610465B (en) Image correction method and device, electronic equipment and computer readable storage medium
JP5843454B2 (en) Image processing apparatus, image processing method, and program
CN109672819B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
JP6047025B2 (en) Imaging apparatus and control method thereof
KR20180032529A (en) Camera module, solid-state imaging device, electronic device and imaging method
JP2017516358A (en) Multi-frame noise reduction method and terminal
JP5499050B2 (en) Image processing apparatus, imaging apparatus, and image processing method
CN107295252B (en) Focusing area display method and device and terminal equipment
JP4748230B2 (en) Imaging apparatus, imaging method, and imaging program
CN108476286B (en) Image output method and electronic equipment
US9832382B2 (en) Imaging apparatus and imaging method for outputting image based on motion
CN106303249B (en) Video anti-shake method and device
Ringaby et al. A virtual tripod for hand-held video stacking on smartphones
KR20100046544A (en) Image distortion compensation method and apparatus
CN113875219A (en) Image processing method and device, electronic equipment and computer readable storage medium
JP6664240B2 (en) Imaging system, imaging apparatus, and control method therefor
Sindelar et al. Space-variant image deblurring on smartphones using inertial sensors
JP2007104516A (en) Image processor, image processing method, program, and recording medium
JP7087187B2 (en) Blur correction device, image pickup device, monitoring system, and program
CN114449130A (en) Multi-camera video fusion method and system
JP6645949B2 (en) Information processing apparatus, information processing system, and information processing method
US11729506B2 (en) Imaging element with processor configured to receive vibration information, imaging apparatus, operation method of imaging element, and program

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