WO2020088317A1 - 拍摄方法及电子设备 - Google Patents

拍摄方法及电子设备 Download PDF

Info

Publication number
WO2020088317A1
WO2020088317A1 PCT/CN2019/112680 CN2019112680W WO2020088317A1 WO 2020088317 A1 WO2020088317 A1 WO 2020088317A1 CN 2019112680 W CN2019112680 W CN 2019112680W WO 2020088317 A1 WO2020088317 A1 WO 2020088317A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
telescopic
displacement
camera
telescopic camera
Prior art date
Application number
PCT/CN2019/112680
Other languages
English (en)
French (fr)
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 维沃移动通信有限公司
Publication of WO2020088317A1 publication Critical patent/WO2020088317A1/zh

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
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F16ENGINEERING ELEMENTS AND UNITS; GENERAL MEASURES FOR PRODUCING AND MAINTAINING EFFECTIVE FUNCTIONING OF MACHINES OR INSTALLATIONS; THERMAL INSULATION IN GENERAL
    • F16MFRAMES, CASINGS OR BEDS OF ENGINES, MACHINES OR APPARATUS, NOT SPECIFIC TO ENGINES, MACHINES OR APPARATUS PROVIDED FOR ELSEWHERE; STANDS; SUPPORTS
    • F16M11/00Stands or trestles as supports for apparatus or articles placed thereon ; Stands for scientific apparatus such as gravitational force meters
    • F16M11/02Heads
    • F16M11/04Means for attachment of apparatus; Means allowing adjustment of the apparatus relatively to the stand
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/57Mechanical or electrical details of cameras or camera modules specially adapted for being embedded in other devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/68Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
    • H04N23/682Vibration or motion blur correction
    • H04N23/685Vibration or motion blur correction performed by mechanical compensation
    • H04N23/687Vibration or motion blur correction performed by mechanical compensation by shifting the lens or sensor position
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/698Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture

