WO2018072308A1 - Image output method and electronic device - Google Patents

Image output method and electronic device Download PDF

Info

Publication number
WO2018072308A1
WO2018072308A1 PCT/CN2016/111452 CN2016111452W WO2018072308A1 WO 2018072308 A1 WO2018072308 A1 WO 2018072308A1 CN 2016111452 W CN2016111452 W CN 2016111452W WO 2018072308 A1 WO2018072308 A1 WO 2018072308A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
frame image
jitter
data
amount
Prior art date
Application number
PCT/CN2016/111452
Other languages
French (fr)
Chinese (zh)
Inventor
徐荣跃
王君
雷磊
杜成
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201680075969.2A priority Critical patent/CN108476286B/en
Publication of WO2018072308A1 publication Critical patent/WO2018072308A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • the present invention relates to the field of image processing, and in particular, to an image output method and an electronic device.
  • the user's handheld electronic devices When using electronic devices for taking pictures, the user's handheld electronic devices will inevitably appear to be shaken, such as the natural shaking of the user's body. Natural jitter can be the user's heartbeat, pulse, breathing, etc.
  • the electronic device takes a picture, the user's jitter will be photographed. The moment causes vibration, and in the case of vibration, it has a great influence on the sharpness of the image captured by the electronic device.
  • the electronic device can be continuously acquired.
  • the multi-frame image is high-pass filtered to obtain the contrast of all the images in the multi-frame image, and the electronic device can output the image with the highest contrast.
  • the electronic device needs to generate a relatively long delay when performing contrast calculation on the multi-frame image, so that the electronic device cannot output the image quickly, thereby reducing the image output efficiency of the electronic device. .
  • the present invention provides an image output method and an electronic device capable of ensuring an output of a clear image of an electronic device while also improving the efficiency of outputting an image of the electronic device.
  • a first aspect of the embodiments of the present invention provides an image output method, including:
  • Step A Obtain sampling data corresponding to a target sampling time point.
  • the electronic device shown in this embodiment may be periodically set with a sampling time point.
  • the electronic device can acquire the time-ordered frame image sequence reported by the sensor, and the frame image sequence includes a plurality of frame images sorted according to the exposure end chronological order. image.
  • the first target frame image is any frame image in the sequence of frame images.
  • the electronic device shown in this embodiment acquires data reported by the sensor at the sampling time point, and the electronic device can acquire an exposure time, a frame rate FR, and a maximum of each frame image included in the frame image sequence. Frame rate, etc.
  • the target sampling time point being any one of sampling time points located in an exposure time of the first target frame image.
  • the sampled data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image.
  • Step B Determine whether the first target jitter amount is less than or equal to a preset value, and if yes, perform step C.
  • the first target shake amount is a shake amount of the first target frame image determined according to the target sampling time point and the sample data.
  • the electronic device may be preset with the preset value in the process of performing the method shown in this embodiment, and the size of the preset value is not limited in this embodiment, as long as the 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 satisfy a certain definition, thereby enabling the user to obtain clear Image.
  • the different preset values can be set according to different requirements for image sharpness.
  • Step C output the first target frame image.
  • the first target frame image when it is determined that the jitter amount of the first target frame image is less than or equal to the preset value, the first target frame image may be directly output.
  • the electronic device first calculates a first target jitter amount of the first target frame image in the acquired image frame sequence, where the first target jitter amount is smaller than a preset preset.
  • the first target frame image is directly output, and the electronic device calculates the amount of jitter of the frame image behind the first target frame image in the image frame sequence, thereby The time-consuming calculation of the amount of jitter of the frame image sorted after the first target frame image is saved, the efficiency of image output is improved, and the delay of image output is reduced.
  • the step B further includes: if the first target jitter amount is greater than the preset value,
  • the method shown further includes the following steps;
  • Step D1 Determine a second target frame image.
  • a second target frame image sorted after the first target frame image is determined.
  • the exposure end time of the second target frame image is later than the exposure end time of the first target frame image, and there are N intervals between the first target frame image and the second target frame image.
  • a target frame image the N being a natural number greater than or 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, the second target frame image is There are N target frame images spaced between the first target frame images.
  • Step D2 Determine whether the second target jitter amount is less than or equal to the preset value.
  • the second target jitter amount is a jitter amount of the second target frame image.
  • step D3 if it is determined that the second target jitter amount is less than or equal to the preset value, step D3 is performed.
  • Step D3 Output the second target frame image.
  • the second target frame image is directly output.
  • the electronic device first calculates a first target jitter amount of the first target frame image in the acquired image frame sequence, where the first target jitter amount is greater than or equal to a preset value.
  • a preset value it indicates that the current resolution of the first target frame image does not satisfy the requirement, and if the first target frame image is output, the definition of the frame image displayed by the electronic device cannot satisfy the user's Determining, the electronic device determines, in the sequence of frame images, that the exposure time is later than the second target frame image of the first target frame image, and the amount of jitter in the second target frame image is less than or
  • the second target frame image whose resolution meets the user's requirement is directly output, and the method shown in this embodiment avoids the frame image located behind the second target frame image.
  • the amount of jitter is calculated, thereby saving the time required for calculating the amount of jitter of the frame image after sorting the image of the second target frame, improving the efficiency of image output
  • the step B further includes: if it is determined that the first target jitter amount is greater than a preset value, The method shown in this embodiment further includes the following steps;
  • the third target frame image is determined.
  • the third target frame image is any frame image in a sequence of frame images, and the frame image sequence includes the first target frame image and the determined at least one second target frame image, and
  • the amount of jitter that the third target frame image has is the minimum value of the amount of jitter that all of the frame images in the sequence of frame images have.
  • the determined amount of jitter of the first target frame image and all the second target frame images is greater than the preset value, and then the determined In a target frame image and all of the second target frame images, a target frame image in which the amount of jitter is determined to be the smallest is determined as the third target frame image.
  • the electronic device in the acquired image frame sequence, in a case where the jitter amount of the first target frame image and all the second target frame images are greater than the preset value And selecting the third target frame image with the highest definition in the frame image sequence, thereby outputting the third target frame image, and the method described in this embodiment can ensure the clarity of the output image of the electronic device, thereby enabling the user to The image with the highest sharpness can be obtained.
  • the step A specifically includes:
  • Step A11 Obtain target sampling data of the target pixel.
  • the target pixel is any pixel located in a target pixel row, and the target pixel is exposed For the target sampling time point, the target pixel acts on 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 target pixel that satisfies the condition is determined, according to the determined target pixel.
  • the amount of jitter of the target frame image can be determined, so that it is not necessary to process all the pixels included in the target frame image, thereby effectively improving the efficiency of calculating the jitter amount of the frame image.
  • the method shown in the embodiment of the present invention further includes:
  • Step A01 Obtain a time when any row of pixels included in the image of the first target frame starts to be exposed.
  • the same jitter has different effects on different pixel rows. It can be seen that the jitter amount is only valid for a single row of pixels in the frame image. In order to accurately determine the influence of the jitter on the entire frame image, the jitter needs to be determined. The effect on a single pixel row of a frame image.
  • the electronic device shown in this embodiment first determines the time at which any row of pixels included in the first target frame image begins to be exposed.
  • Step A02 Determine the target pixel row.
  • the time at which the target pixel row starts to be exposed is the target sampling time point.
  • the target pixel row threshold may be preset, and then When the target pixel row is described, the target pixel row whose number is the target pixel row threshold may be acquired.
  • the accuracy of the jitter calculation of the target frame image can be improved, so that the electronic device calculates the jitter amount according to the target pixel row. , can obtain the amount of jitter of the accurate target frame image.
  • the method further includes:
  • Step B01 Calculate the sub-target jitter amount of the target pixel row.
  • the sub-target jitter amount is the influence of the jitter on the target pixel row, and the target pixel shown in this embodiment acts on any row of pixels included in the first target frame image.
  • the target number of target pixels may be selected to calculate the sub-target jitter amount.
  • the specific value of the selected target number is not limited in this embodiment.
  • 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 jitter amount is equal to the sub-target jitter amount;
  • Step B04 If the number of the target pixel rows is a natural number greater than 1, the all-sub-target jitter amount is calculated by an averaging algorithm to obtain the first target jitter amount.
  • the averaging algorithm is not limited, as long as the sub-target jitter amount can be calculated to obtain an average value.
  • the averaging algorithm may be a moving average algorithm MA, an exponential smoothing average EMA, and a parameter average. SMA and weighted average DMA, etc.
  • the sub-target jitter amount of the target pixel row included in the target frame image may be first determined, and after determining the sub-target jitter amount, Determining the amount of jitter of the target frame image, it can be seen that, by using the method shown in this embodiment, the calculation of the jitter amount of the target frame image is divided into each target based on the same jitter affecting different pixel rows. The pixel row improves the accuracy of the jitter calculation for the target frame image.
  • the step B01 includes:
  • Step B011 Calculate target coordinates of any target pixel located in the target pixel row.
  • the target coordinates are calculated according to the target sampling time point and the target sampling data.
  • Step B012 If the number of the target pixels located in the target pixel row is one, the sub-target shake amount is a distance between the target coordinate and the origin coordinate.
  • the number of the target pixels is one, and the target coordinates of P1 can be expressed 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.
  • Step B013 If the number of the target pixels located in the target pixel row is at least two, set the target set.
  • the target set includes a plurality of target distances, the target distance is a distance between any two of the target coordinates of the target coordinates, and the target distance is also any of the target coordinates and the origin The distance between the coordinates.
  • the target coordinates of P1, the target coordinates of P2, and the target coordinates 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 the origin coordinates (0, 0) and P1, and an origin in a two-dimensional coordinate system.
  • the electronic device sets the acquired target distance in the target set.
  • the sub-target jitter amount is a maximum value among all the target distances located in the target set.
  • the step B011 specifically includes:
  • Step B0111 Acquire first jitter data that is located on the X-axis of any target pixel in the target pixel row at the target sampling time point;
  • the electronic device in this embodiment acquires target sampling data by using a target sampling time point corresponding to the target pixel, and acquires target coordinates of the target pixel according to the target sampling data.
  • 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 in the up-and-down direction, and the Y-axis and The X axis is vertical, and the Y axis is a direction in which the electronic device translates in the inner and outer directions, 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 in the left and right directions.
  • the jitter of the target pixel shown in this embodiment includes first point spread function data of the target pixel moving along the X axis at the target sampling time point, second point spread function data translated along the Y axis, and third translation along the Z axis.
  • 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.
  • the first point spread function data PSF1 (a/b)d1.
  • a is the distance between the lens and the sensor of the electronic device
  • b is the distance between the object and the lens, that is, b is the object distance
  • d1 is the lens shift amount
  • the lens shift amount d1 is the lens shift The distance between the rear position and the position before the movement in the X-axis direction.
  • Step B0112 performing an integration operation on the first jitter data to obtain first coordinate data
  • the target pixel is taken as the A-th target pixel in the target pixel row, and the A-th target pixel is any target pixel included in the target pixel row, and the lime is the target The time interval between the time when the pixel row starts to be exposed and the exposure time of the A target pixel. If the A target pixel is not the last pixel in the target pixel row, then limx is A*s, if A target pixel is the last pixel in the target pixel row, and limx is the exposure end time ex-time of the target pixel row.
  • the electronic device may perform an integral operation to acquire the first coordinate data.
  • Step B0113 acquiring second jitter data that is located in the target pixel row and that is translated along the Y axis at the target sampling time point;
  • the second point spread function data PSF2 (a/b)d1.
  • a is the distance between the lens and the sensor of the electronic device
  • b is the distance between the object and the lens, that is, b is the object distance
  • d1 is the lens shift amount
  • the lens shift amount d1 is the lens shift The distance between the rear position and the position before the movement in the Y-axis direction.
  • Step B0114 performing an integration operation on the second jitter data to obtain second coordinate data
  • Step B0115 target coordinates of any target pixel in the target pixel row include a target abscissa and a target ordinate, determining that the target abscissa is the first coordinate data, and the target ordinate is the second coordinate data.
  • the electronic device may perform an integration operation to acquire second coordinate data.
  • the electronic device does not need to perform contrast calculation on all acquired frame images in the frame image sequence, and only needs to be in the sequence of frame images in the order of exposure end time.
  • the frame image sequentially performs the calculation of the jitter amount. If the jitter amount of the current frame image is calculated to be less than or equal to the preset value, the current frame image is directly output without calculating the frame image sorted after the current frame image, thereby The time taken for calculating the frame image is saved, and the efficiency of outputting the image is improved while ensuring the sharpness of the output image of the electronic device.
  • a second aspect of the embodiments of the present invention provides an electronic device, including:
  • a first acquiring unit configured to acquire sampling data corresponding to a target sampling time point, where the target sampling time point is any sampling time point located in at least one sampling time point of an exposure time of the first target frame image,
  • the sampled 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 used to perform the step A shown in the first aspect of the embodiment of the present invention.
  • the first obtaining unit shown in this embodiment is used to perform the step A shown in the first aspect of the embodiment of the present invention.
  • a first determining unit configured to determine whether the first target jitter amount is less than or equal to a preset value, where the first target jitter amount is a first target frame image determined according to the target sampling time point and the sampling data Amount of jitter;
  • the first determining unit shown in this embodiment is used to perform the step B shown in the first aspect of the embodiment of the present invention.
  • a first output unit configured to output the first target frame image if the first target jitter amount is less than or equal to the preset value.
  • the first output unit shown in this embodiment is used to perform the step C shown in the first aspect of the embodiment of the present invention.
  • the first output unit shown in this embodiment is used to perform the step C shown in the first aspect of the embodiment of the present invention.
  • the electronic device first calculates a first target jitter amount of the first target frame image in the acquired image frame sequence, where the first target jitter amount is smaller than a preset pre-set In the case of setting a value, the first target frame image is directly output, and the electronic device calculates the amount of jitter of the frame image behind the first target frame image in the image frame sequence, thereby saving The time taken to calculate the amount of jitter of the frame image after the first target frame image is sorted, the efficiency of image output is improved, and the delay of image output is reduced.
  • the electronic device further includes:
  • a first determining unit configured to determine a second target frame image if the first target shake amount is greater than the preset value, and an exposure end time of the second target frame image is later than the first target frame image Exposure end time, and there are N target frame images between the first target frame image and the second target frame image, the N being a natural number greater than or equal to 0;
  • the first determining unit shown in this embodiment is used to perform the step D1 shown in the first aspect of the embodiment of the present invention.
  • the first determining unit shown in this embodiment is used to perform the step D1 shown in the first aspect of the embodiment of the present invention.
  • a second determining unit configured to determine whether the second target jitter amount is less than or equal to the preset value, where the second target jitter amount is a jitter amount of the second target frame image
  • the second determining unit shown in this embodiment is used to perform the step D2 shown in the first aspect of the embodiment of the present invention.
  • a second output unit configured to output the second target image frame if the second target jitter amount is less than or equal to the preset value.
  • the second output unit shown in this embodiment is used to perform the step D3 shown in the first aspect of the embodiment of the present invention.
  • the second output unit shown in this embodiment is used to perform the step D3 shown in the first aspect of the embodiment of the present invention.
  • the electronic device of the embodiment in the acquired image frame sequence, first, the first target jitter amount of the first target frame image is calculated, and the first target jitter amount is greater than or equal to a preset preset value. In the case, the current resolution of the image of the first target frame does not meet the requirement. If the image of the first target frame is output, the resolution of the frame image displayed by the electronic device cannot meet the user's needs.
  • the electronic device determines, in the sequence of frame images, a second target frame image whose exposure time is later than the first target frame image, where the jitter amount of the second target frame image is less than or equal to the preset value
  • the second target frame image whose resolution meets the user's requirement is directly output, and the method shown in this embodiment avoids the calculation of the jitter amount of the frame image located behind the second target frame image, thereby saving
  • the time taken to calculate the amount of jitter of the frame image after sorting the image of the second target frame improves the efficiency of image output and reduces the delay of image output.
  • the second output unit is further configured to: if the second target jitter amount is greater than the preset value, output a third target frame image, where the third target frame image is any frame image in the frame image sequence
  • the frame image sequence includes the first target frame image and the second target frame image, and the third target frame image has a jitter amount that is possessed by all frame images in the frame image sequence. The minimum amount of jitter.
  • the second output unit shown in this embodiment is used to perform the step D4 shown in the first aspect of the embodiment of the present invention.
  • the second output unit shown in this embodiment is used to perform the step D4 shown in the first aspect of the embodiment of the present invention.
  • the frame image sequence selects the third target frame image with the highest definition, thereby outputting the third target frame image, and the method described in this embodiment can ensure the clarity of the output image of the electronic device, thereby enabling the user to obtain The highest resolution image.
  • the first acquiring unit is further configured to acquire target sampling data of a target pixel, where the target pixel is any pixel located in a target pixel row, and an exposure time of the target pixel is the target sampling time point, The target pixel acts on any pixel row included in the first target frame image, the mesh
  • the target sample data is jitter data of the target pixel at the target sampling time point.
  • the first obtaining unit shown in this embodiment is used to perform the step A11 shown in the first aspect of the embodiment of the present invention.
  • the target pixel that satisfies the condition is determined, according to the determined target.
  • the pixel can determine the amount of jitter of the target frame image, so that it is not necessary to process all the pixels included in the target frame image, thereby effectively improving the efficiency of calculating the jitter amount of the frame image.
  • the electronic device further includes:
  • a second acquiring unit configured to acquire a time when any row of pixels included in the first target frame image starts to be exposed
  • the second obtaining unit shown in this embodiment is used to perform the step A01 shown in the first aspect of the embodiment of the present invention.
  • a second determining unit configured to determine the target pixel row, wherein a time when the target pixel row starts to be exposed is the target sampling time point.
  • the second determining unit shown in this embodiment is used to perform the step A02 shown in the first 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 the target pixel row according to the target sampling time point and the target sampling data
  • the first calculation unit shown in this embodiment is used to perform the step B01 shown in the first aspect of the embodiment of the present invention.
  • the first calculation unit shown in this embodiment is used to perform the step B01 shown in the first aspect of the embodiment of the present invention.
  • a third determining unit configured to determine a number of the target pixel rows
  • the third determining unit shown in this embodiment is used to perform the step B02 shown in the first aspect of the embodiment of the present invention.
  • a second calculating unit configured to: if the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount; if the target pixel row number is a natural number greater than 1, All of the sub-target shake amounts are calculated by an averaging algorithm to obtain the first target shake amount.
  • the second calculation unit shown in this embodiment is used to perform the step B03 and the step B04 shown in the first aspect of the embodiment of the present invention.
  • the second calculation unit shown in this embodiment is used to perform the step B03 and the step B04 shown in the first aspect of the embodiment of the present invention.
  • the sub-target shake amount of the target pixel row included in the target frame image may be first determined, and after determining the sub-target shake amount, The amount of jitter of the target frame image can be determined. It can be seen that, by using the method shown in this embodiment, the calculation of the jitter amount of the target frame image is divided into various cases based on the same jitter affecting different pixel rows. The target pixel row improves the accuracy of the jitter calculation for the target frame image.
  • the second computing unit includes:
  • a calculation module configured to calculate target coordinates of any target pixel located in the target pixel row according to the target sampling time point and the target sampling data
  • the calculation module shown in this embodiment is used to perform the step B011 shown in the first aspect of the embodiment of the present invention.
  • the calculation module shown in this embodiment is used to perform the step B011 shown in the first aspect of the embodiment of the present invention.
  • a first determining module configured to: if the number of the target pixels located in the target pixel row is one, the sub-target jitter amount is a distance between the target coordinate and the origin coordinate;
  • the first determining module shown in this embodiment is used to perform the step B012 shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
  • a second determining module configured to set a target set if the number of the target pixels located in the target pixel row is at least two, the target set includes a plurality of target distances, and the target distance is all the targets a distance between any two of the target coordinates in the coordinate, and the target distance is also a distance between any of the target coordinates and the origin coordinate;
  • the second determining module shown in this embodiment is used to perform the step B013 shown in the first aspect of the embodiment of the present invention.
  • a third determining module configured to acquire the sub-target jitter amount, where the sub-target jitter amount is located at the location The maximum of all of the target distances within the set of targets.
  • the third determining module shown in this embodiment is used to perform the step B014 shown in the first aspect of the embodiment of the present invention.
  • the computing module includes:
  • a first acquiring sub-module configured to acquire first jitter data that is located on the X-axis of any target pixel in the target pixel row at the target sampling time point;
  • the first obtaining sub-module shown in this embodiment is used to perform the step B0111 shown in the first aspect of the embodiment of the present invention.
  • the first obtaining sub-module shown in this embodiment is used to perform the step B0111 shown in the first aspect of the embodiment of the present invention.
  • a first calculation submodule configured to perform an integration operation on the first jitter data to obtain first coordinate data
  • the first calculation sub-module shown in this embodiment is used to perform the step B0112 shown in the first aspect of the embodiment of the present invention.
  • the first calculation sub-module shown in this embodiment is used to perform the step B0112 shown in the first aspect of the embodiment of the present invention.
  • a second acquiring sub-module configured to acquire second jitter data that is located on the Y-axis of any target pixel in the target pixel row at the target sampling time point;
  • the second obtaining sub-module shown in this embodiment is used to perform the step B0113 shown in the first aspect of the embodiment of the present invention.
  • a second calculation submodule configured to perform an integration operation on the second jitter data to obtain second coordinate data
  • the second calculation sub-module shown in this embodiment is used to perform the step B0114 shown in the first aspect of the embodiment of the present invention.
  • the second calculation sub-module shown in this embodiment is used to perform the step B0114 shown in the first aspect of the embodiment of the present invention.
  • target coordinates for any target pixel located in the target pixel row include a target abscissa and a target ordinate, determining that the target abscissa is the first coordinate data, and the target ordinate is the Second coordinate data.
  • the determining sub-module shown in this embodiment is used to perform the step B0115 shown in the first aspect of the embodiment of the present invention.
  • a third aspect of the embodiments of the present invention provides an electronic device, including:
  • the one or more programs are stored in the image memory, the one or more programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform 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 including instructions that, when executed by an electronic device, cause the electronic device to perform, for example The method according to any one of the first aspect of the embodiments of the present invention to the seventh implementation manner of the first aspect of the present invention.
  • the embodiment provides an image output method and an electronic device.
  • the method shown in this embodiment does not need to calculate the contrast of all the acquired frame images, and only needs to perform the jitter amount of the current first target frame image. Calculating, if the jitter amount of the current first target frame image is calculated to be less than or equal to the preset value, directly outputting the current first target frame image without sorting the exposure end time in the current first. The amount of jitter of the frame image behind the target frame image is calculated, thereby saving the time taken for calculating the frame image, and improving the efficiency of the output image while ensuring the sharpness of the output image of the electronic device.
  • FIG. 1 is a schematic structural view of an embodiment of an electronic device according to the present invention.
  • FIG. 2 is a schematic diagram of an embodiment of an original image taken by an electronic device according to the present invention.
  • FIG. 3 is a schematic diagram showing 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 schematic diagram showing the relationship between the angular velocity of the electronic device and the exposure time in another test 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 showing the steps of an embodiment of an image output method according to the present invention.
  • FIG. 8 is a timing diagram of an embodiment of an image output provided by the present invention.
  • FIG. 9 is a schematic diagram of an embodiment of a frame image and an exposure function provided by the present invention.
  • FIG. 10 is a schematic structural view of an embodiment before and after shaking provided by the present invention.
  • FIG. 11 is a schematic structural view of another embodiment before and after shaking provided by the present invention.
  • FIG. 12 is a schematic diagram of an embodiment of an effect of lens shift jitter and rotational jitter on an image quality of an electronic device according to the present invention
  • FIG. 13 is a timing diagram of another embodiment of image output provided by the present invention.
  • FIG. 14 is a schematic diagram of an 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 according to the present invention.
  • 16 is a schematic diagram showing the steps of another embodiment of an image output method according to the present invention.
  • FIG. 17 is a timing diagram of another embodiment of image output provided by the present invention.
  • Embodiments of the present invention provide an image output method capable of ensuring that an electronic device can output a clear image while improving the efficiency of outputting an image of the electronic device.
  • the electronic device is not limited, as long as the electronic device can perform image capturing and image processing, for example, the electronic device can be a smart phone, a computer, a tablet computer, a digital camera, etc. This embodiment is not limited.
  • FIG. 1 is a schematic structural view of an embodiment of an electronic device provided by the present invention.
  • the imaging optical system 101 forms an object image (not shown) on the image sensor 102.
  • the imaging optical system 101 generally includes a plurality of lenses such as a zoom lens and a focus lens, and an aperture or the like to enable control of zooming, focusing, and 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 configured in two dimensions, and the sequential output from the upper portion to the lower portion of the image sensor 102 is accumulated at different timings for each line during each frame. The charge.
  • the driving method is called a rolling shutter (English full name: rolling shutter, English abbreviation: RS).
  • the image sensor 102 converts an object image formed using 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.
  • CMOS image sensors used as image sensors used in electronic devices have become rapidly popular.
  • a readout method of sequentially reading accumulated charges from the upper portion to the lower portion of the CMOS image sensor in a row is widely used.
  • This readout method is called a rolling shutter method, and has a feature that the readout timing between the upper and lower portions of the image sensor is different. Due to this feature, in the case of shaking the electronic device and moving the position of the subject on the imaging surface, distortion (rolling shutter distortion) caused by the difference in charge readout timing of the image sensor is generated in the captured image.
  • the image output method shown in this embodiment can utilize image processing to correct such rolling shutter distortion. Please refer to the following examples for details.
  • the signal processing unit 103 generates a video signal conforming to, for example, the NTSC format based on the image signal obtained by the image sensor 102, and supplies the generated video signal to the image image memory 104.
  • the angular velocity sensor 111 detects the jitter of the electronic device 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 as the angular jitter data to the microcomputer 110.
  • the microcomputer 110 calculates the digitized signal and transmits the calculated correlation data to the metadata generating unit 116.
  • the metadata generating unit 116 generates metadata based on 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.
  • the display device 106 includes, for example, a liquid crystal display element (LCD) or the like, and displays an image output from the microcomputer 110.
  • LCD liquid crystal display element
  • 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 width of the PSF of the image, Then the more clear the image.
  • the electronic device shown in this embodiment can capture the original image to generate a captured image.
  • the embodiment places the electronic device on a test bench.
  • the test bench shown in this embodiment refers to a device capable of simulating a jitter process.
  • test environment of this embodiment is a scene in which the focus is normal and the exposure is normal.
  • the first test is performed on the electronic device.
  • the first test is combined with FIG. 3 and FIG. 4.
  • the abscissa is the exposure time in milliseconds
  • the ordinate is the electronic device.
  • the angular velocity obtained by the angular velocity sensor.
  • the exposure start time of the current frame image is start, and the exposure end time is end, and the exposure time of the frame image shown in FIG. 3 is end-start.
  • the exposure start time of the current frame image is start, and the exposure end time is end, and the exposure time of the frame image shown in FIG. 4 is end-start.
  • the frame exposure time of FIG. 3 is longer than the frame exposure time shown in FIG. 4.
  • the image output by using the exposure time shown in FIG. 3 is shown in FIG. 5, and the exposure time shown in FIG.
  • the output image is shown in FIG. 6.
  • the sharpness of the image shown in FIG. 6 is higher than the sharpness of the image shown in FIG. 5, that is, the PSF shown in FIG.
  • the width is smaller than the width of the PSF shown in FIG.
  • the electronic device can be placed in the same exposure time, but the jitter is different.
  • the specific test process is not described in this embodiment.
  • the sharpness of the image depends on the severity of the jitter of the electronic device and the length of the exposure time during the exposure process.
  • the different motion forms of electronic devices have no obvious impact on image quality.
  • the image output method shown in this embodiment is based on the exposure time and jitter of the frame image.
  • the detailed process of the image output method provided by the embodiment is described in detail below with reference to FIG. 7 , wherein FIG. 7 is an embodiment of the image output method provided by the present invention. flow chart.
  • Step 701 Determine a target sampling time point.
  • the electronic device shown in this embodiment may be preset with a sampling time point.
  • sampling time point shown in this embodiment may be periodically set, and the length of the sampling period in this embodiment is not limited.
  • the sampling period shown in this embodiment is between any two adjacent sampling time points. Interval.
  • the sampling period is 10 milliseconds, and one sampling time point is set every 10 milliseconds as shown in this embodiment.
  • the electronic device can acquire a time-ordered frame image sequence reported by the sensor, and the frame image sequence includes a plurality of frame images sorted in order of exposure end time.
  • the electronic device shown in this embodiment first determines whether the current first target frame image satisfies an output condition.
  • the first target frame image may be a frame image that is ranked in the first place in the frame image sequence by time.
  • the frame image shown in this embodiment may also be a frame image that is randomly selected by the electronic device in the frame image sequence, and the embodiment is that the first target frame image is located in the frame.
  • the specific position in the sequence of images is not limited as long as the first target frame image can be any frame image in the sequence of frame images.
  • the first target frame image may be an example of arranging the frame images ranked first in the frame image sequence as an example.
  • the electronic device shown in this embodiment acquires the data reported by the sensor at the sampling time point.
  • the sensor reporting data will be described below.
  • FIG. 8 is taken as an example, wherein FIG. 8 is an embodiment of image output provided by the present invention. Schematic diagram.
  • the electronic device can acquire an exposure time, a frame rate FR, a maximum frame rate, and the like of each frame image included in the frame image sequence.
  • the frame rate FR shown in this embodiment is the number of frames displayed per second, that is, the frame rate shown in this embodiment is used to indicate the number of times the frame synchronization signal EOF appears every second.
  • the electronic device can determine an image frame that appears every second and a time point at which the exposure of each image frame ends.
  • FIG. 8 exemplifies an example in which the exposed frame image is the first target frame image and the second target frame image.
  • the number of the frame images that are specifically exposed is not limited in this embodiment, and the description of the exposure time of the frame image and the time of the frame synchronization signal EOF in this embodiment is an optional example, which is not limited.
  • the abscissa shown in FIG. 8 is time, the unit is millisecond, and the ordinate is the line number of the pixel array of the first target frame image formed on the sensor film.
  • the size of the negative film formed on the sensor shown in this embodiment is 12M, including 4000*3000 pixels, the ordinate has 4000 lines and each line has 3000 pixels.
  • the method application shown in this embodiment can be applied to a rolling shutter mechanism of a rolling shutter.
  • the function 71 is a frame exposure of each pixel row of the first target frame image.
  • the start time, the function 72 is the frame exposure end time of each pixel row of the first target frame image, and the second target frame image formed by the sensor is taken as an example, and the function 73 is the second target frame image.
  • the frame exposure start time of each pixel row, function 74 is the frame exposure end time of each pixel row of the second target frame image.
  • 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.
  • the functions formed by the first target frame image and the second target frame image in the present embodiment in the coordinate system shown in FIG. 8 have a parallelogram structure.
  • the sensor shown in this embodiment sends a first frame synchronization signal EOF when the first target frame image ends the last pixel exposure in the last pixel row, and the first EOF is used to indicate the frame exposure of the first target frame image. End Time.
  • the sensor shown in this embodiment sends a second frame synchronization signal EOF when the second target frame image ends the last pixel exposure in the last pixel row, and the second EOF is used to indicate the frame exposure of the second target frame image. End Time.
  • the target sampling time point is determined during an exposure time of the first target frame image, and the target sampling time point is any one of at least one sampling time point located in an exposure time of the first target frame image. Sampling time point.
  • the exposure time of the first target frame image is T1
  • the target sampling time point is located in the time period of T1.
  • the sampling time points t1, t2, t3, t4, and t5 shown in this embodiment are located within the exposure time T1 of the first target frame image.
  • sampling time points t1, t2, t3, t4, and t5 shown in this embodiment are the target sampling time points.
  • the sampling interval shown in this embodiment is exemplified by 10 milliseconds, that is, the time interval between t1 and t2 is 10 milliseconds, and so on, and the time interval between t4 and t5 is 10 milliseconds.
  • Step 702 Determine a target pixel row.
  • the electronic device shown in this embodiment acquires sampling data at the target sampling time point.
  • the electronic device collects sampling data once every other sampling period.
  • the sampling data shown in this embodiment is data reported by the sensor at the sampling time point.
  • sampling time point and the sampling interval set in the process of outputting an image are not limited in this embodiment, and this embodiment is merely an explanation of an optional example.
  • the electronic device shown in this embodiment acquires the data reported by the sensor at the target sampling time points t1, t2, t3, t4, and t5, respectively.
  • FIG. 9 is a schematic diagram of an embodiment of a frame image and an exposure function provided by the present invention.
  • the description of the frame image 801 in the form of a parallelogram is shown in the above embodiment, and is not described in detail in this embodiment.
  • the jitter stable 802 is a quadrilateral structure in the case where the jitter is stable, as shown in FIG.
  • jitter function 802 For jitter function 802 to exhibit jitter only during time period 803, the jitter only affects pixels in frame image 801 that are exposed during time period 803.
  • the dithering function 802 shown in this embodiment has different effects on different pixel rows in the frame image. Specifically, taking two pixel behavior examples in the frame image, that is, the pixel rows line1 and line2 as an example, it is necessary to be clear that This embodiment does not limit the specific line numbers of line1 and line2 in the frame image.
  • the influence of the dithering function 802 on the line1 is the first overlapping area of the dithering function 802 and the line1
  • the influence of the dithering function 802 on the line2 is the second overlapping area of the dithering function 802 and the line2
  • the first overlapping area is different from the second overlapping area
  • the same dithering function 802 has different effects on different pixel rows of the same frame image.
  • the same jitter can have different effects on different pixel rows in the frame image.
  • the jitter can have different effects on different pixel rows in the frame image.
  • the amount of jitter is only valid for a single row of pixels in the frame image. In order to accurately determine the influence of the jitter on the entire frame image, it is necessary to determine the influence of the jitter on the single pixel row of the frame image.
  • the following describes how to obtain the sub-target jitter amount of the target pixel row, where the sub-target jitter amount is the influence of the jitter on the target pixel row, and the target pixel shown in this embodiment acts as the first target frame image. Any row of pixels included.
  • determining a time at which any row of pixels included in the first target frame image starts to be exposed determining the target pixel row, wherein the target pixel row The time at which the exposure starts is coincident with the target sampling time point.
  • the present embodiment is described by taking the target pixel behaviors line1 and line2 as an example, and the start exposure time of line1 coincides with the sampling time point t1, and the start exposure time of line2 coincides with the sampling time point t2. .
  • the description of the target pixel row in this embodiment is an optional example, which is not limited as long as the target pixel acts on the pixel row included in the first frame image.
  • the target pixel row threshold may be preset in this embodiment. And, when determining the target pixel row, the target pixel row whose number is the target pixel row threshold may be acquired.
  • different target pixel row thresholds may be set according to different requirements on the accuracy of the output image.
  • Step 703 Determine a target pixel in the target pixel row.
  • the target pixel shown in this embodiment is a pixel whose exposure time is the target sampling time point.
  • the target pixels in 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.
  • the number of target pixels included in the target pixel row is not limited. In this embodiment, three are taken as an example.
  • the target number of target pixels can be selected for the calculation of the sub-target jitter amount when the sub-target jitter amount is specifically calculated.
  • the specific value of the selected target number is not limited in this embodiment.
  • Step 704 Determine target coordinates of the target pixel.
  • the electronic device in this embodiment acquires target sampling data by using a target sampling time point corresponding to the target pixel, and acquires target coordinates of the target pixel according to the target sampling data.
  • the target pixel P1 shown in FIG. 8 is taken as an example, and the electronic device acquires the sampled data reported by the sensor at the target sampling time point t1.
  • the sampled data shown in this embodiment is the jitter data of the target pixel.
  • 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 in the up-and-down direction, and the Y-axis and The X axis is vertical, and the Y axis is a direction in which the electronic device translates in the inner and outer directions, 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 in the left and right directions.
  • the jitter of the target pixel shown in this embodiment includes first point spread function data of the target pixel moving along the X axis at the target sampling time point, second point spread function data translated along the Y axis, and third translation along the Z axis.
  • Point spread function data, fourth point spread function data rotated around the X axis, rotated about the Y axis
  • the fifth point spread function data and the sixth point spread function data rotated about the Z axis.
  • 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.
  • first point spread function data and the second point spread function data are used to determine the target coordinates as an example, which is not limited. In other embodiments, other points may also be adopted. The process of determining the target coordinates of the diffusion function data is not described in detail in this embodiment.
  • FIG. 10 is a schematic view, which is not limited.
  • a is the distance between the lens 903 and the sensor 904 of the electronic device
  • b is the distance between the object 905 and the lens 903, that is, b is the object distance
  • d1 is the lens shift amount
  • the lens shift amount D1 is the distance in the X-axis direction between the position 902 after the lens is moved and the position 901 before the movement.
  • f is the focal length of the lens of the electronic device.
  • the process of acquiring the second point spread function data PSF2 please refer to the process of acquiring the first point spread function data, which is not described in detail in this embodiment.
  • the lens shift amount d1 is a distance in the Y-axis direction between the position after the lens shift and the position before the movement.
  • the acquisition process of the point spread function data PSF is described below in conjunction with the lens rotation jitter of the electronic device shown in the embodiment of the present invention.
  • is the amount of rotation of the lens. Specifically, ⁇ is the difference between the angle at the start of exposure and the angle at the end of exposure.
  • 1 degrees
  • the abscissa shown in Fig. 12 is the object distance, that is, the distance b between the object and the lens, in millimeters, and the ordinate is the width of the PSF.
  • the curve 1101 is used to indicate the PSF when the lens of the electronic device is shifted
  • the line 1102 is used to indicate the PSF when the electronic device is rotated.
  • the PSF and the object distance are inversely proportional, and in the case of the rotation jitter of the electronic device, the PSF is independent of the object distance.
  • the senor is capable of acquiring first jitter data of the target pixel that is translated along the X axis at the target sampling time point.
  • the target pixel is taken as the A-th target pixel in the target pixel row, and the A-th target pixel is any target pixel included in the target pixel row, and the lime is the target The time interval between the time when the pixel row starts to be exposed and the exposure time of the A target pixel. If the A target pixel is not the last pixel in the target pixel row, then limx is A*s, if A target pixel is the last pixel in the target pixel row, and limx is the exposure end time ex-time of the target pixel row.
  • the sensor shown in this embodiment obtains the corresponding jitter data between the time of the limt and the limx.
  • the specific acquisition process of the jitter data is shown in the foregoing embodiment, and details are not described herein.
  • the sensor may acquire the first jitter data x(t) at the target sampling points t1, t2, and t3, respectively.
  • the first jitter data x(t) PSF1, 0 ⁇ t ⁇ S acquired by the sensor.
  • the first jitter data x(t) PSF1, 2S ⁇ t ⁇ ex-time acquired by the sensor.
  • the sensor may acquire the second jitter data y(t) at the target sampling points t1, t2, and t3, respectively.
  • the second jitter data y(t) PSF2, 0 ⁇ t ⁇ S acquired by the sensor.
  • the second jitter data y(t) PSF2, S ⁇ t ⁇ 2S acquired by the sensor.
  • the second jitter data y(t) PSF2, 2S ⁇ t ⁇ ex-time acquired by the sensor.
  • the electronic device may perform an integration operation to acquire the first coordinate data.
  • the first coordinate data x(t) t*Data1x, 0 ⁇ t ⁇ S acquired by the sensor.
  • the first coordinate data x(t) S*Data1x+t*Data2x acquired by the sensor, S ⁇ t ⁇ 2S;
  • the first coordinate data acquired by the sensor x(t) S*Data1x+S*Data2x+t*Data3x, 2S ⁇ t ⁇ ex-time;
  • Data1x For details of Data1x, Data2x, and Data3x, please refer to the above, and details are not described here.
  • the electronic device may perform an integration operation to acquire the second coordinate data.
  • the second coordinate data y(t) t*Data1y, 0 ⁇ t ⁇ S acquired by the sensor.
  • the second coordinate data y(t) S*Data1y+t*Data2y acquired by the sensor, S ⁇ t ⁇ 2S;
  • the second coordinate data acquired by the sensor y(t) S*Data1y+S*Data2y+t*Data3y, 2S ⁇ t ⁇ ex-time;
  • the exposure time of the target pixel row is smaller than the sampling interval preset by the electronic device. If the sampling interval is 10 milliseconds as an example, in this case, The exposure time of the target pixel row is less than 10 mm such that there is only one target pixel in the target pixel row.
  • the exposure time of the target pixel row line1 is smaller than the sampling interval, and the sampling interval is the time difference between t2 and t1.
  • limt is the time interval between the time when the target pixel row starts to be exposed and the exposure time of the target pixel
  • ex-time is the exposure end time of the target pixel row.
  • the sensor shown in this embodiment obtains the corresponding jitter data between the time of the exposure and the ex-time.
  • the specific acquisition process of the jitter data is shown in the foregoing embodiment, and details are not described herein.
  • the sensor can acquire the first jitter data x(t) at the target sampling point t1.
  • the first jitter data x(t) PSF1, 0 ⁇ t ⁇ ex-time acquired by the sensor.
  • the sensor may also acquire second jitter data y(t) at the target sampling point t1.
  • the second jitter data y(t) PSF2, 0 ⁇ t ⁇ ex-time acquired by the sensor.
  • the electronic device may perform an integration operation to acquire the first coordinate data.
  • the first coordinate data x(t) t*Data1x, 0 ⁇ t ⁇ ex-time obtained by the sensor.
  • the second coordinate data y(t) t*Data1y, 0 ⁇ t ⁇ ex-time acquired by the sensor.
  • Step 705 Determine a sub-target jitter amount.
  • the electronic device shown in this embodiment first needs to determine the number of the target pixels in the target pixel row.
  • the target set includes a plurality of target distances, where the target distance is any two of all the target coordinates
  • the distance between the target coordinates, and the target distance is also the distance between any of the target coordinates and the origin coordinates.
  • a two-dimensional coordinate system can be created, and the target coordinates of the respective target pixels located in the same row of target pixel rows are expressed in the two-dimensional coordinate system.
  • the number of the target pixels is three, and the target coordinates of P1 , the target coordinates of P 2 , and the target coordinates of P 3 may be as shown in FIG. 14 . Expressed in the coordinate system.
  • the target distance is a distance between P1 and P2, a distance between P2 and P3, a distance between P1 and P3, and an origin coordinate (0, 0) in a two-dimensional coordinate system as shown in FIG.
  • the electronic device sets the acquired target distance in the target set.
  • the sub-target shake amount is the maximum of all of the target distances located within the target set.
  • the sub-target shake amount of the target pixel line line1 is the distance between the origin coordinates and P3.
  • the sub-target shake amount is a distance between the target coordinate and the origin coordinate
  • the sub-target shake amount of the target pixel row is the distance between the target coordinates of P4 and the origin coordinates.
  • Step 706 Calculate a first target jitter amount of the first target frame image.
  • the number of the target pixel rows located in the first target frame image determined by the embodiment is a natural number greater than 1, all the sub-target jitter amounts are calculated by an averaging algorithm to obtain The first target jitter amount is described.
  • the averaging algorithm is not limited, as long as the sub-target jitter amount can be calculated to obtain an average value.
  • the averaging algorithm may be a moving average algorithm MA, an exponential smoothing average EMA, and a parameter average. SMA and weighted average DMA, etc.
  • the first target jitter amount is equal to the sub-target jitter amount.
  • Step 707 Determine whether the first target jitter amount is less than or equal to a preset value. If yes, execute step 708. If no, perform step 709.
  • the electronic device may be preset with the preset value in the process of performing the method shown in this embodiment, and the size of the preset value is not limited in this embodiment, as long as the 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 satisfy a certain definition, thereby enabling the user to obtain clear Image.
  • the preset value when the preset value is set, the following manner may be adopted. It should be clarified that the description of the setting manner of the preset value in this embodiment is an optional example. It is not limited. In a specific application, the preset value may be set in other manners as long as the image is clear when the first target jitter amount is less than or equal to the preset value.
  • the electronic device is in different application scenarios, and different standards are applied.
  • the description of the standard in this embodiment is an optional example. In a specific application, a standard that can be applied to more application scenarios may also be created.
  • the first fuzzy parameter is: the length of consecutive 10 pixels is 14um.
  • a length of 10 consecutive pixels in the image needs to be less than or equal to 14 um, and a clear image is output.
  • the preset value shown in this embodiment is a parameter that is proportional to the fuzzy parameter
  • the preset value may be set by referring to the fuzzy parameter, so that the jitter amount of the image is less than or equal to the preset.
  • the electronic device can output an image whose resolution meets the requirements.
  • Step 708 Output the first target frame image.
  • the first target is when the electronic device outputs the first target frame image.
  • the frame image is an image whose resolution satisfies the condition, that is, the user can acquire the first target frame image that is clear.
  • Step 709 Determine a second target frame image.
  • the method shown in this embodiment may sequentially determine the second target frame image, that is, after performing step 708, and when step 709 is performed for the first time, the second target frame image is below the first target frame image.
  • a target frame image may be sequentially determined.
  • Step 710 Determine whether the second target jitter amount is less than or equal to the preset value. If yes, execute step 711. If no, return to step 709 or step 712.
  • the second target jitter amount is a jitter amount of the second target frame image.
  • the specific process of obtaining the second target jitter amount is described in detail in the specific process of obtaining the first target jitter amount, which is not specifically described in this embodiment.
  • step 710 if the second jitter amount of the second target frame image is greater than the preset value, indicating that the second target frame image clarity is relatively low, returning to step 709 to re-determine the second target frame image,
  • step 710 is performed in the second loop, the second target frame image and the first target frame image are separated by one frame image. After the second frame image is re-determined, step 710 is continued.
  • the exposure end time of the second target frame image shown in the embodiment is later than the exposure end time of the first target frame image, and the interval between the first target frame image and the second target frame image is N target frame image, the N being a natural number greater than or equal to 0;
  • the second target frame image is the next target frame image of the first target frame image. If N is equal to 1, the second target frame image is the first target frame. The next two target frame images of the image, and so on.
  • the second target jitter amount is greater than the preset value, it is determined whether the current second target frame image is the last frame image sorted by the exposure end time in the frame image sequence, if If not, it is explained that there is a frame image in the sequence of frame images in which the amount of jitter has not yet been calculated.
  • step 712 If yes, it is determined that all frame images in the frame image sequence have been calculated, and the jitter amount of all frame images in the frame image sequence is greater than the preset value, and then step 712 is continued.
  • Step 711 Output the second target frame image.
  • step 711 For the description of step 711 shown in this embodiment, please refer to step 708, and details are not described herein.
  • Step 712 Output a third target frame image.
  • the third target frame image is any frame image in a sequence of frame images, and the frame image sequence includes the first target frame image and the determined at least one second target frame image, and
  • the amount of jitter that the third target frame image has is the minimum value of the amount of jitter that all of the frame images in the sequence of frame images have.
  • a total of five frame images in the frame image sequence are determined, and the jitter amounts of the respective frame images are Q1, Q2, Q3, Q4, and Q5, respectively, and the third target frame image is It is a frame image having a minimum value among Q1, Q2, Q3, Q4, and Q5.
  • the electronic device does not need to calculate the contrast of all acquired frame images in the frame image sequence, and only needs to calculate the jitter amount of the frame images located in the frame image sequence in the order of the exposure end time, if the current calculation is calculated If the amount of jitter of the frame image is less than or equal to the preset value, the current frame image is directly output without calculating the frame image after the current frame image by sorting the exposure end time, thereby saving the calculation of the frame image.
  • the duration of the image is improved in the case of ensuring the sharpness of the output image of the electronic device.
  • the method shown above is based on the rolling shutter shutter to implement the image output method provided by the embodiment.
  • the following describes how the global shutter global shutter realizes the method shown in the embodiment of the present invention:
  • the image output method includes:
  • Step 1601 Determine a target sampling time point.
  • step 701 shown in FIG. 7 For details of the target sampling time point shown in this embodiment, refer to step 701 shown in FIG. 7 in this embodiment, and details are not described herein.
  • the electronic device can determine the image frame appearing every second and the time point at which the exposure of each image frame ends by the data reported by the sensor.
  • FIG. 17 exemplifies an example in which the exposed frame image is the first target frame image and the second target frame image.
  • the electronic device can acquire an exposure time, a frame rate FR, a maximum frame rate, and the like of each frame image included in the frame image sequence.
  • FIG. 8 exemplifies an example in which the exposed frame image is the first target frame image and the second target frame image.
  • the abscissa shown in FIG. 8 is time, the unit is millisecond, and the ordinate is the line number of the pixel array of the first target frame image formed on the sensor film.
  • the method application shown in this embodiment can be applied to a global shutter global shutter mechanism, taking the first target frame image formed by the sensor as an example, and the initial exposure time of each pixel row of the first target frame image. The same 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, the timing chart of the row exposure of the first target frame and the second target frame is rectangular. structure.
  • the exposure time of the first target frame image is T1
  • the target sampling time point is located in the time period of T1.
  • the sampling time points t1 and t2 shown in this embodiment are located within the exposure time T1 of the first target frame image.
  • sampling time points t1 and t2 shown in this embodiment are the target sampling time points.
  • Step 1602 determining a target pixel row.
  • the target pixel row shown in this embodiment may be the first target frame image. Any line included.
  • Step 1603 determining a target pixel in the target pixel row.
  • the target pixel shown in this embodiment is a pixel whose exposure time is the target sampling time point.
  • step 703 For details, please refer to step 703 for details.
  • Step 1604 determining target coordinates of the target pixel.
  • the acquisition process of the PSF1 is shown in the embodiment 704 shown in FIG. 7 , and details are not described herein.
  • the target pixel is taken as the A-th target pixel in the target pixel row, and the A-th target pixel is any target pixel included in the target pixel row, and the lime is the The time interval between the time when the target pixel row starts to be exposed and the exposure time of the A target pixel, and if the A target pixel is not the last pixel in the target pixel row, then limx is A*s, if The A target pixel is the last pixel in the target pixel row, and limx is the exposure end time ex-time of the target pixel row.
  • the sensor shown in this embodiment acquires corresponding jitter between the moments of lime and limx.
  • the specific acquisition process of data and jitter data please refer to the above embodiment for details.
  • the sensor can acquire the first jitter data x(t) at the target sampling points t1 and t2, respectively.
  • the first jitter data x(t) PSF1, 0 ⁇ t ⁇ S acquired by the sensor.
  • the first jitter data acquired by the sensor x(t) PSF1
  • x(t) PSF1
  • x(t) PSF1
  • the sensor may acquire the second jitter data y(t) at the target sampling points t1 and t2, respectively.
  • the second jitter data y(t) PSF2, 0 ⁇ t ⁇ S acquired by the sensor.
  • the second jitter data y(t) PSF2, s ⁇ t ⁇ ex-time acquired by the sensor.
  • the electronic device may perform an integration operation to acquire the first coordinate data.
  • the first coordinate data x(t) t*Data1x, 0 ⁇ t ⁇ S acquired by the sensor.
  • the first coordinate data acquired by the sensor x(t) S*Data1x+t*Data2x, s ⁇ t ⁇ ex-time ;
  • the second coordinate data acquired by the sensor y(t) t*Data1y, 0 ⁇ t ⁇ S.
  • the second coordinate data acquired by the sensor y(t) S*Data1y+t*Data2y, s ⁇ t ⁇ ex-time ;
  • Step 1605 Calculate the target jitter amount.
  • the first target frame image has a rectangular structure, and the same jitter is consistent with the application of the pixel row of the first target frame image, and the first target frame image shown in this embodiment is different.
  • the pixel rows have the same amount of jitter.
  • the jitter amount of any row of the first target frame image may be used as the jitter amount of the entire first target frame image.
  • Step 1606 Determine whether the first target jitter amount is less than or equal to a preset value. If yes, go to step 1607. If no, go to step 1608.
  • Step 1607 Output the first target frame image.
  • Step 1608 determining a second target frame image.
  • Step 1609 Determine whether the second target jitter amount is less than or equal to the preset value. If yes, execute step 1610. If no, return to step 1608 or step 1611.
  • Step 1610 Output the second target frame image.
  • Step 1611 Output a third target frame image.
  • the electronic device does not need to calculate the contrast of all acquired frame images in the frame image sequence, and only needs to calculate the jitter amount of the frame images located in the frame image sequence in the order of the exposure end time, if the current calculation is calculated.
  • the jitter of the frame image is less than or equal to the preset value, then directly
  • the current frame image is output without calculating the frame image after the current frame image by the exposure end time, thereby saving the time taken for calculating the frame image and ensuring the clarity of the output image of the electronic device. The efficiency of the output image is improved.
  • the electronic device includes:
  • a second acquiring unit 1501 configured to acquire a time when any row of pixels included in the first target frame image starts to be exposed
  • the second determining unit 1502 is configured to determine the target pixel row, wherein a time when the target pixel row starts to be exposed is the target sampling time point.
  • a first acquiring unit 1503 configured to acquire sampling data corresponding to a target sampling time point, where the target sampling time point is any sampling time point of at least one sampling time point of an exposure time of the first target frame image,
  • the sampled data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image;
  • the first obtaining unit 1503 is further configured to acquire target sampling data of the target pixel, where the target pixel is any pixel located in the target pixel row, and an exposure time of the target pixel is the target sampling time point. And the target pixel is performed by 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 jitter amount of the target pixel row according to the target sampling time point and the target sampling data;
  • a third determining unit 1505, configured to determine a number of the target pixel rows
  • a second calculating unit 1506 configured to: if the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount; if the target pixel row number is a natural number greater than 1, All of the sub-target shake amounts are calculated by an averaging algorithm to obtain the first target shake amount.
  • the second calculating unit 1506 includes:
  • a calculation module 15061 configured to calculate target coordinates of any target pixel located in the target pixel row according to the target sampling time point and the target sampling data;
  • the first determining module 15062 is configured to: if the number of the target pixels located in the target pixel row is one, the sub-target jitter amount is a distance between the target coordinate and the origin coordinate;
  • a second determining module 15063 configured to set a target set if the number of the target pixels located in the target pixel row is at least two, the target set includes a plurality of target distances, and the target distance is all the a distance between any two of the target coordinates in the target coordinate, and the target distance is also a distance between any of the target coordinates and the origin coordinate;
  • the third determining module 15064 is configured to acquire 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 calculation module 15061 includes:
  • a first obtaining sub-module 150611, configured to acquire first jitter data that is located on the X-axis of any target pixel in the target pixel row at the target sampling time point;
  • a first calculation sub-module 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 acquire second jitter data that is located on the Y-axis of any target pixel in the target pixel row at the target sampling time point;
  • a second calculation sub-module 150614 configured to perform an integration operation on the second jitter data to obtain second coordinate data
  • the target coordinates for any target pixel in the target pixel row include a target abscissa and a target ordinate, and determining the target abscissa as the first coordinate data, the target ordinate is a The second coordinate data is described.
  • the first determining unit 1507 is configured to determine whether the first target jitter amount is less than or equal to a preset value, where the first target jitter amount is a first target frame image determined according to the target sampling time point and the sampling data. Amount of jitter
  • the first output unit 1508 is configured to output the first target frame image 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 image if the first target jitter amount is greater than the preset value, where an exposure end time of the second target frame image is later than the first target frame An exposure end time of the image, and an N target frame image is spaced between the first target frame image and the second target frame image, wherein the N is a natural number greater than or equal to 0;
  • the second determining unit 1510 is configured to determine whether the second target jitter amount is less than or equal to the preset value, where the second target jitter amount is a jitter amount of the second target frame image;
  • the second output unit 1511 is configured to output the second target image frame if the second target jitter amount is less than or equal to the preset value.
  • the second output unit 1511 is further configured to: if the second target jitter amount is greater than the preset value, output a third target frame image, where the third target frame image is any one of the frame image sequences a frame image, the frame image sequence including the first target frame image and the second target frame image, and the third target frame image has a jitter amount that is all frame images in the frame image sequence The minimum amount of jitter that is present.
  • the electronic device does not need to calculate the contrast of all acquired frame images in the frame image sequence, and only needs to calculate the jitter amount of the frame images located in the frame image sequence in the order of the exposure end time, if the current calculation is calculated If the amount of jitter of the frame image is less than or equal to the preset value, the current frame image is directly output without calculating the frame image after the current frame image by sorting the exposure end time, thereby saving the calculation of the frame image.
  • the duration of the image is improved in the case of ensuring the sharpness of the output image of the electronic device.
  • FIG. 15 illustrates the structure of the electronic device from the perspective of the functional module, and the structure of the physical hardware angle of the electronic device will be further described below in conjunction with FIG.
  • the electronic device includes one or more microcomputers 110, an image memory 104, a bus system, and one or more programs, and the microcomputer 110 and the image memory 104 are connected by the bus system;
  • the one or more programs are stored in the image memory 104, the one or more programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform as shown in FIG. Image output method.
  • FIG. 7 The specific process of the image output method of the electronic device shown in this embodiment is shown in FIG. 7 , which is not described in detail in this embodiment.
  • the one or more programs include instructions that, when executed by the electronic device, cause the electronic device to perform an image output method as shown in FIG. 7, the instructions executing the image
  • FIG. 7 The specific process of the output method is shown in FIG. 7 , and details are not described in this embodiment.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the 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 standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the 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 the like, which can store program codes.