Definitions

  • the present disclosure relates to the field of communication technology, and in particular, to a shooting method and electronic equipment.
  • the electronic equipment has a panoramic shooting function.
  • the current implementation of the panoramic shooting function is to stitch together multiple frames of images collected during the movement of the electronic device, and finally merge into a complete panoramic photo. In this way, during the shooting process, it is necessary to control the electronic device to move in the horizontal direction as much as possible.
  • Some embodiments of the present disclosure provide a shooting method and an electronic device to solve the problem of poor panoramic images due to the shaking of the electronic device during shooting.
  • some embodiments of the present disclosure provide a shooting method, which is applied to an electronic device with a retractable camera, including:
  • the second displacement of the position is opposite to the first displacement direction.
  • some embodiments of the present disclosure also provide an electronic device having a retractable camera, including:
  • a first acquisition module configured to control the telescopic camera to acquire a first image at a first position
  • a determining module configured to determine the first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera when the telescopic camera is moved to the second position;
  • a second acquisition module configured to control the telescopic camera to move to a third position in the telescopic direction and acquire a second image at the third position; wherein, the third position is at the telescopic position of the telescopic camera
  • the second displacement in the direction relative to the second position is opposite to the first displacement direction.
  • some embodiments of the present disclosure also provide an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, which is implemented when the processor executes the computer program The steps in the shooting method as described above.
  • some embodiments of the present disclosure also provide a readable storage medium that stores a computer program on the computer-readable storage medium, and when the computer program is executed by a processor, implements the steps in the shooting method described above .
  • the telescopic camera is controlled to acquire a first image at a first position; when the telescopic camera is moved to a second position, it is determined that the second position is at the position of the telescopic camera A first displacement relative to the first position in the telescoping direction; controlling the telescoping camera to move to a third position in the telescoping direction and acquiring a second image at the third position; wherein, the third position is at The second displacement relative to the second position in the telescopic direction of the telescopic camera is opposite to the first displacement direction.
  • the telescopic camera is used to compensate for the displacement of the electronic device in the vertical direction, which can reduce the impact of the electronic device on the panoramic image and improve the shooting effect of the panoramic image.
  • FIG. 1 is one of flowcharts of shooting methods provided by some embodiments of the present disclosure
  • FIG. 2a is a second flowchart of a shooting method provided by some embodiments of the present disclosure.
  • 2b is one of the structural diagrams of the electronic device provided by some embodiments of the present disclosure.
  • 2c is a third flowchart of a shooting method provided by some embodiments of the present disclosure.
  • FIG. 3 is a second structural diagram of an electronic device provided by some embodiments of the present disclosure.
  • FIG. 4 is a third structural diagram of an electronic device provided by some embodiments of the present disclosure.
  • FIG. 5 is a structural diagram of a determination module in an electronic device provided by some embodiments of the present disclosure.
  • FIG. 6 is a structural diagram of a determining submodule in an electronic device provided by some embodiments of the present disclosure.
  • FIG. 7 is a fourth structural diagram of an electronic device provided by some embodiments of the present disclosure.
  • FIG. 8 is a fifth structural diagram of an electronic device provided by some embodiments of the present disclosure.
  • FIG. 1 is a flowchart of a shooting method provided by some embodiments of the present disclosure, and the method is applied to an electronic device having a telescopic camera. As shown in Figure 1, it includes the following steps:
  • Step 101 Control the telescopic camera to collect a first image at a first position.
  • the telescopic camera can be a telescopic camera.
  • the telescopic camera can extend out of the electronic device body when in use, and can be retracted to the electronic device body when not in use. The camera can be moved away from and close to the electronic device body by stretching .
  • the first image may be an image collected at the first position after the telescopic camera extends out of the electronic device body.
  • Step 102 When the telescopic camera is moved to a second position, determine a first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera.
  • the electronic device can acquire the displacement of the second position relative to the first position in the telescopic direction, that is, the first displacement.
  • the above-mentioned telescopic direction can be understood as the direction in which the telescopic camera moves relative to the body of the electronic device when telescopic.
  • the above-mentioned first displacement can be specifically determined by comparing the acquired images, for example, by performing feature matching on the two acquired images to obtain the longitudinal displacement difference of the two images, so that the telescopic camera can be calculated in the telescopic direction Height difference.
  • it can also be determined by monitoring the height change of the electronic device in the vertical direction in real time, for example, using a distance sensor to detect the height of the electronic device from the ground in real time, thereby monitoring the height change of the electronic device,
  • the changing height is the first displacement.
  • Step 103 Control the telescopic camera to move to a third position in the telescopic direction, and collect a second image at the third position.
  • the second displacement of the third position relative to the second position in the telescopic direction of the telescopic camera is opposite to the first displacement direction.
  • the telescopic camera can be controlled to expand and contract to compensate for the displacement caused by the shake. For example, if the electronic device moves up by a first displacement due to jitter, for example, by 0.2 cm upwards, the telescopic camera can contract so that the camera moves down by a second displacement, for example, by 0.2 cm downward, and collects after the camera contracts The second image.
  • the second displacement can be equal to the value of the first displacement. In this way, the effect caused by the first displacement can be better compensated, so that the camera maintains the vertical viewing angle during the panoramic shooting process.
  • the second displacement may also be a value smaller than the first displacement.
  • the direction of the first displacement is up to 5mm; the direction of the second displacement is down to 5mm or 4mm .
  • the value of the second displacement may also be a value greater than the first displacement.
  • the direction of the first displacement is upwards, and the value is 5 mm.
  • the camera can be controlled to move downward by 6 mm to compensate for the camera's upward shaking.
  • the telescopic camera moves to the third position, since the third position is closer to the first position, the telescopic camera is used to collect the second image.
  • the second image collected at this time and the first image collected by the telescopic camera at the first position The difference in height is small.
  • the above-mentioned shooting method may be applied to electronic devices, such as: mobile phones, tablet computers (Tablet Personal Computer), laptop computers (Laptop Computer), personal digital assistants (personal digital assistant (PDA), mobile Internet access device (Mobile Internet Device, MID) or wearable device (Wearable Device), etc.
  • electronic devices such as: mobile phones, tablet computers (Tablet Personal Computer), laptop computers (Laptop Computer), personal digital assistants (personal digital assistant (PDA), mobile Internet access device (Mobile Internet Device, MID) or wearable device (Wearable Device), etc.
  • the shooting method of some embodiments of the present disclosure controls the telescopic camera to acquire a first image at a first position; when the telescopic camera is moved to a second position, it is determined that the second position is at the telescopic type A first displacement relative to the first position in the telescopic direction of the camera; controlling the telescopic camera to move to a third position in the telescopic direction and acquiring a second image at the third position; wherein, the third The second displacement of the position relative to the second position in the telescopic direction of the telescopic camera is opposite to the first displacement direction.
  • the electronic device can compensate for the vertical shake in real time, increase the success rate of the panoramic shooting, and avoid the strict requirements on the user's shooting method. Improve user experience. By compensating the shaking of the electronic device in the vertical direction, the panoramic viewing angle of the panoramic image can be restored, and the image cropping due to the shaking can be reduced. In addition, because the difference between image frames is small, the process of image synthesis is easier, and the stitching transition is more natural, so that the effect of the panoramic image is better.
  • the main difference between this embodiment and the above embodiment is that, based on the longitudinal displacement of the third image relative to the first image, the first displacement of the second position in the telescopic direction of the telescopic camera relative to the first position is calculated .
  • FIG. 2a is a flowchart of a shooting method provided by some embodiments of the present disclosure. As shown in FIG. 2a, the method includes the following steps:
  • Step 201 Control the telescopic camera to collect a first image at a first position.
  • step 101 For a specific implementation manner of this step, reference may be made to the related description of step 101 in the foregoing embodiment.
  • Step 202 When the telescopic camera is moved to the second position, control the telescopic camera to collect a third image at the second position.
  • the electronic device moves and the camera moves.
  • the camera collects the third image at the second position, and the third image may be an image collected after the camera shakes.
  • Step 203 Determine the longitudinal displacement of the third image relative to the first image.
  • the electronic device can determine the amount of longitudinal displacement of the third image relative to the first image based on the third image and the content captured in the first image.
  • the longitudinal displacement amount may specifically be the longitudinal displacement amount of the photographic object in the third image relative to the photographic object in the first image, and the electronic device may determine the displacement by comparing the image contour of the first image with the image contour of the third image .
  • the determining the longitudinal displacement of the third image relative to the first image includes:
  • the longitudinal displacement of the third image relative to the first image is determined.
  • the electronic device may use the feature detection operator to calculate the strong corner points of the image to obtain the feature points of the image frame.
  • the feature points of the image may be obtained according to the color change of the image.
  • the feature detection operator can use Harris corners, Surf corners, and so on. After acquiring the feature points of the first image and the third image respectively, the feature points of the first image and the third image are matched.
  • the feature matching can use a traditional brute force matching or nearest neighbor matching algorithm to obtain a matching relationship.
  • both the first image and the third image contain face images, and the face images in the first image and the third image can be matched to determine the face image in the third image relative to the face image in the first image The amount of vertical displacement of the face image.
  • the perspective change matrix H of the first image and the third image can be estimated according to the matching relationship between the first image and the third image.
  • the perspective transformation matrix is as shown in equation (1), where s is the zoom factor and M is the camera Internal reference matrix, [r 1 r 2 ] represents the rotation of the image, and t represents the horizontal and vertical direction of the image, that is, the vertical displacement.
  • the number of displacement pixels ⁇ y of the third image relative to the first image in the longitudinal direction can be obtained, and the number of displacement pixels and the pixel size can be used to obtain the displacement ⁇ Y of the image in the vertical direction, that is, the third image The amount of longitudinal displacement relative to the first image.
  • the solution of this embodiment is used to calculate the longitudinal displacement of the third image relative to the first image, so as to calculate the displacement of the camera in the vertical direction, which can improve the accuracy of the calculation, and thus can improve the synthesis effect of the panoramic image.
  • Step 204 Based on the longitudinal displacement amount, calculate a first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera.
  • the first displacement of the camera between the second position and the first position is calculated based on the longitudinal displacement between the third image collected at the second position and the first image collected at the first position.
  • the value of the first displacement Y can be determined according to the image original size ⁇ and displacement ⁇ Y of the telescopic camera:
  • the displacement ⁇ Y may be the displacement of the third image relative to the first image in the longitudinal direction.
  • the calculating the first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera based on the longitudinal displacement includes:
  • a first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera is calculated.
  • the longitudinal displacement of the third image relative to the first image when the longitudinal displacement of the third image relative to the first image is obtained, it may be determined whether the longitudinal displacement is greater than a preset value.
  • the preset value may be a value preset by the electronic device.
  • the longitudinal displacement amount is less than the preset value, it means that the deviation of the third image relative to the first image in the longitudinal direction is small, that is, the jitter of the electronic device is small and can be ignored.
  • the vertical displacement is greater than or equal to the preset value, it means that the third image has a greater deviation in the longitudinal direction from the first image, that is, the electronic device shakes up and down greatly, and the electronic device needs to compensate for displacement through the telescopic camera.
  • the electronic device Based on the longitudinal displacement between the images, the displacement of the telescopic camera's vertical shake is calculated, which is the first displacement.
  • the electronic device performs displacement compensation by moving the telescopic camera, but the image collected by the electronic device when the vibration is small can be processed without processing and can Improve the effect of panoramic shooting and save power consumption of electronic equipment.
  • Step 205 Control the telescopic camera to move to a third position in the telescopic direction, and collect a second image at the third position.
  • the second displacement of the third position relative to the second position in the telescopic direction of the telescopic camera is opposite to the first displacement direction.
  • step 103 For the implementation of this step, please refer to the description in step 103. To avoid repetition, it will not be repeated here.
  • the method further includes:
  • panoramic shooting may be an image obtained by synthesizing a plurality of shot images into one image to obtain a wider field of view.
  • the first image and the second image can be combined to obtain a panoramic image.
  • multiple second images can be captured in the above manner, thereby synthesizing the first image and the multiple second images. Since the second image is an image taken after correcting the shooting position, the resulting composite image has a better effect.
  • the first image may be any frame image collected during the panoramic shooting process, and the electronic device may adjust the position of the camera based on the collected first image.
  • This embodiment can be applied to the embodiment corresponding to FIG. 1 and achieve the same beneficial effects.
  • the first image is the first frame of image collected by the telescopic camera during panoramic shooting, or the last frame of the image that has been collected by the telescopic camera during panoramic shooting.
  • the position of the telescopic camera at the time of collecting the first image that is, the first position
  • the position of the telescopic camera changes, so that the telescopic camera is controlled to expand and contract with the first position as the reference position to compensate for the displacement caused by the jitter of the electronic device, so that the position of the telescopic camera is close to the first position, that is, the acquisition is guaranteed
  • the positions of the first image and the second image are close, and the effect of the combined image is improved.
  • the position of the camera when the last frame of image was collected is used as the reference position, and the displacement is based on the displacement of the camera shake Compensation makes the position of the telescopic camera close to the first position, that is, the position when collecting the first image and the second image is guaranteed to be close, and the effect of synthesizing the image is improved.
  • the method further includes:
  • a panoramic image is synthesized based on images other than the target image among all frame images collected by the telescopic camera during panoramic shooting, and the longitudinal displacement of the target image relative to the first image is greater than a preset value.
  • all images collected during the panoramic shooting process of the telescopic camera can be used for image synthesis.
  • the longitudinal displacement of the target image relative to the first image is large, that is, greater than the preset value, it means that when the target image is collected, the jitter displacement of the electronic device is large, so the electronic device removes the target image from the acquired image Removal, get all images except the target image in all frame images, and use the remaining images after the removal to perform image synthesis.
  • the above-mentioned other images may include images acquired after displacement compensation using a mobile telescopic camera, and these images may be used in place of the removed target images, so that the images are synthesized in the order of the images of each frame during shooting.
  • the above-mentioned image synthesis process may be performed specifically during shooting, or may be performed after shooting is completed.
  • the image collected when the telescopic camera has a large displacement can be eliminated, and only when the telescopic camera produces a small vertical displacement
  • the collected images are synthesized into a panoramic image, which can improve the effect of the synthesized image.
  • the telescopic camera collects the first image at the first position, and the camera moves to the second position due to human hand shaking and collects the second image.
  • the electronic device corrects the position of the camera, and collects the third image at the third position after correcting the camera; at this time, the camera moves to the fourth position and collects the fourth image due to human hand shaking, and then the electronic device adjusts the camera to the fifth position and Acquire the fifth frame image.
  • the second and fourth positions are offset from the first position, resulting in a poor effect of the second and fourth images.
  • the third image can be replaced with the second image, and the fifth image can be replaced with the fourth image, that is, the second image and the fourth image are removed, and the first image, the third image, and the fifth image are combined into a panoramic image.
  • the third image and the first image are synthesized, and subsequent image collection is performed at the same time.
  • This embodiment can also be applied to the embodiment corresponding to FIG. 1 and achieve the same beneficial effects.
  • the image may be subjected to projection transformation correction.
  • the distance between the shooting object and the camera is different, resulting in different shooting effects of the same shooting object.
  • a panoramic river is required due to the long river.
  • a curved river is obtained.
  • the panoramic image can be corrected so that the river appears on the panoramic image as being located in the same vertical plane, rather than showing the effect of being located on a spherical surface.
  • a reference image is obtained in the image sequence, and the subject in the image other than the reference image in the image sequence is corrected so that the subject is in the same plane .
  • the reference image may be the first frame image or any frame image in the shooting process.
  • the center of the shooting sequence may be used as the reference image.
  • the fifth frame image may be used as the reference image.
  • the stitching seam between the image frames can be estimated, and the image can be continuously synthesized according to the stitching algorithm such as distance weighting.
  • the stitching algorithm such as distance weighting.
  • the exposure compensation can be performed on the synthesized image, that is, the exposure value is adjusted on the synthesized panoramic image to maintain uniform brightness of the entire panoramic image and improve the effect of the panoramic image.
  • the shooting method of some embodiments of the present disclosure calculates the first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera based on the longitudinal displacement of the third image relative to the first image.
  • the displacement calculation accuracy of the telescopic camera in the telescopic direction can be improved, thereby improving the displacement compensation accuracy and the effect of panoramic shooting.
  • the shooting method is mainly realized by four modules of the electronic device, a telescopic camera, an information processing module, a control module and a panoramic image synthesis module.
  • the connection relationship of the modules can be seen in FIG. 2b.
  • the telescopic camera can capture the image sequence in real time, and the telescopic camera can be controlled to accurately extend and contract through the driving signal to compensate for the change of the field of view of the output image in real time.
  • the information processing module can calculate the amount of moving pixels in the vertical direction between different frames of the image by analyzing the image sequence, and convert the amount of moving pixels into the actual displacement of the electronic device.
  • the control module can receive the displacement output from the information processing module and convert it into a driving signal such as voltage, and drive a stepper motor to control the expansion and contraction of the camera to compensate for the vertical shake of the electronic device when the user shoots.
  • a driving signal such as voltage
  • the panoramic image synthesis module is used to screen the compensated image sequence, and generate a panoramic image through synthesis algorithms such as projection change, stitching seam estimation, and exposure compensation.
  • the shooting method includes the following steps:
  • Step 1 The electronic device starts the panoramic photo mode, and obtains a continuous image sequence in real time.
  • Step 2 Use the feature detection operator to calculate the strong corner points of the image to obtain the feature points of the image frame, and then match the feature points between the image frames.
  • Step 3 According to the feature matching result between the image frames, the perspective change matrix H between the image frames is estimated, and the calculation formula of H is as shown in formula (1) in the above embodiment. From the homography matrix H between the image frames, the number of displacement pixels ⁇ y of the image in the vertical direction can be obtained, and the displacement ⁇ Y of the image in the vertical direction can be obtained according to the number of displacement pixels.
  • Step 4 Compare the displacement ⁇ Y with the preset threshold T.
  • ⁇ Y> T it means that the height of the electronic device has changed in the vertical direction, go to step 5; when ⁇ Y ⁇ T, go to step 7.
  • Step 5 According to equation (2) in the above embodiment, the pixel displacement amount ⁇ Y is converted into the displacement amount Y that the telescopic camera should actually move.
  • Step 6 The control module will receive the actual displacement amount Y and convert it into a driving signal to drive the telescopic camera to expand and contract to compensate for the displacement of the camera in the vertical direction, keep the vertical angle of view unchanged during panorama shooting, and return to step 2.
  • Step 7 Remove the redundant images in the image sequence, and perform projection transformation correction on the images according to the homography matrix obtained in Step 3.
  • the redundant image may be an image that is less effective due to a larger displacement of the camera offset.
  • Step 8 Estimate the stitching seam between the image frames, perform fusion according to the stitching algorithm such as distance weight, and perform exposure compensation on the fused panoramic image to maintain uniform brightness.
  • Step 9 Output the panoramic image after vertical viewing angle compensation.
  • the present disclosure can restore the panoramic angle of view of the captured landscape to the greatest extent, and the telescopic camera can compensate the user's shaking of the electronic device during shooting, reduce the user's requirement for the photographing posture, and improve the user's experience of shooting panoramic photos Compensated by the retractable camera, the difference between the image frames is reduced, the stitching transition of the panoramic photos will be more natural, and the shooting success rate will be higher.
  • FIG. 3 is a structural diagram of an electronic device provided by some embodiments of the present disclosure.
  • the electronic device has a telescopic camera.
  • the electronic device 300 includes: a first collection module 301 and a determination module 302 ⁇ ⁇ ⁇ module 303.
  • the first acquisition module 301 is used to control the telescopic camera to acquire the first image at the first position;
  • the determining module 302 is configured to determine the first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera when the telescopic camera is moved to the second position;
  • the second acquisition module 303 is used to control the telescopic camera to move to a third position in the telescopic direction and acquire a second image at the third position; wherein the third position is at the position of the telescopic camera
  • the second displacement relative to the second position in the telescopic direction is opposite to the first displacement direction.
  • the electronic device further includes:
  • the first synthesis module 304 is used to synthesize the first image and the second image to obtain a panoramic image.
  • the first image is the first frame of image collected by the telescopic camera during panoramic shooting, or the last frame of the image that has been collected by the telescopic camera during panoramic shooting.
  • the determination module 302 includes:
  • An acquisition submodule 3021 configured to control the telescopic camera to acquire a third image at the second position
  • a determining submodule 3022 configured to determine a longitudinal displacement of the third image relative to the first image
  • the calculation submodule 3023 is configured to calculate a first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera based on the longitudinal displacement.
  • the determining submodule 3022 includes:
  • the detecting unit 30221 is configured to detect the feature points of the first image and the feature points of the third image respectively;
  • the matching unit 30222 is configured to match the feature points of the first image and the feature points of the third image to obtain a matching relationship
  • the determining unit 30223 is configured to determine the longitudinal displacement of the third image relative to the first image based on the matching relationship.
  • the calculation sub-module 3023 is specifically configured to, when the longitudinal displacement is greater than a preset value, calculate the telescopic direction of the second position in the telescopic camera based on the longitudinal displacement A first displacement relative to the first position.
  • the electronic device further includes:
  • the second synthesis module 305 is configured to synthesize a panoramic image according to all images except the target image in all frame images collected by the telescopic camera during the panoramic shooting process, and the target image is longitudinal to the first image The displacement is greater than the preset value.
  • the electronic device 300 can implement various processes implemented by the electronic device in the foregoing method embodiments. To avoid repetition, details are not described here.
  • the electronic device 300 of some embodiments of the present disclosure uses the expansion and contraction of the telescopic camera to compensate for the displacement of the electronic device in the vertical direction, which can reduce the impact of the electronic device on the panoramic image and improve the panoramic image. Shooting effect.
  • the electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, and a display unit 806, user input unit 807, interface unit 808, memory 809, processor 810, power supply 811 and other components.
  • a radio frequency unit 801 for example, a radio frequency unit 801
  • a network module 802 for example, a radio frequency unit 801
  • an audio output unit 803 an input unit 804
  • a sensor 805 a sensor 805
  • a display unit 806 user input unit 807, interface unit 808, memory 809, processor 810, power supply 811 and other components.
  • FIG. 8 does not constitute a limitation on the electronic device, and the electronic device may include more or less components than the illustration, or combine certain components, or different components Layout.
  • electronic devices include but are not limited to mobile phones, tablet computers, notebook computers, palmtop computers, in-vehicle mobile terminals, wearable devices, and pedometers.
  • the processor 810 is configured to control the telescopic camera to acquire a first image at a first position; when the telescopic camera is moved to a second position, it is determined that the second position is at the position of the telescopic camera A first displacement relative to the first position in the telescoping direction; controlling the telescoping camera to move to a third position in the telescoping direction and acquiring a second image at the third position; wherein, the third position is at The second displacement relative to the second position in the telescopic direction of the telescopic camera is opposite to the first displacement direction.
  • the telescopic camera is used to compensate for the vertical displacement of the electronic device, which can reduce the impact of the electronic device on the panoramic image and improve the shooting effect of the panoramic image.
  • the method further includes: synthesizing the first image and the second image to obtain a panoramic image.
  • the first image is the first frame of image collected by the telescopic camera during panoramic shooting, or the last frame of the image that has been collected by the telescopic camera during panoramic shooting.
  • the processor 810 executes the first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera, including: controlling the telescopic camera to the second position Acquiring a third image at a position; determining a longitudinal displacement of the third image relative to the first image; based on the longitudinal displacement, calculating the second position relative to the telescopic direction of the telescopic camera The first displacement of the first position.
  • the processor 810 executing the determination of the longitudinal displacement of the third image relative to the first image includes: detecting feature points of the first image and feature points of the third image, respectively; Matching feature points of the first image and feature points of the third image to obtain a matching relationship; based on the matching relationship, determining a longitudinal displacement of the third image relative to the first image.
  • the processor 810 executes the calculation of the first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera based on the longitudinal displacement amount, including: in the longitudinal direction When the displacement amount is greater than a preset value, based on the longitudinal displacement amount, the first displacement of the second position relative to the first position in the telescopic direction of the telescopic camera is calculated.
  • the method further includes: removing all target images from all frame images collected during the panoramic shooting process by the telescopic camera The other images are combined into a panoramic image, and the longitudinal displacement of the target image relative to the first image is greater than a preset value.
  • the radio frequency unit 801 may be used to receive and send signals during sending and receiving information or during a call. Specifically, after receiving the downlink data from the base station, it is processed by the processor 810; To send the uplink data to the base station.
  • the radio frequency unit 801 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
  • the radio frequency unit 801 can also communicate with the network and other devices through a wireless communication system.
  • the electronic device provides wireless broadband Internet access for the user through the network module 802, such as helping the user to send and receive e-mail, browse the web, and access streaming media.
  • the audio output unit 803 may convert the audio data received by the radio frequency unit 801 or the network module 802 or stored in the memory 809 into an audio signal and output as sound. Moreover, the audio output unit 803 may also provide audio output related to a specific function performed by the electronic device 800 (eg, call signal reception sound, message reception sound, etc.).
  • the audio output unit 803 includes a speaker, a buzzer, a receiver, and the like.
  • the input unit 804 is used to receive audio or video signals.
  • the input unit 804 may include a graphics processor (Graphics, Processing, Unit, GPU) 8041 and a microphone 8042.
  • the graphics processor 8041 pairs the image of a still picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode
  • the data is processed.
  • the processed image frame may be displayed on the display unit 806.
  • the image frame processed by the graphics processor 8041 may be stored in the memory 809 (or other storage medium) or sent via the radio frequency unit 801 or the network module 802.
  • the microphone 8042 can receive sound, and can process such sound into audio data.
  • the processed audio data can be converted into a format that can be sent to the mobile communication base station via the radio frequency unit 801 in the case of a telephone call mode and output.
  • the electronic device 800 further includes at least one sensor 805, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 8061 according to the brightness of the ambient light, and the proximity sensor can close the display panel 8061 and the electronic device 800 when moving to the ear / Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when at rest, and can be used to identify the posture of electronic devices (such as horizontal and vertical screen switching, related games) , Magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc .; sensor 805 can also include fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, Infrared sensors, etc. will not be repeated here.
  • the display unit 806 is used to display information input by the user or information provided to the user.
  • the display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display (Liquid Crystal) (LCD), an organic light emitting diode (Organic Light-Emitting Diode, OLED), or the like.
  • LCD Liquid Crystal
  • OLED Organic Light-Emitting Diode
  • the user input unit 807 may be used to receive input numeric or character information, and generate key signal input related to user settings and function control of the electronic device.
  • the user input unit 807 includes a touch panel 8071 and other input devices 8072.
  • the touch panel 8071 also known as a touch screen, can collect user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc. on or near the touch panel 8071 operating).
  • the touch panel 8071 may include a touch detection device and a touch controller.
  • the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into contact coordinates, and then sends To the processor 810, the command sent by the processor 810 is received and executed.
  • the touch panel 8071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the user input unit 807 may also include other input devices 8072.
  • other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which are not repeated here.
  • the touch panel 8071 may be overlaid on the display panel 8061.
  • the touch panel 8071 detects a touch operation on or near it, it is transmitted to the processor 810 to determine the type of touch event, and then the processor 810 according to the touch The type of event provides corresponding visual output on the display panel 8061.
  • the touch panel 8071 and the display panel 8061 are implemented as two independent components to realize the input and output functions of the electronic device, in some embodiments, the touch panel 8071 and the display panel 8061 may be integrated The input and output functions of the electronic device are not limited here.
  • the interface unit 808 is an interface for connecting an external device to the electronic device 800.
  • the external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input / output (I / O) port, video I / O port, headphone port, etc.
  • the interface unit 808 may be used to receive input from external devices (eg, data information, power, etc.) and transmit the received input to one or more elements within the electronic device 800 or may be used in the electronic device 800 and external Transfer data between devices.
  • the memory 809 may be used to store software programs and various data.
  • the memory 809 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the storage data area may store Data created by the use of mobile phones (such as audio data, phone books, etc.), etc.
  • the memory 809 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the processor 810 is the control center of the electronic device, and uses various interfaces and lines to connect the various parts of the entire electronic device, by running or executing the software programs and / or modules stored in the memory 809, and calling the data stored in the memory 809 , Perform various functions of electronic devices and process data, so as to monitor the electronic devices as a whole.
  • the processor 810 may include one or more processing units; optionally, the processor 810 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, and application programs, etc.
  • the modulation processor mainly handles wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 810.
  • the electronic device 800 may further include a power supply 811 (such as a battery) that supplies power to various components.
  • a power supply 811 (such as a battery) that supplies power to various components.
  • the power supply 811 may be logically connected to the processor 810 through a power management system, thereby managing charge, discharge, and power consumption through the power management system Management and other functions.
  • the electronic device 800 includes some not-shown functional modules, which will not be repeated here.
  • some embodiments of the present disclosure also provide an electronic device, including a processor 810, a memory 809, and a computer program stored on the memory 809 and executable on the processor 810, the computer program is processed by the processor
  • the 810 is executed, the processes in the above embodiments of the shooting method are implemented, and the same technical effect can be achieved. To avoid repetition, no further description is provided here.
  • Some embodiments of the present disclosure also provide a computer-readable storage medium that stores a computer program on the computer-readable storage medium.
  • the computer program is executed by a processor, the processes of the above embodiments of the shooting method are implemented, and the same Technical effects, in order to avoid repetition, will not repeat them here.
  • the computer-readable storage medium such as read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Mechanical Engineering (AREA)
  • Studio Devices (AREA)
  • Stereoscopic And Panoramic Photography (AREA)

Abstract

本公开涉及通信技术领域,提供一种拍摄方法及电子设备。该方法包括:控制所述伸缩式摄像头在第一位置采集第一图像;当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。

Description

拍摄方法及电子设备
相关申请的交叉引用
本申请主张在2018年10月31日在中国提交的中国专利申请号No.201811285085.7的优先权,其全部内容通过引用包含于此。
技术领域
本公开涉及通信技术领域,尤其涉及一种拍摄方法及电子设备。
背景技术
随着电子设备的发展,电子设备具备全景拍摄功能。目前的全景拍摄功能的实现方式是,将电子设备在移动的过程中采集的多帧图像进行拼接,最终融合为一张完整的全景照片。这样,在拍摄的过程中,需要尽量控制电子设备在水平方向移动。
然而,在实际进行拍摄时,用户难免会发生手抖动的情况,当电子设备发生上下移动时,容易导致所拍摄得到的全景图像的效果较差。
发明内容
本公开的一些实施例提供一种拍摄方法及电子设备,以解决由于电子设备在拍摄过程中发生抖动而导致全景图像的效果较差的问题。
为了解决上述技术问题,本公开是这样实现的:
第一方面,本公开的一些实施例提供了一种拍摄方法,应用于具有伸缩式摄像头的电子设备,包括:
控制所述伸缩式摄像头在第一位置采集第一图像;
当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;
控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。
第二方面,本公开的一些实施例还提供一种电子设备,所述电子设备具有伸缩式摄像头,包括:
第一采集模块,用于控制所述伸缩式摄像头在第一位置采集第一图像;
确定模块,用于当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;
第二采集模块,用于控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。
第三方面,本公开的一些实施例还提供一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上所述的拍摄方法中的步骤。
第四方面,本公开的一些实施例还提供一种可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如上所述的拍摄方法中的步骤。
本公开的一些实施例中,控制所述伸缩式摄像头在第一位置采集第一图像;当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。这样,利用伸缩式摄像头的伸缩,对电子设备在竖直方向上的位移进行补偿,可以减少由于电子设备的抖动给全景图像造成的影响,可以提高全景图像的拍摄效果。
附图说明
为了更清楚地说明本公开的一些实施例的技术方案,下面将对本公开的一些实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本公开的一些实施例提供的拍摄方法的流程图之一;
图2a是本公开的一些实施例提供的拍摄方法的流程图之二;
图2b是本公开的一些实施例提供的电子设备的结构图之一;
图2c是本公开的一些实施例提供的拍摄方法的流程图之三;
图3是本公开的一些实施例提供的电子设备的结构图之二;
图4是本公开的一些实施例提供的电子设备的结构图之三;
图5是本公开的一些实施例提供的电子设备中的确定模块的结构图;
图6是本公开的一些实施例提供的电子设备中的确定子模块的结构图;
图7是本公开的一些实施例提供的电子设备的结构图之四;
图8是本公开的一些实施例提供的电子设备的结构图之五。
具体实施方式
下面将结合本公开的一些实施例中的附图,对本公开的一些实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
参见图1,图1是本公开的一些实施例提供的拍摄方法的流程图,该方法应用于具有伸缩式摄像头的电子设备。如图1所示,包括以下步骤:
步骤101、控制所述伸缩式摄像头在第一位置采集第一图像。
其中,伸缩式摄像头可以是能够进行伸缩的摄像头,伸缩式摄像头在使用时可以伸出电子设备本体,在不需要使用时可以收缩至电子设备本体,通过进行伸缩可以实现摄像头远离和靠近电子设备本体。
第一图像可以是伸缩式摄像头伸出电子设备本体后,在第一位置采集的图像。
步骤102、当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
在此步骤中,由于用户握持电子设备时可能会发生手抖动的情况,摄像头的位置也会随之移动。当伸缩式摄像头被移动至第二位置时,电子设备可以获取第二位置相对第一位置在伸缩方向上的位移,即第一位移。
其中,上述伸缩方向可以理解为,伸缩式摄像头伸缩时相对电子设备本体移动的方向。上述第一位移具体可以通过对已采集的图像进行对比确定,例如,通过对已采集的两张图像进行特征匹配,从而获取两张图像在纵向的位移差,从而可以计算伸缩式摄像头在伸缩方向上的高差。在通过水平方向移动的方式拍摄全景图像时,也可以通过实时监测电子设备在竖直方向上的高度变化确定,例如,利用距离传感器实时检测电子设备距离地面的高度,从而监测电子设备高度变化,变化的高度即第一位移。
步骤103、控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像。
其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。
在此步骤中,由于用户拍摄过程中摄像头发生抖动,会对拍摄效果造成影响。因此,可以通过控制伸缩式摄像头伸缩以补偿抖动产生的位移。例如,若电子设备由于抖动向上移动第一位移,例如,向上移动0.2厘米,则伸缩式摄像头可以收缩从而使摄像头向下移动第二位移,例如,向下移动0.2厘米,并在摄像头收缩后采集第二图像。
其中,第二位移可以与第一位移的值相等,这样,能够较好地补偿第一位移带来的影响,使摄像头在全景拍摄过程中保持垂直视角不变。
第二位移也可以是小于第一位移的值。例如,第一位移的方向向上,值为5mm;第二位移的方向向下,值可以是5mm,也可以是4mm,按照这些位移值移动摄像头,均可以减少由于摄像头的上下抖动带来的影响。
另外,第二位移的值还可以是大于第一位移的值。例如,第一位移的方向向上,值为5mm,此时若检测到电子设备仍存在向上的加速度,则可以控制摄像头向下移动6mm,以补偿摄像头向上的抖动。
在伸缩式摄像头移动至第三位置后,由于第三位置较接近第一位置,利用伸缩式摄像头采集第二图像,此时采集的第二图像和伸缩式摄像头在第一位置采集的第一图像之间的高度差较小。
本公开的一些实施例中,上述拍摄方法可以应用于电子设备,例如:手机、平板电脑(Tablet Personal Computer)、膝上型电脑(Laptop Computer)、 个人数字助理(personal digital assistant,PDA)、移动上网装置(Mobile Internet Device,MID)或可穿戴式设备(Wearable Device)等。
本公开的一些实施例的拍摄方法,控制所述伸缩式摄像头在第一位置采集第一图像;当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。利用本公开的一些实施例的拍摄方法,用户在拍摄全景图像的过程中,电子设备可以实时补偿在竖直方向上的抖动,增加全景拍摄的成功率,避免对用户拍摄方式的严苛要求,提高用户使用体验。通过补偿电子设备在竖直方向上的抖动,能够还原全景图像的全景视角,减少由于抖动造成的图像裁剪。另外,由于图像帧间的差异较小,图像合成的过程更容易,拼接过渡更自然,从而全景图像的效果更好。
参见图2a,本实施例与上述实施例的主要区别在于,基于第三图像相对于第一图像的纵向位移量,计算第二位置在伸缩式摄像头的伸缩方向上相对第一位置的第一位移。
图2a是本公开的一些实施例提供的拍摄方法的流程图,如图2a所示,包括以下步骤:
步骤201、控制所述伸缩式摄像头在第一位置采集第一图像。
此步骤的具体实现方式可以参见上述实施例中步骤101的相关描述。
步骤202、当所述伸缩式摄像头被移动至第二位置时,控制所述伸缩式摄像头在所述第二位置采集第三图像。
在此步骤中,由于外界作用,电子设备发生移动使得摄像头移动。例如,用户在拍摄时难免会发生手抖动的情况,电子设备随之人手抖动而移动,从而使伸缩式摄像头被移动至第二位置。摄像头在第二位置采集第三图像,第三图像可以是摄像头在发生抖动后采集的图像。
步骤203、确定所述第三图像相对于所述第一图像的纵向位移量。
在此步骤中,电子设备基于第三图像和第一图像中拍摄的内容,可以确定第三图像相对于第一图像的纵向位移量。该纵向位移量具体可以是第三图 像中的拍摄对象相对第一图像中的拍摄对象的纵向位移量,电子设备可以根据第一图像的图像轮廓和第三图像的图像轮廓进行对比确定该位移量。
可选的,所述确定所述第三图像相对于所述第一图像的纵向位移量,包括:
分别检测所述第一图像的特征点和所述第三图像的特征点;
对所述第一图像的特征点和所述第三图像的特征点进行匹配,得到匹配关系;
基于所述匹配关系,确定所述第三图像相对于所述第一图像的纵向位移量。
在该实施方式中,电子设备可以利用特征检测算子,计算图像的强角点,以获取图像帧的特征点,例如,可以根据图像的颜色变化,获取图像的特征点。其中,特征检测算子可以用Harris角点、Surf角点等。在分别获取第一图像和第三图像的特征点后,对第一图像和第三图像的特征点进行匹配,特征匹配可以使用传统的暴力匹配或者最近邻匹配算法,得到匹配关系。
例如,第一图像和第三图像中均包含人脸图像,可以将第一图像和第三图像中的人脸图像进行匹配,从而确定第三图像中的人脸图像相对于第一图像中的人脸图像的纵向位移量。
具体地,可以根据第一图像和第三图像的匹配关系,估计第一图像和第三图像的透视变化矩阵H,透视变换矩阵如式(1)所示,其中s为缩放因子,M为相机内参矩阵,[r 1 r 2]表示图像的旋转,t则表示图像在水平及垂直方向,即纵向的位移。将上述参数进行相乘,即可以得到透视变化矩阵H。
H=sM[r 1 r 2 t]    (1)
由图像帧间单应性矩阵H,可以获取第三图像相对第一图像在纵向的位移像素数Δy,利用位移像素数和像素尺寸可以得到图像在垂直方向上的位移量ΔY,即第三图像相对于所述第一图像的纵向位移量。
利用该实施方式的方案计算第三图像相对第一图像的纵向位移量,从而计算摄像头在竖直方向上的位移,能够提高计算的精确度,从而能够提高全景图像的合成效果。
步骤204、基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头 的伸缩方向上相对所述第一位置的第一位移。
在此步骤中,根据在第二位置采集的第三图像和在第一位置采集的第一图像之间的纵向位移量,计算摄像头在第二位置与第一位置之间的第一位移。
其中,第一位移Y的数值可以根据伸缩式摄像头的像原尺寸δ和位移量ΔY确定:
Y=ΔY·δ   (2)
其中,位移量ΔY可以是第三图像相对第一图像在纵向的位移。
可选的,所述基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移,包括:
在所述纵向位移量大于预设值的情况下,基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
在该实施方式中,在得到第三图像相对于第一图像的纵向位移量的情况下,可以先判断纵向位移量是否大于预设值。其中,预设值可以是电子设备预先设置的值。当纵向位移量小于预设值时,表示第三图像相对于第一图像在纵向的偏差较小,即电子设备抖动较小,可以忽略。当纵向位移量大于或等于预设值时,表示第三图像相对第一图像在纵向的偏差较大,即电子设备上下抖动幅度较大,电子设备需要通过伸缩式摄像头伸缩进行位移补偿,电子设备基于图像之间的纵向位移量,计算伸缩式摄像头上下抖动的位移,即第一位移。
该实施方式中,对电子设备抖动较大的情况下采集的图像,电子设备通过移动伸缩式摄像头进行位移补偿,而对于电子设备在抖动较小的情况下采集的图像则可以不进行处理,能够提高全景拍摄的效果,节约电子设备的功耗。
步骤205、控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像。
其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。
此步骤的实现方式可以参见步骤103中的描述,为避免重复,此处不再赘述。
可选的,所述控制所述伸缩式摄像头在第三位置采集第二图像之后,所述方法还包括:
对所述第一图像和所述第二图像进行合成,得到全景图像。
该实施方式可以应用于在全景拍摄的过程中。其中,全景拍摄可以是将拍摄的多张图像合成为一张图像,得到的视野更加广阔的图像。该实施方式中可以将第一图像和第二图像进行图像合成,得到全景图像,进一步地,可以利用上述方式拍摄多张第二图像,从而将第一图像和多张第二图像进行图像合成,由于第二图像是对拍摄位置进行矫正后拍摄的图像,得到的合成图像的效果较好。
其中,第一图像可以是在全景拍摄过程中采集的任一帧图像,电子设备可以基于采集的第一图像,对摄像头的位置进行调整。
该实施方式可以应用于图1对应的实施例中以及达到相同的有益效果。
可选的,所述第一图像为所述伸缩式摄像头在全景拍摄过程中采集的第一帧图像,或所述伸缩式摄像头在全景拍摄过程中已采集的图像中的最后一帧图像。
若第一图像为伸缩式摄像头在全景拍摄过程中采集的第一帧图像,在采集第一帧图像时,可以获取伸缩式摄像头在采集第一图像时的位置,即第一位置,并实时检测伸缩式摄像头的位置变化,从而控制伸缩式摄像头以第一位置为参考位置进行伸缩,以对由于电子设备抖动而产生的位移进行补偿,使伸缩式摄像头的位置与第一位置接近,即保证采集第一图像和采集第二图像时的位置接近,提高合成图像的效果。
若第一图像为伸缩式摄像头在全景拍摄过程中已采集的图像中的最后一帧图像,则以摄像头采集该最后一帧图像时所在的位置作为参考位置,并依据摄像头抖动的位移大小进行位移补偿,使伸缩式摄像头的位置与第一位置接近,即保证采集第一图像和采集第二图像时的位置接近,提高合成图像的效果。
可选的,所述控制所述伸缩式摄像头在第三位置采集第二图像之后,所述方法还包括:
根据所述伸缩式摄像头在全景拍摄过程中采集的所有帧图像中除目标图 像之外的其他图像,合成全景图像,所述目标图像相对所述第一图像的纵向位移量大于预设值。
该实施方式在具体实施时,可以利用伸缩式摄像头在全景拍摄过程中采集的全部图像进行图像合成。为了获得更好的合成图像,可以仅获取伸缩式摄像头在相对第一位置的位移小于预设值时采集的图像,并将这些图像合成全景图像。
由于目标图像相对于第一图像的纵向位移量较大,即大于预设值,表示在采集目标图像时,电子设备的发生抖动位移较大,因此,电子设备从已采集的图像中将目标图像剔除,得到所有帧图像中除目标图像之外的其他图像,并利用剔除后剩下的其他图像进行图像合成。上述其他图像中可以包括利用移动伸缩式摄像头进行位移补偿后采集的图像,可以利用这些图像替代剔除的目标图像,从而按照拍摄时各帧图像的顺序将这些图像进行合成。
上述图像合成的过程具体可以在拍摄的过程中进行,也可以在拍摄完成后进行。在利用已采集的图像进行对比确定伸缩式摄像头的位移的情况下,在此步骤中,可以将伸缩式摄像头产生位移较大时采集的图像剔除,而仅获取伸缩式摄像头产生竖向位移较小时采集的图像合成全景图像,可以提高合成图像的效果。
例如,伸缩式摄像头在第一位置采集第一图像,由于人手抖动摄像头移动至第二位置并采集第二图像。电子设备对摄像头的位置进行矫正,在矫正摄像头后的第三位置采集第三图像;此时由于人手抖动摄像头移动至第四位置并采集第四图像,接着电子设备将摄像头调整至第五位置并采集第五帧图像。在进行图像合成时,由于第二位置和第四位置偏移第一位置,导致第二图像和第四图像效果较差。可以将第三图像替换第二图像,将第五图像替换第四图像,即将第二图像和第四图像剔除,将第一图像、第三图像和第五图像合成为一张全景图像。在具体实施时,可以在采集第三图像后,即将第三图像和第一图像进行合成,并同时进行后续的图像采集。
这样,进行图像合成的所有图像均是在电子设备的上下抖动位移较小时采集的图像,这样得到的合成图像的效果较好。
该实施方式也可以应用于图1对应的实施例中以及达到相同的有益效果。
可选的,在进行图像合成的过程中,可以对图像进行投影变换矫正,例如,在全景拍摄过程中,由于拍摄对象与摄像头的距离不同,导致同一拍摄对象的拍摄效果不同。例如,在河流的侧边拍摄河流时,由于河流较长需要进行全景拍摄,在进行图像合成后得到的是一条弯曲的河流。可以将该全景图像矫正,使该河流在全景图像上呈现为位于同一竖向平面内,而非呈现出位于球面的效果。
具体地,根据采集的图像序列,在所述图像序列中获取参考图像,将所述图像序列中除所述参考图像之外的图像中的拍摄对象进行矫正,使所述拍摄对象位于同一平面内。其中,参考图像可以是第一帧图像或者是拍摄过程中的任意一帧图像。可选地,可以将拍摄序列中位于中间的作为参考图像,例如,拍摄10帧图像序列,可以将第5帧图像作为参考图像。
对图像进行矫正后,可以估计图像帧间的拼接缝,按照距离权重等拼接算法对图像继续合成,具体拼接方式可以参见相关技术。进一步地,对图像进行合成后,可以对合成图像进行曝光补偿,即对合成后的全景图像调整曝光值,以保持整个全景图像的亮度均一,提高全景图像的效果。
本公开的一些实施例的拍摄方法,基于第三图像相对于第一图像的纵向位移量,计算第二位置在伸缩式摄像头的伸缩方向上相对第一位置的第一位移。能够提高伸缩式摄像头在伸缩方向上的位移计算精度,从而提高位移补偿精度,提高全景拍摄的效果。
为了进一步理解本公开的实施例,以下结合具体实施方式对拍摄方法进行举例说明。
其中,拍摄方法主要通过电子设备的四个模块实现,伸缩摄像头,信息处理模块,控制模块和全景图像合成模块,模块的连接关系可以参见图2b。
其中,伸缩摄像头,可实时拍摄图像序列,且可以通过驱动信号控制伸缩摄像头进行精确地伸和缩,以实时补偿输出图像的视场的变化。
信息处理模块,可以通过分析图像序列,计算图像不同帧间垂直方向的移动像素量,并将移动像素量换算成电子设备实际的位移量。
控制模块,可以接收来自信息处理模块输出的位移量,并转化为电压等驱动信号,驱动步进电机等控制摄像头伸缩,以补偿用户拍摄时电子设备在 垂直方向的抖动。
全景图像合成模块,用于对补偿后的图像序列进行筛选,并通过投影变化、拼接缝估计、曝光补偿等合成算法,生成全景图像。
如图2c所示,拍摄方法包括以下步骤:
步骤1:电子设备开启全景拍照模式,实时获取连续的图像序列。
步骤2:利用特征检测算子,计算图像的强角点,以获取图像帧的特征点,然后对图像帧间的特征点进行匹配。
步骤3:根据图像帧间的特征匹配结果,估计图像帧间的透视变化矩阵H,H的计算式如上述实施例中的式(1)所示。由图像帧间的单应性矩阵H,可以获取图像在垂直方向的位移像素数△y,并根据位移像素数可以获得图像在垂直方向的位移量△Y。
步骤4:比较位移量△Y和预设阈值T的大小。当△Y>T时,表示电子设备在竖直方向发生了高度变化,执行步骤5;当△Y≤T时,执行步骤7。
步骤5:按照上述实施例中的式(2),将像素位移量△Y转换为伸缩摄像头实际应该移动的位移量Y。
步骤6:控制模块将接收实际位移量Y,并转化为驱动信号,驱动伸缩摄像头伸缩,以补偿摄像头在垂直方向上的位移,保持在全景图拍摄中垂直视角不变,并返回执行步骤2。
步骤7:剔除图像序列中的冗余图像,并根据步骤3中获取的单应性矩阵,对图像进行投影变换矫正。冗余图像可以是由于摄像头偏移的位移较大导致的效果较差的图像。
步骤8:估计图像帧间的拼接缝,按照距离权重等拼接算法进行融合,并对融合后的全景图像做曝光补偿,以保持亮度均一。
步骤9:输出垂直视角补偿后的全景图像。
本公开可最大程度还原被拍摄风景的全景视角,而且伸缩式摄像头可以补偿用户在拍摄时电子设备的抖动,降低对用户拍照姿态的要求,提升用户拍摄全景拍照的体验,而且由于电子设备的抖动被伸缩式摄像头补偿,图像帧间的差异减小,全景照片的拼接缝过渡会更加自然,拍摄成功率也会更高。
参见图3,图3是本公开的一些实施例提供的电子设备的结构图,所述 电子设备具有伸缩式摄像头,如图3所示,电子设备300包括:第一采集模块301、确定模块302和第二采集模块303。
第一采集模块301,用于控制所述伸缩式摄像头在第一位置采集第一图像;
确定模块302,用于当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;
第二采集模块303,用于控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。
可选的,如图4所示,所述电子设备还包括:
第一合成模块304,用于对所述第一图像和所述第二图像进行合成,得到全景图像。
可选的,所述第一图像为所述伸缩式摄像头在全景拍摄过程中采集的第一帧图像,或所述伸缩式摄像头在全景拍摄过程中已采集的图像中的最后一帧图像。
可选的,如图5所示,所述确定模块302包括:
采集子模块3021,用于控制所述伸缩式摄像头在所述第二位置采集第三图像;
确定子模块3022,用于确定所述第三图像相对于所述第一图像的纵向位移量;
计算子模块3023,用于基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
可选的,如图6所示,所述确定子模块3022包括:
检测单元30221,用于分别检测所述第一图像的特征点和所述第三图像的特征点;
匹配单元30222,用于对所述第一图像的特征点和所述第三图像的特征点进行匹配,得到匹配关系;
确定单元30223,用于基于所述匹配关系,确定所述第三图像相对于所述 第一图像的纵向位移量。
可选的,所述计算子模块3023具体用于,在所述纵向位移量大于预设值的情况下,基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
可选的,如图7所述,所述电子设备还包括:
第二合成模块305,用于根据所述伸缩式摄像头在全景拍摄过程中采集的所有帧图像中除目标图像之外的其他图像,合成全景图像,所述目标图像相对所述第一图像的纵向位移量大于预设值。
电子设备300能够实现上述方法实施例中电子设备实现的各个过程,为避免重复,这里不再赘述。
本公开的一些实施例的电子设备300,利用伸缩式摄像头的伸缩,对电子设备在竖直方向上的位移进行补偿,可以减少由于电子设备的抖动给全景图像造成的影响,可以提高全景图像的拍摄效果。
图8为实现本公开各个实施例的一种电子设备的硬件结构示意图,该电子设备800包括但不限于:射频单元801、网络模块802、音频输出单元803、输入单元804、传感器805、显示单元806、用户输入单元807、接口单元808、存储器809、处理器810、以及电源811等部件。本领域技术人员可以理解,图8中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本公开的一些实施例中,电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载移动终端、可穿戴设备、以及计步器等。
其中,处理器810,用于控制所述伸缩式摄像头在第一位置采集第一图像;当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。
这样,利用伸缩式摄像头的伸缩,对电子设备在竖直方向上的位移进行补偿,可以减少由于电子设备的抖动给全景图像造成的影响,可以提高全景 图像的拍摄效果。
可选的,所述控制所述伸缩式摄像头在第三位置采集第二图像之后,还包括:对所述第一图像和所述第二图像进行合成,得到全景图像。
可选的,所述第一图像为所述伸缩式摄像头在全景拍摄过程中采集的第一帧图像,或所述伸缩式摄像头在全景拍摄过程中已采集的图像中的最后一帧图像。
可选的,处理器810执行所述确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移,包括:控制所述伸缩式摄像头在所述第二位置采集第三图像;确定所述第三图像相对于所述第一图像的纵向位移量;基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
可选的,处理器810执行所述确定所述第三图像相对于所述第一图像的纵向位移量,包括:分别检测所述第一图像的特征点和所述第三图像的特征点;对所述第一图像的特征点和所述第三图像的特征点进行匹配,得到匹配关系;基于所述匹配关系,确定所述第三图像相对于所述第一图像的纵向位移量。
可选的,处理器810执行所述基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移,包括:在所述纵向位移量大于预设值的情况下,基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
可选的,处理器810执行所述控制所述伸缩式摄像头在第三位置采集第二图像之后,还包括:根据所述伸缩式摄像头在全景拍摄过程中采集的所有帧图像中除目标图像之外的其他图像,合成全景图像,所述目标图像相对所述第一图像的纵向位移量大于预设值。
应理解的是,本公开的一些实施例中,射频单元801可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器810处理;另外,将上行的数据发送给基站。通常,射频单元801包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元801还可以通过无线通信系统与网络和其他设备通信。
电子设备通过网络模块802为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。
音频输出单元803可以将射频单元801或网络模块802接收的或者在存储器809中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元803还可以提供与电子设备800执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元803包括扬声器、蜂鸣器以及受话器等。
输入单元804用于接收音频或视频信号。输入单元804可以包括图形处理器(Graphics Processing Unit,GPU)8041和麦克风8042,图形处理器8041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元806上。经图形处理器8041处理后的图像帧可以存储在存储器809(或其它存储介质)中或者经由射频单元801或网络模块802进行发送。麦克风8042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元801发送到移动通信基站的格式输出。
电子设备800还包括至少一种传感器805,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板8061的亮度,接近传感器可在电子设备800移动到耳边时,关闭显示面板8061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器805还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。
显示单元806用于显示由用户输入的信息或提供给用户的信息。显示单元806可包括显示面板8061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置 显示面板8061。
用户输入单元807可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元807包括触控面板8071以及其他输入设备8072。触控面板8071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板8071上或在触控面板8071附近的操作)。触控面板8071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器810,接收处理器810发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板8071。除了触控面板8071,用户输入单元807还可以包括其他输入设备8072。具体地,其他输入设备8072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。
进一步的,触控面板8071可覆盖在显示面板8061上,当触控面板8071检测到在其上或附近的触摸操作后,传送给处理器810以确定触摸事件的类型,随后处理器810根据触摸事件的类型在显示面板8061上提供相应的视觉输出。虽然在图8中,触控面板8071与显示面板8061是作为两个独立的部件来实现电子设备的输入和输出功能,但是在某些实施例中,可以将触控面板8071与显示面板8061集成而实现电子设备的输入和输出功能,具体此处不做限定。
接口单元808为外部装置与电子设备800连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元808可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到电子设备800内的一个或多个元件或者可以用于在电子设备800和外部装置之间传输数据。
存储器809可用于存储软件程序以及各种数据。存储器809可主要包括 存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器809可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
处理器810是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器809内的软件程序和/或模块,以及调用存储在存储器809内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。处理器810可包括一个或多个处理单元;可选的,处理器810可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器810中。
电子设备800还可以包括给各个部件供电的电源811(比如电池),可选的,电源811可以通过电源管理系统与处理器810逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
另外,电子设备800包括一些未示出的功能模块,在此不再赘述。
可选的,本公开的一些实施例还提供一种电子设备,包括处理器810,存储器809,存储在存储器809上并可在所述处理器810上运行的计算机程序,该计算机程序被处理器810执行时实现上述拍摄方法实施例中的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
本公开的一些实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述拍摄方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况 下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台电子设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本公开各个实施例所述的方法。
上面结合附图对本公开的实施例进行了描述,但是本公开并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本公开的启示下,在不脱离本公开宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本公开的保护之内。