Abstract

An image output method and an electronic device. The method comprises: acquiring sampled data corresponding to a target sampling time point; determining whether a first target amount of shaking is less than or equal to a preset value, the first target amount of shaking being an amount of shaking of a first target image frame; and if the first target amount of shaking is less than or equal to the preset value, outputting the first target image frame. In the method, it is only needed to calculate an amount of shaking of a current first target image frame, without the need to calculate the contrast of all acquired images, and if it is calculated that the amount of shaking of the current first target image frame is less than or equal to a preset value, the current first target image frame is directly output without the need to calculate an amount of shaking of an image that is taken after the current first target image frame, thereby improving image output efficiency while ensuring the sharpness of images output by electronic devices.

Description

一种图像输出方法以及电子设备Image output method and electronic device
本申请要求于2016年10月17日提交中国专利局、申请号为201610901195.6、发明名称为“一种拍照方法和终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. PCT Application No. No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域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 technique
随着电子设备功能的日益完善,用户对电子设备的镜头进行拍照后所输出的图像的清晰度的要求也越来越高。With the improvement of the functions of electronic devices, the requirements for the sharpness of images output by the user after taking pictures of the lenses of the electronic devices are also increasing.
在使用电子设备进行拍照时,用户手持电子设备难免会出现抖动,例如用户身体的自然抖动,自然抖动可为用户的心跳、脉搏,呼吸等,当电子设备进行拍照时,用户的抖动会在拍照的瞬间引起震动,在震动的情况下,对电子设备所拍摄的图像的清晰度造成较大的影响,为避免抖动对图像清晰度的影响,则现有技术中,可对电子设备连续获取的多帧图像进行高通滤波从而获取多帧图像中所有图像的对比度,电子设备即可将对比度最高的图像进行输出。When using electronic devices for taking pictures, the user's handheld electronic devices will inevitably appear to be shaken, such as the natural shaking of the user's body. Natural jitter can be the user's heartbeat, pulse, breathing, etc. When the electronic device takes a picture, the user's jitter will be photographed. The moment causes vibration, and in the case of vibration, it has a great influence on the sharpness of the image captured by the electronic device. In order to avoid the influence of the jitter on the image sharpness, in the prior art, the electronic device can be continuously acquired. The multi-frame image is high-pass filtered to obtain the contrast of all the images in the multi-frame image, and the electronic device can output the image with the highest contrast.
但是,采用现有技术所示的方案,电子设备在对多帧图像进行对比度的运算时需要产生比较长的时延,则使得电子设备无法快速的输出图像,从而降低了电子设备图像输出的效率。However, with the solution shown in the prior art, the electronic device needs to generate a relatively long delay when performing contrast calculation on the multi-frame image, so that the electronic device cannot output the image quickly, thereby reducing the image output efficiency of the electronic device. .
发明内容Summary of the invention
本发明提供了一种能够保障电子设备输出清晰的图像的同时,还能够提升电子设备输出图像的效率的图像输出方法以及电子设备。The present invention provides an image output method and an electronic device capable of ensuring an output of a clear image of an electronic device while also improving the efficiency of outputting an image of the electronic device.
本发明实施例第一方面提供了一种图像输出方法,包括:A first aspect of the embodiments of the present invention provides an image output method, including:
步骤A、获取与目标采样时间点对应的采样数据。Step A: Obtain sampling data corresponding to a target sampling time point.
本实施例所示的电子设备可预先周期性设置有采样时间点。The electronic device shown in this embodiment may be periodically set with a sampling time point.
采用本实施例所示的方法,电子设备能够获取传感器上报的按时间排序的帧图像序列,所述帧图像序列包括多个按曝光结束时间先后顺序排序的帧图 像。With the method shown in this embodiment, the electronic device can acquire the time-ordered frame image sequence reported by the sensor, and the frame image sequence includes a plurality of frame images sorted according to the exposure end chronological order. image.
所述第一目标帧图像为所述帧图像序列中的任一帧图像。The first target frame image is any frame image in the sequence of frame images.
具体的,本实施例所示的电子设备在所述采样时间点获取所述传感器上报的数据,所述电子设备能够获取帧图像序列中所包括的各个帧图像的曝光时间、帧率FR以及最大帧率等。Specifically, the electronic device shown in this embodiment acquires data reported by the sensor at the sampling time point, and the electronic device can acquire an exposure time, a frame rate FR, and a maximum of each frame image included in the frame image sequence. Frame rate, etc.
在所述第一目标帧图像的曝光时间内确定目标采样时间点,所述目标采样时间点为位于第一目标帧图像的曝光时间内的至少一个采样时间点中的任一采样时间点。Determining a target sampling time point in an exposure time of the first target frame image, the target sampling time point being any one of sampling time points located in an exposure time of the first target frame image.
所述采样数据为所述第一目标帧图像中与所述目标采样时间点对应的像素的抖动数据。The sampled data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image.
步骤B、判断第一目标抖动量是否小于或等于预设值,若是,则执行步骤C。Step B: Determine whether the first target jitter amount is less than or equal to a preset value, and if yes, perform step C.
所述第一目标抖动量为根据所述目标采样时间点和所述采样数据所确定的第一目标帧图像的抖动量。The first target shake amount is a shake amount of the first target frame image determined according to the target sampling time point and the sample data.
本实施例中,所述电子设备在执行本实施例所示的方法的过程中,可预先设置有所述预设值,本实施例对所述预设值的大小不作限定,只要当所述电子设备输出的所述第一目标帧图像的所述第一目标抖动量小于或等于所述预设值时,所述第一目标帧图像能够满足一定的清晰度,从而使得用户能够获取到清晰的图像。In this embodiment, the electronic device may be preset with the preset value in the process of performing the method shown in this embodiment, and the size of the preset value is not limited in this embodiment, as long as the 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 satisfy a certain definition, thereby enabling the user to obtain clear Image.
本实施例所述预设值越小,则在所述第一目标帧图像的抖动量小于或等于所述预设值的情况下,所输出的所述第一目标帧图像的清晰度越高,则可根据对图像清晰度的不同要求,设定不同的所述预设值。The smaller the preset value in this embodiment, the higher the resolution of the outputted first target frame image is when the jitter amount of the first target frame image is less than or equal to the preset value. , the different preset values can be set according to different requirements for image sharpness.
步骤C、输出所述第一目标帧图像。Step C: output 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 image is less than or equal to the preset value, the first target frame image may be directly output.
采用本实施例所述的方法,所述电子设备在获取到的图像帧序列中,首先计算第一目标帧图像的第一目标抖动量,在所述第一目标抖动量小于预先设置的预设值的情况下,则直接输出所述第一目标帧图像,所述电子设备在所述图像帧序列中排序在所述第一目标帧图像后面的帧图像的抖动量进行计算,从而 节省了对排序在所述第一目标帧图像后面的帧图像的抖动量进行计算的耗时,提升了图像输出的效率,降低了图像输出的时延。In the method of the embodiment, the electronic device first calculates a first target jitter amount of the first target frame image in the acquired image frame sequence, where the first target jitter amount is smaller than a preset preset. In the case of a value, the first target frame image is directly output, and the electronic device calculates the amount of jitter of the frame image behind the first target frame image in the image frame sequence, thereby The time-consuming calculation of the amount of jitter of the frame image sorted after the first target frame image is saved, the efficiency of image output is improved, and the delay of image output is reduced.
结合本发明实施例的第一方面,本发明实施例第一方面的第一种实现方式中,所述步骤B还包括:若判断出第一目标抖动量大于预设值,则本实施例所示的方法还包括下述步骤;With reference to the first aspect of the embodiments of the present invention, in the first implementation manner of the first aspect of the embodiment, the step B further includes: if the first target jitter amount is greater than the preset value, The method shown further includes the following steps;
步骤D1、确定第二目标帧图像。Step D1: Determine a second target frame image.
本实施例中,在所述第一目标抖动量大于所述预设值的情况下,在所述图像帧序列中,确定出排序在所述第一目标帧图像后面的第二目标帧图像。In this embodiment, in a case where the first target jitter amount is greater than the preset value, in the image frame sequence, a second target frame image sorted after the first target frame image is determined.
具体的,所述第二目标帧图像的曝光结束时间晚于所述第一目标帧图像的曝光结束时间,且所述第一目标帧图像和所述第二目标帧图像之间间隔有N个目标帧图像,所述N为大于或等于0的自然数;Specifically, the exposure end time of the second target frame image is later than the exposure end time of the first target frame image, and there are N intervals between the first target frame image and the second target frame image. a target frame image, the N being a natural number greater than or equal to 0;
更具体的,当N等于0时,所述第二目标帧图像为所述第一目标帧图像的下一目标帧图像,若N为大于1的正整数时,所述第二目标帧图像与所述第一目标帧图像之间间隔有N个目标帧图像。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, the second target frame image is There are N target frame images spaced between the first target frame images.
步骤D2、判断第二目标抖动量是否小于或等于所述预设值。Step D2: Determine whether the second target jitter amount is less than or equal to the preset value.
其中,所述第二目标抖动量为所述第二目标帧图像所具有的抖动量。The second target jitter amount is a jitter amount of the second target frame image.
获取所述第二目标抖动量的具体过程请详见获取第一目标抖动量的具体过程,具体在本实施例中不作赘述。For the specific process of obtaining the second target jitter amount, refer to the specific process of obtaining the first target jitter amount, which is not specifically described in this embodiment.
步骤中,若判断出第二目标抖动量小于或等于所述预设值,则执行步骤D3。In the step, if it is determined that the second target jitter amount is less than or equal to the preset value, step D3 is performed.
步骤D3、输出所述第二目标帧图像。Step D3: Output the second target frame image.
本实施例中,若所述第二目标抖动量小于或等于所述预设值,则直接输出所述第二目标帧图像。In this embodiment, if the second target jitter amount is less than or equal to the preset value, the second target frame image is directly output.
采用本实施例所述的方法,所述电子设备在获取到的图像帧序列中,首先计算第一目标帧图像的第一目标抖动量,在所述第一目标抖动量大于或等于预先设置的预设值的情况下,则说明当前的所述第一目标帧图像的清晰度不满足要求,若输出该第一目标帧图像,则使得电子设备所显示的帧图像的清晰度不能满足用户的需求,则所述电子设备在所述帧图像序列中确定曝光时间晚于所述第一目标帧图像的第二目标帧图像,在所述第二目标帧图像的抖动量小于或 等于所述预设值的情况下,则直接输出清晰度满足用户需求的第二目标帧图像,采用本实施例所示的方法,避免了对位于所述第二目标帧图像后面的帧图像的抖动量进行计算,从而节省了对排序在所述第二目标帧图像后面的帧图像的抖动量进行计算的耗时,提升了图像输出的效率,降低了图像输出的时延。In the method of the embodiment, the electronic device first calculates a first target jitter amount of the first target frame image in the acquired image frame sequence, where the first target jitter amount is greater than or equal to a preset value. In the case of a preset value, it indicates that the current resolution of the first target frame image does not satisfy the requirement, and if the first target frame image is output, the definition of the frame image displayed by the electronic device cannot satisfy the user's Determining, the electronic device determines, in the sequence of frame images, that the exposure time is later than the second target frame image of the first target frame image, and the amount of jitter in the second target frame image is less than or In the case of the preset value, the second target frame image whose resolution meets the user's requirement is directly output, and the method shown in this embodiment avoids the frame image located behind the second target frame image. The amount of jitter is calculated, thereby saving the time required for calculating the amount of jitter of the frame image after sorting the image of the second target frame, improving the efficiency of image output and reducing the delay of image output.
结合本发明实施例第一方面的第一种实现方式,本发明实施例第一方面的第二种实现方式中,所述步骤B还包括:若判断出第一目标抖动量大于预设值,则本实施例所示的方法还包括下述步骤;With reference to the first implementation manner of the first aspect of the embodiment of the present invention, in the second implementation manner of the first aspect of the embodiment, the step B further includes: if it is determined that the first target jitter amount is greater than a preset value, The method shown in this embodiment further includes the following steps;
D4、输出第三目标帧图像。D4. Output 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, indicating that the second target frame image clarity is relatively low, the third target frame image is determined.
具体的,所述第三目标帧图像为帧图像序列中的任一帧图像,所述帧图像序列包括所述第一目标帧图像和已确定的至少一个所述第二目标帧图像,且所述第三目标帧图像所具有的抖动量是所述帧图像序列中的所有帧图像所具有的抖动量的最小值。Specifically, the third target frame image is any frame image in a sequence of frame images, and the frame image sequence includes the first target frame image and the determined at least one second target frame image, and The amount of jitter that the third target frame image has is the minimum value of the amount of jitter that all of the frame images in the sequence of frame images have.
在执行本实施例所示的步骤D4之前,已确定的所述第一目标帧图像和所有所述第二目标帧图像的抖动量均大于所述预设值,则在已确定的所述第一目标帧图像和所有所述第二目标帧图像中,确定抖动量最小的目标帧图像为所述第三目标帧图像。Before the step D4 shown in this embodiment is performed, the determined amount of jitter of the first target frame image and all the second target frame images is greater than the preset value, and then the determined In a target frame image and all of the second target frame images, a target frame image in which the amount of jitter is determined to be the smallest is determined as the third target frame image.
采用本实施例所述的方法,所述电子设备在获取到的图像帧序列中,在第一目标帧图像和所有所述第二目标帧图像的抖动量均大于所述预设值的情况下,则在所述帧图像序列选择清晰度最高的第三目标帧图像,从而输出所述第三目标帧图像,采用本实施例所述的方法能够保障电子设备输出图像的清晰度,从而使得用户能够获取到清晰度最高的图像。In the method of the embodiment, the electronic device, in the acquired image frame sequence, in a case where the jitter amount of the first target frame image and all the second target frame images are greater than the preset value And selecting the third target frame image with the highest definition in the frame image sequence, thereby outputting the third target frame image, and the method described in this embodiment can ensure the clarity of the output image of the electronic device, thereby enabling the user to The image with the highest sharpness can be obtained.
结合本发明实施例第一方面至本发明实施例第一方面的第二种实现方式,本发明实施例第一方面的第二种实现方式中任一项所示,本发明实施例第一方面的第三种实现方式中,With reference to the first aspect of the first embodiment of the present invention to the second implementation manner of the first aspect of the embodiment of the present invention, the first aspect of the first embodiment of the present disclosure In the third implementation,
所述步骤A具体包括:The step A specifically includes:
步骤A11、获取目标像素的目标采样数据。Step A11: Obtain target sampling data of the target pixel.
所述目标像素为位于目标像素行内的任一像素,且所述目标像素的曝光时 间为所述目标采样时间点,所述目标像素行为所述第一目标帧图像所包括的任一像素行,所述目标采样数据为所述目标像素在所述目标采样时间点的抖动数据。The target pixel is any pixel located in a target pixel row, and the target pixel is exposed For the target sampling time point, the target pixel acts on 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.
采用本实施例所示的方法,为了能够提升输出图像的效率,减少输出图像的时延,则在计算目标帧图像的抖动量时,首先确定出满足条件的目标像素,根据已确定的目标像素即可确定出目标帧图像的抖动量,从而无需对目标帧图像所包括的所有像素进行处理,从而有效的提升了计算帧图像的抖动量的效率。With the method shown in this embodiment, in order to improve the efficiency of the output image and reduce the delay of the output image, when calculating the jitter amount of the target frame image, first, the target pixel that satisfies the condition is determined, according to the determined target pixel. The amount of jitter of the target frame image can be determined, so that it is not necessary to process all the pixels included in the target frame image, thereby effectively improving the efficiency of calculating the jitter amount of the frame image.
结合本发明实施例第一方面的第三种实现方式,本发明实施例第一方面的第四种实现方式中,With reference to the third implementation manner of the first aspect of the embodiment of the present invention, in a fourth implementation manner of the first aspect of the embodiment of the present invention,
所述步骤A之前,本发明实施例所示的方法还包括:Before the step A, the method shown in the embodiment of the present invention further includes:
步骤A01、获取所述第一目标帧图像所包括的任一行像素开始曝光的时间。Step A01: Obtain a time when any row of pixels included in the image of the first target frame starts to be exposed.
本实施例中,相同的抖动对不同的像素行造成的影响不同,可见,抖动量的只对帧图像中的单行像素有效,为了准确的确定抖动对整幅帧图像的影响,则需要确定抖动对帧图像的单个像素行所造成的影响。In this embodiment, the same jitter has different effects on different pixel rows. It can be seen that the jitter amount is only valid for a single row of pixels in the frame image. In order to accurately determine the influence of the jitter on the entire frame image, the jitter needs to be determined. The effect on a single pixel row of a frame image.
但是在获取目标帧图像的抖动量时,基于图像输出效率的考虑,不能对目标帧图像所包括的所有像素行进行计算,则需要在目标帧图像所包括的所有像素行中确定能够用于进行抖动量计算的目标像素行。However, when acquiring the jitter amount of the target frame image, based on the image output efficiency consideration, all the pixel rows included in the target frame image cannot be calculated, and it is necessary to determine that all the pixel rows included in the target frame image can be used for performing. The target pixel row for the amount of jitter calculation.
在确定目标像素行的过程中,本实施例所示的电子设备首先确定所述第一目标帧图像所包括的任一行像素开始曝光的时间。In the process of determining the target pixel row, the electronic device shown in this embodiment first determines the time at which any row of pixels included in the first target frame image begins to be exposed.
步骤A02、确定所述目标像素行。Step A02: Determine the target pixel row.
其中,所述目标像素行的开始曝光的时间为所述目标采样时间点。The time at which the target pixel row starts to be exposed is the target sampling time point.
本实施例所示的方法确定出的目标像素行越多,则对图像帧进行计算以获取到的抖动量就越精确,本实施例所示可预先设置有目标像素行阈值,则在确定所述目标像素行时,可获取到数目为目标像素行阈值的所述目标像素行。The more the target pixel row determined by the method shown in this embodiment, the more accurate the image jitter is obtained by calculating the image frame. In this embodiment, the target pixel row threshold may be preset, and then When the target pixel row is described, the target pixel row whose number is the target pixel row threshold may be acquired.
采用开始曝光的时间为所述目标采样时间点的像素行为所述目标像素行,能够提升目标帧图像进行抖动量计算的准确性,从而使得电子设备在根据所述目标像素行进行抖动量计算时,能够获取准确的目标帧图像的抖动量。 Taking the pixel of the target sampling time point as the target pixel row, the accuracy of the jitter calculation of the target frame image can be improved, so that the electronic device calculates the jitter amount according to the target pixel row. , can obtain the amount of jitter of the accurate target frame image.
结合本发明实施例第一方面的第三种实现方式或本发明实施例第一方面的第四种实现方式,本发明实施例第一方面的第五种实现方式中,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,
所述步骤B之前,所述方法还包括:Before the step B, the method further includes:
步骤B01、计算目标像素行的子目标抖动量。Step B01: Calculate the sub-target jitter amount of the target pixel row.
所述子目标抖动量为抖动对目标像素行所造成的影响,本实施例所示的目标像素行为所述第一目标帧图像所包括的任一行像素。The sub-target jitter amount is the influence of the jitter on the target pixel row, and the target pixel shown in this embodiment acts on any row of pixels included in the first target frame image.
若在目标像素行内确定出多个目标像素,则在具体进行子目标抖动量的计算时,可选定目标数目的目标像素进行子目标抖动量的计算。本实施例对所选定的目标数目的具体数值不作限定。If a plurality of target pixels are determined in the target pixel row, when the sub-target jitter amount is specifically calculated, the target number of target pixels may be selected to calculate the sub-target jitter amount. The specific value of the selected target number is not limited in this embodiment.
步骤B02、确定所述目标像素行的数目;Step B02, determining the number of the target pixel rows;
步骤B03、若所述目标像素行的数目为1,则所述第一目标抖动量等于所述子目标抖动量;Step B03, if the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount;
步骤B04、若所述目标像素行的数目为大于1的自然数,则对所有所述子目标抖动量通过平均算法进行计算以获取所述第一目标抖动量。Step B04: If the number of the target pixel rows is a natural number greater than 1, the all-sub-target jitter amount is calculated by an averaging algorithm to obtain the first target jitter amount.
本实施例对所述平均算法不做限定,只要能够对所述子目标抖动量进行计算以获取平均值即可,例如,所述平均算法可为移动平均算法MA、指数平滑平均EMA、参数平均SMA以及权重平均DMA等。In this embodiment, the averaging algorithm is not limited, 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, and a parameter average. SMA and weighted average DMA, etc.
采用本实施例所示的方法,在计算目标帧图像的抖动时,可首先确定出目标帧图像所包括的目标像素行的子目标抖动量,在确定出所述子目标抖动量后,即可确定出目标帧图像的抖动量,可见,采用本实施例所示的方法,基于同样的抖动对不同的像素行造成不同的影响的情况下,将目标帧图像的抖动量的计算划分到各个目标像素行,从而提升了对目标帧图像的抖动量计算的准确性。With the method shown in this embodiment, when calculating the jitter of the target frame image, the sub-target jitter amount of the target pixel row included in the target frame image may be first determined, and after determining the sub-target jitter amount, Determining the amount of jitter of the target frame image, it can be seen that, by using the method shown in this embodiment, the calculation of the jitter amount of the target frame image is divided into each target based on the same jitter affecting different pixel rows. The pixel row improves the accuracy of the jitter calculation for the target frame image.
结合本发明实施例第一方面的第五种实现方式,本发明实施例第一方面的第六种实现方式中,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,
所述步骤B01包括:The step B01 includes:
步骤B011、计算位于所述目标像素行内任一目标像素的目标坐标。Step B011: Calculate target coordinates of any target pixel located in the target pixel row.
本实施例中,根据所述目标采样时间点和所述目标采样数据计算所述目标坐标。 In this embodiment, the target coordinates are calculated according to the target sampling time point and the target sampling data.
步骤B012、若位于所述目标像素行内的所述目标像素的数目为一个,则所述子目标抖动量为所述目标坐标与原点坐标之间的距离。Step B012: If the number of the target pixels located in the target pixel row is one, the sub-target shake amount is a distance between the target coordinate and the origin coordinate.
具体的,在目标像素行中,所述目标像素的数目为一个,可将P1的目标坐标在二维坐标系中表示出来。Specifically, in the target pixel row, the number of the target pixels is one, and the target coordinates of P1 can be expressed in a two-dimensional coordinate system.
则所述目标距离为所述二维坐标系中原点坐标(0,0)与P1之间的距离。Then the target distance is the distance between the origin coordinates (0, 0) and P1 in the two-dimensional coordinate system.
步骤B013、若位于所述目标像素行内的所述目标像素的数目为至少两个,则设置目标集合。Step B013: If the number of the target pixels located in the target pixel row is at least two, set the target set.
所述目标集合包括多个目标距离,所述目标距离为所有所述目标坐标中任意两个所述目标坐标之间的距离,且所述目标距离还为任一所述目标坐标与所述原点坐标之间的距离。The target set includes a plurality of target distances, the target distance is a distance between any two of the target coordinates of the target coordinates, and the target distance is also any of the target coordinates and the origin The distance between the coordinates.
具体的,在目标像素行中,以所述目标像素的数目为三个为例,可将P1的目标坐标、P2的目标坐标和P3的目标坐标在二维坐标系中表示出来。Specifically, in the target pixel row, taking the number of the target pixels as three as an example, the target coordinates of P1, the target coordinates of P2, and the target coordinates of P3 may be expressed in a two-dimensional coordinate system.
所述目标距离为二维坐标系中,P1与P2之间的距离、P2与P3之间的距离、P1与P3之间的距离、原点坐标(0,0)与P1之间的距离、原点坐标(0,0)与P2之间的距离、原点坐标(0,0)与P3之间的距离。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 the origin coordinates (0, 0) and P1, and an origin in a two-dimensional coordinate system. The distance between the coordinates (0,0) and P2, the distance between the origin coordinates (0,0) and P3.
所述电子设备将已获取的所述目标距离设置在目标集合中。The electronic device sets the acquired target distance in the target set.
B014、获取所述子目标抖动量。B014. Acquire the sub-target jitter amount.
具体的,所述子目标抖动量为位于所述目标集合内的所有所述目标距离中的最大值。Specifically, the sub-target jitter amount is a maximum value among all the target distances located in the target set.
本实施例中,通过将目标像素的目标坐标在二维坐标系中表示出来,进而获取在所述二维坐标系中获取所述目标距离,从而实现了子目标抖动量的快速计算,提升了图像输出的效率,而且减少了图像输出过程中的时延。In this embodiment, by obtaining the target coordinates of the target pixel in a two-dimensional coordinate system, acquiring the target distance in the two-dimensional coordinate system, thereby realizing the fast calculation of the sub-target jitter amount, and improving the The efficiency of image output, and the delay in image output is reduced.
结合本发明实施例第一方面的第六种实现方式,本发明实施例第一方面的第七种实现方式中,With reference to the sixth implementation manner of the first aspect of the embodiment of the present invention, in a seventh implementation manner of the first aspect of the embodiment of the present invention,
所述步骤B011具体包括:The step B011 specifically includes:
步骤B0111、获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿X轴平移的第一抖动数据;Step B0111: Acquire first jitter data that is located on the X-axis of any target pixel in the target pixel row at the target sampling time point;
具体的,本实施例所述电子设备通过与目标像素对应的目标采样时间点获取目标采样数据,并根据该目标采样数据获取目标像素的目标坐标。 Specifically, the electronic device in this embodiment acquires target sampling data by using a target sampling time point corresponding to the target pixel, and acquires target coordinates of the target pixel according to the target sampling data.
本实施例所示将电子设备的抖动划分到三维坐标系中,所述三维坐标系分为X轴、Y轴以及Z轴,其中,X轴为电子设备沿上下方向平移的方向,Y轴与X轴垂直,且Y轴为电子设备沿里外的方向平移的方向,Z轴为分别与X轴、Y轴垂直,且Z轴为电子设备沿左右的方向平移的方向。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 in the up-and-down direction, and the Y-axis and The X axis is vertical, and the Y axis is a direction in which the electronic device translates in the inner and outer directions, 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 in the left and right directions.
本实施例所示的目标像素的抖动包括目标像素在目标采样时间点上沿X轴平移的第一点扩散函数数据、沿Y轴平移的第二点扩散函数数据、沿Z轴平移的第三点扩散函数数据、绕X轴旋转的第四点扩散函数数据、绕Y轴旋转的第五点扩散函数数据以及绕Z轴旋转的第六点扩散函数数据。The jitter of the target pixel shown in this embodiment includes first point spread function data of the target pixel moving along the X axis at the target sampling time point, second point spread function data translated along the Y axis, and third translation along the Z axis. Point spread function data, fourth point spread function data rotated about the X axis, fifth point spread function data rotated about the Y axis, and sixth point spread function data rotated about the Z axis.
本实施例中,可通过所述点扩散函数数据中的第一点扩散函数数据和第二点扩散函数数据确定目标像素的目标坐标。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.
本实施例中,在电子设备的镜头沿X轴的方向平移时,第一点扩散函数数据PSF1=(a/b)d1。In this embodiment, when the lens of the electronic device is translated in the direction of the X-axis, the first point spread function data PSF1=(a/b)d1.
其中,a为电子设备的镜头和传感器之间的距离,b为被摄物体和镜头之间的距离,即b为物距;d1为镜头偏移量,所述镜头偏移量d1为镜头移动后的位置和移动前的位置之间沿X轴方向的距离。Where a is the distance between the lens and the sensor of the electronic device, b is the distance between the object and the lens, that is, b is the object distance; d1 is the lens shift amount, and the lens shift amount d1 is the lens shift The distance between the rear position and the position before the movement in the X-axis direction.
步骤B0112、对所述第一抖动数据进行积分运算以获取第一坐标数据;Step B0112, performing an integration operation on the first jitter data to obtain first coordinate data;
本实施例所示的传感器可在目标采样点获取第一抖动数据x(t)=PSF1,limt<t<limx。The sensor shown in this embodiment can acquire the first jitter data x(t)=PSF1, limt<t<limx at the target sampling point.
其中,以所述目标像素为所述目标像素行中的第A个目标像素为例,且第A个所述目标像素为所述目标像素行所包括的任一目标像素,limt为所述目标像素行开始曝光的时间到第A个目标像素的曝光时间之间所间隔的时间,若第A个所述目标像素不是所述目标像素行内的最后一个像素,则limx为A*s,若第A个目标像素为所述目标像素行内的最后一个像素,则limx为所述目标像素行的曝光结束时间ex-time。Wherein, the target pixel is taken as the A-th target pixel in the target pixel row, and the A-th target pixel is any target pixel included in the target pixel row, and the lime is the target The time interval between the time when the pixel row starts to be exposed and the exposure time of the A target pixel. If the A target pixel is not the last pixel in the target pixel row, then limx is A*s, if A target pixel is the last pixel in the target pixel row, and limx is the exposure end time ex-time of the target pixel row.
电子设备在获取到所述采样数据后,即可进行积分运算以获取第一坐标数据。After acquiring the sampled data, the electronic device may perform an integral operation to acquire the first coordinate data.
具体的,第一坐标数据
Figure PCTCN2016111452-appb-000001
Specifically, the first coordinate data
Figure PCTCN2016111452-appb-000001
步骤B0113、获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿Y轴平移的第二抖动数据; Step B0113, acquiring second jitter data that is located in the target pixel row and that is translated along the Y axis at the target sampling time point;
本实施例中,在电子设备的镜头沿Y轴的方向平移时,第二点扩散函数数据PSF2=(a/b)d1。In this embodiment, when the lens of the electronic device is translated in the direction of the Y-axis, the second point spread function data PSF2=(a/b)d1.
其中,a为电子设备的镜头和传感器之间的距离,b为被摄物体和镜头之间的距离,即b为物距;d1为镜头偏移量,所述镜头偏移量d1为镜头移动后的位置和移动前的位置之间沿Y轴方向的距离。Where a is the distance between the lens and the sensor of the electronic device, b is the distance between the object and the lens, that is, b is the object distance; d1 is the lens shift amount, and the lens shift amount d1 is the lens shift The distance between the rear position and the position before the movement in the Y-axis direction.
步骤B0114、对所述第二抖动数据进行积分运算以获取第二坐标数据;Step B0114, performing an integration operation on the second jitter data to obtain second coordinate data;
步骤B0115、位于所述目标像素行内任一目标像素的目标坐标包括目标横坐标和目标纵坐标,确定所述目标横坐标为所述第一坐标数据,所述目标纵坐标为所述第二坐标数据。Step B0115: target coordinates of any target pixel in the target pixel row include a target abscissa and a target ordinate, determining that the target abscissa is the first coordinate data, and the target ordinate is the second coordinate data.
本实施例中,电子设备在获取到所述采样数据后,即可进行积分运算以获取第二坐标数据。In this embodiment, after acquiring the sampled data, the electronic device may perform an integration operation to acquire second coordinate data.
具体的,第二坐标数据
Figure PCTCN2016111452-appb-000002
Specifically, the second coordinate data
Figure PCTCN2016111452-appb-000002
采用本实施例所示的图像输出方法,所述电子设备无需对所获取到的位于帧图像序列中的所有帧图像进行对比度的计算,只需要按曝光结束时间的先后顺序对位于帧图像序列中帧图像依次进行抖动量的计算,若计算出当前的帧图像的抖动量小于或等于预设值,则直接输出当前的帧图像,而无需对排序在当前帧图像后面的帧图像进行计算,从而节省了对帧图像进行计算所耗费的时长,在保障了电子设备输出图像的清晰度的情况下,提升了输出图像的效率。With the image output method shown in this embodiment, the electronic device does not need to perform contrast calculation on all acquired frame images in the frame image sequence, and only needs to be in the sequence of frame images in the order of exposure end time. The frame image sequentially performs the calculation of the jitter amount. If the jitter amount of the current frame image is calculated to be less than or equal to the preset value, the current frame image is directly output without calculating the frame image sorted after the current frame image, thereby The time taken for calculating the frame image is saved, and the efficiency of outputting the image is improved while ensuring the sharpness of the output image of the electronic device.
本发明实施例第二方面提供了一种电子设备,包括:A second aspect of the embodiments of the present invention provides an electronic device, including:
第一获取单元,用于获取与目标采样时间点对应的采样数据,所述目标采样时间点为位于第一目标帧图像的曝光时间内的至少一个采样时间点中的任一采样时间点,所述采样数据为所述第一目标帧图像中与所述目标采样时间点对应的像素的抖动数据;a first acquiring unit, configured to acquire sampling data corresponding to a target sampling time point, where the target sampling time point is any sampling time point located in at least one sampling time point of an exposure time of the first target frame image, The sampled data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image;
本实施例所示的第一获取单元用于执行本发明实施例第一方面所示的步骤A,具体执行过程请详见上述所示,具体不作赘述。The first obtaining unit shown in this embodiment is used to perform the step A shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
第一判断单元,用于判断第一目标抖动量是否小于或等于预设值,所述第一目标抖动量为根据所述目标采样时间点和所述采样数据所确定的第一目标帧图像的抖动量; a first determining unit, configured to determine whether the first target jitter amount is less than or equal to a preset value, where the first target jitter amount is a first target frame image determined according to the target sampling time point and the sampling data Amount of jitter;
本实施例所示的第一判断单元用于执行本发明实施例第一方面所示的步骤B,具体执行过程请详见上述所示,具体不作赘述。The first determining unit shown in this embodiment is used to perform the step B shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
第一输出单元,用于若所述第一目标抖动量小于或等于所述预设值,则输出所述第一目标帧图像。And a first output unit, configured to output the first target frame image if the first target jitter amount is less than or equal to the preset value.
本实施例所示的第一输出单元用于执行本发明实施例第一方面所示的步骤C,具体执行过程请详见上述所示,具体不作赘述。The first output unit shown in this embodiment is used to perform the step C shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
采用本实施例所述的电子设备,所述电子设备在获取到的图像帧序列中,首先计算第一目标帧图像的第一目标抖动量,在所述第一目标抖动量小于预先设置的预设值的情况下,则直接输出所述第一目标帧图像,所述电子设备在所述图像帧序列中排序在所述第一目标帧图像后面的帧图像的抖动量进行计算,从而节省了对排序在所述第一目标帧图像后面的帧图像的抖动量进行计算的耗时,提升了图像输出的效率,降低了图像输出的时延。According to the electronic device of the embodiment, the electronic device first calculates a first target jitter amount of the first target frame image in the acquired image frame sequence, where the first target jitter amount is smaller than a preset pre-set In the case of setting a value, the first target frame image is directly output, and the electronic device calculates the amount of jitter of the frame image behind the first target frame image in the image frame sequence, thereby saving The time taken to calculate the amount of jitter of the frame image after the first target frame image is sorted, the efficiency of image output is improved, and the delay of image output is reduced.
结合本发明实施例第二方面,本发明实施例第二方面的第一种实现方式中,With reference to the second aspect of the embodiments of the present invention, in a first implementation manner of the second aspect of the embodiment of the present invention,
所述电子设备还包括:The electronic device further includes:
第一确定单元,用于若所述第一目标抖动量大于所述预设值,则确定第二目标帧图像,所述第二目标帧图像的曝光结束时间晚于所述第一目标帧图像的曝光结束时间,且所述第一目标帧图像和所述第二目标帧图像之间间隔有N个目标帧图像,所述N为大于或等于0的自然数;a first determining unit, configured to determine a second target frame image if the first target shake amount is greater than the preset value, and an exposure end time of the second target frame image is later than the first target frame image Exposure end time, and there are N target frame images between the first target frame image and the second target frame image, the N being a natural number greater than or equal to 0;
本实施例所示的第一确定单元用于执行本发明实施例第一方面所示的步骤D1,具体执行过程请详见上述所示,具体不作赘述。The first determining unit shown in this embodiment is used to perform the step D1 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
第二判断单元,用于判断第二目标抖动量是否小于或等于所述预设值,所述第二目标抖动量为所述第二目标帧图像所具有的抖动量;a second determining unit, configured to determine whether the second target jitter amount is less than or equal to the preset value, where the second target jitter amount is a jitter amount of the second target frame image;
本实施例所示的第二判断单元用于执行本发明实施例第一方面所示的步骤D2,具体执行过程请详见上述所示,具体不作赘述。The second determining unit shown in this embodiment is used to perform the step D2 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
第二输出单元,用于若所述第二目标抖动量小于或等于所述预设值,则输出所述第二目标图像帧。And a second output unit, configured to output the second target image frame if the second target jitter amount is less than or equal to the preset value.
本实施例所示的第二输出单元用于执行本发明实施例第一方面所示的步骤D3,具体执行过程请详见上述所示,具体不作赘述。 The second output unit shown in this embodiment is used to perform the step D3 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
采用本实施例所述的电子设备,在获取到的图像帧序列中,首先计算第一目标帧图像的第一目标抖动量,在所述第一目标抖动量大于或等于预先设置的预设值的情况下,则说明当前的所述第一目标帧图像的清晰度不满足要求,若输出该第一目标帧图像,则使得电子设备所显示的帧图像的清晰度不能满足用户的需求,则所述电子设备在所述帧图像序列中确定曝光时间晚于所述第一目标帧图像的第二目标帧图像,在所述第二目标帧图像的抖动量小于或等于所述预设值的情况下,则直接输出清晰度满足用户需求的第二目标帧图像,采用本实施例所示的方法,避免了对位于所述第二目标帧图像后面的帧图像的抖动量进行计算,从而节省了对排序在所述第二目标帧图像后面的帧图像的抖动量进行计算的耗时,提升了图像输出的效率,降低了图像输出的时延。According to the electronic device of the embodiment, in the acquired image frame sequence, first, the first target jitter amount of the first target frame image is calculated, and the first target jitter amount is greater than or equal to a preset preset value. In the case, the current resolution of the image of the first target frame does not meet the requirement. If the image of the first target frame is output, the resolution of the frame image displayed by the electronic device cannot meet the user's needs. The electronic device determines, in the sequence of frame images, a second target frame image whose exposure time is later than the first target frame image, where the jitter amount of the second target frame image is less than or equal to the preset value In this case, the second target frame image whose resolution meets the user's requirement is directly output, and the method shown in this embodiment avoids the calculation of the jitter amount of the frame image located behind the second target frame image, thereby saving The time taken to calculate the amount of jitter of the frame image after sorting the image of the second target frame improves the efficiency of image output and reduces the delay of image output.
结合本发明实施例第二方面的第一种实现方式,本发明实施例第二方面的第二种实现方式中,With reference to the first implementation manner of the second aspect of the embodiment of the present invention, in a second implementation manner of the second aspect of the embodiment of the present invention,
所述第二输出单元还用于,若所述第二目标抖动量大于所述预设值,则输出第三目标帧图像,所述第三目标帧图像为帧图像序列中的任一帧图像,所述帧图像序列包括所述第一目标帧图像和所述第二目标帧图像,且所述第三目标帧图像所具有的抖动量是所述帧图像序列中的所有帧图像所具有的抖动量的最小值。The second output unit is further configured to: if the second target jitter amount is greater than the preset value, output a third target frame image, where the third target frame image is any frame image in the frame image sequence The frame image sequence includes the first target frame image and the second target frame image, and the third target frame image has a jitter amount that is possessed by all frame images in the frame image sequence. The minimum amount of jitter.
本实施例所示的第二输出单元用于执行本发明实施例第一方面所示的步骤D4,具体执行过程请详见上述所示,具体不作赘述。The second output unit shown in this embodiment is used to perform the step D4 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
采用本实施例所述的电子设备,在获取到的图像帧序列中,在第一目标帧图像和所有所述第二目标帧图像的抖动量均大于所述预设值的情况下,则在所述帧图像序列选择清晰度最高的第三目标帧图像,从而输出所述第三目标帧图像,采用本实施例所述的方法能够保障电子设备输出图像的清晰度,从而使得用户能够获取到清晰度最高的图像。According to the electronic device of the embodiment, in the acquired image frame sequence, in a case where the jitter amount of the first target frame image and all the second target frame images are greater than the preset value, The frame image sequence selects the third target frame image with the highest definition, thereby outputting the third target frame image, and the method described in this embodiment can ensure the clarity of the output image of the electronic device, thereby enabling the user to obtain The highest resolution image.
结合本发明实施例第二方面至本发明实施例第二方面的第二种实现方式任一项所述的电子设备,本发明实施例第二方面的第三种实现方式中,With reference to the second aspect of the second aspect of the present invention, to the electronic device of the second aspect of the second aspect of the present invention,
所述第一获取单元还用于,获取目标像素的目标采样数据,所述目标像素为位于目标像素行内的任一像素,且所述目标像素的曝光时间为所述目标采样时间点,所述目标像素行为所述第一目标帧图像所包括的任一像素行,所述目 标采样数据为所述目标像素在所述目标采样时间点的抖动数据。The first acquiring unit is further configured to acquire target sampling data of a target pixel, where the target pixel is any pixel located in a target pixel row, and an exposure time of the target pixel is the target sampling time point, The target pixel acts on any pixel row included in the first target frame image, the mesh The target sample data is jitter data of the target pixel at the target sampling time point.
本实施例所示的第一获取单元用于执行本发明实施例第一方面所示的步骤A11,具体执行过程请详见上述所示,具体不作赘述。The first obtaining unit shown in this embodiment is used to perform the step A11 shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
采用本实施例所示的电子设备,为了能够提升输出图像的效率,减少输出图像的时延,则在计算目标帧图像的抖动量时,首先确定出满足条件的目标像素,根据已确定的目标像素即可确定出目标帧图像的抖动量,从而无需对目标帧图像所包括的所有像素进行处理,从而有效的提升了计算帧图像的抖动量的效率。According to the electronic device shown in this embodiment, in order to improve the efficiency of the output image and reduce the delay of the output image, when calculating the jitter amount of the target frame image, first, the target pixel that satisfies the condition is determined, according to the determined target. The pixel can determine the amount of jitter of the target frame image, so that it is not necessary to process all the pixels included in the target frame image, thereby effectively improving the efficiency of calculating the jitter amount of the frame image.
结合本发明实施例第二方面的第三种实现方式,本发明实施例第二方面的第四种实现方式中,With reference to the third implementation manner of the second aspect of the embodiment of the present invention, in a 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 when any row of pixels included in the first target frame image starts to be exposed;
本实施例所示的第二获取单元用于执行本发明实施例第一方面所示的步骤A01,具体执行过程请详见上述所示,具体不作赘述。The second obtaining unit shown in this embodiment is used to perform the step A01 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
第二确定单元,用于确定所述目标像素行,其中,所述目标像素行的开始曝光的时间为所述目标采样时间点。a second determining unit, configured to determine the target pixel row, wherein a time when the target pixel row starts to be exposed is the target sampling time point.
本实施例所示的第二确定单元用于执行本发明实施例第一方面所示的步骤A02,具体执行过程请详见上述所示,具体不作赘述。The second determining unit shown in this embodiment is used to perform the step A02 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
结合本发明实施例第二方面的第三种实现方式或本发明实施例第二方面的第四种实现方式,本发明实施例第二方面的第五种实现方式中,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 the target pixel row according to the target sampling time point and the target sampling data;
本实施例所示的第一计算单元用于执行本发明实施例第一方面所示的步骤B01,具体执行过程请详见上述所示,具体不作赘述。The first calculation unit shown in this embodiment is used to perform the step B01 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
第三确定单元,用于确定所述目标像素行的数目;a third determining unit, configured to determine a number of the target pixel rows;
本实施例所示的第三确定单元用于执行本发明实施例第一方面所示的步骤B02,具体执行过程请详见上述所示,具体不作赘述。 The third determining unit shown in this embodiment is used to perform the step B02 shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
第二计算单元,用于若所述目标像素行的数目为1,则所述第一目标抖动量等于所述子目标抖动量;若所述目标像素行的数目为大于1的自然数,则对所有所述子目标抖动量通过平均算法进行计算以获取所述第一目标抖动量。a second calculating unit, configured to: if the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount; if the target pixel row number is a natural number greater than 1, All of the sub-target shake amounts are calculated by an averaging algorithm to obtain the first target shake amount.
本实施例所示的第二计算单元用于执行本发明实施例第一方面所示的步骤B03和步骤B04,具体执行过程请详见上述所示,具体不作赘述。The second calculation unit shown in this embodiment is used to perform the step B03 and the step B04 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
采用本实施例所示的电子设备,在计算目标帧图像的抖动时,可首先确定出目标帧图像所包括的目标像素行的子目标抖动量,在确定出所述子目标抖动量后,即可确定出目标帧图像的抖动量,可见,采用本实施例所示的方法,基于同样的抖动对不同的像素行造成不同的影响的情况下,将目标帧图像的抖动量的计算划分到各个目标像素行,从而提升了对目标帧图像的抖动量计算的准确性。With the electronic device shown in this embodiment, when calculating the jitter of the target frame image, the sub-target shake amount of the target pixel row included in the target frame image may be first determined, and after determining the sub-target shake amount, The amount of jitter of the target frame image can be determined. It can be seen that, by using the method shown in this embodiment, the calculation of the jitter amount of the target frame image is divided into various cases based on the same jitter affecting different pixel rows. The target pixel row improves the accuracy of the jitter calculation for the target frame image.
结合本发明实施例第二方面的第五种实现方式,本发明实施例第二方面的第六种实现方式中,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 computing unit includes:
计算模块,用于根据所述目标采样时间点和所述目标采样数据计算位于所述目标像素行内任一目标像素的目标坐标;a calculation module, configured to calculate target coordinates of any target pixel located in the target pixel row according to the target sampling time point and the target sampling data;
本实施例所示的计算模块用于执行本发明实施例第一方面所示的步骤B011,具体执行过程请详见上述所示,具体不作赘述。The calculation module shown in this embodiment is used to perform the step B011 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
第一确定模块,用于若位于所述目标像素行内的所述目标像素的数目为一个,则所述子目标抖动量为所述目标坐标与原点坐标之间的距离;a first determining module, configured to: if the number of the target pixels located in the target pixel row is one, the sub-target jitter amount is a distance between the target coordinate and the origin coordinate;
本实施例所示的第一确定模块用于执行本发明实施例第一方面所示的步骤B012,具体执行过程请详见上述所示,具体不作赘述。The first determining module shown in this embodiment is used to perform the step B012 shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
第二确定模块,用于若位于所述目标像素行内的所述目标像素的数目为至少两个,则设置目标集合,所述目标集合包括多个目标距离,所述目标距离为所有所述目标坐标中任意两个所述目标坐标之间的距离,且所述目标距离还为任一所述目标坐标与所述原点坐标之间的距离;a second determining module, configured to set a target set if the number of the target pixels located in the target pixel row is at least two, the target set includes a plurality of target distances, and the target distance is all the targets a distance between any two of the target coordinates in the coordinate, and the target distance is also a distance between any of the target coordinates and the origin coordinate;
本实施例所示的第二确定模块用于执行本发明实施例第一方面所示的步骤B013,具体执行过程请详见上述所示,具体不作赘述。The second determining module shown in this embodiment is used to perform the step B013 shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
第三确定模块,用于获取所述子目标抖动量,所述子目标抖动量为位于所 述目标集合内的所有所述目标距离中的最大值。a third determining module, configured to acquire the sub-target jitter amount, where the sub-target jitter amount is located at the location The maximum of all of the target distances within the set of targets.
本实施例所示的第三确定模块用于执行本发明实施例第一方面所示的步骤B014,具体执行过程请详见上述所示,具体不作赘述。The third determining module shown in this embodiment is used to perform the step B014 shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
结合本发明实施例第二方面的第六种实现方式,本发明实施例第二方面的第七种实现方式中,所述计算模块包括:With reference to the sixth implementation manner of the second aspect of the embodiment of the present invention, in the seventh implementation manner of the second aspect of the embodiment, the computing module includes:
第一获取子模块,用于获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿X轴平移的第一抖动数据;a first acquiring sub-module, configured to acquire first jitter data that is located on the X-axis of any target pixel in the target pixel row at the target sampling time point;
本实施例所示的第一获取子模块用于执行本发明实施例第一方面所示的步骤B0111,具体执行过程请详见上述所示,具体不作赘述。The first obtaining sub-module shown in this embodiment is used to perform the step B0111 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
第一计算子模块,用于对所述第一抖动数据进行积分运算以获取第一坐标数据;a first calculation submodule, configured to perform an integration operation on the first jitter data to obtain first coordinate data;
本实施例所示的第一计算子模块用于执行本发明实施例第一方面所示的步骤B0112,具体执行过程请详见上述所示,具体不作赘述。The first calculation sub-module shown in this embodiment is used to perform the step B0112 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
第二获取子模块,用于获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿Y轴平移的第二抖动数据;a second acquiring sub-module, configured to acquire second jitter data that is located on the Y-axis of any target pixel in the target pixel row at the target sampling time point;
本实施例所示的第二获取子模块用于执行本发明实施例第一方面所示的步骤B0113,具体执行过程请详见上述所示,具体不作赘述。The second obtaining sub-module shown in this embodiment is used to perform the step B0113 shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
第二计算子模块,用于对所述第二抖动数据进行积分运算以获取第二坐标数据;a second calculation submodule, configured to perform an integration operation on the second jitter data to obtain second coordinate data;
本实施例所示的第二计算子模块用于执行本发明实施例第一方面所示的步骤B0114,具体执行过程请详见上述所示,具体不作赘述。The second calculation sub-module shown in this embodiment is used to perform the step B0114 shown in the first aspect of the embodiment of the present invention. For details, refer to the above description, and details are not described herein.
确定子模块,用于位于所述目标像素行内任一目标像素的目标坐标包括目标横坐标和目标纵坐标,确定所述目标横坐标为所述第一坐标数据,所述目标纵坐标为所述第二坐标数据。Determining a sub-module, wherein target coordinates for any target pixel located in the target pixel row include a target abscissa and a target ordinate, determining that the target abscissa is the first coordinate data, and the target ordinate is the Second coordinate data.
本实施例所示的确定子模块用于执行本发明实施例第一方面所示的步骤B0115,具体执行过程请详见上述所示,具体不作赘述。The determining sub-module shown in this embodiment is used to perform the step B0115 shown in the first aspect of the embodiment of the present invention. For details, refer to the foregoing description, and details are not described herein.
本发明实施例第三方面提供了一种电子设备,包括:A third aspect of the embodiments of the present invention provides an electronic device, including:
一个或多个微计算机、图像存储器、总线系统、以及一个或多个程序,所述微计算机和所述图像存储器通过所述总线系统相连; One or more microcomputers, image memories, bus systems, 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 that, when executed by the electronic device, cause the electronic device to perform an embodiment of the present invention The method according to any one of the seventh aspect of the first aspect 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 including instructions that, when executed by an electronic device, cause the electronic device to perform, for example The method according to any one of the first aspect of the embodiments of the present invention to the seventh implementation manner of the first aspect of the present invention.
本实施例提供了一种图像输出方法以及电子设备,采用本实施例所示的方法无需对所获取到的所有帧图像进行对比度的计算,只需要对当前的第一目标帧图像的抖动量进行计算,若计算出当前的第一目标帧图像的抖动量小于或等于预设值,则直接输出当前的所述第一目标帧图像,而无需对按曝光结束时间排序在当前的所述第一目标帧图像后面的帧图像的抖动量进行计算,从而节省了对帧图像进行计算所耗费的时长,在保障了电子设备输出图像的清晰度的情况下,提升了输出图像的效率。The embodiment provides an image output method and an electronic device. The method shown in this embodiment does not need to calculate the contrast of all the acquired frame images, and only needs to perform the jitter amount of the current first target frame image. Calculating, if the jitter amount of the current first target frame image is calculated to be less than or equal to the preset value, directly outputting the current first target frame image without sorting the exposure end time in the current first The amount of jitter of the frame image behind the target frame image is calculated, thereby saving the time taken for calculating the frame image, and improving the efficiency of the output image while ensuring the sharpness of the output image of the electronic device.
附图说明DRAWINGS
图1为本发明所提供的电子设备的一种实施例结构示意图;1 is a schematic structural view of an embodiment of an electronic device according to the present invention;
图2为本发明所提供的电子设备所拍摄的原始图像一种实施例示意图;2 is a schematic diagram of an embodiment of an original image taken by an electronic device according to the present invention;
图3为本发明所提供的一种测试环境中,电子设备抖动角速度和曝光时间的关系示意图;3 is a schematic diagram showing relationship between an angular velocity of an electronic device and an exposure time in a test environment according to the present invention;
图4为本发明所提供的另一种测试环境中,电子设备抖动角速度和曝光时间的关系示意图;4 is a schematic diagram showing the relationship between the angular velocity of the electronic device and the exposure time in another test environment provided by the present invention;
图5为本发明所提供的输出图像的一种实施例示意图;FIG. 5 is a schematic diagram of an embodiment of an output image provided by the present invention; FIG.
图6为本发明所提供的输出图像的另一种实施例示意图;6 is a schematic diagram of another embodiment of an output image provided by the present invention;
图7为本发明所提供的图像输出方法的一种实施例步骤示意图;FIG. 7 is a schematic diagram showing the steps of an embodiment of an image output method according to the present invention; FIG.
图8为本发明所提供的图像输出的一种实施例时序示意图;FIG. 8 is a timing diagram of an embodiment of an image output provided by the present invention; FIG.
图9为本发明所提供的帧图像和曝光函数的一种实施例示意图;9 is a schematic diagram of an embodiment of a frame image and an exposure function provided by the present invention;
图10为本发明所提供的抖动前后的一种实施例结构示意图;10 is a schematic structural view of an embodiment before and after shaking provided by the present invention;
图11为本发明所提供的抖动前后的另一种实施例结构示意图; 11 is a schematic structural view of another embodiment before and after shaking provided by the present invention;
图12为本发明所提供对电子设备的镜头平移抖动和旋转抖动对图像的质量的影响的一种实施例示意图;12 is a schematic diagram of an embodiment of an effect of lens shift jitter and rotational jitter on an image quality of an electronic device according to the present invention;
图13为本发明所提供的图像输出的另一种实施例时序示意图;FIG. 13 is a timing diagram of another embodiment of image output provided by the present invention; FIG.
图14为本发明所提供的用于表示目标坐标的坐标系的一种实施例示意图;14 is a schematic diagram of an embodiment of a coordinate system for representing target coordinates provided by the present invention;
图15为本发明所提供的电子设备的另一种实施例结构示意图;15 is a schematic structural diagram of another embodiment of an electronic device according to the present invention;
图16为本发明所提供的图像输出方法的另一种实施例步骤示意图;16 is a schematic diagram showing the steps of another embodiment of an image output method according to the present invention;
图17为本发明所提供的图像输出的另一种实施例时序示意图。FIG. 17 is a timing diagram of another embodiment of image output provided by the present invention.
具体实施方式detailed description
本发明实施例提供了一种能够保障电子设备能够输出清晰的图像的同时,还能够提升电子设备输出图像的效率的图像输出方法。Embodiments of the present invention provide an image output method capable of ensuring that an electronic device can output a clear image while improving the efficiency of outputting an image of the electronic device.
为更好的说明为本发明实施例所提供的方法,首先结合图1所示对能够实现本发明实施例所示的方法的电子设备的结构进行说明。For a better description of the method provided by the embodiments of the present invention, first, the structure of an electronic device capable of implementing the method shown in the embodiment of the present invention will be described with reference to FIG.
本实施例对所述电子设备不作限定,只要所述电子设备能够进行图像的拍摄以及能够进行图像处理即可,例如,所述电子设备可为智能手机,计算机,平板电脑,数码相机等,具体在本实施例中不作限定。In this embodiment, the electronic device is not limited, as long as the electronic device can perform image capturing and image processing, for example, the electronic device can be a smart phone, a computer, a tablet computer, a digital camera, etc. This embodiment is not limited.
其中,图1为本发明所提供的电子设备的一种实施例结构示意图。1 is a schematic structural view of an embodiment of an electronic device provided by the present invention.
摄像光学系统101在图像传感器102上形成被摄体图像(未示出)。The imaging optical system 101 forms an object image (not shown) on the image sensor 102.
其中,图1示出由单个透镜构成的摄像光学系统101,但摄像光学系统101通常包括诸如变焦透镜和调焦透镜等的多个透镜和光圈等以使得能够控制变焦、调焦和入射光量等。1 shows an imaging optical system 101 composed of a single lens, but the imaging optical system 101 generally includes a plurality of lenses such as a zoom lens and a focus lens, and an aperture or the like to enable control of zooming, focusing, and amount of incident light, and the like. .
本实施例的图像传感器102是包括二维配置的多个光电转换元件的CMOS图像传感器,并且从图像传感器102的上部分向下部分、顺次输出在各帧期间针对各线以不同定时所累积的电荷。The image sensor 102 of the present embodiment is a CMOS image sensor including a plurality of photoelectric conversion elements configured in two dimensions, and the sequential output from the upper portion to the lower portion of the image sensor 102 is accumulated at different timings for each line during each frame. The charge.
如上所述,该驱动方法称为卷帘快门(英文全称:rolling shutter,英文简称:RS)。图像传感器102使用卷帘快门方法将利用摄像光学系统101所形成的被摄体图像转换成用作图像信号的电气信号,并且将转换后的电气信号提供给信号处理单元103。 As described above, the driving method is called a rolling shutter (English full name: rolling shutter, English abbreviation: RS). The image sensor 102 converts an object image formed using 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.
近年来,用作在电子设备中使用的图像传感器的CMOS图像传感器已经变得迅速普及。在使用CMOS图像传感器来拍摄运动图像的情况下,广泛使用从CMOS图像传感器的上部分向下部分逐行地顺次读出累积电荷的读出方法。该读出方法称为卷帘快门方法,并且具有图像传感器的上下部分之间的读出定时不同的特征。由于该特征,因而在抖动电子设备并且移动摄像面上的被摄体的位置的情况下,在拍摄图像中产生由图像传感器的电荷读出定时不同所导致的失真(卷帘快门失真)。In recent years, CMOS image sensors used as image sensors used in electronic devices have become rapidly popular. In the case of capturing a moving image using a CMOS image sensor, a readout method of sequentially reading accumulated charges from the upper portion to the lower portion of the CMOS image sensor in a row is widely used. This readout method is called a rolling shutter method, and has a feature that the readout timing between the upper and lower portions of the image sensor is different. Due to this feature, in the case of shaking the electronic device and moving the position of the subject on the imaging surface, distortion (rolling shutter distortion) caused by the difference in charge readout timing of the image sensor is generated in the captured image.
本实施例所示的图像输出方法能够利用图像处理来校正这种卷帘快门失真。具体请详见下述实施例所示。The image output method shown in this embodiment can utilize image processing to correct such rolling shutter distortion. Please refer to the following examples for details.
信号处理单元103根据图像传感器102所获得的图像信号来生成符合例如NTSC格式的视频信号,并且将所生成的视频信号提供给图像图像存储器104。The signal processing unit 103 generates a video signal conforming to, for example, the NTSC format based on the image signal obtained by the image sensor 102, and supplies the generated video signal to the image image memory 104.
角速度传感器111检测电子设备100的抖动作为角速度信号,并且将该角速度信号提供给A/D转换器112。The angular velocity sensor 111 detects the jitter of the electronic device 100 as an angular velocity signal, and supplies the angular velocity signal to the A/D converter 112.
A/D转换器112对来自角速度传感器111的角速度信号进行数字化,并且将作为角抖动数据的数字化信号提供给设置在微计算机110。The A/D converter 112 digitizes the angular velocity signal from the angular velocity sensor 111, and supplies the digitized signal as the angular jitter data to the microcomputer 110.
所述微计算机110对所述数字化信号进行计算,并将计算得到的相关数据发送给元数据生成单元116。The microcomputer 110 calculates the digitized signal and transmits the calculated correlation data to the metadata generating unit 116.
元数据生成单元116基于从所述微计算机110所提供的数据来生成元数据,并且将所生成的元数据记录在记录介质108中。The metadata generating unit 116 generates metadata based on data supplied from the microcomputer 110, and records the generated metadata in the recording medium 108.
记录介质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.
显示装置106,所述显示装置106包括例如液晶显示元件(LCD)等,并且显示从所述微计算机110输出的图像。The display device 106 includes, for example, a liquid crystal display element (LCD) or the like, and displays an image output from the microcomputer 110.
以下对电子设备进行拍照的过程中,抖动对图像清晰度的影响进行说明。The following describes the effect of jitter on image sharpness during photographing of an electronic device.
首先参见图2所示,图2所示为原始的清晰图像,则本实施例所示的原始图像的点扩散函数PSF的宽度的原始值为无穷小。Referring first to FIG. 2, which shows the original sharp image, the original value of the width of the point spread function PSF of the original image shown in this embodiment is infinitesimal.
其中,点扩散函数PSF用来衡量图像的分辨率,且图像的PSF的宽度越小, 则说明图像越清晰。Wherein, the point spread function PSF is used to measure the resolution of the image, and the smaller the width of the PSF of the image, Then the more clear the image.
本实施例所示的电子设备能够对所述原始图像进行拍摄以生成拍摄后的图像,为更好说明抖动对图像清晰度的应用,则本实施例将所述电子设备置于测试台上,本实施例所示的测试台是指,能够模拟抖动过程的设备。The electronic device shown in this embodiment can capture the original image to generate a captured image. To better illustrate the application of jitter to image sharpness, the embodiment places the electronic device on a test bench. The test bench shown in this embodiment refers to a device capable of simulating a jitter process.
本实施例的测试环境为对焦正常,且曝光正常的场景。The test environment of this embodiment is a scene in which the focus is normal and the exposure is normal.
首先对电子设备进行第一测试,所述第一测试结合图3和图4所示,在图3和图4的坐标系中,横坐标是曝光时间,单位是毫秒,纵坐标是电子设备的角速度传感器所获取到的角速度。First, the first test is performed on the electronic device. The first test is combined with FIG. 3 and FIG. 4. In the coordinate system of FIG. 3 and FIG. 4, the abscissa is the exposure time in milliseconds, and the ordinate is the electronic device. The angular velocity obtained by the angular velocity sensor.
在图3和图4所示中,将电子设备置于抖动相同的环境中,即图3和图4所示的不同的测试中,所述角速度传感器所获取到的角速度是相同的。In Figures 3 and 4, the electronic devices are placed in the same environment where the jitter is the same, i.e., in the different tests shown in Figures 3 and 4, the angular velocities obtained by the angular velocity sensors are the same.
在图3所示的测试环境中,当前帧图像的曝光起始时间为start,曝光结束时间为end,则图3所示的帧图像的曝光时间为end-start。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 the exposure time of the frame image shown in FIG. 3 is end-start.
在图4所示的测试环境中,当前帧图像的曝光起始时间为start,曝光结束时间为end,则图4所示的帧图像的曝光时间为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 the exposure time of the frame image shown in FIG. 4 is end-start.
图3相对于图4可知,图3的帧曝光时间长于图4所示的帧曝光时间,采用图3所示的曝光时间所输出的图像请参见图5所示,图4所示的曝光时间所输出的图像请参见图6所示,对比图5和图6所示可知,图6所示的图像的清晰度高于图5所示的图像的清晰度,即图6所示的PSF的宽度小于图5所示的PSF的宽度。3, relative to FIG. 4, the frame exposure time of FIG. 3 is longer than the frame exposure time shown in FIG. 4. The image output by using the exposure time shown in FIG. 3 is shown in FIG. 5, and the exposure time shown in FIG. The output image is shown in FIG. 6. As shown in FIG. 5 and FIG. 6, the sharpness of the image shown in FIG. 6 is higher than the sharpness of the image shown in FIG. 5, that is, the PSF shown in FIG. The width is smaller than the width of the PSF shown in FIG.
可见,在同样的抖动的测试环境中,曝光时间越长,则图像的PSF的宽度越大,即曝光时间越长,则图像的清晰度越低。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, that is, the longer the exposure time, the lower the sharpness of the image.
同理,可将电子设备置于相同的曝光时间,但抖动不同的环境,具体测试过程在本实施例中不作赘述,在同样的曝光时间的测试环境下,抖动越大,则图像的PSF的宽度越大,即抖动越大,则图像的清晰度越低。Similarly, the electronic device can be placed in the same exposure time, but the jitter is different. The specific test process is not described in this embodiment. In the test environment of the same exposure time, the larger the jitter, the PSF of the image. The larger the width, that is, the larger the jitter, the lower the sharpness of the image.
由上述所示可知,图像的清晰度取决于曝光过程中,电子设备抖动的剧烈程度以及曝光时间的长短。同时电子设备不同的运动形式,对图像质量的影响也不完全一致。As can be seen from the above, the sharpness of the image depends on the severity of the jitter of the electronic device and the length of the exposure time during the exposure process. At the same time, the different motion forms of electronic devices have no obvious impact on image quality.
本实施例所示的图像输出方法,基于帧图像的曝光时间以及抖动情况进行 分析,从而能够输出清晰的图像,以下结合图7所示对本实施例所提供的图像输出方法的具体流程进行详细说明,其中,图7为本发明所提供的图像输出方法的一种实施例步骤流程图。The image output method shown in this embodiment is based on the exposure time and jitter of the frame image. The detailed process of the image output method provided by the embodiment is described in detail below with reference to FIG. 7 , wherein FIG. 7 is an embodiment of the image output method provided by the present invention. flow chart.
步骤701、确定目标采样时间点。Step 701: Determine a target sampling time point.
本实施例所示的电子设备可预先设定有采样时间点。The electronic device shown in this embodiment may be preset with a sampling time point.
具体的,本实施例所示的所述采样时间点可周期性设置,且本实施例采样周期的长度不作限定,本实施例所示的采样周期为任意相邻的两个采样时间点之间的间隔。Specifically, the sampling time point shown in this embodiment may be periodically set, and the length of the sampling period in this embodiment is not limited. The sampling period shown in this embodiment is between any two adjacent sampling time points. Interval.
例如,本实施例以所述采样周期为10毫秒为例,则本实施例所示每隔10毫秒设置有一个所述采样时间点。For example, in the embodiment, the sampling period is 10 milliseconds, and one sampling time point is set every 10 milliseconds as shown in this embodiment.
采用本实施例所示的方法,电子设备能够获取传感器上报的按时间排序的帧图像序列,所述帧图像序列包括多个按曝光结束时间先后顺序排序的帧图像。With the method shown in this embodiment, the electronic device can acquire a time-ordered frame image sequence reported by the sensor, and the frame image sequence includes a plurality of frame images sorted in order of exposure end time.
本实施例所示的电子设备会首先判断当前的第一目标帧图像是否满足输出条件。The electronic device shown in this embodiment first determines whether the current first target frame image satisfies an output condition.
可选的,在首次执行本发明实施例所示的方法时,所述第一目标帧图像可为所述帧图像序列中按时间排序排位在第一位的帧图像。Optionally, when the method shown in the embodiment of the present invention is performed for the first time, the first target frame image may be a frame image that is ranked in the first place in the frame image sequence by time.
可选的,本实施例所示的帧图像也可为所述电子设备在所述帧图像序列中随机选定的帧图像,可见,本实施例对所述第一目标帧图像位于所述帧图像序列中的具体位置不作限定,只要所述第一目标帧图像可为所述帧图像序列中的任一帧图像即可。Optionally, the frame image shown in this embodiment may also be a frame image that is randomly selected by the electronic device in the frame image sequence, and the embodiment is that the first target frame image is located in the frame. The specific position in the sequence of images is not limited as long as the first target frame image can be any frame image in the sequence of frame images.
本实施例以所述第一目标帧图像可为所述帧图像序列中按时间排序排位在第一位的帧图像为例进行说明。In this embodiment, the first target frame image may be an example of arranging the frame images ranked first in the frame image sequence as an example.
本实施例中,为确定是否输出所述第一目标帧图像,则首先需要确定所述第一目标帧图像的曝光时间。In this embodiment, in order to determine whether to output the first target frame image, it is first necessary to determine an 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 sensor reporting data will be described below.
以图8所示为例,其中,图8为本发明所提供的图像输出的一种实施例时 序示意图。8 is taken as an example, wherein FIG. 8 is an embodiment of image output provided by the present invention. Schematic diagram.
本实施例中,所述电子设备能够获取帧图像序列中所包括的各个帧图像的曝光时间、帧率FR以及最大帧率等。In this embodiment, the electronic device can acquire an exposure time, a frame rate FR, a maximum frame rate, and the like of each frame image included in the frame image sequence.
本实施例所示的帧率FR为每秒显示的帧数,即本实施例所示的帧率用于指示每秒出现帧同步信号EOF的次数。The frame rate FR shown in this embodiment is the number of frames displayed per second, that is, the frame rate shown in this embodiment is used to indicate the number of times the frame synchronization signal EOF appears every second.
可见,通过所述传感器上报的所述帧率,所述电子设备能够确定每秒出现的图像帧以及各图像帧曝光结束的时间点。It can be seen that, by the frame rate reported by the sensor, the electronic device can determine an image frame that appears every second and a time point at which the exposure of each image frame ends.
以图8所示为例,其中,图8以曝光的帧图像为第一目标帧图像和第二目标帧图像为例进行示例性说明。Taking FIG. 8 as an example, FIG. 8 exemplifies an example in which the exposed frame image is the first target frame image and the second target frame image.
需明确的是,本实施例对具体进行曝光的帧图像的数目不作限定,且本实施例对帧图像的曝光时间以及帧同步信号EOF的时间的说明为可选的示例,不作限定。It should be noted that the number of the frame images that are specifically exposed is not limited in this embodiment, and the description of the exposure time of the frame image and the time of the frame synchronization signal EOF in this embodiment is an optional example, which is not limited.
以图8所示为例,图8所示的横坐标为时间,单位是毫秒,纵坐标为传感器底片上所形成的第一目标帧图像的像素阵列的行号。Taking FIG. 8 as an example, the abscissa shown in FIG. 8 is time, the unit is millisecond, and the ordinate is the line number of the pixel array of the first target frame image formed on the sensor film.
具体的,若本实施例所示的在传感器上所形成的底片的大小为12M,包括4000*3000个像素,则纵坐标有4000行,每行有3000个像素。Specifically, if the size of the negative film formed on the sensor shown in this embodiment is 12M, including 4000*3000 pixels, the ordinate has 4000 lines and each line has 3000 pixels.
本实施例所示的方法应用可应用于卷帘快门rolling shutter机制中,以传感器所形成的第一目标帧图像为例,函数71为所述第一目标帧图像的每一像素行的帧曝光起始时间,函数72为所述第一目标帧图像的每一像素行的帧曝光结束时间,又以传感器所形成的第二目标帧图像为例,函数73为所述第二目标帧图像的每一像素行的帧曝光起始时间,函数74为所述第二目标帧图像的每一像素行的帧曝光结束时间。The method application shown in this embodiment can be applied to a rolling shutter mechanism of a rolling shutter. Taking a first target frame image formed by the sensor as an example, the function 71 is a frame exposure of each pixel row of the first target frame image. The start time, the function 72 is the frame exposure end time of each pixel row of the first target frame image, and the second target frame image formed by the sensor is taken as an example, and the function 73 is the second target frame image. The frame exposure start time of each pixel row, function 74 is the frame exposure end time of each pixel row of the second target frame image.
可见,本实施例在传感器上所形成的帧图像的每个像素行的曝光起始时间是依次递增的,且传感器上所形成的帧图像的每个像素行的曝光结束时间也是依次递增的,在如图8所示,本实施例所述的第一目标帧图像和第二目标帧图像在图8所示的坐标系中所形成的函数呈平行四边形结构。It can be seen that, in this 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. As shown in FIG. 8, the functions formed by the first target frame image and the second target frame image in the present embodiment in the coordinate system shown in FIG. 8 have a parallelogram structure.
本实施例所示的传感器在第一目标帧图像在最后一像素行中的最后一个像素曝光结束时发出第一帧同步信号EOF,所述第一EOF用于指示第一目标帧图像的帧曝光结束时间。 The sensor shown in this embodiment sends a first frame synchronization signal EOF when the first target frame image ends the last pixel exposure in the last pixel row, and the first EOF is used to indicate the frame exposure of the first target frame image. End Time.
本实施例所示的传感器在第二目标帧图像在最后一像素行中的最后一个像素曝光结束时发出第二帧同步信号EOF,所述第二EOF用于指示第二目标帧图像的帧曝光结束时间。The sensor shown in this embodiment sends a second frame synchronization signal EOF when the second target frame image ends the last pixel exposure in the last pixel row, and the second EOF is used to indicate the frame exposure of the second target frame image. End Time.
本实施例中,在传感器上所形成的帧图像的序列中,在时刻上任意相邻的两个帧图像中,位于前一时刻的帧图像的曝光结束时间和位于下一时刻的帧图像的帧曝光起始时间之间具有曝光间隔gap time,本实施例所示的所述传感器上所形成的帧图像的序列中,各所述曝光间隔gap time均相等,且所述曝光间隔gap time=1000/FR。In this embodiment, in the sequence of frame images formed on the sensor, in the two adjacent frame images at the time, the exposure end time of the frame image located at the previous moment and the frame image at the next moment are Between the frame exposure start time and the exposure interval gap time, in the sequence of frame images formed on the sensor shown in this embodiment, each of the exposure intervals gap time is equal, and the exposure interval gap time= 1000/FR.
本实施例中,在所述第一目标帧图像的曝光时间内确定目标采样时间点,所述目标采样时间点为位于第一目标帧图像的曝光时间内的至少一个采样时间点中的任一采样时间点。In this embodiment, the target sampling time point is determined during an exposure time of the first target frame image, and the target sampling time point is any one of at least one sampling time point located in an exposure time of the first target frame image. Sampling time point.
如图8所示,第一目标帧图像的曝光时间为T1,则所述目标采样时间点位于T1的时间段内。As shown in FIG. 8, the exposure time of the first target frame image is T1, and the target sampling time point is located in the time period of T1.
如图8所示为例,本实施例所示的采样时间点t1、t2、t3、t4以及t5位于所述第一目标帧图像的曝光时间T1内。As shown in FIG. 8, the sampling time points t1, t2, t3, t4, and t5 shown in this embodiment are located within the exposure time T1 of the first target frame image.
则本实施例所示的采样时间点t1、t2、t3、t4以及t5为所述目标采样时间点。Then, the sampling time points t1, t2, t3, t4, and t5 shown in this embodiment are the target sampling time points.
本实施例所示的采样间隔以10毫秒为例,即t1与t2之间的时间间隔为10毫秒,依次类推,t4与t5之间的时间间隔为10毫秒。The sampling interval shown in this embodiment is exemplified by 10 milliseconds, that is, the time interval between t1 and t2 is 10 milliseconds, and so on, and the time interval between t4 and t5 is 10 milliseconds.
步骤702、确定目标像素行。Step 702: Determine a target pixel row.
本实施例所示的电子设备在所述目标采样时间点获取采样数据。The electronic device shown in this embodiment acquires sampling data at the target sampling time point.
本实施例中,所述电子设备每隔一个所述采样周期采集一次采样数据,具体的,本实施例所示的所述采样数据为传感器在所述采样时间点上报的数据。In this embodiment, the electronic device collects sampling data once every other sampling period. Specifically, the sampling data shown in this embodiment is data reported by the sensor at the sampling time point.
需明确的是,本实施例对输出图像过程中所设定的采样时间点以及采样间隔不作限定,本实施例只是进行可选示例的说明。It should be clarified that the sampling time point and the sampling interval set in the process of outputting an image are not limited in this embodiment, and this embodiment is merely an explanation of an optional example.
本实施例所示的电子设备分别在目标采样时间点t1、t2、t3、t4以及t5时刻获取传感器上报的数据。The electronic device shown in this embodiment acquires the data reported by the sensor at the 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 jitter on a frame image will be described below with reference to the accompanying drawings.
如图9所示,其中,图9为本发明所提供的帧图像和曝光函数的一种实施例示意图。其中,帧图像801呈平行四边形的说明请详见上述实施例所示,具体在本实施例中不作赘述。As shown in FIG. 9, FIG. 9 is a schematic diagram of an embodiment of a frame image and an exposure function provided by the present invention. The description of the frame image 801 in the form of a parallelogram is shown in the above embodiment, and is not described in detail in this embodiment.
需明确的,本实施例图9所示以抖动稳定的场景为例,在抖动稳定的情况下,本实施例所述的抖动函数802呈四边形结构。It should be understood that the jitter stable 802 is a quadrilateral structure in the case where the jitter is stable, as shown in FIG.
对于抖动函数802只在时间段803内出现抖动,则该抖动只对帧图像801中在时间段803内进行曝光的像素有影响。For jitter function 802 to exhibit jitter only during time period 803, the jitter only affects pixels in frame image 801 that are exposed during time period 803.
本实施例所示的抖动函数802对帧图像中不同的像素行具有不同的影响,具体的,以帧图像中的两个像素行为例,即像素行line1和line2为例,需明确的是,本实施例对line1和line2在所述帧图像中的具体行号不作限定。The dithering function 802 shown in this embodiment has different effects on different pixel rows in the frame image. Specifically, taking two pixel behavior examples in the frame image, that is, the pixel rows line1 and line2 as an example, it is necessary to be clear that This embodiment does not limit the specific line numbers of line1 and line2 in the frame image.
所述抖动函数802对line1的影响,为所述抖动函数802与line1的第一重合面积,而所述抖动函数802对line2的影响,为所述抖动函数802与line2的第二重合面积,由图9所示可知,第一重合面积与所述第二重合面积不相同,则相同的抖动函数802对相同的帧图像的不同的像素行具有不同的影响。The influence of the dithering function 802 on the line1 is the first overlapping area of the dithering function 802 and the line1, and the influence of the dithering function 802 on the line2 is the second overlapping area of the dithering function 802 and the line2, As shown in FIG. 9, the first overlapping area is different from the second overlapping area, and the same dithering function 802 has different effects on different pixel rows of the same frame image.
在抖动稳定的场景时,相同的抖动对帧图像中不同的像素行能够造成不同的影响,那么在抖动不稳定的场景,则抖动更会对帧图像中不同的像素行能够造成不同的影响。In a scene with stable jitter, the same jitter can have different effects on different pixel rows in the frame image. In a scene with unstable jitter, the jitter can have different effects on different pixel rows in the frame image.
可见,抖动量的只对帧图像中的单行像素有效,为了准确的确定抖动对整幅帧图像的影响,则需要确定抖动对帧图像的单个像素行所造成的影响。It can be seen that the amount of jitter is only valid for a single row of pixels in the frame image. In order to accurately determine the influence of the jitter on the entire frame image, it is necessary to determine the influence of the jitter on the single pixel row of the frame image.
以下对如何获取目标像素行的子目标抖动量进行说明,其中,所述子目标抖动量为抖动对目标像素行所造成的影响,本实施例所示的目标像素行为所述第一目标帧图像所包括的任一行像素。The following describes how to obtain the sub-target jitter amount of the target pixel row, where the sub-target jitter amount is the influence of the jitter on the target pixel row, and the target pixel shown in this embodiment acts as the first target frame image. Any row of pixels included.
可选的,为了准确的计算目标像素行的抖动量,则可确定所述第一目标帧图像所包括的任一行像素开始曝光的时间,确定所述目标像素行,其中,所述目标像素行的开始曝光的时间与所述目标采样时间点重合。Optionally, in order to accurately calculate the amount of jitter of the target pixel row, determining a time at which any row of pixels included in the first target frame image starts to be exposed, determining the target pixel row, wherein the target pixel row The time at which the exposure starts is coincident with the target sampling time point.
继续如图8所示,本实施例以所述目标像素行为line1和line2为例进行说明,且line1的开始曝光的时间与采样时间点t1重合,line2的开始曝光的时间与采样时间点t2重合。 Continuing with FIG. 8, the present embodiment is described by taking the target pixel behaviors line1 and line2 as an example, and the start exposure time of line1 coincides with the sampling time point t1, and the start exposure time of line2 coincides with the sampling time point t2. .
需明确的是,本实施例对所述目标像素行的说明为可选的示例,不作限定,只要所述目标像素行为所述第一帧图像所包括的像素行即可。It should be noted that the description of the target pixel row in this embodiment is an optional example, which is not limited as long as the target pixel acts on the pixel row included in the first frame image.
需明确的是,本实施例所示的方法确定出的目标像素行越多,则对图像帧进行计算以获取到的抖动量就越精确,本实施例所示可预先设置有目标像素行阈值,则在确定所述目标像素行时,可获取到数目为目标像素行阈值的所述目标像素行。It should be clarified that the more the target pixel rows are determined by the method shown in this embodiment, the more accurate the jitter is obtained by calculating the image frame, and the target pixel row threshold may be preset in this embodiment. And, when determining the target pixel row, the target pixel row whose number is the target pixel row threshold may be acquired.
在具体应用中,可根据对输出图像的精度的不同的要求,设置不同的目标像素行阈值,目标像素行阈值越大,则输出的图像的清晰度越高。In a specific application, different target pixel row thresholds may be set according to different requirements on the accuracy of the output image. The larger the target pixel row threshold is, the higher the resolution of the output image is.
步骤703、确定所述目标像素行内的目标像素。Step 703: Determine a target pixel in the target pixel row.
本实施例所示的所述目标像素为曝光时间为所述目标采样时间点的像素。The target pixel shown in this embodiment is a pixel whose exposure time is the target sampling time point.
本实施例中,如图8所示,line1中的目标像素为像素P1、P2以及P3,P1的曝光时间为t1,P2的曝光时间为t2、P3的曝光时间为t3,本实施例对所述目标像素行所包括的目标像素的数目不作限定,本实施例以3个为例。In this embodiment, as shown in FIG. 8, the target pixels in 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. The number of target pixels included in the target pixel row is not limited. In this embodiment, three are taken as an example.
还需明确的是,若在目标像素行内确定出多个目标像素,则在具体进行子目标抖动量的计算时,可选定目标数目的目标像素进行子目标抖动量的计算。本实施例对所选定的目标数目的具体数值不作限定。It should also be clarified that if a plurality of target pixels are determined in the target pixel row, the target number of target pixels can be selected for the calculation of the sub-target jitter amount when the sub-target jitter amount is specifically calculated. The specific value of the selected target number is not limited in this embodiment.
步骤704、确定所述目标像素的目标坐标。Step 704: Determine target coordinates of the target pixel.
具体的,本实施例所述电子设备通过与目标像素对应的目标采样时间点获取目标采样数据,并根据该目标采样数据获取目标像素的目标坐标。Specifically, the electronic device in this embodiment acquires target sampling data by using a target sampling time point corresponding to the target pixel, and acquires target coordinates of the target pixel according to the target sampling data.
具体的,如图8所示的目标像素P1为例,电子设备在目标采样时间点t1获取传感器上报的采样数据,具体的,本实施例所示的采样数据为所述目标像素的抖动数据。Specifically, the target pixel P1 shown in FIG. 8 is taken as an example, and the electronic device acquires the sampled data reported by the sensor at the target sampling time point t1. Specifically, the sampled data shown in this embodiment is the jitter data of the target pixel.
本实施例所示将电子设备的抖动划分到三维坐标系中,所述三维坐标系分为X轴、Y轴以及Z轴,其中,X轴为电子设备沿上下方向平移的方向,Y轴与X轴垂直,且Y轴为电子设备沿里外的方向平移的方向,Z轴为分别与X轴、Y轴垂直,且Z轴为电子设备沿左右的方向平移的方向。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 in the up-and-down direction, and the Y-axis and The X axis is vertical, and the Y axis is a direction in which the electronic device translates in the inner and outer directions, 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 in the left and right directions.
本实施例所示的目标像素的抖动包括目标像素在目标采样时间点上沿X轴平移的第一点扩散函数数据、沿Y轴平移的第二点扩散函数数据、沿Z轴平移的第三点扩散函数数据、绕X轴旋转的第四点扩散函数数据、绕Y轴旋转的 第五点扩散函数数据以及绕Z轴旋转的第六点扩散函数数据。The jitter of the target pixel shown in this embodiment includes first point spread function data of the target pixel moving along the X axis at the target sampling time point, second point spread function data translated along the Y axis, and third translation along the Z axis. Point spread function data, fourth point spread function data rotated around the X axis, rotated about the Y axis The fifth point spread function data and the sixth point spread function data rotated about the Z axis.
本实施例中,可通过所述点扩散函数数据中的第一点扩散函数数据和第二点扩散函数数据确定目标像素的目标坐标。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 is to be noted that the first point spread function data and the second point spread function data are used to determine the target coordinates as an example, which is not limited. In other embodiments, other points may also be adopted. The process of determining the target coordinates of the diffusion function data is not described in detail in this embodiment.
以下对传感器具体如何获取所述第一点扩散函数数据和所述第二点扩散函数数据进行说明:The following describes how the sensor specifically acquires the first point spread function data and the second point spread function data:
本实施例中,在电子设备的镜头沿X轴的方向平移时,如图10所示,镜头由第一时刻的901的位置沿X轴的方向平移至第二时刻的902的位置时,第一点扩散函数数据PSF1=(a/b)d1。In this embodiment, when the lens of the electronic device is translated in the direction of the X-axis, as shown in FIG. 10, when the lens is translated from the position of the first time 901 in the direction of the X-axis to the position of the second time at 902, The point spread function data PSF1 = (a / b) d1.
需明确的是,本实施例所示的所述电子设备的镜头沿X平移前后,镜头的直径在X方向上是重合的,图10所示电子设备的镜头沿X平移前后镜头的直径相互错开是为了更好的说明镜头沿X平移前后位置的移动,图10为示意图,不作限定。It should be clarified that, before and after the lens of the electronic device shown in this embodiment is translated along X, the diameter of the lens is coincident in the X direction, and the lenses of the electronic device shown in FIG. In order to better explain the movement of the lens before and after the X translation, FIG. 10 is a schematic view, which is not limited.
其中,a为电子设备的镜头903和传感器904之间的距离,b为被摄物体905和镜头903之间的距离,即b为物距;d1为镜头偏移量,所述镜头偏移量d1为镜头移动后的位置902和移动前的位置901之间沿X轴方向的距离。Where a is the distance between the lens 903 and the sensor 904 of the electronic device, b is the distance between the object 905 and the lens 903, that is, b is the object distance; d1 is the lens shift amount, and the lens shift amount D1 is the distance in the X-axis direction between the position 902 after the lens is moved and the position 901 before the movement.
其中,1/a+1/b=1/f,所述f为电子设备镜头的焦距。Where 1/a+1/b=1/f, the f is the focal length of the lens of the electronic device.
在电子设备的镜头沿Y轴的方向平移时,对第二点扩散函数数据PSF2的获取过程,请详见对第一点扩散函数数据进行获取的过程,具体在本实施例中不做赘述,在对第二点扩散函数数据进行获取的过程中,所述镜头偏移量d1为镜头移动后的位置和移动前的位置之间沿Y轴方向的距离。When the lens of the electronic device is translated in the direction of the Y axis, the process of acquiring the second point spread function data PSF2, please refer to the process of acquiring the first point spread function data, which is not described in detail in this embodiment. In the process of acquiring the second point spread function data, the lens shift amount d1 is a distance in the Y-axis direction between the position after the lens shift and the position before the movement.
为更好的理解本发明实施例,以下结合图11所示对本发明实施例所示的电子设备的镜头旋转抖动时,点扩散函数数据PSF的获取过程进行说明:For a better understanding of the embodiments of the present invention, the acquisition process of the point spread function data PSF is described below in conjunction with the lens rotation jitter of the electronic device shown in the embodiment of the present invention.
本实施例中,在电子设备的镜头绕Z轴旋转时,如图11所示,镜头由第一时刻的1001的位置沿Z轴的方向旋转至第二时刻的1002的位置时,第六点扩散函数数据PSF6=a*tanθ。In this embodiment, when the lens of the electronic device rotates about the Z axis, as shown in FIG. 11, when the lens is rotated from the position of the first time 1001 in the direction of the Z axis to the position of the second time of 1002, the sixth point The diffusion function data PSF6 = a * tan θ.
其中,a为电子设备的镜头和传感器1004之间的距离,b为被摄物体1005 和镜头之间的距离,θ为镜头的旋转角量,具体的,θ为曝光开始时的角度和曝光结束时的角度的差。Where a is the distance between the lens of the electronic device and the sensor 1004, and b is the object 1005 The distance from the lens, θ is the amount of rotation of the lens. Specifically, θ is the difference between the angle at the start of exposure and the angle at the end of exposure.
以下结合图12所示对电子设备的镜头平移抖动和旋转抖动对图像的质量的影响进行说明:The effects of lens shift jitter and rotational jitter on the quality of the image of the electronic device are described below in conjunction with FIG. 12:
本实施例中,在镜头旋转抖动的场景和平移抖动的场景中,均设定电子设备的镜头和传感器之间的距离a=3mm,镜头偏移量d1=3mm,θ=1度,且图12所示的横坐标为物距,即被摄物体和镜头之间的距离b,单位为毫米,纵坐标为PSF的宽度。In this embodiment, in the scene of the lens rotation and the scene of the translational shake, the distance between the lens and the sensor of the electronic device is set to a=3 mm, the lens offset is d1=3 mm, and θ=1 degrees, and the figure The abscissa shown in Fig. 12 is the object distance, that is, the distance b between the object and the lens, in millimeters, and the ordinate is the width of the PSF.
由图12所示可知,曲线1101用于表示在电子设备的镜头平移时的PSF,直线1102用于表示在电子设备旋转时的PSF。As can be seen from FIG. 12, the curve 1101 is used to indicate the PSF when the lens of the electronic device is shifted, and the line 1102 is used to indicate the PSF when the electronic device is rotated.
可见,在电子设备平移抖动的情况下,PSF和物距反比例相关,而在电子设备旋转抖动的情况下,PSF和物距无关。It can be seen that in the case of the translational jitter of the electronic device, the PSF and the object distance are inversely proportional, and in the case of the rotation jitter of the electronic device, the PSF is independent of the object distance.
基于上述说明,本实施例中,所述传感器能够获取所述目标像素在所述目标采样时间点沿X轴平移的第一抖动数据。Based on the above description, in the embodiment, the sensor is capable of acquiring first jitter data of the target pixel that is translated along the X axis at the target sampling time point.
具体的,本实施例所示的传感器可在目标采样点获取第一抖动数据x(t)=PSF1,limt<t<limx。Specifically, the sensor shown in this embodiment can acquire the first jitter data x(t)=PSF1, limt<t<limx at the target sampling point.
其中,以所述目标像素为所述目标像素行中的第A个目标像素为例,且第A个所述目标像素为所述目标像素行所包括的任一目标像素,limt为所述目标像素行开始曝光的时间到第A个目标像素的曝光时间之间所间隔的时间,若第A个所述目标像素不是所述目标像素行内的最后一个像素,则limx为A*s,若第A个目标像素为所述目标像素行内的最后一个像素,则limx为所述目标像素行的曝光结束时间ex-time。Wherein, the target pixel is taken as the A-th target pixel in the target pixel row, and the A-th target pixel is any target pixel included in the target pixel row, and the lime is the target The time interval between the time when the pixel row starts to be exposed and the exposure time of the A target pixel. If the A target pixel is not the last pixel in the target pixel row, then limx is A*s, if A target pixel is the last pixel in the target pixel row, and limx is the exposure end time ex-time of the target pixel row.
具体的,本实施例所示的传感器在limt至limx的时刻之间获取对应的抖动数据,抖动数据的具体获取过程,请详见上述实施例所示,具体不做赘述。Specifically, the sensor shown in this embodiment obtains the corresponding jitter data between the time of the limt and the limx. The specific acquisition process of the jitter data is shown in the foregoing embodiment, and details are not described herein.
更具体的,以图8所示为例,对于目标像素行line1,传感器可分别在目标采样点t1、t2以及t3获取第一抖动数据x(t)。More specifically, taking FIG. 8 as an example, for the target pixel row line1, the sensor may acquire the first jitter data x(t) at the target sampling points t1, t2, and t3, respectively.
在目标采样点t1,对于目标像素行line1中的第一个目标像素P1,所述传感器获取到的第一抖动数据x(t)=PSF1,0<t≤S。At the target sampling point t1, for the first target pixel P1 in the target pixel row line1, the first jitter data x(t)=PSF1, 0<t≤S acquired by the sensor.
在目标采样点t2,对于目标像素行line1中的第二个目标像素P2,所述传 感器获取到的第一抖动数据x(t)=PSF1,S<t≤2S。At the target sampling point t2, for the second target pixel P2 in the target pixel row line1, the pass The first jitter data x(t) obtained by the sensor = PSF1, S < t ≤ 2S.
在目标采样点t3,对于目标像素行line1中的第三个目标像素P3,所述传感器获取到的第一抖动数据x(t)=PSF1,2S<t≤ex-time。At the target sampling point t3, for the third target pixel P3 in the target pixel row line1, the first jitter data x(t)=PSF1, 2S<t≤ex-time acquired by the sensor.
更具体的,对于目标像素行line1,传感器可分别在目标采样点t1、t2以及t3获取第二抖动数据y(t)。More specifically, for the target pixel row line1, the sensor may acquire the second jitter data y(t) at the target sampling points t1, t2, and t3, respectively.
在目标采样点t1,对于目标像素行line1中的第一个目标像素P1,所述传感器获取到的第二抖动数据y(t)=PSF2,0<t≤S。At the target sampling point t1, for the first target pixel P1 in the target pixel row line1, the second jitter data y(t)=PSF2, 0<t≤S acquired by the sensor.
在目标采样点t2,对于目标像素行line1中的第二个目标像素P2,所述传感器获取到的第二抖动数据y(t)=PSF2,S<t≤2S。At the target sampling point t2, for the second target pixel P2 in the target pixel row line1, the second jitter data y(t)=PSF2, S<t≤2S acquired by the sensor.
在目标采样点t3,对于目标像素行line1中的第三个目标像素P3,所述传感器获取到的第二抖动数据y(t)=PSF2,2S<t≤ex-time。At the target sampling point t3, for the third target pixel P3 in the target pixel row line1, the second jitter data y(t)=PSF2, 2S<t≤ex-time acquired by the sensor.
本实施例所示的电子设备在目标采样点t1所获取到的采样数据为Data1,所述Data1包括Data1x和Data1y,其中,Data1x为x(t)=PSF1,0<t≤S;Data1y为y(t)=PSF2,0<t≤S;The sampling data acquired by the electronic device shown in this embodiment at the target sampling point t1 is Data1, and the Data1 includes Data1x and Data1y, where Data1x is x(t)=PSF1, 0<t≤S; Data1y is y. (t) = PSF2, 0 < t ≤ S;
所述电子设备在目标采样点t2所获取到的采样数据为Data2,所述Data2包括Data2x和Data2y,其中,Data2x为x(t)=PSF1,S<t≤2S;Data2y为y(t)=PSF2,S<t≤2S;The sampling data acquired by the electronic device at the target sampling point t2 is Data2, and the Data2 includes Data2x and Data2y, where Data2x is x(t)=PSF1, S<t≤2S; Data2y is y(t)= PSF2, S<t≤2S;
所述电子设备在目标采样点t2所获取到的采样数据为Data3,所述Data3包括Data3x和Data3y,其中,Data3x为x(t)=PSF1,2S<t≤ex-time;Data3y为y(t)=PSF2,2S<t≤ex-time;The sampling data acquired by the electronic device at the target sampling point t2 is Data3, and the Data3 includes Data3x and Data3y, where Data3x is x(t)=PSF1, 2S<t≤ex-time; Data3y is y(t ) = PSF2, 2S < t ≤ ex-time;
本实施例中,电子设备在获取到所述采样数据后,即可进行积分运算以获取第一坐标数据。In this embodiment, after acquiring the sampling data, the electronic device may perform an integration operation to acquire the first coordinate data.
具体的,第一坐标数据
Figure PCTCN2016111452-appb-000003
Specifically, the first coordinate data
Figure PCTCN2016111452-appb-000003
更具体的,在目标采样点t1,对于目标像素行line1中的第一个目标像素P1,所述传感器获取到的第一坐标数据x(t)=t*Data1x,0<t≤S。More specifically, at the target sampling point t1, for the first target pixel P1 in the target pixel row line1, the first coordinate data x(t)=t*Data1x, 0<t≤S acquired by the sensor.
其中,Data1x的具体说明请详见上述所示,具体不作赘述。For details of Data1x, please refer to the above, please do not repeat them.
在目标采样点t2,对于目标像素行line1中的第二个目标像素P2,所述传感器获取到的第一坐标数据x(t)=S*Data1x+t*Data2x,S<t≤2S;At the target sampling point t2, for the second target pixel P2 in the target pixel row line1, the first coordinate data x(t)=S*Data1x+t*Data2x acquired by the sensor, S<t≤2S;
其中,Data1x、Data2x的具体说明请详见上述所示,具体不作赘述。 For details of Data1x and Data2x, please refer to the above, please do not repeat them.
在目标采样点t3,对于目标像素行line1中的第三个目标像素P3,所述传感器获取到的第一坐标数据x(t)=S*Data1x+S*Data2x+t*Data3x,2S<t≤ex-time;At the target sampling point t3, for the third target pixel P3 in the target pixel row line1, the first coordinate data acquired by the sensor x(t)=S*Data1x+S*Data2x+t*Data3x, 2S<t ≤ex-time;
其中,Data1x、Data2x、Data3x的具体说明请详见上述所示,具体不作赘述。For details of Data1x, Data2x, and Data3x, please refer to the above, and details are not described here.
电子设备在获取到所述采样数据后,即可进行积分运算以获取第二坐标数据。After acquiring the sampled data, the electronic device may perform an integration operation to acquire the second coordinate data.
Figure PCTCN2016111452-appb-000004
Figure PCTCN2016111452-appb-000004
更具体的,在目标采样点t1,对于目标像素行line1中的第一个目标像素P1,所述传感器获取到的第二坐标数据y(t)=t*Data1y,0<t≤S。More specifically, at the target sampling point t1, for the first target pixel P1 in the target pixel row line1, the second coordinate data y(t)=t*Data1y, 0<t≤S acquired by the sensor.
其中,Data1y的具体说明请详见上述所示,具体不作赘述。For details of Data1y, please refer to the above, please do not repeat them.
在目标采样点t2,对于目标像素行line1中的第二个目标像素P2,所述传感器获取到的第二坐标数据y(t)=S*Data1y+t*Data2y,S<t≤2S;At the target sampling point t2, for the second target pixel P2 in the target pixel row line1, the second coordinate data y(t)=S*Data1y+t*Data2y acquired by the sensor, S<t≤2S;
其中,Data1y、Data2y的具体说明请详见上述所示,具体不作赘述。For details of Data1y and Data2y, please refer to the above, and the details are not described here.
在目标采样点t3,对于目标像素行line1中的第三个目标像素P3,所述传感器获取到的第二坐标数据y(t)=S*Data1y+S*Data2y+t*Data3y,2S<t≤ex-time;At the target sampling point t3, for the third target pixel P3 in the target pixel row line1, the second coordinate data acquired by the sensor y(t)=S*Data1y+S*Data2y+t*Data3y, 2S<t ≤ex-time;
其中,Data1y、Data2y、Data3y的具体说明请详见上述所示,具体不作赘述。For details of Data1y, Data2y, and Data3y, please refer to the above, and the details are not described here.
则在所述目标像素行line1中,目标像素P1的目标坐标为(x(t)=t*Data1x,y(t)=t*Data1y)、在所述目标像素行line1中,目标像素P2的目标坐标为(x(t)=S*Data1x+t*Data2x,y(t)=S*Data1y+t*Data2y)、在所述目标像素行line1中,目标像素P3的目标坐标为(x(t)=S*Data1x+S*Data2x+t*Data3x,y(t)=S*Data1y+S*Data2y+t*Data3y)。Then, in the target pixel row line1, the target coordinates of the target pixel P1 are (x(t)=t*Data1x, y(t)=t*Data1y), in the target pixel row line1, the target pixel P2 The target coordinates are (x(t)=S*Data1x+t*Data2x, y(t)=S*Data1y+t*Data2y), and in the target pixel row line1, the target coordinate of the target pixel P3 is (x( t)=S*Data1x+S*Data2x+t*Data3x, y(t)=S*Data1y+S*Data2y+t*Data3y).
对于如图8所示的目标像素行line2中的各目标像素的目标坐标的获取过程,请详见对line1中的各目标像素的目标坐标的获取过程,具体在实施例中不作赘述。For the process of acquiring the target coordinates of the target pixels in the target pixel row 2 as shown in FIG. 8, please refer to the process of acquiring the target coordinates of each target pixel in line1, which is not described in detail in the embodiment.
上述说明了目标像素行内包含有多个目标像素的情况进行了说明,以下对 目标像素行内若只包含有一个目标像素,如何获取目标坐标的进行说明。The above description has been made on the case where a plurality of target pixels are included in the target pixel row, and the following If only one target pixel is included in the target pixel row, how to obtain the target coordinates will be described.
若所述目标像素行内只有一个目标像素,则说明目标像素行的曝光时间小于电子设备预设的采样间隔,若本实施例以采样间隔为10毫秒为例,则在此种情况下,所述目标像素行的曝光时间小于10毫米,从而使得所述目标像素行内只有一个目标像素。If the target pixel row has only one target pixel, the exposure time of the target pixel row is smaller than the sampling interval preset by the electronic device. If the sampling interval is 10 milliseconds as an example, in this case, The exposure time of the target pixel row is less than 10 mm such that there is only one target pixel in the target pixel row.
以图13所示为例,在第一目标帧图像中,目标像素行line1中只有一个目标像素P4,目标像素行line1的曝光时间小于采样间隔,所述采样间隔为t2与t1的时间差。For example, as shown in FIG. 13, in the first target frame image, there is only one target pixel P4 in the target pixel row line1, and the exposure time of the target pixel row line1 is smaller than the sampling interval, and the sampling interval is the time difference between t2 and t1.
本实施例所示的传感器可在目标采样点获取第一抖动数据x(t)=PSF1,limt<t<ex-time。The sensor shown in this embodiment can acquire the first jitter data x(t)=PSF1, limt<t<ex-time at the target sampling point.
其中,limt为所述目标像素行开始曝光的时间到所述目标像素的曝光时间之间所间隔的时间,ex-time为所述目标像素行的曝光结束时间。Wherein, limt is the time interval between the time when the target pixel row starts to be exposed and the exposure time of the target pixel, and ex-time is the exposure end time of the target pixel row.
具体的,本实施例所示的传感器在limt至ex-time的时刻之间获取对应的抖动数据,抖动数据的具体获取过程,请详见上述实施例所示,具体不做赘述。Specifically, the sensor shown in this embodiment obtains the corresponding jitter data between the time of the exposure and the ex-time. The specific acquisition process of the jitter data is shown in the foregoing embodiment, and details are not described herein.
更具体的,以图13所示为例,对于目标像素行line3,传感器可在目标采样点t1获取第一抖动数据x(t)。More specifically, taking the example shown in FIG. 13, for the target pixel row line3, the sensor can acquire the first jitter data x(t) at the target sampling point t1.
在目标采样点t1,对于目标像素行line3中的目标像素P4,所述传感器获取到的第一抖动数据x(t)=PSF1,0<t<ex-time。At the target sampling point t1, for the target pixel P4 in the target pixel row line3, the first jitter data x(t)=PSF1, 0<t<ex-time acquired by the sensor.
所述传感器还可在目标采样点t1获取第二抖动数据y(t)。The sensor may also acquire second jitter data y(t) at the target sampling point t1.
在目标采样点t1,对于目标像素行line3中的目标像素P1,所述传感器获取到的第二抖动数据y(t)=PSF2,0<t<ex-time。At the target sampling point t1, for the target pixel P1 in the target pixel row line3, the second jitter data y(t)=PSF2, 0<t<ex-time acquired by the sensor.
本实施例所示的电子设备在目标采样点t1所获取到的采样数据为Data1,所述Data1包括Data1x和Data1y,其中,Data1x为x(t)=PSF1,0<t<ex-time;Data1y为y(t)=PSF2,0<t<ex-time;The sampling data acquired by the electronic device shown in this embodiment at the target sampling point t1 is Data1, and the Data1 includes Data1x and Data1y, where Data1x is x(t)=PSF1, 0<t<ex-time; Data1y Is y(t)=PSF2, 0<t<ex-time;
本实施例中,电子设备在获取到所述采样数据后,即可进行积分运算以获取第一坐标数据。In this embodiment, after acquiring the sampling data, the electronic device may perform an integration operation to acquire the first coordinate data.
具体的,第一坐标数据
Figure PCTCN2016111452-appb-000005
Specifically, the first coordinate data
Figure PCTCN2016111452-appb-000005
更具体的,在目标采样点t1,对于目标像素行line3中的目标像素P4,所 述传感器获取到的第一坐标数据x(t)=t*Data1x,0<t<ex-time。More specifically, at the target sampling point t1, for the target pixel P4 in the target pixel row line3, The first coordinate data x(t)=t*Data1x, 0<t<ex-time obtained by the sensor.
其中,Data1x的具体说明请详见上述所示,具体不作赘述。For details of Data1x, please refer to the above, please do not repeat them.
更具体的,在目标采样点t1,对于目标像素行line3中目标像素P4,所述传感器获取到的第二坐标数据y(t)=t*Data1y,0<t<ex-time。More specifically, at the target sampling point t1, for the target pixel P4 in the target pixel row line3, the second coordinate data y(t)=t*Data1y, 0<t<ex-time acquired by the sensor.
其中,Data1y的具体说明请详见上述所示,具体不作赘述。For details of Data1y, please refer to the above, please do not repeat them.
则在所述目标像素行line1中,目标像素P4的目标坐标为(x(t)=t*Data1x,y(t)=t*Data1y)。Then, in the target pixel row line1, the target coordinates of the target pixel P4 are (x(t)=t*Data1x, y(t)=t*Data1y).
步骤705、确定子目标抖动量。Step 705: Determine a sub-target jitter amount.
具体的,本实施例所示的电子设备首先需要确定所述目标像素行内所述目标像素的数目。Specifically, the electronic device shown in this embodiment first needs to determine the number of the target pixels in the target pixel row.
若位于所述目标像素行内的所述目标像素的数目为至少两个,则设置目标集合,所述目标集合包括多个目标距离,所述目标距离为所有所述目标坐标中任意两个所述目标坐标之间的距离,且所述目标距离还为任一所述目标坐标与所述原点坐标之间的距离。And if the number of the target pixels located in the target pixel row is at least two, setting a target set, where the target set includes a plurality of target distances, where the target distance is any two of all the target coordinates The distance between the target coordinates, and the target distance is also the distance between any of the target coordinates and the origin coordinates.
在确定子目标抖动量时,可创建一个二维坐标系,并将位于同一行目标像素行内的各个目标像素的目标坐标在所述二维坐标系中表示出来。When determining the sub-target jitter amount, a two-dimensional coordinate system can be created, and the target coordinates of the respective target pixels located in the same row of target pixel rows are expressed in the two-dimensional coordinate system.
结合图8和图14所示为例,在目标像素行line1中,所述目标像素的数目为三个,可将P1的目标坐标、P2的目标坐标和P3的目标坐标在图14所示的坐标系中表示出来。As shown in FIG. 8 and FIG. 14 , in the target pixel row line 1 , the number of the target pixels is three, and the target coordinates of P1 , the target coordinates of P 2 , and the target coordinates of P 3 may be as shown in FIG. 14 . Expressed in the coordinate system.
则所述目标距离为在如图14所示的二维坐标系中,P1与P2之间的距离、P2与P3之间的距离、P1与P3之间的距离、原点坐标(0,0)与P1之间的距离、原点坐标(0,0)与P2之间的距离、原点坐标(0,0)与P3之间的距离。Then, the target distance is a distance between P1 and P2, a distance between P2 and P3, a distance between P1 and P3, and an origin coordinate (0, 0) in a two-dimensional coordinate system as shown in FIG. The distance from P1, the distance between the origin coordinates (0,0) and P2, and the distance between the origin coordinates (0,0) and P3.
所述电子设备将已获取的所述目标距离设置在目标集合中。The electronic device sets the acquired target distance in the target set.
在此种情况下,则所述子目标抖动量为位于所述目标集合内的所有所述目标距离中的最大值。In this case, the sub-target shake amount is the maximum of all of the target distances located within the target set.
继续结合图8和图14所示为例,则所述目标像素行line1的子目标抖动量为原点坐标与P3之间的距离。Continuing with the example shown in FIG. 8 and FIG. 14, the sub-target shake amount of the target pixel line line1 is the distance between the origin coordinates and P3.
若位于所述目标像素行内的所述目标像素的数目为一个,则所述子目标抖动量为所述目标坐标与原点坐标之间的距离; If the number of the target pixels located in the target pixel row is one, the sub-target shake amount is a distance between the target coordinate and the origin coordinate;
如图13所示,在目标像素行line3中只有一个目标像素P4,则所述目标像素行的子目标抖动量为P4的目标坐标与原点坐标之间的距离。As shown in FIG. 13, in the target pixel row line3, there is only one target pixel P4, and the sub-target shake amount of the target pixel row is the distance between the target coordinates of P4 and the origin coordinates.
步骤706、计算第一目标帧图像的第一目标抖动量。Step 706: Calculate a first target jitter amount of the first target frame image.
具体的,若本实施例已确定的位于所述第一目标帧图像中的所述目标像素行的数目为大于1的自然数,则对所有所述子目标抖动量通过平均算法进行计算以获取所述第一目标抖动量。Specifically, if the number of the target pixel rows located in the first target frame image determined by the embodiment is a natural number greater than 1, all the sub-target jitter amounts are calculated by an averaging algorithm to obtain The first target jitter amount is described.
本步骤所示的确定目标像素行的数目的具体过程请详见上述实施例所示,具体在本实施例中不作赘述。The specific process for determining the number of the target pixel rows shown in this step is shown in the above embodiment, and is not described in detail in this embodiment.
本实施例对所述平均算法不做限定,只要能够对所述子目标抖动量进行计算以获取平均值即可,例如,所述平均算法可为移动平均算法MA、指数平滑平均EMA、参数平均SMA以及权重平均DMA等。In this embodiment, the averaging algorithm is not limited, 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, and a parameter average. SMA and weighted average DMA, etc.
若所述目标像素行的数目为1,则所述第一目标抖动量等于所述子目标抖动量。If the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount.
步骤707、判断所述第一目标抖动量是否小于或等于预设值,若是,则执行步骤708,若否,则执行步骤709。Step 707: Determine whether the first target jitter amount is less than or equal to a preset value. If yes, execute step 708. If no, perform step 709.
本实施例中,所述电子设备在执行本实施例所示的方法的过程中,可预先设置有所述预设值,本实施例对所述预设值的大小不作限定,只要当所述电子设备输出的所述第一目标帧图像的所述第一目标抖动量小于或等于所述预设值时,所述第一目标帧图像能够满足一定的清晰度,从而使得用户能够获取到清晰的图像。In this embodiment, the electronic device may be preset with the preset value in the process of performing the method shown in this embodiment, and the size of the preset value is not limited in this embodiment, as long as the 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 satisfy a certain definition, thereby enabling the user to obtain clear Image.
可选的,本实施例在设定所述预设值时,可采用如下所示的方式,需明确的是,本实施例对所述预设值的设定方式的说明为可选的示例,不作限定,在具体应用中,可采用其他方式设定所述预设值,只要能够保障第一目标抖动量小于或等于所述预设值时图像是清晰的即可。Optionally, in the embodiment, when the preset value is set, the following manner may be adopted. It should be clarified that the description of the setting manner of the preset value in this embodiment is an optional example. It is not limited. In a specific application, the preset value may be set in other manners as long as the image is clear when the first target jitter amount is less than or equal to the preset value.
以下结合表1所示进行说明: The following is described in conjunction with Table 1:
表1Table 1
Figure PCTCN2016111452-appb-000006
Figure PCTCN2016111452-appb-000006
本实施例中,电子设备处于不同的应用场景,则适用不同的标准,本实施例对标准的说明为可选的示例,在具体应用中,也可创建能够适用更多应用场景的标准。In this embodiment, the electronic device is in different application scenarios, and different standards are applied. The description of the standard in this embodiment is an optional example. In a specific application, a standard that can be applied to more application scenarios may also be created.
以场景“6寸电子设备直接看”为例,则若需要电子设备输出清晰的图像,则需要执行对应的标准C,在C标准中,第一模糊参数为:连续的10个像素的长度为14um。Taking the scene “6-inch electronic device directly” as an example, if the electronic device needs to output a clear image, the corresponding standard C needs to be executed. In the C standard, the first fuzzy parameter is: the length of consecutive 10 pixels is 14um.
在具体应用中,若输出清晰的图像,则图像中连续的10个像素的长度需要小于或等于14um,则才会输出清晰的图像。In a specific application, if a clear image is output, a length of 10 consecutive pixels in the image needs to be less than or equal to 14 um, and a clear image is output.
本实施例所示的预设值与所述模糊参数为正比例相关的参数,则可参照所述模糊参数执行对预设值进行设定,从而使得图像的抖动量在小于或等于所述预设值的情况下,电子设备能够输出清晰度满足要求的图像。If the preset value shown in this embodiment is a parameter that is proportional to the fuzzy parameter, the preset value may be set by referring to the fuzzy parameter, so that the jitter amount of the image is less than or equal to the preset. In the case of a value, the electronic device can output an image whose resolution meets the requirements.
步骤708、输出所述第一目标帧图像。Step 708: Output 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, the first target is when the electronic device outputs the first target frame image. The frame image is an image whose resolution satisfies the condition, that is, the user can acquire the first target frame image that is clear.
步骤709、确定第二目标帧图像。Step 709: Determine a second target frame image.
本实施例所示的方法可依次确定所述第二目标帧图像,即在执行完步骤708后,且首次执行步骤709时,所述第二目标帧图像为所述第一目标帧图像的下一目标帧图像。The method shown in this embodiment may sequentially determine the second target frame image, that is, after performing step 708, and when step 709 is performed for the first time, the second target frame image is below the first target frame image. A target frame image.
步骤710、判断第二目标抖动量是否小于或等于所述预设值,若是,则执行步骤711,若否,则返回执行步骤709或执行步骤712。 Step 710: Determine whether the second target jitter amount is less than or equal to the preset value. If yes, execute step 711. If no, return to step 709 or step 712.
其中,所述第二目标抖动量为所述第二目标帧图像所具有的抖动量。The second target jitter amount is a jitter amount of the second target frame image.
具体的,获取所述第二目标抖动量的具体过程请详见获取第一目标抖动量的具体过程,具体在本实施例中不作赘述。Specifically, the specific process of obtaining the second target jitter amount is described in detail in the specific process of obtaining the first target jitter amount, which is not specifically described in this embodiment.
本步骤所示的预设值的说明请详见上述实施例所示,具体在本实施例不作赘述。For the description of the preset values shown in this step, please refer to the foregoing embodiment, which is not described in detail in this embodiment.
在本步骤中,若所述第二目标帧图像的第二抖动量大于所述预设值,则说明该第二目标帧图像清晰度比较低,则返回步骤709重新确定第二目标帧图像,在第二次循环执行步骤710时,所述第二目标帧图像与所述第一目标帧图像间隔有一个帧图像,重新确定出所述第二帧图像后,继续执行步骤710。In this step, if the second jitter amount of the second target frame image is greater than the preset value, indicating that the second target frame image clarity is relatively low, returning to step 709 to re-determine the second target frame image, When the step 710 is performed in the second loop, the second target frame image and the first target frame image are separated by one frame image. After the second frame image is re-determined, step 710 is continued.
可见,实施例所示的第二目标帧图像的曝光结束时间晚于所述第一目标帧图像的曝光结束时间,且所述第一目标帧图像和所述第二目标帧图像之间间隔有N目标帧图像,所述N为大于或等于0的自然数;It can be seen that the exposure end time of the second target frame image shown in the embodiment is later than the exposure end time of the first target frame image, and the interval between the first target frame image and the second target frame image is N target frame image, the N being a natural number greater than or equal to 0;
若N等于0,则说明所述第二目标帧图像为所述第一目标帧图像的下一目标帧图像,若N等于1,则说明所述第二目标帧图像为所述第一目标帧图像的下两目标帧图像,依次类推。If N is equal to 0, the second target frame image is the next target frame image of the first target frame image. If N is equal to 1, the second target frame image is the first target frame. The next two target frame images of the image, and so on.
本实施例中,若所述第二目标抖动量大于所述预设值,则需判断当前的所述第二目标帧图像是否是帧图像序列中按曝光结束时间排序的最后一个帧图像,若不是,则说明所述帧图像序列中还有尚未计算抖动量的帧图像。In this embodiment, if the second target jitter amount is greater than the preset value, it is determined whether the current second target frame image is the last frame image sorted by the exposure end time in the frame image sequence, if If not, it is explained that there is a frame image in the sequence of frame images in which the amount of jitter has not yet been calculated.
若是,则说明所述帧图像序列中所有帧图像均已计算完成,且所述帧图像序列中所有帧图像的抖动量均大于所述预设值,则继续执行步骤712。If yes, it is determined that all frame images in the frame image sequence have been calculated, and the jitter amount of all frame images in the frame image sequence is greater than the preset value, and then step 712 is continued.
步骤711、输出所述第二目标帧图像。Step 711: Output the second target frame image.
本实施例所示的步骤711的说明请参加步骤708所示,具体不作赘述。For the description of step 711 shown in this embodiment, please refer to step 708, and details are not described herein.
步骤712、输出第三目标帧图像。Step 712: Output a third target frame image.
具体的,所述第三目标帧图像为帧图像序列中的任一帧图像,所述帧图像序列包括所述第一目标帧图像和已确定的至少一个所述第二目标帧图像,且所述第三目标帧图像所具有的抖动量是所述帧图像序列中的所有帧图像所具有的抖动量的最小值。Specifically, the third target frame image is any frame image in a sequence of frame images, and the frame image sequence includes the first target frame image and the determined at least one second target frame image, and The amount of jitter that the third target frame image has is the minimum value of the amount of jitter that all of the frame images in the sequence of frame images have.
例如,在上述实施例中,确定出帧图像序列中一共有五个帧图像,且各个帧图像的抖动量分别为Q1、Q2、Q3、Q4以及Q5,所述第三目标帧图像即 为具有Q1、Q2、Q3、Q4以及Q5中的最小值的帧图像。For example, in the above embodiment, a total of five frame images in the frame image sequence are determined, and the jitter amounts of the respective frame images are Q1, Q2, Q3, Q4, and Q5, respectively, and the third target frame image is It is a frame image having a minimum value among Q1, Q2, Q3, Q4, and Q5.
采用本实施例所示的图像输出方法的有益效果在于:The advantageous effects of using the image output method shown in this embodiment are:
电子设备无需对所获取到的位于帧图像序列中的所有帧图像进行对比度的计算,只需要按曝光结束时间的先后顺序对位于帧图像序列中帧图像依次进行抖动量的计算,若计算出当前的帧图像的抖动量小于或等于预设值,则直接输出当前的帧图像,而无需对按曝光结束时间排序在当前帧图像后面的帧图像进行计算,从而节省了对帧图像进行计算所耗费的时长,在保障了电子设备输出图像的清晰度的情况下,提升了输出图像的效率。The electronic device does not need to calculate the contrast of all acquired frame images in the frame image sequence, and only needs to calculate the jitter amount of the frame images located in the frame image sequence in the order of the exposure end time, if the current calculation is calculated If the amount of jitter of the frame image is less than or equal to the preset value, the current frame image is directly output without calculating the frame image after the current frame image by sorting the exposure end time, thereby saving the calculation of the frame image. The duration of the image is improved in the case of ensuring the sharpness of the output image of the electronic device.
以上所示的方法基于卷帘快门rolling shutter以实现本实施例所提供的图像输出方法,以下对基于全局快门global shutter是如何实现本发明实施例所示的方法进行说明:The method shown above is based on the rolling shutter shutter to implement the image output method provided by the embodiment. The following describes how the global shutter global shutter realizes the method shown in the embodiment of the present invention:
如图16所示,本实施例基于全局快门global shutter的情况下,图像输出方法包括:As shown in FIG. 16, in the case that the present embodiment is based on a global shutter global shutter, the image output method includes:
步骤1601、确定目标采样时间点。Step 1601: Determine a target sampling time point.
本实施例所示的目标采样时间点的具体说明请详见本实施例图7所示的步骤701所示,具体不作赘述。For details of the target sampling time point shown in this embodiment, refer to step 701 shown in FIG. 7 in this embodiment, and details are not described herein.
在全局快门global shutter中,电子设备通过传感器上报的数据能够确定出每秒出现的图像帧以及各图像帧曝光结束的时间点。In the global shutter global shutter, the electronic device can determine the image frame appearing every second and the time point at which the exposure of each image frame ends by the data reported by the sensor.
以图17所示为例,其中,图17以曝光的帧图像为第一目标帧图像和第二目标帧图像为例进行示例性说明。Taking FIG. 17 as an example, FIG. 17 exemplifies an example in which the exposed frame image is the first target frame image and the second target frame image.
本实施例中,所述电子设备能够获取帧图像序列中所包括的各个帧图像的曝光时间、帧率FR以及最大帧率等。In this embodiment, the electronic device can acquire an exposure time, a frame rate FR, a maximum frame rate, and the like of each frame image included in the frame image sequence.
以图17所示为例,其中,图8以曝光的帧图像为第一目标帧图像和第二目标帧图像为例进行示例性说明。Taking FIG. 17 as an example, FIG. 8 exemplifies an example in which the exposed frame image is the first target frame image and the second target frame image.
以图8所示为例,图8所示的横坐标为时间,单位是毫秒,纵坐标为传感器底片上所形成的第一目标帧图像的像素阵列的行号。Taking FIG. 8 as an example, the abscissa shown in FIG. 8 is time, the unit is millisecond, and the ordinate is the line number of the pixel array of the first target frame image formed on the sensor film.
本实施例所示的方法应用可应用于全局快门global shutter机制中,以传感器所形成的第一目标帧图像为例,所述第一目标帧图像各像素行的起始曝光时 间均相同,且所述第一目标帧图像各像素行的曝光结束时间均相同,则如图17所示,所述第一目标帧以及所述第二目标帧的行曝光的时序图呈长方形结构。The method application shown in this embodiment can be applied to a global shutter global shutter mechanism, taking the first target frame image formed by the sensor as an example, and the initial exposure time of each pixel row of the first target frame image. The same 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, the timing chart of the row exposure of the first target frame and the second target frame is rectangular. structure.
对所述第一目标帧图像的其他参数的说明请详见图8所示,具体不作赘述。For the description of other parameters of the first target frame image, please refer to FIG. 8 , and details are not described herein.
如图17所示,第一目标帧图像的曝光时间为T1,则所述目标采样时间点位于T1的时间段内。As shown in FIG. 17, the exposure time of the first target frame image is T1, and the target sampling time point is located in the time period of T1.
如图17所示为例,本实施例所示的采样时间点t1以及t2位于所述第一目标帧图像的曝光时间T1内。As shown in FIG. 17, the sampling time points t1 and t2 shown in this embodiment are located within the exposure time T1 of the first target frame image.
则本实施例所示的采样时间点t1以及t2为所述目标采样时间点。Then, the sampling time points t1 and t2 shown in this embodiment are the target sampling time points.
步骤1602、确定目标像素行。 Step 1602, determining a target pixel row.
因本实施例所示各像素行的起始曝光时间均相同,且各像素行的曝光结束时间也相同,则本实施例所示的所述目标像素行可为所述第一目标帧图像所包括的任一行。Because the initial exposure time of each pixel row is the same, and the exposure end time of each pixel row is also the same, the target pixel row shown in this embodiment may be the first target frame image. Any line included.
步骤1603、确定所述目标像素行内的目标像素。 Step 1603, determining a target pixel in the target pixel row.
本实施例所示的所述目标像素为曝光时间为所述目标采样时间点的像素。The target pixel shown in this embodiment is a pixel whose exposure time is the target sampling time point.
具体说明请详见步骤703所示,具体不作赘述。For details, please refer to step 703 for details.
步骤1604、确定所述目标像素的目标坐标。 Step 1604, determining target coordinates of the target pixel.
本实施例所示的传感器可在目标采样点获取第一抖动数据x(t)=PSF1,limt<t<limx。The sensor shown in this embodiment can acquire the first jitter data x(t)=PSF1, limt<t<limx at the target sampling point.
其中,PSF1的获取过程,请详见图7所示的实施例704所示,具体不作赘述。The acquisition process of the PSF1 is shown in the embodiment 704 shown in FIG. 7 , and details are not described herein.
具体的,以所述目标像素为所述目标像素行中的第A个目标像素为例,且第A个所述目标像素为所述目标像素行所包括的任一目标像素,limt为所述目标像素行开始曝光的时间到第A个目标像素的曝光时间之间所间隔的时间,若第A个所述目标像素不是所述目标像素行内的最后一个像素,则limx为A*s,若第A个目标像素为所述目标像素行内的最后一个像素,则limx为所述目标像素行的曝光结束时间ex-time。Specifically, the target pixel is taken as the A-th target pixel in the target pixel row, and the A-th target pixel is any target pixel included in the target pixel row, and the lime is the The time interval between the time when the target pixel row starts to be exposed and the exposure time of the A target pixel, and if the A target pixel is not the last pixel in the target pixel row, then limx is A*s, if The A target pixel is the last pixel in the target pixel row, and limx is the exposure end time ex-time of the target pixel row.
具体的,本实施例所示的传感器在limt至limx的时刻之间获取对应的抖动 数据,抖动数据的具体获取过程,请详见上述实施例所示,具体不做赘述。Specifically, the sensor shown in this embodiment acquires corresponding jitter between the moments of lime and limx. For the specific acquisition process of data and jitter data, please refer to the above embodiment for details.
更具体的,以图17所示为例,对于目标像素行line1,传感器可分别在目标采样点t1以及t2获取第一抖动数据x(t)。More specifically, taking the example shown in FIG. 17, for the target pixel row line1, the sensor can acquire the first jitter data x(t) at the target sampling points t1 and t2, respectively.
在目标采样点t1,对于目标像素行line1中的第一个目标像素P1,所述传感器获取到的第一抖动数据x(t)=PSF1,0<t≤S。At the target sampling point t1, for the first target pixel P1 in the target pixel row line1, the first jitter data x(t)=PSF1, 0<t≤S acquired by the sensor.
在目标采样点t2,对于目标像素行line1中的最后一个目标像素P2,所述传感器获取到的第一抖动数据x(t)=PSF1,x(t)=PSF1,s<t≤ex-time。At the target sampling point t2, for the last target pixel P2 in the target pixel row line1, the first jitter data acquired by the sensor x(t)=PSF1, x(t)=PSF1, s<t≤ex-time .
更具体的,对于目标像素行line1,传感器可分别在目标采样点t1以及t2获取第二抖动数据y(t)。More specifically, for the target pixel row line1, the sensor may acquire the second jitter data y(t) at the target sampling points t1 and t2, respectively.
在目标采样点t1,对于目标像素行line1中的第一个目标像素P1,所述传感器获取到的第二抖动数据y(t)=PSF2,0<t≤S。At the target sampling point t1, for the first target pixel P1 in the target pixel row line1, the second jitter data y(t)=PSF2, 0<t≤S acquired by the sensor.
在目标采样点t2,对于目标像素行line1中的最后一个目标像素P2,所述传感器获取到的第二抖动数据y(t)=PSF2,s<t≤ex-time。At the target sampling point t2, for the last target pixel P2 in the target pixel row line1, the second jitter data y(t)=PSF2, s<t≤ex-time acquired by the sensor.
本实施例所示的电子设备在目标采样点t1所获取到的采样数据为Data1,所述Data1包括Data1x和Data1y,其中,Data1x为x(t)=PSF1,0<t≤S;Data1y为y(t)=PSF2,0<t≤S;The sampling data acquired by the electronic device shown in this embodiment at the target sampling point t1 is Data1, and the Data1 includes Data1x and Data1y, where Data1x is x(t)=PSF1, 0<t≤S; Data1y is y. (t) = PSF2, 0 < t ≤ S;
所述电子设备在目标采样点t2所获取到的采样数据为Data2,所述Data2包括Data2x和Data2y,其中,Data2x为x(t)=PSF1,s<t≤ex-time;Data2y为y(t)=PSF2,s<t≤ex-time;The sampling data acquired by the electronic device at the target sampling point t2 is Data2, and the Data2 includes Data2x and Data2y, where Data2x is x(t)=PSF1, s<t≤ex-time; Data2y is y(t )=PSF2,s<t≤ex-time;
本实施例中,电子设备在获取到所述采样数据后,即可进行积分运算以获取第一坐标数据。In this embodiment, after acquiring the sampling data, the electronic device may perform an integration operation to acquire the first coordinate data.
具体的,第一坐标数据
Figure PCTCN2016111452-appb-000007
Specifically, the first coordinate data
Figure PCTCN2016111452-appb-000007
更具体的,在目标采样点t1,对于目标像素行line1中的第一个目标像素P1,所述传感器获取到的第一坐标数据x(t)=t*Data1x,0<t≤S。More specifically, at the target sampling point t1, for the first target pixel P1 in the target pixel row line1, the first coordinate data x(t)=t*Data1x, 0<t≤S acquired by the sensor.
其中,Data1x的具体说明请详见上述所示,具体不作赘述。For details of Data1x, please refer to the above, please do not repeat them.
在目标采样点t2,对于目标像素行line1中的第二个目标像素P2,所述传感器获取到的第一坐标数据x(t)=S*Data1x+t*Data2x,s<t≤ex-time;At the target sampling point t2, for the second target pixel P2 in the target pixel row line1, the first coordinate data acquired by the sensor x(t)=S*Data1x+t*Data2x, s<t≤ex-time ;
其中,Data1x、Data2x的具体说明请详见上述所示,具体不作赘述。For details of Data1x and Data2x, please refer to the above, please do not repeat them.
更具体的,在目标采样点t1,对于目标像素行line1中的第一个目标像素 P1,所述传感器获取到的第二坐标数据y(t)=t*Data1y,0<t≤S。More specifically, at the target sampling point t1, for the first target pixel in the target pixel row line1 P1, the second coordinate data acquired by the sensor y(t)=t*Data1y, 0<t≤S.
其中,Data1y的具体说明请详见上述所示,具体不作赘述。For details of Data1y, please refer to the above, please do not repeat them.
在目标采样点t2,对于目标像素行line1中的第二个目标像素P2,所述传感器获取到的第二坐标数据y(t)=S*Data1y+t*Data2y,s<t≤ex-time;At the target sampling point t2, for the second target pixel P2 in the target pixel row line1, the second coordinate data acquired by the sensor y(t)=S*Data1y+t*Data2y, s<t≤ex-time ;
其中,Data1y、Data2y的具体说明请详见上述所示,具体不作赘述。For details of Data1y and Data2y, please refer to the above, and the details are not described here.
则在所述目标像素行line1中,目标像素P1的目标坐标为(x(t)=t*Data1x,y(t)=t*Data1y)、在所述目标像素行line1中,目标像素P2的目标坐标为(x(t)=S*Data1x+t*Data2x,y(t)=S*Data1y+t*Data2y)。Then, in the target pixel row line1, the target coordinates of the target pixel P1 are (x(t)=t*Data1x, y(t)=t*Data1y), in the target pixel row line1, the target pixel P2 The target coordinates are (x(t)=S*Data1x+t*Data2x, y(t)=S*Data1y+t*Data2y).
步骤1605、计算目标抖动量。Step 1605: Calculate the target jitter amount.
本实施例确定目标抖动量的具体过程,请详见图7所示的步骤705所示的确定子目标抖动量的具体过程。In the specific process of determining the target jitter amount in this embodiment, please refer to the specific process of determining the sub-target jitter amount shown in step 705 shown in FIG. 7 .
因本实施例中,所述第一目标帧图像呈长方形结构,则相同的抖动对第一目标帧图像不同的像素行的应用是一致的,则本实施例所示的第一目标帧图像不同的像素行具有相同的抖动量,则本实施例中,可将所述第一目标帧图像的任一行所具有的抖动量作为整幅第一目标帧图像的抖动量。In this embodiment, the first target frame image has a rectangular structure, and the same jitter is consistent with the application of the pixel row of the first target frame image, and the first target frame image shown in this embodiment is different. The pixel rows have the same amount of jitter. In this embodiment, the jitter amount of any row of the first target frame image may be used as the jitter amount of the entire first target frame image.
步骤1606、判断所述第一目标抖动量是否小于或等于预设值,若是,则执行步骤1607,若否,则执行步骤1608。Step 1606: Determine whether the first target jitter amount is less than or equal to a preset value. If yes, go to step 1607. If no, go to step 1608.
步骤1607、输出所述第一目标帧图像。Step 1607: Output the first target frame image.
步骤1608、确定第二目标帧图像。 Step 1608, determining a second target frame image.
步骤1609、判断第二目标抖动量是否小于或等于所述预设值,若是,则执行步骤1610,若否,则返回执行步骤1608或执行步骤1611。Step 1609: Determine whether the second target jitter amount is less than or equal to the preset value. If yes, execute step 1610. If no, return to step 1608 or step 1611.
步骤1610、输出所述第二目标帧图像。Step 1610: Output the second target frame image.
步骤1611、输出第三目标帧图像。Step 1611: Output a third target frame image.
本实施例所示的步骤1606至步骤1611的具体执行过程,请详见图7所示的步骤707至步骤712所示,具体不作赘述。For the specific implementation process of the steps 1606 to 1611 shown in this embodiment, please refer to the steps 707 to 712 shown in FIG. 7 , and details are not described herein.
采用本实施例所示的图像输出方法的有益效果在于:The advantageous effects of using the image output method shown in this embodiment are:
电子设备无需对所获取到的位于帧图像序列中的所有帧图像进行对比度的计算,只需要按曝光结束时间的先后顺序对位于帧图像序列中帧图像依次进行抖动量的计算,若计算出当前的帧图像的抖动量小于或等于预设值,则直接 输出当前的帧图像,而无需对按曝光结束时间排序在当前帧图像后面的帧图像进行计算,从而节省了对帧图像进行计算所耗费的时长,在保障了电子设备输出图像的清晰度的情况下,提升了输出图像的效率。The electronic device does not need to calculate the contrast of all acquired frame images in the frame image sequence, and only needs to calculate the jitter amount of the frame images located in the frame image sequence in the order of the exposure end time, if the current calculation is calculated The jitter of the frame image is less than or equal to the preset value, then directly The current frame image is output without calculating the frame image after the current frame image by the exposure end time, thereby saving the time taken for calculating the frame image and ensuring the clarity of the output image of the electronic device. The efficiency of the output image is improved.
以下结合图15所示,从功能模块的角度对能够实现图7所示的图像输出方法的电子设备的具体结构进行详细说明:The specific structure of the electronic device capable of realizing the image output method shown in FIG. 7 will be described in detail from the perspective of the functional module, as shown in FIG.
本实施例所示的电子设备执行图像输出的过程,请详见图7所示的实施例,具体在本实施例中不作赘述。The process of performing the image output by the electronic device shown in this embodiment is shown in the embodiment shown in FIG. 7 , and is not described in detail in this embodiment.
如图15所示,所述电子设备包括:As shown in FIG. 15, the electronic device includes:
第二获取单元1501,用于获取所述第一目标帧图像所包括的任一行像素开始曝光的时间;a second acquiring unit 1501, configured to acquire a time when any row of pixels included in the first target frame image starts to be exposed;
第二确定单元1502,用于确定所述目标像素行,其中,所述目标像素行的开始曝光的时间为所述目标采样时间点。The second determining unit 1502 is configured to determine the target pixel row, wherein a time when the target pixel row starts to be exposed is the target sampling time point.
第一获取单元1503,用于获取与目标采样时间点对应的采样数据,所述目标采样时间点为位于第一目标帧图像的曝光时间内的至少一个采样时间点中的任一采样时间点,所述采样数据为所述第一目标帧图像中与所述目标采样时间点对应的像素的抖动数据;a first acquiring unit 1503, configured to acquire sampling data corresponding to a target sampling time point, where the target sampling time point is any sampling time point of at least one sampling time point of an exposure time of the first target frame image, The sampled data is jitter data of a pixel corresponding to the target sampling time point in the first target frame image;
其中,所述第一获取单元1503还用于,获取目标像素的目标采样数据,所述目标像素为位于目标像素行内的任一像素,且所述目标像素的曝光时间为所述目标采样时间点,所述目标像素行为所述第一目标帧图像所包括的任一像素行,所述目标采样数据为所述目标像素在所述目标采样时间点的抖动数据。The first obtaining unit 1503 is further configured to acquire target sampling data of the target pixel, where the target pixel is any pixel located in the target pixel row, and an exposure time of the target pixel is the target sampling time point. And the target pixel is performed by 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.
第一计算单元1504,用于根据所述目标采样时间点和所述目标采样数据计算目标像素行的子目标抖动量;a first calculating unit 1504, configured to calculate a sub-target jitter amount of the target pixel row according to the target sampling time point and the target sampling data;
第三确定单元1505,用于确定所述目标像素行的数目;a third determining unit 1505, configured to determine a number of the target pixel rows;
第二计算单元1506,用于若所述目标像素行的数目为1,则所述第一目标抖动量等于所述子目标抖动量;若所述目标像素行的数目为大于1的自然数,则对所有所述子目标抖动量通过平均算法进行计算以获取所述第一目标抖动量。a second calculating unit 1506, configured to: if the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount; if the target pixel row number is a natural number greater than 1, All of the sub-target shake amounts are calculated by an averaging algorithm to obtain the first target shake amount.
具体的,所述第二计算单元1506包括: Specifically, the second calculating unit 1506 includes:
计算模块15061,用于根据所述目标采样时间点和所述目标采样数据计算位于所述目标像素行内任一目标像素的目标坐标;a calculation module 15061, configured to calculate target coordinates of any target pixel located in the target pixel row according to the target sampling time point and the target sampling data;
第一确定模块15062,用于若位于所述目标像素行内的所述目标像素的数目为一个,则所述子目标抖动量为所述目标坐标与原点坐标之间的距离;The first determining module 15062 is configured to: if the number of the target pixels located in the target pixel row is one, the sub-target jitter amount is a distance between the target coordinate and the origin coordinate;
第二确定模块15063,用于若位于所述目标像素行内的所述目标像素的数目为至少两个,则设置目标集合,所述目标集合包括多个目标距离,所述目标距离为所有所述目标坐标中任意两个所述目标坐标之间的距离,且所述目标距离还为任一所述目标坐标与所述原点坐标之间的距离;a second determining module 15063, configured to set a target set if the number of the target pixels located in the target pixel row is at least two, the target set includes a plurality of target distances, and the target distance is all the a distance between any two of the target coordinates in the target coordinate, and the target distance is also a distance between any of the target coordinates and the origin coordinate;
第三确定模块15064,用于获取所述子目标抖动量,所述子目标抖动量为位于所述目标集合内的所有所述目标距离中的最大值。The third determining module 15064 is configured to acquire 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.
更具体的,所述计算模块15061包括:More specifically, the calculation module 15061 includes:
第一获取子模块150611,用于获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿X轴平移的第一抖动数据;a first obtaining sub-module 150611, configured to acquire first jitter data that is located on the X-axis of any target pixel in the target pixel row at the target sampling time point;
第一计算子模块150612,用于对所述第一抖动数据进行积分运算以获取第一坐标数据;a first calculation sub-module 150612, configured to perform an integration operation on the first jitter data to obtain first coordinate data;
第二获取子模块150613,用于获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿Y轴平移的第二抖动数据;a second obtaining sub-module 150613, configured to acquire second jitter data that is located on the Y-axis of any target pixel in the target pixel row at the target sampling time point;
第二计算子模块150614,用于对所述第二抖动数据进行积分运算以获取第二坐标数据;a second calculation sub-module 150614, configured to perform an integration operation on the second jitter data to obtain second coordinate data;
确定子模块150615,用于位于所述目标像素行内任一目标像素的目标坐标包括目标横坐标和目标纵坐标,确定所述目标横坐标为所述第一坐标数据,所述目标纵坐标为所述第二坐标数据。Determining a sub-module 150615, the target coordinates for any target pixel in the target pixel row include a target abscissa and a target ordinate, and determining the target abscissa as the first coordinate data, the target ordinate is a The second coordinate data is described.
第一判断单元1507,用于判断第一目标抖动量是否小于或等于预设值,所述第一目标抖动量为根据所述目标采样时间点和所述采样数据所确定的第一目标帧图像的抖动量;The first determining unit 1507 is configured to determine whether the first target jitter amount is less than or equal to a preset value, where the first target jitter amount is a first target frame image determined according to the target sampling time point and the sampling data. Amount of jitter
第一输出单元1508,用于若所述第一目标抖动量小于或等于所述预设值,则输出所述第一目标帧图像。The first output unit 1508 is configured to output the first target frame image if the first target jitter amount is less than or equal to the preset value.
第一确定单元1509,用于若所述第一目标抖动量大于所述预设值,则确定第二目标帧图像,所述第二目标帧图像的曝光结束时间晚于所述第一目标帧 图像的曝光结束时间,且所述第一目标帧图像和所述第二目标帧图像之间间隔有N个目标帧图像,所述N为大于或等于0的自然数;a first determining unit 1509, configured to determine a second target frame image if the first target jitter amount is greater than the preset value, where an exposure end time of the second target frame image is later than the first target frame An exposure end time of the image, and an N target frame image is spaced between the first target frame image and the second target frame image, wherein the N is a natural number greater than or equal to 0;
第二判断单元1510,用于判断第二目标抖动量是否小于或等于所述预设值,所述第二目标抖动量为所述第二目标帧图像所具有的抖动量;The second determining unit 1510 is configured to determine whether the second target jitter amount is less than or equal to the preset value, where the second target jitter amount is a jitter amount of the second target frame image;
第二输出单元1511,用于若所述第二目标抖动量小于或等于所述预设值,则输出所述第二目标图像帧。The second output unit 1511 is configured to output the second target image frame if the second target jitter amount is less than or equal to the preset value.
其中,所述第二输出单元1511还用于,若所述第二目标抖动量大于所述预设值,则输出第三目标帧图像,所述第三目标帧图像为帧图像序列中的任一帧图像,所述帧图像序列包括所述第一目标帧图像和所述第二目标帧图像,且所述第三目标帧图像所具有的抖动量是所述帧图像序列中的所有帧图像所具有的抖动量的最小值。The second output unit 1511 is further configured to: if the second target jitter amount is greater than the preset value, output a third target frame image, where the third target frame image is any one of the frame image sequences a frame image, the frame image sequence including the first target frame image and the second target frame image, and the third target frame image has a jitter amount that is all frame images in the frame image sequence The minimum amount of jitter that is present.
采用本实施例所示的电子设备的有益效果在于:The beneficial effects of using the electronic device shown in this embodiment are as follows:
电子设备无需对所获取到的位于帧图像序列中的所有帧图像进行对比度的计算,只需要按曝光结束时间的先后顺序对位于帧图像序列中帧图像依次进行抖动量的计算,若计算出当前的帧图像的抖动量小于或等于预设值,则直接输出当前的帧图像,而无需对按曝光结束时间排序在当前帧图像后面的帧图像进行计算,从而节省了对帧图像进行计算所耗费的时长,在保障了电子设备输出图像的清晰度的情况下,提升了输出图像的效率。The electronic device does not need to calculate the contrast of all acquired frame images in the frame image sequence, and only needs to calculate the jitter amount of the frame images located in the frame image sequence in the order of the exposure end time, if the current calculation is calculated If the amount of jitter of the frame image is less than or equal to the preset value, the current frame image is directly output without calculating the frame image after the current frame image by sorting the exposure end time, thereby saving the calculation of the frame image. The duration of the image is improved in the case of ensuring the sharpness of the output image of the electronic device.
图15从功能模块的角度对电子设备的结构进行说明,以下进一步结合图1所示对电子设备的实体硬件角度的结构进行说明。15 illustrates the structure of the electronic device from the perspective of the functional module, and the structure of the physical hardware angle of the electronic device will be further described below in conjunction with FIG.
所述电子设备包括一个或多个微计算机110、图像存储器104、总线系统、以及一个或多个程序,所述微计算机110和所述图像存储器104通过所述总线系统相连;The electronic device includes one or more microcomputers 110, an image memory 104, a bus system, and one or more programs, and the microcomputer 110 and the image memory 104 are connected by the bus system;
其中所述一个或多个程序被存储在所述图像存储器104中,所述一个或多个程序包括指令,所述指令当被所述电子设备执行时使所述电子设备执行如图7所示的图像输出方法。Wherein the one or more programs are stored in the image memory 104, the one or more programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform as shown in FIG. Image output method.
本实施例所示的电子设备执行图像输出方法的具体过程,请详见图7所示,具体在本实施例中不做赘述。The specific process of the image output method of the electronic device shown in this embodiment is shown in FIG. 7 , which is not described in detail in this embodiment.
本实施例所述电子设备的具体结构也可参见上述实施例所示,具体在本实 施例中不再赘述。The specific structure of the electronic device in this embodiment can also be seen in the foregoing embodiment, specifically in the present embodiment. It will not be repeated in the example.
具体的,本实施例中,所述一个或多个程序包括指令,所述指令当被电子设备执行时使所述电子设备执行如图7所示的图像输出方法,所述指令执行所述图像输出的方法的具体流程请详见图7所示,具体在本实施例中不再赘述。Specifically, in this embodiment, the one or more programs include instructions that, when executed by the electronic device, cause the electronic device to perform an image output method as shown in FIG. 7, the instructions executing the image The specific process of the output method is shown in FIG. 7 , and details are not described in this embodiment.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述 的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. And the foregoing The 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 the like, which can store program codes.
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the embodiments are modified, or the equivalents of the technical features are replaced by the equivalents of the 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, where the target sampling time point is any sampling time point of at least one sampling time point located in an exposure time of the first target frame image, wherein the sampling data is the Jitter data of a pixel corresponding to the target sampling time point in a target frame image;
    判断第一目标抖动量是否小于或等于预设值,所述第一目标抖动量为根据所述目标采样时间点和所述采样数据所确定的第一目标帧图像的抖动量;Determining whether the first target jitter amount is less than or equal to a preset value, the first target jitter amount being a jitter amount of the first target frame image determined according to the target sampling time point and the sampling data;
    若所述第一目标抖动量小于或等于所述预设值,则输出所述第一目标帧图像。If the first target jitter amount is less than or equal to the preset value, outputting the first target frame image.
  2. 根据权利要求1所述的方法,其特征在于,所述判断第一目标抖动量是否小于或等于预设值之后,所述方法还包括:The method according to claim 1, wherein after the determining whether the first target amount of jitter is less than or equal to a preset value, the method further comprises:
    若所述第一目标抖动量大于所述预设值,则确定第二目标帧图像,所述第二目标帧图像的曝光结束时间晚于所述第一目标帧图像的曝光结束时间,且所述第一目标帧图像和所述第二目标帧图像之间间隔有N个目标帧图像,所述N为大于或等于0的自然数;If the first target shake amount is greater than the preset value, determining a second target frame image, an exposure end time of the second target frame image is later than an exposure end time of the first target frame image, and There are N target frame images between the first target frame image and the second target frame image, and the N is a natural number greater than or equal to 0;
    判断第二目标抖动量是否小于或等于所述预设值,所述第二目标抖动量为所述第二目标帧图像所具有的抖动量;Determining whether the second target jitter amount is less than or equal to the preset value, and the second target jitter amount is a jitter amount of the second target frame image;
    若所述第二目标抖动量小于或等于所述预设值,则输出所述第二目标图像帧。And if the second target jitter amount is less than or equal to the preset value, outputting the second target image frame.
  3. 根据权利要求2所述的方法,其特征在于,所述判断第二目标抖动量是否小于或等于所述预设值之后,所述方法还包括:The method according to claim 2, wherein after the determining whether the second target amount of jitter is less than or equal to the preset value, the method further comprises:
    若所述第二目标抖动量大于所述预设值,则输出第三目标帧图像,所述第三目标帧图像为帧图像序列中的任一帧图像,所述帧图像序列包括所述第一目标帧图像和所述第二目标帧图像,且所述第三目标帧图像所具有的抖动量是所述帧图像序列中的所有帧图像所具有的抖动量的最小值。If the second target jitter amount is greater than the preset value, outputting a third target frame image, where the third target frame image is any frame image in the frame image sequence, and the frame image sequence includes the first a target frame image and the second target frame image, and the third target frame image has a jitter amount which is a minimum value of a jitter amount of all frame images in the frame image sequence.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述获取与目标采样时间点对应的采样数据包括:The method according to any one of claims 1 to 3, wherein the acquiring sampling data corresponding to a target sampling time point comprises:
    获取目标像素的目标采样数据,所述目标像素为位于目标像素行内的任一 像素,且所述目标像素的曝光时间为所述目标采样时间点,所述目标像素行为所述第一目标帧图像所包括的任一像素行,所述目标采样数据为所述目标像素在所述目标采样时间点的抖动数据。Obtaining target sample data of the target pixel, the target pixel being any one of the target pixel rows a pixel, and an exposure time of the target pixel is the target sampling time point, the target pixel acts on any pixel row included in the first target frame image, and the target sampling data is the target pixel in the The jitter data of the target sampling time point.
  5. 根据权利要求4所述的方法,其特征在于,所述获取目标像素的目标采样数据之前,所述方法还包括:The method according to claim 4, wherein before the acquiring the target sample data of the target pixel, the method further comprises:
    获取所述第一目标帧图像所包括的任一行像素开始曝光的时间;Obtaining a time when any row of pixels included in the image of the first target frame starts to be exposed;
    确定所述目标像素行,其中,所述目标像素行的开始曝光的时间为所述目标采样时间点。Determining the target pixel row, wherein a time at which the target pixel row starts to be exposed is the target sampling time point.
  6. 根据权利要求4或5所述的方法,其特征在于,所述判断第一目标抖动量是否小于或等于预设值之前,所述方法还包括:The method according to claim 4 or 5, wherein the method further comprises: before determining whether the first target amount of jitter is less than or equal to a preset value, the method further comprising:
    根据所述目标采样时间点和所述目标采样数据计算目标像素行的子目标抖动量;Calculating a sub-target jitter amount of the target pixel row according to the target sampling time point and the target sampling data;
    确定所述目标像素行的数目;Determining the number of the target pixel rows;
    若所述目标像素行的数目为1,则所述第一目标抖动量等于所述子目标抖动量;If the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount;
    若所述目标像素行的数目为大于1的自然数,则对所有所述子目标抖动量通过平均算法进行计算以获取所述第一目标抖动量。If the number of the target pixel rows is a natural number greater than 1, all of the sub-target jitter amounts are calculated by an averaging algorithm to obtain the first target jitter amount.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述目标采样时间点和所述目标采样数据计算目标像素行的子目标抖动量包括:The method according to claim 6, wherein the calculating the sub-target jitter amount of the target pixel row according to the target sampling time point and the target sampling data comprises:
    根据所述目标采样时间点和所述目标采样数据计算位于所述目标像素行内任一目标像素的目标坐标;Calculating target coordinates of any target pixel located in the target pixel row according to the target sampling time point and the target sampling data;
    若位于所述目标像素行内的所述目标像素的数目为一个,则所述子目标抖动量为所述目标坐标与原点坐标之间的距离;If the number of the target pixels located in the target pixel row is one, the sub-target shake amount is a distance between the target coordinate and the origin coordinate;
    若位于所述目标像素行内的所述目标像素的数目为至少两个,则设置目标集合,所述目标集合包括多个目标距离,所述目标距离为所有所述目标坐标中任意两个所述目标坐标之间的距离,且所述目标距离还为任一所述目标坐标与所述原点坐标之间的距离;And if the number of the target pixels located in the target pixel row is at least two, setting a target set, where the target set includes a plurality of target distances, where the target distance is any two of all the target coordinates a distance between the target coordinates, and the target distance is also a distance between any of the target coordinates and the origin coordinates;
    获取所述子目标抖动量,所述子目标抖动量为位于所述目标集合内的所有所述目标距离中的最大值。 Obtaining the sub-target jitter amount, the sub-target jitter amount being a maximum of all of the target distances within the target set.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述目标采样时间点和所述目标采样数据计算位于所述目标像素行内任一目标像素的目标坐标包括:The method according to claim 7, wherein the calculating target coordinates of any target pixel located in the target pixel row according to the target sampling time point and the target sampling data comprises:
    获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿X轴平移的第一抖动数据;Obtaining first jitter data that is located along the X axis of any target pixel in the target pixel row at the target sampling time point;
    对所述第一抖动数据进行积分运算以获取第一坐标数据;Performing an integration operation on the first jitter data to obtain first coordinate data;
    获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿Y轴平移的第二抖动数据;Obtaining second jitter data that is located in the target pixel row and that is translated along the Y axis at the target sampling time point;
    对所述第二抖动数据进行积分运算以获取第二坐标数据;Performing an integration operation on the second jitter data to obtain second coordinate data;
    位于所述目标像素行内任一目标像素的目标坐标包括目标横坐标和目标纵坐标,确定所述目标横坐标为所述第一坐标数据,所述目标纵坐标为所述第二坐标数据。The target coordinates of any target pixel located in the target pixel row include a target abscissa and a target ordinate, and the target abscissa is determined as the first coordinate data, and the target ordinate is the second coordinate data.
  9. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    第一获取单元,用于获取与目标采样时间点对应的采样数据,所述目标采样时间点为位于第一目标帧图像的曝光时间内的至少一个采样时间点中的任一采样时间点,所述采样数据为所述第一目标帧图像中与所述目标采样时间点对应的像素的抖动数据;a first acquiring unit, configured to acquire sampling data corresponding to a target sampling time point, where the target sampling time point is any sampling time point located in at least one sampling time point of an exposure time of the first target frame image, The sampled 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 the first target jitter amount is less than or equal to a preset value, where the first target jitter amount is a first target frame image determined according to the target sampling time point and the sampling data Amount of jitter;
    第一输出单元,用于若所述第一目标抖动量小于或等于所述预设值,则输出所述第一目标帧图像。And a first output unit, configured to output the first target frame image if the first target jitter amount is less than or equal to the preset value.
  10. 根据权利要求9所述的电子设备,其特征在于,所述电子设备还包括:The electronic device according to claim 9, wherein the electronic device further comprises:
    第一确定单元,用于若所述第一目标抖动量大于所述预设值,则确定第二目标帧图像,所述第二目标帧图像的曝光结束时间晚于所述第一目标帧图像的曝光结束时间,且所述第一目标帧图像和所述第二目标帧图像之间间隔有N个目标帧图像,所述N为大于或等于0的自然数;a first determining unit, configured to determine a second target frame image if the first target shake amount is greater than the preset value, and an exposure end time of the second target frame image is later than the first target frame image Exposure end time, and there are N target frame images between the first target frame image and the second target frame image, the N being a natural number greater than or equal to 0;
    第二判断单元,用于判断第二目标抖动量是否小于或等于所述预设值,所述第二目标抖动量为所述第二目标帧图像所具有的抖动量; a second determining unit, configured to determine whether the second target jitter amount is less than or equal to the preset value, where the second target jitter amount is a jitter amount of the second target frame image;
    第二输出单元,用于若所述第二目标抖动量小于或等于所述预设值,则输出所述第二目标图像帧。And a second output unit, configured to output the second target image frame if the second target jitter amount is less than or equal to the preset value.
  11. 根据权利要求10所述的电子设备,其特征在于,所述第二输出单元还用于,若所述第二目标抖动量大于所述预设值,则输出第三目标帧图像,所述第三目标帧图像为帧图像序列中的任一帧图像,所述帧图像序列包括所述第一目标帧图像和所述第二目标帧图像,且所述第三目标帧图像所具有的抖动量是所述帧图像序列中的所有帧图像所具有的抖动量的最小值。The electronic device according to claim 10, wherein the second output unit is further configured to output a third target frame image if the second target jitter amount is greater than the preset value, The three target frame image is any frame image in the frame image sequence, and the frame image sequence includes the first target frame image and the second target frame image, and the third target frame image has a jitter amount Is the minimum value of the amount of jitter that all of the frame images in the sequence of frame images have.
  12. 根据权利要求9至11任一项所述的电子设备,其特征在于,所述第一获取单元还用于,获取目标像素的目标采样数据,所述目标像素为位于目标像素行内的任一像素,且所述目标像素的曝光时间为所述目标采样时间点,所述目标像素行为所述第一目标帧图像所包括的任一像素行,所述目标采样数据为所述目标像素在所述目标采样时间点的抖动数据。The electronic device according to any one of claims 9 to 11, wherein the first obtaining unit is further configured to acquire target sampling data of the target pixel, where the target pixel is any pixel located in the target pixel row. And the exposure time of the target pixel is the target sampling time point, the target pixel acts on any pixel row included in the first target frame image, and the target sampling data is the target pixel in the Jitter data at the target sampling time point.
  13. 根据权利要求12所述的电子设备,其特征在于,所述电子设备还包括:The electronic device according to claim 12, wherein the electronic device further comprises:
    第二获取单元,用于获取所述第一目标帧图像所包括的任一行像素开始曝光的时间;a second acquiring unit, configured to acquire a time when any row of pixels included in the first target frame image starts to be exposed;
    第二确定单元,用于确定所述目标像素行,其中,所述目标像素行的开始曝光的时间为所述目标采样时间点。a second determining unit, configured to determine the target pixel row, wherein a time when the target pixel row starts to be exposed is the target sampling time point.
  14. 根据权利要求12或13所述的电子设备,其特征在于,所述电子设备还包括:The electronic device according to claim 12 or 13, wherein the electronic device further comprises:
    第一计算单元,用于根据所述目标采样时间点和所述目标采样数据计算目标像素行的子目标抖动量;a first calculating unit, configured to calculate a sub-target jitter amount of the target pixel row according to the target sampling time point and the target sampling data;
    第三确定单元,用于确定所述目标像素行的数目;a third determining unit, configured to determine a number of the target pixel rows;
    第二计算单元,用于若所述目标像素行的数目为1,则所述第一目标抖动量等于所述子目标抖动量;若所述目标像素行的数目为大于1的自然数,则对所有所述子目标抖动量通过平均算法进行计算以获取所述第一目标抖动量。a second calculating unit, configured to: if the number of the target pixel rows is 1, the first target jitter amount is equal to the sub-target jitter amount; if the target pixel row number is a natural number greater than 1, All of the sub-target shake amounts are calculated by an averaging algorithm to obtain the first target shake amount.
  15. 根据权利要求14所述的电子设备,其特征在于,所述第二计算单元包括:The electronic device according to claim 14, wherein the second calculating unit comprises:
    计算模块,用于根据所述目标采样时间点和所述目标采样数据计算位于所 述目标像素行内任一目标像素的目标坐标;a calculation module, configured to calculate a location based on the target sampling time point and the target sampling data a target coordinate of any target pixel in the target pixel row;
    第一确定模块,用于若位于所述目标像素行内的所述目标像素的数目为一个,则所述子目标抖动量为所述目标坐标与原点坐标之间的距离;a first determining module, configured to: if the number of the target pixels located in the target pixel row is one, the sub-target jitter amount is a distance between the target coordinate and the origin coordinate;
    第二确定模块,用于若位于所述目标像素行内的所述目标像素的数目为至少两个,则设置目标集合,所述目标集合包括多个目标距离,所述目标距离为所有所述目标坐标中任意两个所述目标坐标之间的距离,且所述目标距离还为任一所述目标坐标与所述原点坐标之间的距离;a second determining module, configured to set a target set if the number of the target pixels located in the target pixel row is at least two, the target set includes a plurality of target distances, and the target distance is all the targets a distance between any two of the target coordinates in the coordinate, and the target distance is also a distance between any of the target coordinates and the origin coordinate;
    第三确定模块,用于获取所述子目标抖动量,所述子目标抖动量为位于所述目标集合内的所有所述目标距离中的最大值。And a third determining module, configured to acquire 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. 根据权利要求15所述的电子设备,其特征在于,所述计算模块包括:The electronic device according to claim 15, wherein the calculation module comprises:
    第一获取子模块,用于获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿X轴平移的第一抖动数据;a first acquiring sub-module, configured to acquire first jitter data that is located on the X-axis of any target pixel in the target pixel row at the target sampling time point;
    第一计算子模块,用于对所述第一抖动数据进行积分运算以获取第一坐标数据;a first calculation submodule, configured to perform an integration operation on the first jitter data to obtain first coordinate data;
    第二获取子模块,用于获取位于所述目标像素行内任一目标像素在所述目标采样时间点沿Y轴平移的第二抖动数据;a second acquiring sub-module, configured to acquire second jitter data that is located on the Y-axis of any target pixel in the target pixel row at the target sampling time point;
    第二计算子模块,用于对所述第二抖动数据进行积分运算以获取第二坐标数据;a second calculation submodule, configured to perform an integration operation on the second jitter data to obtain second coordinate data;
    确定子模块,用于位于所述目标像素行内任一目标像素的目标坐标包括目标横坐标和目标纵坐标,确定所述目标横坐标为所述第一坐标数据,所述目标纵坐标为所述第二坐标数据。Determining a sub-module, wherein target coordinates for any target pixel located in the target pixel row include a target abscissa and a target ordinate, determining that the target abscissa is the first coordinate data, and the target ordinate is the Second coordinate data.
  17. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    一个或多个微计算机、图像存储器、总线系统、以及一个或多个程序,所述微计算机和所述图像存储器通过所述总线系统相连;One or more microcomputers, image memories, bus systems, and one or more programs, the microcomputers and the image memory being connected by the bus system;
    其中所述一个或多个程序被存储在所述图像存储器中,所述一个或多个程序包括指令,所述指令当被所述电子设备执行时使所述电子设备执行如权利要求1至8任一项所述的方法。Wherein the one or more programs are stored in the image memory, the one or more programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform as claimed in claims 1 to 8 The method of any of the preceding claims.
  18. 一种存储一个或多个程序的计算机可读存储介质,其特征在于,所述一个或多个程序包括指令,所述指令当被电子设备执行时使所述电子设备执行 如权利要求1至8任一项所述的方法。 A computer readable storage medium storing one or more programs, wherein the one or more programs include instructions that, when executed by an electronic device, cause the electronic device to execute A method as claimed in any one of claims 1 to 8.