Claims (16)

  1. 一种拍摄方法,应用于具有伸缩式摄像头的电子设备,包括:
    控制所述伸缩式摄像头在第一位置采集第一图像;
    当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;
    控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。
  2. 根据权利要求1所述的方法,其中,所述控制所述伸缩式摄像头在第三位置采集第二图像之后,还包括:
    对所述第一图像和所述第二图像进行合成,得到全景图像。
  3. 根据权利要求2所述的方法,其中,所述第一图像为所述伸缩式摄像头在全景拍摄过程中采集的第一帧图像,或所述伸缩式摄像头在全景拍摄过程中已采集的图像中的最后一帧图像。
  4. 根据权利要求1所述的方法,其中,所述确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移,包括:
    控制所述伸缩式摄像头在所述第二位置采集第三图像;
    确定所述第三图像相对于所述第一图像的纵向位移量;
    基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
  5. 根据权利要求4所述的方法,其中,所述确定所述第三图像相对于所述第一图像的纵向位移量,包括:
    分别检测所述第一图像的特征点和所述第三图像的特征点;
    对所述第一图像的特征点和所述第三图像的特征点进行匹配,得到匹配关系;
    基于所述匹配关系,确定所述第三图像相对于所述第一图像的纵向位移量。
  6. 根据权利要求4或5所述的方法,其中,所述基于所述纵向位移量, 计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移,包括:
    在所述纵向位移量大于预设值的情况下,基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
  7. 根据权利要求6所述的方法,其中,所述控制所述伸缩式摄像头在第三位置采集第二图像之后,还包括:
    根据所述伸缩式摄像头在全景拍摄过程中采集的所有帧图像中除目标图像之外的其他图像,合成全景图像,所述目标图像相对所述第一图像的纵向位移量大于预设值。
  8. 一种电子设备,所述电子设备具有伸缩式摄像头,包括:
    第一采集模块,用于控制所述伸缩式摄像头在第一位置采集第一图像;
    确定模块,用于当所述伸缩式摄像头被移动至第二位置时,确定所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移;
    第二采集模块,用于控制所述伸缩式摄像头在所述伸缩方向上移动至第三位置,并在第三位置采集第二图像;其中,所述第三位置在所述伸缩式摄像头的伸缩方向上相对所述第二位置的第二位移与所述第一位移方向相反。
  9. 根据权利要求8所述的电子设备,还包括:
    第一合成模块,用于对所述第一图像和所述第二图像进行合成,得到全景图像。
  10. 根据权利要求9所述的电子设备,其中,所述第一图像为所述伸缩式摄像头在全景拍摄过程中采集的第一帧图像,或所述伸缩式摄像头在全景拍摄过程中已采集的图像中的最后一帧图像。
  11. 根据权利要求8所述的电子设备,其中,所述确定模块包括:
    采集子模块,用于控制所述伸缩式摄像头在所述第二位置采集第三图像;
    确定子模块,用于确定所述第三图像相对于所述第一图像的纵向位移量;
    计算子模块,用于基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
  12. 根据权利要求11所述的电子设备,其中,所述确定子模块包括:
    检测单元,用于分别检测所述第一图像的特征点和所述第三图像的特征 点;
    匹配单元,用于对所述第一图像的特征点和所述第三图像的特征点进行匹配,得到匹配关系;
    确定单元,用于基于所述匹配关系,确定所述第三图像相对于所述第一图像的纵向位移量。
  13. 根据权利要求11或12所述的电子设备,其中,所述计算子模块具体用于,在所述纵向位移量大于预设值的情况下,基于所述纵向位移量,计算所述第二位置在所述伸缩式摄像头的伸缩方向上相对所述第一位置的第一位移。
  14. 根据权利要求13所述的电子设备,还包括:
    第二合成模块,用于根据所述伸缩式摄像头在全景拍摄过程中采集的所有帧图像中除目标图像之外的其他图像,合成全景图像,所述目标图像相对所述第一图像的纵向位移量大于预设值。
  15. 一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述的拍摄方法中的步骤。
  16. 一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的拍摄方法中的步骤。
PCT/CN2019/112680 2018-10-31 2019-10-23 拍摄方法及电子设备 WO2020088317A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811285085.7 2018-10-31
CN201811285085.7A CN109194875A (zh) 2018-10-31 2018-10-31 一种拍摄方法及电子设备

Publications (1)

Publication Number Publication Date
WO2020088317A1 true WO2020088317A1 (zh) 2020-05-07

Family

ID=64940852

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/112680 WO2020088317A1 (zh) 2018-10-31 2019-10-23 拍摄方法及电子设备

Country Status (2)

Country Link
CN (1) CN109194875A (zh)
WO (1) WO2020088317A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109194875A (zh) * 2018-10-31 2019-01-11 维沃移动通信有限公司 一种拍摄方法及电子设备
CN109941885A (zh) * 2019-03-07 2019-06-28 无锡顶视科技有限公司 一种基于伸缩臂的集装箱箱号抓拍和识别装置及其方法
CN110047380B (zh) * 2019-03-26 2020-06-30 武汉华星光电半导体显示技术有限公司 一种显示面板及显示装置
CN110198372B (zh) * 2019-05-31 2020-10-09 华为技术有限公司 确定摄像组件伸缩状态的方法、可读存储介质及相关设备
CN110166695B (zh) * 2019-06-26 2021-10-01 Oppo广东移动通信有限公司 摄像头防抖方法、装置、电子设备和计算机可读存储介质
CN110493457B (zh) * 2019-07-30 2021-10-15 维沃移动通信有限公司 一种终端设备控制方法及终端设备
CN110740260B (zh) 2019-10-24 2023-04-07 深圳传音控股股份有限公司 一种拍摄方法、装置以及计算机可读存储介质
CN110933295B (zh) * 2019-11-11 2021-09-10 北京三快在线科技有限公司 拍摄方法、装置、电子设备及可读存储介质
CN113190103A (zh) * 2020-01-14 2021-07-30 北京小米移动软件有限公司 终端设备、图像采集模组的运动检测方法及装置、存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006243170A (ja) * 2005-03-01 2006-09-14 Pentax Corp 撮像装置
CN101377615A (zh) * 2007-08-29 2009-03-04 三星电子株式会社 拍摄全景画面的方法
CN103973950A (zh) * 2014-04-29 2014-08-06 蒂莫西·奥耶诺比 移动通信设备多向/广角摄像机镜头系统
CN104378544A (zh) * 2013-08-15 2015-02-25 联想(北京)有限公司 一种获得图像的方法和电子设备
CN109194875A (zh) * 2018-10-31 2019-01-11 维沃移动通信有限公司 一种拍摄方法及电子设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001223942A (ja) * 1999-12-01 2001-08-17 Canon Inc 撮像装置、撮像装置の制御方法、パノラマ合成用画像の撮像方法、撮像装置の制御プログラムを供給する媒体
JP4342493B2 (ja) * 2005-09-22 2009-10-14 三洋電機株式会社 手ぶれ補正装置
CN103763483A (zh) * 2014-01-23 2014-04-30 贝壳网际(北京)安全技术有限公司 一种移动终端拍照防抖方法、装置以及移动终端
CN105046649A (zh) * 2015-06-30 2015-11-11 硅革科技(北京)有限公司 一种去除运动视频中运动物体的全景图拼接方法
CN105827958A (zh) * 2016-03-17 2016-08-03 广东欧珀移动通信有限公司 控制方法、控制装置及电子装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006243170A (ja) * 2005-03-01 2006-09-14 Pentax Corp 撮像装置
CN101377615A (zh) * 2007-08-29 2009-03-04 三星电子株式会社 拍摄全景画面的方法
CN104378544A (zh) * 2013-08-15 2015-02-25 联想(北京)有限公司 一种获得图像的方法和电子设备
CN103973950A (zh) * 2014-04-29 2014-08-06 蒂莫西·奥耶诺比 移动通信设备多向/广角摄像机镜头系统
CN109194875A (zh) * 2018-10-31 2019-01-11 维沃移动通信有限公司 一种拍摄方法及电子设备