PCT/CN2016/111452 2016-10-17 2016-12-22 Image output method and electronic device WO2018072308A1 (en)

Priority Applications (1)

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

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610901195.6 2016-10-17
CN201610901195 2016-10-17

Publications (1)

Publication Number Publication Date
WO2018072308A1 true WO2018072308A1 (en) 2018-04-26

Family

ID=62018196

Family Applications (1)

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

Country Status (2)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113225473A (en) * 2020-02-05 2021-08-06 浙江大华技术股份有限公司 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 (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104104856A (en) * 2013-04-09 2014-10-15 腾讯科技(深圳)有限公司 Image acquisition method and device and electronic device
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
CN105578061A (en) * 2016-02-25 2016-05-11 广东欧珀移动通信有限公司 Anti-shaking method and device for photographing, and mobile terminal

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4872797B2 (en) * 2007-05-18 2012-02-08 カシオ計算機株式会社 Imaging apparatus, imaging method, and imaging program
JP6062656B2 (en) * 2012-05-02 2017-01-18 キヤノン株式会社 Imaging apparatus, control method, and program
SI2858269T1 (en) * 2012-05-24 2018-06-29 Panasonic Intellectual Property Corporation Of America Information communication method
CN103051836B (en) * 2012-12-14 2016-03-30 中兴通讯股份有限公司 Mobile terminal stabilization photographic method and device
JP6460653B2 (en) * 2014-06-11 2019-01-30 オリンパス株式会社 Image processing apparatus, imaging apparatus including the same, image processing method, and image processing program
CN105323420B (en) * 2014-07-29 2019-02-22 腾讯科技(深圳)有限公司 Method of video image processing and device
JP5914716B1 (en) * 2015-02-19 2016-05-11 オリンパス株式会社 Imaging device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104104856A (en) * 2013-04-09 2014-10-15 腾讯科技(深圳)有限公司 Image acquisition method and device and electronic device
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
CN105578061A (en) * 2016-02-25 2016-05-11 广东欧珀移动通信有限公司 Anti-shaking method and device for photographing, and mobile terminal

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113225473A (en) * 2020-02-05 2021-08-06 浙江大华技术股份有限公司 Method, apparatus, device and medium for auto-focusing
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

Also Published As

Publication number Publication date
CN108476286A (en) 2018-08-31
CN108476286B (en) 2020-09-08

Similar Documents

Publication Publication Date Title
JP6271990B2 (en) Image processing apparatus and image processing method
WO2018201809A1 (en) Double cameras-based image processing device and method
JP5589548B2 (en) Imaging apparatus, image processing method, and program storage medium
JP5794705B2 (en) Imaging apparatus, control method thereof, and program
JP6047025B2 (en) Imaging apparatus and control method thereof
JP5843454B2 (en) Image processing apparatus, image processing method, and program
JP6593629B2 (en) Image processing apparatus, solid-state imaging device, and electronic device
US20120300115A1 (en) Image sensing device
JP5938281B2 (en) Imaging apparatus, control method therefor, and program
TW201103317A (en) Response to detection of blur in an image
JP5950678B2 (en) Imaging apparatus, control method, and program
CN110536057A (en) Image processing method and device, electronic equipment, computer readable storage medium
JP5499050B2 (en) Image processing apparatus, imaging apparatus, and image processing method
JP6319972B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP5766077B2 (en) Image processing apparatus and image processing method for noise reduction
US9363427B2 (en) Device and method for calibrating a temporal contrast sensor with a frame-based camera sensor
JP6656035B2 (en) Image processing apparatus, imaging apparatus, and control method for image processing apparatus
JP2012195797A (en) Pan-focus image generating device
WO2018072308A1 (en) Image output method and electronic device
JP2018074361A (en) Imaging apparatus, imaging method, and program
JP6483661B2 (en) Imaging control apparatus, imaging control method, and program
US20150254856A1 (en) Smart moving object capture methods, devices and digital imaging systems including the same
JP5743769B2 (en) Image processing apparatus and image processing method
Sindelar et al. Space-variant image deblurring on smartphones using inertial sensors
JP2015216604A (en) Image processing system, method of the same, and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16919425

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16919425

Country of ref document: EP

Kind code of ref document: A1