Also Published As

Publication number Publication date
CN109194875A (zh) 2019-01-11

Similar Documents

Publication Publication Date Title
WO2020088317A1 (zh) 拍摄方法及电子设备
CN108513070B (zh) 一种图像处理方法、移动终端及计算机可读存储介质
EP3780577B1 (en) Photography method and mobile terminal
WO2020108261A1 (zh) 拍摄方法及终端
CN110784651B (zh) 一种防抖方法及电子设备
WO2020020134A1 (zh) 拍摄方法及移动终端
CN109660723B (zh) 一种全景拍摄方法及装置
CN111145192B (zh) 图像处理方法及电子设备
CN109474786B (zh) 一种预览图像生成方法及终端
CN107248137B (zh) 一种实现图像处理的方法及移动终端
CN109685915B (zh) 一种图像处理方法、装置及移动终端
CN111064895B (zh) 一种虚化拍摄方法和电子设备
CN110198413B (zh) 一种视频拍摄方法、视频拍摄装置和电子设备
CN108449546B (zh) 一种拍照方法及移动终端
CN110213485B (zh) 一种图像处理方法及终端
CN109246360A (zh) 一种提示方法及移动终端
WO2021036623A1 (zh) 显示方法及电子设备
CN111031234B (zh) 一种图像处理方法及电子设备
CN111416935B (zh) 一种拍摄方法及电子设备
CN116033269A (zh) 一种联动辅助防抖拍摄方法、设备及计算机可读存储介质
CN110363729B (zh) 一种图像处理方法、终端设备及计算机可读存储介质
CN110602390B (zh) 一种图像处理方法及电子设备
WO2021136181A1 (zh) 图像处理方法及电子设备
CN108243489B (zh) 一种拍照控制方法及移动终端
CN108683849B (zh) 一种图像获取方法及终端

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: 19880567

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: 19880567

Country of ref document: EP

Kind code of ref document: A1