WO2021032117A1 - 一种拍摄方法及电子设备 - Google Patents
一种拍摄方法及电子设备 Download PDFInfo
- Publication number
- WO2021032117A1 WO2021032117A1 PCT/CN2020/110008 CN2020110008W WO2021032117A1 WO 2021032117 A1 WO2021032117 A1 WO 2021032117A1 CN 2020110008 W CN2020110008 W CN 2020110008W WO 2021032117 A1 WO2021032117 A1 WO 2021032117A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- frame
- shooting
- electronic device
- ratio
- cropping
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/68—Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
- H04N23/682—Vibration or motion blur correction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/69—Control of means for changing angle of the field of view, e.g. optical zoom objectives or electronic zooming
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
- H04N23/632—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/633—Control of cameras or camera modules by using electronic viewfinders for displaying additional information relating to control or operation of the camera
- H04N23/635—Region indicators; Field of view indicators
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/68—Control of cameras or camera modules for stable pick-up of the scene, e.g. compensating for camera body vibrations
- H04N23/682—Vibration or motion blur correction
- H04N23/684—Vibration or motion blur correction performed by controlling the image sensor readout, e.g. by controlling the integration time
- H04N23/6842—Vibration or motion blur correction performed by controlling the image sensor readout, e.g. by controlling the integration time by controlling the scanning position, e.g. windowing
Definitions
- This application relates to the field of terminal technology, and in particular to a photographing method and electronic equipment.
- the shooting functions of the camera APP in the mobile phone have been widely used in the daily life of users.
- the photos or videos captured by the user using the camera APP will show a certain amount of jitter, which affects the clarity of the captured images.
- the anti-shake angle of the anti-shake algorithm has a positive correlation with the field of view (FOV) of the shooting picture. For example, when the FOV of the shooting image is 80°, the corresponding anti-shake angle is 8°; when the FOV of the shooting image is 40°, the corresponding anti-shake angle is 4°.
- the FOV of the shooting screen will also be reduced by N times.
- the anti-shake angle of the shooting screen will also be reduced by N times.
- the present application provides a shooting method and electronic equipment, which can ensure the anti-shake performance of shooting in a zoom scene, improve the clarity of the shooting picture, and improve the user's shooting experience.
- the present application provides a shooting method, including: the electronic device obtains a first shooting image through a first camera; further, the electronic device may determine the first crop of the first shooting image according to the first zoom ratio of the first shooting image Ratio, the anti-shake angle of the first shot image is the product of the FOV of the first camera and the first cropping ratio; the electronic device crops the first shot image according to the first cropping ratio to obtain and output the first cropped image; subsequently, if detected The user inputs the first zoom operation, and the electronic device can obtain the second shooting image through the first camera; similarly, the electronic device can determine the second cropping ratio of the second shooting image according to the second zoom ratio of the second shooting image, and the second zoom The ratio is greater than the first zoom ratio, the second crop ratio is greater than the first crop ratio, and the anti-shake angle of the second shooting image is the product of the FOV of the first camera and the second crop ratio; the electronic device crops the second shot according to the second crop ratio Screen, get the second cropped screen and output.
- the electronic device can dynamically set the cropping ratio of the current shooting image according to the zoom ratio of the current shooting image, and then crop the current shooting image according to the cropping ratio.
- the zoom ratio is larger, the cropping ratio is set for the shooting image. Therefore, when the zoom ratio is larger, the image stabilization angle that can be used to compensate for the image shake is larger when the electronic device crops the shooting image.
- the electronic device can still correct the shooting picture with a large shake angle, thereby improving the anti-shake performance of the shooting picture and the user's shooting experience.
- the electronic device determines the first cropping ratio of the first shot image according to the first zoom ratio, which specifically includes: the electronic device calculates the first cropping ratio according to a preset formula according to the first zoom ratio; similar
- the electronic device determines the second cropping ratio of the second shooting image according to the second zoom ratio, which specifically includes: the electronic device calculates the second cropping ratio according to the preset formula according to the second zoom ratio;
- zoom_ratio is the current zoom ratio
- init_ratio is a constant.
- the electronic device can determine the corresponding crop ratio (ie, the above crop_ratio) for the shot image at one time in combination with the current zoom ratio, and the subsequent electronic device can crop the shot image once according to the crop ratio.
- the electronic device can perform a cropping based on the entire shooting frame.
- the anti-shake angle that can be used to compensate for screen shake is increased, so that the shooting screen shot by the electronic device can still be relatively stable under large shake. effect.
- the corresponding relationship between different zoom ratios and different cropping ratios may be stored in the electronic device; at this time, the electronic device determines the first cropping ratio of the first shot image according to the first zoom ratio, which specifically includes: the electronic device according to the corresponding Relationship, determining the first cropping ratio corresponding to the first zoom ratio; similarly, the electronic device determines the second cropping ratio of the second shooting image according to the second zoom ratio, which specifically includes: the electronic device determines the second cropping ratio according to the corresponding relationship. The second cropping ratio corresponding to the zoom ratio.
- the anti-shake angle of the captured image is the product of the camera’s FOV and the crop ratio. Then, when the camera’s FOV is constant, when the zoom ratio is larger, the corresponding anti-shake angle of the captured image will be larger, and the electronic equipment’s anti-shake The higher the ability.
- the electronic device crops the first shot image according to the first cropping ratio to obtain the first cropped image, which specifically includes: the electronic device calculates the size of the first cropping frame according to the first cropping ratio; A position of the first cropping frame is determined in a shooting frame; further, the electronic device can crop the first shooting frame along the position of the first cropping frame to obtain the first cropping frame.
- the electronic device determining the position of the first trimming frame in the first shooting frame specifically includes: the electronic device acquiring the first shaking direction and the first shaking amount of the first shooting frame on the x-axis, and acquiring the first shooting The second shaking direction and the second shaking amount of the picture on the y-axis; in order to compensate for the shaking of the first shot picture on the x-axis and y-axis, the electronic device can start from the first initial position (that is, the first trimming frame is located in the first The center of a shooting frame), start by moving the first trimming frame on the x-axis in the opposite direction of the first shaking direction by the first amount of shaking, and move the first trimming frame on the y-axis in the opposite direction of the second shaking direction The second amount of jitter.
- the electronic device crops the second shot frame according to the second crop ratio to obtain the second crop frame, which specifically includes: the electronic device calculates the size of the second crop frame according to the second crop ratio; the electronic device determines the first shot frame in the second shot frame 2. The position of the cropping frame; further, the electronic device can crop the second shooting frame along the position of the second cropping frame to obtain the second cropping frame.
- the electronic device determining the position of the second cropping frame in the second shooting frame specifically includes: the electronic device acquiring the first shaking direction and the first shaking amount of the second shooting frame on the x-axis, and acquiring the second shooting The second shaking direction and the second shaking amount of the picture on the y-axis; further, the electronic device can start from the second initial position (that is, the second trimming frame is located at the center of the second shooting picture) and move along the direction opposite to the first shaking direction The second trimming frame is moved on the x-axis by the first amount of shaking, and the second trimming frame is moved on the y-axis by the second amount of shaking in a direction opposite to the second shaking direction.
- the electronic device can compensate for the image shift caused by shaking by adjusting the position of the cropping frame in each frame of the shooting image, so that the anti-shake effect of the electronic device is significantly improved.
- the first cropping frame includes a moving object in the first shooting frame; the second cropping frame includes a moving object in the second shooting frame. That is to say, the electronic device can determine the cropping ratio of this shooting image according to the current zoom ratio, and retain the moving objects in the shooting image according to the cropping ratio, so that the moving objects can appear in the main position of the shooting image smoothly, reducing the user Difficulty of composition when shooting.
- the above method further includes: in response to a second zoom operation input by the user, the electronic device obtains a third shooting image through a second camera, and the FOV of the second camera is different from the FOV of the first camera.
- the electronic device detects the zoom operation input by the user, it can also replace the camera that is in use.
- the electronic device acquiring the first shooting image through the first camera includes: the electronic device may use the first camera to acquire the first shooting image in a preview scene, a video shooting scene, or a photo shooting scene. That is to say, no matter in the photo scene or the video scene, whether in the preview scene or the recording scene, after the electronic device obtains each frame of the shooting image, it can dynamically set the cropping ratio of the shooting image according to the current zoom ratio. . Since the larger the zoom ratio, the larger the corresponding cropping ratio of the shooting image, therefore, the larger the zoom ratio, the greater the anti-shake angle of the shooting image. In this way, the electronic device can still correct the camera shake angle under high-zoom shooting scenes. The large shooting screen improves the anti-shake performance of the shooting screen and the user's shooting experience.
- this application provides an electronic device, including: a touch screen, one or more processors, one or more cameras, a memory, and one or more computer programs; wherein the processor is coupled with the touch screen, the camera and the memory
- the above-mentioned one or more computer programs are stored in a memory, and when the electronic device is running, the processor executes the one or more computer programs stored in the memory, so that the electronic device executes any of the above-mentioned shooting methods.
- the present application provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to execute the shooting method as described in any one of the first aspect.
- this application provides a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute the shooting method described in any one of the first aspect.
- the electronic equipment described in the second aspect, the computer storage medium described in the third aspect, and the computer program product described in the fourth aspect provided above are all used to execute the corresponding methods provided above.
- the beneficial effects that can be achieved please refer to the beneficial effects in the corresponding method provided above, which will not be repeated here.
- FIG. 1 is a first structural diagram of an electronic device according to an embodiment of the application
- FIG. 2 is a schematic diagram of the working principle of a camera provided by an embodiment of the application.
- Figure 3 is a schematic diagram of the principle of digital zoom in the prior art
- FIG. 4 is a schematic diagram of the principle of anti-shake processing on a captured image in the prior art
- FIG. 5 is a schematic flowchart of a shooting method provided by an embodiment of the application.
- FIG. 6 is a schematic diagram 1 of an application scenario of a shooting method provided by an embodiment of the application.
- FIG. 7 is a second schematic diagram of an application scenario of a shooting method provided by an embodiment of the application.
- FIG. 8 is a third schematic diagram of an application scenario of a shooting method provided by an embodiment of this application.
- FIG. 9 is a fourth schematic diagram of an application scenario of a shooting method provided by an embodiment of this application.
- FIG. 10 is a schematic diagram 5 of an application scenario of a shooting method provided by an embodiment of this application.
- FIG. 11 is a sixth schematic diagram of an application scenario of a shooting method provided by an embodiment of this application.
- FIG. 12 is a schematic diagram 7 of an application scenario of a shooting method provided by an embodiment of this application.
- FIG. 13 is an eighth schematic diagram of an application scenario of a shooting method provided by an embodiment of this application.
- FIG. 14 is a schematic diagram 9 of an application scenario of a shooting method provided by an embodiment of this application.
- 15 is a schematic diagram ten of an application scenario of a shooting method provided by an embodiment of the application.
- 16 is a schematic diagram eleventh of an application scenario of a shooting method provided by an embodiment of this application.
- FIG. 17 is a second structural diagram of an electronic device provided by an embodiment of this application.
- the shooting method provided in the embodiments of the present application can be applied to mobile phones, tablet computers, notebook computers, ultra-mobile personal computers (UMPC), handheld computers, netbooks, and personal digital assistants (personal digital assistants).
- UMPC ultra-mobile personal computers
- PDA personal digital assistants
- wearable electronic devices virtual reality devices and other electronic devices
- the embodiments of the present application do not make any restrictions on this.
- FIG. 1 shows a schematic structural diagram of an electronic device 100.
- the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
- Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
- SIM Subscriber identification module
- the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100.
- the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
- the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
- the processor 110 may include one or more processing units.
- the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
- AP application processor
- modem processor modem processor
- GPU graphics processing unit
- image signal processor image signal processor
- ISP image signal processor
- controller video codec
- digital signal processor digital signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- the different processing units may be independent devices or integrated in one or more processors.
- a memory may also be provided in the processor 110 to store instructions and data.
- the memory in the processor 110 is a cache memory.
- the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
- the processor 110 may include one or more interfaces.
- the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface.
- I2C integrated circuit
- I2S integrated circuit built-in audio
- PCM pulse code modulation
- PCM pulse code modulation
- UART universal asynchronous transmitter
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- SIM subscriber identity module
- USB Universal Serial Bus
- the charging management module 140 is used to receive charging input from the charger.
- the charger can be a wireless charger or a wired charger.
- the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
- the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
- the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
- the power management module 141 can receive input from the battery 142 and/or the charging management module 140, and supply power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160.
- the power management module 141 can be used to monitor performance parameters such as battery capacity, battery cycle times, battery charging voltage, battery discharging voltage, and battery health status (such as leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
- the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
- the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
- antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
- the antenna can be used in combination with a tuning switch.
- the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
- the mobile communication module 150 may include one or more filters, switches, power amplifiers, low noise amplifiers (LNA), etc.
- the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering and amplifying the received electromagnetic waves, and then transmitting them to the modem processor for demodulation.
- the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves for radiation via the antenna 1.
- at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
- at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
- the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), and global navigation satellites.
- WLAN wireless local area networks
- BT Bluetooth
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication technology
- infrared technology infrared, IR
- the wireless communication module 160 may be one or more devices integrating one or more communication processing modules.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
- the wireless communication module 160 can also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic wave radiation via the antenna 2.
- the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
- the wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
- the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
- GPS global positioning system
- GLONASS global navigation satellite system
- BDS Beidou navigation satellite system
- QZSS quasi-zenith satellite system
- SBAS satellite-based augmentation systems
- the electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor.
- the GPU is a microprocessor for image processing, connected to the display 194 and the application processor.
- the GPU is used to perform mathematical and geometric calculations for graphics rendering.
- the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
- the display screen 194 is used to display images, videos, etc.
- the display screen 194 includes a display panel.
- the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
- LCD liquid crystal display
- OLED organic light-emitting diode
- active-matrix organic light-emitting diode active-matrix organic light-emitting diode
- AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
- the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
- the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
- the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
- ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
- the ISP may be provided in the camera 193.
- the camera 193 is used to capture still images or videos.
- the mobile phone 100 may include 1 or N cameras, and N is a positive integer greater than 1.
- the camera 193 may be a front camera or a rear camera. As shown in FIG. 2, the camera 193 generally includes a lens and a sensor.
- the photosensitive element can be a CCD (charge-coupled device) or a CMOS (complementary metal oxide semiconductor, complementary metal oxide semiconductor). ) And other arbitrary photosensitive devices.
- the reflected light of the object being photographed can generate an optical image after passing through the lens.
- the optical image is projected on the photosensitive element, and the photosensitive element converts the received optical signal into electricity.
- the camera 193 sends the obtained electrical signal to a DSP (Digital Signal Processing, digital signal processing) module for digital signal processing, and finally each frame of digital image is obtained.
- DSP Digital Signal Processing, digital signal processing
- the image or video captured by the camera 193 can be output on the mobile phone 100 through the display screen 194, or the digital image can be stored in the internal memory 121, which is not limited in the embodiment of the present application.
- Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
- Video codecs are used to compress or decompress digital video.
- the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in a variety of encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
- MPEG moving picture experts group
- the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
- the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
- the internal memory 121 may be used to store one or more computer programs, and the one or more computer programs include instructions.
- the processor 110 can execute the above-mentioned instructions stored in the internal memory 121 to enable the electronic device 100 to execute the method for intelligently recommending contacts provided in some embodiments of the present application, as well as various functional applications and data processing.
- the internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store the operating system; the storage program area can also store one or more application programs (such as a gallery, contacts, etc.) and so on.
- the data storage area can store data (such as photos, contacts, etc.) created during the use of the electronic device 100.
- the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, universal flash storage (UFS), etc.
- the processor 110 executes the instructions stored in the internal memory 121 and/or the instructions stored in the memory provided in the processor to cause the electronic device 100 to execute the smart device provided in the embodiments of the present application. Recommended number method, as well as various functional applications and data processing.
- the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
- the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
- the audio module 170 can also be used to encode and decode audio signals.
- the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
- the speaker 170A also called a “speaker” is used to convert audio electrical signals into sound signals.
- the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
- the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
- the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
- the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
- the user can make a sound by approaching the microphone 170C through the mouth, and input the sound signal to the microphone 170C.
- the electronic device 100 may be provided with one or more microphones 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
- the earphone interface 170D is used to connect wired earphones.
- the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
- OMTP open mobile terminal platform
- CTIA cellular telecommunications industry association of the USA
- the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc., in the embodiments of the present application There are no restrictions on this.
- the electronic device 100 provided in the embodiment of the present application may further include one or more devices such as the button 190, the motor 191, the indicator 192, and the SIM card interface 195, which is not limited in the embodiment of the present application.
- the field of view can also be referred to as the field of view, and the size of the field of view determines the field of view of the shooting picture taken by an optical instrument (such as a camera).
- an optical instrument such as a camera
- Digital zoom is to enlarge the area of each pixel in the shooting frame through the DSP or processor in the electronic equipment, so as to achieve the purpose of magnification.
- exemplary take the zoom ratio of 4 (ie 4x zoom) as an example.
- the electronic device can shoot the center point A of the image 301 as the center, crop the image 301, and retain the image 302 with a FOV of 20° (ie, 80°/4).
- the electronic device can zoom in and display the cropped image 302 in the preview frame 303 of the electronic device. At this time, the user can view the display effect of the shooting screen 301 after 4x zooming in the preview box 303.
- the shooting image can be cropped according to the current zoom ratio. Still as shown in FIG. 3, after the mobile phone obtains the shooting frame 301 with a FOV of 80°, if the current zoom ratio is 4, the mobile phone can crop the shooting frame 401 into a shooting frame 302 with a FOV of 20°.
- the mobile phone can determine the first shaking amount D1 of the shooting image 302 on the x-axis and the second shaking amount D2 of the shooting image 302 on the y-axis through a preset anti-shake algorithm. Taking the first amount of shaking D1 as 1° and the second amount of shaking D2 as 1° as an example, it is illustrated that the captured image 302 obtained this time has 1° shaking along the positive direction of the x-axis, and the captured image 302 is generated along the positive direction of the y-axis. 1° jitter.
- the mobile phone can move the cropping frame 401 1° in the negative direction of the x-axis and 1° in the negative direction of the y-axis. ° Cropping frame 401. Furthermore, the mobile phone can crop and output the shooting image 302 according to the position of the cropping frame 401 at this time, so as to compensate for the shaking of the shooting image 302 in the positive x-axis direction and the positive y-axis direction.
- the anti-shake angle of the shooting picture is only 2°. Since the aforementioned cropping ratio for compensating for screen shake is fixed, when the zoom ratio of the shooting screen is higher, the anti-shake angle of the shooting screen will become smaller. Still taking the FOV of the initial shooting image as 80° and the cropping ratio of 10% as an example, when the zoom ratio of the shooting image is 10x zoom, the FOV of the image after zooming is 8° (ie 80°/10). The image stabilization angle is only 0.8° (that is, 8°*10%). The jitter of the shooting picture taken by the user while walking is about 3°-5°, and the jitter of the shooting picture taken by the user while running can reach more than 10°. Obviously, the anti-shake processing method in the prior art can no longer meet the user's anti-shake requirement in a high-magnification zoom scene, resulting in a reduction in the shooting quality of the shooting picture and the user's shooting experience.
- an embodiment of the present application provides a shooting method, still taking a mobile phone as an example of the above electronic device. As shown in FIG. 5, the method includes steps S501-S506.
- the mobile phone obtains a first shooting image through a camera, and the zoom ratio of the first shooting image is the first zoom ratio.
- one or more shooting modes such as photo taking, video recording, panorama, slow motion or time-lapse photography are set in the camera application of the mobile phone.
- the mobile phone can call the camera application to enter a certain shooting mode and turn on the camera.
- the camera can collect each frame of the shooting image at a certain working frequency.
- the mobile phone can de-shake each frame of the shooting image in real time to reduce the jitter phenomenon in the shooting image.
- the preview interface 601 in the photographing mode can be displayed.
- the preview interface 601 includes a viewfinder window 602 which can be used to display the preview image before taking a picture in real time.
- the preview interface 601 may also include a zoom option 603.
- the user can select the zoom ratio of the current shooting in the zoom option 603, for example, 2x zoom, 4x zoom, or 10x zoom.
- the mobile phone can zoom in or out according to the current zoom ratio to display the shooting screen captured by the camera.
- the zoom option 603 can also be hidden in the preview interface 601.
- the mobile phone can adjust the current zoom ratio according to the pinch operation of the user in the viewfinder window 602.
- the mobile phone can also use the default zoom ratio to zoom in or zoom out to display the shooting picture collected by the camera, and the embodiment of the present application does not impose any limitation on this.
- the FOV of each frame of the captured picture collected after the camera works is fixed.
- the FOV of the camera is 80°
- the FOV of the shooting picture collected by the camera is also 80°.
- the mobile phone can collect the first shooting picture 701 with a FOV of 80° through the camera.
- the current zoom ratio of the mobile phone is 2 times zoom, it means that the user wants to enlarge the first shot screen 701 by 2 times and display it in the viewfinder window 602.
- FIG. 6 is an example of obtaining the first shooting image 701 by the mobile phone in the preview scene of the camera mode. It is understandable that the mobile phone can also obtain the first shooting image in other shooting modes (such as video, panoramic, slow motion or time-lapse photography, etc.). For example, the mobile phone can obtain the first shooting image in the preview scene of the video mode. It is also possible to obtain the first shooting picture in the shooting scene in the video mode, which is not limited in the embodiment of the present application.
- S502 The mobile phone determines a first cropping ratio of the first shooting image according to the first zoom ratio.
- the mobile phone after the mobile phone obtains the above-mentioned first shooting image 701, it can set a corresponding cropping ratio for the first shooting image 701 according to the current real-time zoom ratio, so as to crop the first shooting image 701. If the current zoom ratio is large, the mobile phone can set a larger cropping ratio for the first shooting image 701; correspondingly, if the current zoom ratio is small, the mobile phone can set a smaller cropping ratio for the first shooting image 701 .
- the crop ratio (crop_ratio) of the current captured image can be calculated according to the following formula (1).
- zoom_ratio is the current zoom ratio
- init_ratio is the preset initial reduction ratio.
- init_ratio can be a constant 10%.
- the first cropping ratio of the first shooting image 701 can be calculated according to the above formula (1) That is to say, in a 2x zoom scenario, it is necessary to crop the first shooting image 701 with a FOV of 80° by 30%, so as to meet the zoom requirement of 2x zoom.
- the correspondence between different zoom ratios and different crop ratios can also be pre-stored in the mobile phone at a certain FOV (for example, 80°). In this way, after the mobile phone obtains the first shooting image 701, it can query the current first zoom ratio. Furthermore, the mobile phone can determine, according to the correspondence relationship shown in Table 1, that the first cropping ratio of the first shooting image 701 corresponding to the first zoom ratio is 30%.
- the cropping ratio set for each frame of the shooting image in the embodiment of the present application changes dynamically in combination with the current zoom ratio.
- the cropping ratio set for each frame of the shooting picture is fixed, for example, a fixed cropping ratio of 10%. Then, in the prior art, after each frame of the shooting picture is acquired, it needs to be cropped according to the current zoom ratio to meet the current zoom requirement, and then cropped for the second time at a fixed 10% crop ratio to compensate for the shooting.
- the screen jitter that appears in the screen.
- the mobile phone can determine the corresponding crop ratio (ie, the aforementioned crop_ratio) for the shot image at one time in combination with the current zoom ratio, and the subsequent mobile phone can crop the shot image once according to the crop ratio.
- the mobile phone can perform a crop based on the entire shooting screen (the first shooting screen 701).
- the anti-shake angle that can be used to compensate for screen shake increases, so that the shooting screen shot by the phone can still be used under large shakes. Obtain a more stable shooting effect.
- the mobile phone can be It is determined in a shooting frame 701 that the FOV size of the cropping frame 801 is 32°.
- the respective borders of the cropping frame 801 are left with a FOV of 24° from the corresponding boundary of the first shooting frame 701.
- the mobile phone can subsequently determine the specific cutting position by moving the cutting frame 801, so as to compensate for the picture shift caused by the shaking of the mobile phone.
- the above-mentioned remaining 24° FOV can be used to compensate for the image shift caused by mobile phone shaking, that is to say, in the 2x zoom scene, the image stabilization angle can reach 24°, thereby improving the image stabilization performance. .
- the mobile phone can obtain different anti-shake angles in different zoom scenes.
- the anti-shake angle of the shooting picture can be increased with the increase of the zoom ratio, thereby It can still get a better anti-shake effect in high zoom scenes.
- the mobile phone crops the first shooting image according to the above-mentioned first cropping ratio.
- the mobile phone can determine that the FOV size of the cropping frame 801 in the first shooting image 701 is 32°. Furthermore, the mobile phone can determine the specific position of the cropping frame 801 in the first photographed image 701 according to the shaking of the first photographed image 701 and perform cutting, so as to compensate for the image shaking of the first photographed image 701.
- the mobile phone can shift the crop frame 801 from the center of the first shooting frame 701 to the right by 3° to compensate for the first shooting frame 701 shaking to the left by 3° The resulting picture shift.
- the mobile phone can shift the cropping frame 801 downward from the center of the first shooting frame 701 by 5° to compensate the first shooting frame 701 shaking upward by 5°. The screen shift.
- the mobile phone can also turn on sensors such as a gyroscope to detect the actual displacement of the mobile phone on the x-axis and y-axis, that is, the actual displacement of the first captured image 701 on the x-axis. S1 and the actual displacement S2 of the first shooting frame 701 on the y axis.
- the mobile phone can obtain the previous frame of the captured image adjacent to the first captured image 701, and then calculate the actual displacement of the first captured image 701 on the x-axis through the OIS (optical image stabilization) algorithm or optical flow algorithm S1 and the actual displacement S2 of the first shooting frame 701 on the y axis.
- OIS optical image stabilization
- the actual displacement of the captured image on the x-axis and the y-axis (that is, the above S1 and S2) is partly caused by the real movement of the user, and the other part is caused by the shaking of the mobile phone.
- the mobile phone obtains the first shooting image 701
- it can be combined with the latest N (N>1) frames to predict the first shooting
- N N>1 frames to predict the first shooting
- the first shooting frame 701 is along x
- the first shooting frame 701 is along x
- the mobile phone can move the crop frame 801 in the first shooting frame 701 along the negative direction of the x-axis by 10°, thereby compensating for the image generated by the first shooting frame 701 shaking 10° in the negative direction of the x-axis Offset; and, the mobile phone can move the crop frame 801 in the first shooting frame 701 along the negative direction of the y-axis by 5°, so as to compensate the screen offset caused by the first shooting frame 701 shaking 5° in the positive direction of the y-axis.
- the mobile phone can adjust the trimming frame 801 to compensate for the image shift caused by the jitter, so that the anti-shake effect of the mobile phone is significantly improved.
- the mobile phone may shake in the z-axis direction when shooting the first shooting frame 701.
- the shaking of the first shooting frame 701 in the z-axis direction will cause the image in the first shooting frame 701 to be deformed.
- the mobile phone can also use a preset warp algorithm to remove the image distortion in the first shooting screen 701 to further improve the anti-shake effect of the mobile phone. .
- the first shooting frame 701 can be cropped according to the location of the cropping frame 801 to obtain the first
- the shooting screen 701 is a cropped shooting screen 1001.
- the mobile phone can zoom in and display the cropped image 1001 in the viewfinder window 602 of the preview interface 601.
- the shooting image 1001 not only satisfies the current zoom requirement of 2x zoom, but also compensates the image shift caused by the mobile phone shaking, so that the user can obtain a better shooting experience.
- the captured image 1001 may be stored in the cache of the mobile phone.
- the captured image 1001 can be stored in the preview buffer or the video buffer.
- the mobile phone can obtain various cropped shots from the preview buffer in real time, and output them in the viewfinder window 602 of the preview interface 601.
- the mobile phone can obtain the cropped shots from the video cache in real time, and encode these shots to save the video recorded this time.
- the first shooting image 701 is cropped according to the current zoom ratio as an example. It is understandable that when the zoom ratio is the first zoom ratio (for example, the above-mentioned 2x zoom), after the mobile phone obtains each frame of the shooting image, the shooting image can be cropped according to the method described in S501-S503. The zoom and anti-shake function of the shooting screen.
- the mobile phone In response to the user's zoom operation, the mobile phone obtains a second shooting image through the camera, and the zoom ratio of the second shooting image is the second zoom ratio.
- the user can also manually adjust the current zoom ratio.
- the user can slide the zoom option 603 in the preview interface 601 to adjust the shooting image from 2x zoom (ie, the first zoom ratio) to 4x zoom (ie, the second zoom ratio).
- the mobile phone detects this zoom operation input by the user, it can update the current zoom ratio to 4x zoom.
- the mobile phone can also respond to the aforementioned zooming operation to obtain a second shooting frame through the camera.
- the FOV of the second shooting frame 1201 is also 80°, which is different from the first shooting frame 701.
- the current zoom ratio of the mobile phone is 4 times zoom, indicating that the user wants to enlarge the second shooting screen 1201 by 4 times and then display it in the viewfinder window 602.
- the mobile phone after the mobile phone detects the zoom operation input by the user, it can also change the camera in use. For example, when detecting that the user adjusts the shooting screen from 2x zoom to 4x zoom, the mobile phone can switch the wide-angle lens with a FOV of 80° in use to a telephoto lens with a FOV of 40°. At this time, the FOV of the second shooting picture acquired by the mobile phone is 40°.
- S505 The mobile phone determines a second cropping ratio of the second shooting image according to the second zoom ratio.
- step S502 after the mobile phone obtains the second shooting frame 1201, it can also determine the cropping ratio (ie, the second cropping ratio) of the second shooting frame 1201 according to the above formula (1) or the corresponding relationship shown in Table 1.
- the cropping ratio ie, the second cropping ratio
- the second cropping ratio of the second shooting frame 1201 can be calculated according to the above formula (1)
- the second shooting frame 1201 with a FOV of 80° needs to be cropped by 40%, so as to achieve the 4x zoom zoom requirement.
- the second shooting frame 1201 with a FOV of 80° has a FOV of 16° remaining after 40% cropping, so the phone can be used for the second shooting It is determined in the screen 1201 that the FOV size of the cropping frame 1301 is 16°.
- the cropping frame 1301 is located at the center of the second shooting frame 1201, the respective borders of the cropping frame 1301 are still 32° FOV from the corresponding border of the second shooting frame 1201.
- the mobile phone can compensate for the image shift caused by mobile phone shaking by moving the cropping frame 1301, and the remaining 32° FOV can be used to compensate for the image shift caused by mobile phone shaking, that is, in a 4x zoom scene, the picture is taken
- the anti-shake angle can reach 32°, and the anti-shake performance during shooting will be significantly improved.
- the mobile phone still uses a camera with a FOV of 80° for shooting after zooming as an example. It is understandable that if the mobile phone changes a camera with another FOV (for example, FOV is 40°) in response to the user's zoom operation, the mobile phone can also store the correspondence between different zoom ratios and different crop ratios when the FOV is 40° Furthermore, the mobile phone can determine the second cropping ratio of the second shooting frame 1201 according to the aforementioned second zoom ratio.
- FOV FOV is 40°
- S506 The mobile phone crops the second shooting frame according to the above-mentioned second cropping ratio.
- the mobile phone can determine that the FOV size of the cropping frame 1301 in the second shooting frame 1201 is 16°. Furthermore, similar to step S503, the mobile phone can determine that the cropping frame 1301 is in the second shooting according to the first shaking amount D1 of the second shooting frame 1201 on the x-axis and the second shaking amount D2 of the second shooting screen 1201 on the y-axis. The specific position in the screen 1201 is cropped, so as to compensate for the screen shake that occurs in the second shooting screen 1201.
- the mobile phone can move the cropping frame 1301 in the second shooting screen 1201 by 20° in the negative x-axis direction, thereby compensating for the picture deviation caused by the second shooting screen 1201 shaking 20° in the positive x-axis direction.
- the mobile phone can move the cropping frame 1301 in the second shooting frame 1201 along the negative direction of the y-axis by 25°, so as to compensate for the screen shift caused by the second shooting frame 1201 shaking 25° in the positive direction of the y-axis.
- the mobile phone can adjust the trimming frame 1301 to compensate for the picture shift caused by the jitter, so that the anti-shake effect of the mobile phone is significantly improved.
- the second shooting frame 1201 can be cropped according to the cropping frame 1301 to obtain the second
- the shooting screen 1201 is a cropped shooting screen 1501.
- the mobile phone can zoom in and display the cropped shot 1501 in the viewfinder window 602 of the preview interface 601.
- the shooting image 1501 not only satisfies the current 4x zoom zoom requirement, but also compensates the image shift caused by the mobile phone shaking, so that the user can obtain a better shooting experience.
- the mobile phone when the mobile phone displays the shooting screen 1501 in the viewfinder window 602 of the preview interface 601, if it is detected that the user clicks the camera button in the preview interface 601, the mobile phone can display the shooting screen 1501 displayed in the viewfinder window 602 at this time. As the photo taken this time, it is saved in the phone album.
- the mobile phone when the mobile phone displays the shooting image 1501 in the viewfinder window 602 of the preview interface 601, if it is detected that the user clicks the camera button in the preview interface 601, the mobile phone can obtain the shooting image collected by the camera at this time, and follow the above steps
- the cropping method in S505-S506 performs zooming and de-shake processing on the captured shots, and saves the cropped shots as the photos taken this time in the phone album.
- the mobile phone can dynamically set the reduction ratio of this shooting picture according to the current zoom ratio.
- This reduction ratio can meet current zoom requirements.
- the mobile phone can determine the specific cutting position in the shooting screen according to the cropping ratio, so as to compensate for the screen shift caused by the shaking of the mobile phone. Since the larger the zoom ratio, the larger the corresponding cropping ratio of the shooting image. Therefore, when the zoom ratio is larger, the remaining image stabilization angle that can be used to compensate for the image shake when the mobile phone crops the shooting image becomes larger. In the shooting scene, the mobile phone can still correct the shooting screen with a large shake angle, thereby improving the anti-shake performance of the shooting screen and the user's shooting experience.
- the mobile phone can also crop the shooting image according to the above method, so as to meet the current zoom ratio and reduce the jitter phenomenon in the shooting image.
- the mobile phone after the mobile phone acquires the shooting frame A, it can recognize the moving object 1601 in the shooting frame A through a preset image recognition algorithm, that is, the current shooting target is a moving object 1601. Moreover, if the current zoom ratio is 2x zoom, the mobile phone can determine that the cropping ratio of the shot frame A is 30% according to the method described in the above embodiment, and the mobile phone can determine the size of the cropping frame 1602 in the shot frame A. Furthermore, the mobile phone can determine the specific position of the cropping frame 1602 according to the amount of shaking of the moving object 1601 in the shooting frame A, so that the moving object 1601 still occupies the main position of the shooting frame after being cropped.
- the mobile phone can obtain the shooting frame B and identify the moving object 1601 in the shooting frame B. If the current zoom ratio is 4x zoom, the mobile phone can determine that the cropping ratio of the shot frame B is 40% according to the method described in the above embodiment, and the mobile phone can determine the size of the cropping frame 1603 in the shot frame B. Furthermore, the mobile phone can determine the specific position of the cropping frame 1603 according to the amount of shaking of the moving object 1601 in the shot frame B, so that the moving object 1601 still occupies the main position of the shot frame after being cropped.
- the mobile phone can obtain the shooting image C and recognize the moving object 1601 in the shooting image C. If the current zoom ratio is 10 times zoom, the mobile phone can determine that the cropping ratio of the shot image C is 46% according to the method described in the above embodiment, and the mobile phone can determine the size of the cropping frame 1604 in the shot image C. Furthermore, the mobile phone can determine the specific position of the trimming frame 1604 according to the amount of shaking of the moving object 1601 in the shooting image C, so that the moving object 1601 still occupies the main position of the shooting image after cropping.
- the moving objects may randomly appear in different positions on the shooting screen. Then, after the mobile phone obtains each frame of the shooting image, it can determine the cropping ratio of the shooting image according to the current zoom ratio, and retain the moving objects in the shooting image according to the cropping ratio, so that the moving objects can appear in the shooting smoothly.
- the position of the subject of the picture reduces the difficulty of composition when shooting.
- the embodiment of the present application discloses an electronic device including a processor, and a memory, an input device, and an output device connected to the processor.
- the input device and the output device can be integrated into one device.
- a touch sensor can be used as an input device
- a display screen can be used as an output device
- the touch sensor and display screen can be integrated into a touch screen.
- the above electronic device may include: a touch screen 1701, which includes a touch sensor 1706 and a display screen 1707; one or more processors 1702; one or more cameras 1708; a memory 1703; one Or multiple application programs (not shown); and one or more computer programs 1704.
- the above-mentioned devices can be connected through one or more communication buses 1705.
- the one or more computer programs 1704 are stored in the aforementioned memory 1703 and configured to be executed by the one or more processors 1702, and the one or more computer programs 1704 include instructions, and the aforementioned instructions can be used to execute the aforementioned implementations.
- the steps in the example Among them, all relevant content of the steps involved in the above method embodiments can be cited in the functional description of the corresponding physical device, which will not be repeated here.
- the aforementioned processor 1702 may specifically be the processor 110 shown in FIG. 1
- the foregoing memory 1703 may specifically be the internal memory 121 shown in FIG. 1
- the foregoing camera 1708 may specifically be the camera 193 shown in FIG.
- the display screen 1707 may specifically be the display screen 194 shown in FIG. 1
- the aforementioned touch sensor 1706 may specifically be a touch sensor in the sensor module 180 shown in FIG. 1, which is not limited in the embodiment of the present application.
- the functional units in the various embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
- a computer readable storage medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Studio Devices (AREA)
Abstract
本申请提供一种拍摄方法及电子设备,涉及终端技术领域,可在变焦场景下保证拍摄的防抖性能,提升拍摄画面的清晰度。该方法包括:通过第一摄像头获取第一拍摄画面;根据第一拍摄画面的第一变焦比例确定第一拍摄画面的第一裁剪比例,第一拍摄画面的防抖角度为第一摄像头的FOV与第一裁剪比例的乘积;按照第一裁剪比例裁剪第一拍摄画面;响应于第一变焦操作,通过第一摄像头获取第二拍摄画面;根据第二拍摄画面的第二变焦比例确定第二拍摄画面的第二裁剪比例,第二变焦比例大于第一变焦比例,第二裁剪比例大于第一裁剪比例,第二拍摄画面的防抖角度为第一摄像头的FOV与第二裁剪比例的乘积;按照第二裁剪比例裁剪第二拍摄画面。
Description
本申请要求于2019年8月22日提交国家知识产权局、申请号为201910780029.9、发明名称为“一种拍摄方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及终端技术领域,尤其涉及一种拍照方法及电子设备。
手机中相机APP的拍摄功能(例如拍照、录影)已经广泛应用在用户的日常生活中。而在在手持条件下,用户使用相机APP拍摄得到的照片或视频会出现一定的抖动现象,影响拍摄画面的清晰度。
目前,一些手机可通过预置的防抖算法降低拍摄时因抖动造成的画面模糊问题。一般,防抖算法的防抖角度与拍摄画面的视场角(field of view,FOV)呈正相关的关系。例如,当拍摄画面的FOV为80°时,对应的防抖角度为8°;当拍摄画面的FOV为40°时,对应的防抖角度为4°。
那么,在拍摄过程中如果用户通过数字变焦的方式将拍摄画面放大N倍,则拍摄画面的FOV也随之缩小N倍,相应的,拍摄画面的防抖角度也会随之缩小N倍,这样一来,手机的防抖效果将显著降低,通过高倍变焦拍摄的拍摄画面的清晰度较差。
发明内容
本申请提供一种拍摄方法及电子设备,可在变焦场景下保证拍摄的防抖性能,提升拍摄画面的清晰度,提高用户的拍摄体验。
为达到上述目的,本申请采用如下技术方案:
第一方面,本申请提供一种拍摄方法,包括:电子设备通过第一摄像头获取第一拍摄画面;进而,电子设备可根据第一拍摄画面的第一变焦比例确定第一拍摄画面的第一裁剪比例,第一拍摄画面的防抖角度为第一摄像头的FOV与第一裁剪比例的乘积;电子设备按照第一裁剪比例裁剪第一拍摄画面,得到第一剪裁画面并输出;后续,如果检测到用户输入第一变焦操作,则电子设备可通过第一摄像头获取第二拍摄画面;同样,电子设备可根据第二拍摄画面的第二变焦比例确定第二拍摄画面的第二裁剪比例,第二变焦比例大于第一变焦比例,第二裁剪比例大于第一裁剪比例,第二拍摄画面的防抖角度为第一摄像头的FOV与第二裁剪比例的乘积;电子设备按照第二裁剪比例裁剪第二拍摄画面,得到第二剪裁画面并输出。
可以看出,电子设备获取到每一帧拍摄画面后,均可按照当前拍摄画面的变焦比例动态的设置本次拍摄画面的裁减比例,进而按照该剪裁比例对本次拍摄画面进行剪裁。当变焦比例越大时,为拍摄画面设置裁减比例越大,因此,当变焦比例越大时,电子设备裁剪拍摄画面时拍摄画面内剩余的可用于补偿画面抖动的防抖角度越大,这 样,在高倍变焦的拍摄场景下电子设备依然可以校正抖动角度较大的拍摄画面,从而提高拍摄画面的防抖性能以及用户的拍摄体验。
在一种可能的实现方式中,电子设备根据第一变焦比例确定第一拍摄画面的第一裁剪比例,具体包括:电子设备根据第一变焦比例按照预设的公式计算第一裁剪比例;类似的,电子设备根据第二变焦比例确定第二拍摄画面的第二裁剪比例,具体包括:电子设备根据第二变焦比例按照预设的公式计算第二裁剪比例;
其中,上述预设的公式为:
其中,zoom_ratio为当前的变焦比例,init_ratio为常数。
也就是说,电子设备可结合当前的变焦比例一次性为拍摄画面确定出对应的裁剪比例(即上述crop_ratio),后续电子设备按照该裁剪比例对拍摄画面进行一次剪裁即可。这样一来,电子设备可基于整个拍摄画面进行一次剪裁,剪裁过程中可用于补偿画面抖动的防抖角度增加,使得电子设备拍摄出的拍摄画面在较大的抖动下仍可获得较为稳定的拍摄效果。
或者,可在电子设备中存储不同变焦比例与不同裁减比例之间的对应关系;此时,电子设备根据第一变焦比例确定第一拍摄画面的第一裁剪比例,具体包括:电子设备根据该对应关系,确定与第一变焦比例对应的第一裁剪比例;类似的,电子设备根据第二变焦比例确定第二拍摄画面的第二裁剪比例,具体包括:电子设备根据该对应关系,确定与第二变焦比对应的第二裁剪比例。
需要说明的是,当变焦比例越大时,为拍摄画面设置裁减比例越大。而拍摄画面的防抖角度为摄像头的FOV与裁减比例的乘积,那么,在摄像头的FOV一定的情况下,当变焦比例越大时,拍摄画面对应的防抖角度越大,电子设备的防抖能力越高。
在一种可能的实现方式中,电子设备按照第一裁剪比例裁剪第一拍摄画面,得到第一剪裁画面,具体包括:电子设备按照第一裁剪比例计算第一剪裁框的大小;电子设备在第一拍摄画面中确定第一剪裁框的位置;进而,电子设备可沿第一剪裁框的位置剪裁第一拍摄画面,得到第一剪裁画面。
示例性的,电子设备在第一拍摄画面中确定第一剪裁框的位置,具体包括:电子设备获取第一拍摄画面在x轴上的第一抖动方向和第一抖动量,并获取第一拍摄画面在y轴上的第二抖动方向和第二抖动量;为了补偿第一拍摄画面在x轴和y轴上的产生的抖动,电子设备可从第一初始位置(即第一剪裁框位于第一拍摄画面的中心)开始,沿第一抖动方向的反方向将第一剪裁框在x轴上移动第一抖动量,并沿第二抖动方向的反方向将第一剪裁框在y轴上移动第二抖动量。
类似的,电子设备按照第二裁剪比例裁剪第二拍摄画面,得到第二剪裁画面,具体包括:电子设备按照第二裁剪比例计算第二剪裁框的大小;电子设备在第二拍摄画面中确定第二剪裁框的位置;进而,电子设备可沿第二剪裁框的位置剪裁第二拍摄画面,得到第二剪裁画面。
示例性的,电子设备在第二拍摄画面中确定第二剪裁框的位置,具体包括:电子 设备获取第二拍摄画面在x轴上的第一抖动方向和第一抖动量,并获取第二拍摄画面在y轴上的第二抖动方向和第二抖动量;进而,电子设备可从第二初始位置(即第二剪裁框位于第二拍摄画面的中心)开始,沿第一抖动方向的反方向将第二剪裁框在x轴上移动第一抖动量,并沿第二抖动方向的反方向将第二剪裁框在y轴上移动第二抖动量。
也就是说,电子设备可通过调整剪裁框在每帧拍摄画面中的位置补偿因抖动而产生的画面偏移,使得电子设备的防抖效果得到明显提升。
在一种可能的实现方式中,上述第一剪裁框中包括第一拍摄画面内的运动物体;上述第二剪裁框中包括第二拍摄画面内的运动物体。也就是说,电子设备可根据当前的变焦比例确定本次拍摄画面的裁减比例,并按照该裁减比例保留拍摄画面中的运动物体,使得运动物体能够平稳的出现在拍摄画面的主体位置,降低用户拍摄时的构图难度。
在一种可能的实现方式中,上述方法还包括:响应于用户输入的第二变焦操作,电子设备通过第二摄像头获取第三拍摄画面,第二摄像头的FOV与第一摄像头的FOV不同。也就是说,电子设备检测到用户输入的变焦操作后,还可以更换正在使用的摄像头。
在一种可能的实现方式中,电子设备通过第一摄像头获取第一拍摄画面,包括:电子设备可在预览场景、视频拍摄场景或照片拍摄场景中使用第一摄像头获取第一拍摄画面。也就是说,无论在拍照场景或视频场景下,无论在预览场景或录制场景下,电子设备获取到每一帧拍摄画面后,均可按照当前的变焦比例动态的设置本次拍摄画面的裁减比例。由于当变焦比例越大时拍摄画面对应的裁减比例越大,因此,当变焦比例越大时拍摄画面的防抖角度越大,这样,在高倍变焦的拍摄场景下电子设备依然可以校正抖动角度较大的拍摄画面,从而提高拍摄画面的防抖性能以及用户的拍摄体验。
第二方面,本申请提供一种电子设备,包括:触摸屏、一个或多个处理器、一个或多个摄像头、存储器以及一个或多个计算机程序;其中,处理器与触摸屏、摄像头和存储器均耦合,上述一个或多个计算机程序被存储在存储器中,当电子设备运行时,该处理器执行该存储器存储的一个或多个计算机程序,以使电子设备执行上述任一项所述的拍摄方法。
第三方面,本申请提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如第一方面中任一项所述的拍摄方法。
第四方面,本申请提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行如第一方面中任一项所述的拍摄方法。
可以理解地,上述提供的第二方面所述的电子设备、第三方面所述的计算机存储介质,以及第四方面所述的计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
图1为本申请实施例提供的一种电子设备的结构示意图一;
图2为本申请实施例提供的一种摄像头的工作原理示意图;
图3为现有技术中数码变焦的原理示意图;
图4为现有技术中对拍摄画面进行防抖处理的原理示意图;
图5为本申请实施例提供的一种拍摄方法的流程示意图;
图6为本申请实施例提供的一种拍摄方法的应用场景示意图一;
图7为本申请实施例提供的一种拍摄方法的应用场景示意图二;
图8为本申请实施例提供的一种拍摄方法的应用场景示意图三;
图9为本申请实施例提供的一种拍摄方法的应用场景示意图四;
图10为本申请实施例提供的一种拍摄方法的应用场景示意图五;
图11为本申请实施例提供的一种拍摄方法的应用场景示意图六;
图12为本申请实施例提供的一种拍摄方法的应用场景示意图七;
图13为本申请实施例提供的一种拍摄方法的应用场景示意图八;
图14为本申请实施例提供的一种拍摄方法的应用场景示意图九;
图15为本申请实施例提供的一种拍摄方法的应用场景示意图十;
图16为本申请实施例提供的一种拍摄方法的应用场景示意图十一;
图17为本申请实施例提供的一种电子设备的结构示意图二。
下面将结合附图对本实施例的实施方式进行详细描述。
示例性的,本申请实施例提供的一种拍摄方法可应用于手机、平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、手持计算机、上网本、个人数字助理(personal digital assistant,PDA)、可穿戴电子设备、虚拟现实设备等电子设备,本申请实施例对此不做任何限制。
示例性的,图1示出了电子设备100的结构示意图。
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141可接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显示屏194,摄像头193,和无线通信模块160等供电。
电源管理模块141可用于监测电池容量,电池循环次数,电池充电电压,电池放电电压,电池健康状态(例如漏电,阻抗)等性能参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括一个或多个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(Bluetooth, BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成一个或多个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。在一些实施例中,手机100可以包括1个或N个摄像头,N为大于1的正整数。摄像头193可以是前置摄像头也可以是后置摄像头。如图2所示,摄像头193一般包括镜头(lens)和感光元件(sensor),该感光 元件可以为CCD(charge-coupled device,电荷耦合元件)或者CMOS(complementary metal oxide semiconductor,互补金属氧化物半导体)等任意感光器件。
仍如图2所示,在拍摄照片或视频的过程中,被拍摄物体的反射光线经过镜头后可生成光学图像,该光学图像投射到感光元件上,感光元件将接收到的光信号转换为电信号,进而,摄像头193将得到的电信号发送至DSP(Digital Signal Processing,数字信号处理)模块进行数字信号处理,最终得到每一帧数字图像。
其中,使用摄像头193拍摄得到的图像或视频可通过显示屏194在手机100上输出,也可以将该数字图像存储在内部存储器121中,本申请实施例对此不做任何限制。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储一个或多个计算机程序,该一个或多个计算机程序包括指令。处理器110可以通过运行存储在内部存储器121的上述指令,从而使得电子设备100执行本申请一些实施例中所提供的联系人智能推荐的方法,以及各种功能应用和数据处理等。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统;该存储程序区还可以存储一个或多个应用程序(比如图库、联系人等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如照片,联系人等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。在另一些实施例中,处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,来使得电子设备100执行本申请实施例中所提供的智能推荐号码的方法,以及各种功能应用和数据处理。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨 打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置一个或多个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等,本申请实施例对此不做任何限制。
当然,本申请实施例提供的电子设备100还可以包括按键190、马达191、指示器192以及SIM卡接口195等一项或多项器件,本申请实施例对此不做任何限制。
为了清楚地理解相关现有技术以及本申请中的各实施例,首先给出相关技术的简要介绍:
视场角(field of view,FOV)又可称为视场,视场角的大小决定了光学仪器(例如摄像头)拍摄出的拍摄画面的视野范围。当摄像头的FOV越大时,拍摄画面的视野范围越大;当摄像头的FOV越小时,拍摄画面的视野范围越小。
数码变焦(digital zoom),是通过电子设备中的DSP或处理器等器件,将拍摄画面内的每个像素面积增大,从而达到放大目的。示例性的,以变焦比例为4(即4倍变焦)举例,如图3所示,使用FOV为80°的摄像头采集到拍摄画面301时,如果此时电子设备设置的变焦比例为4,说明用户希望将拍摄画面301放大4倍进行显示。那么,电子设备可以拍摄画面301的中心点A为中心,对拍摄画面301进行裁剪,保留FOV为20°(即80°/4)的拍摄画面302。进而,电子设备可将裁剪后的拍摄画面302放大显示在电子设备的预览框303中。此时,用户可在预览框303中观看到拍摄画面301进行4倍变焦后的显示效果。
在现有技术中,以手机为上述电子设备举例,手机通过摄像头获取到每一帧拍摄画面后,可先根据当前的变焦比例对该拍摄画面进行裁剪。仍如图3所示,手机获取到FOV为80°的拍摄画面301后,如果当前的变焦比例为4,则手机可将拍摄画面401裁剪为FOV为20°的拍摄画面302。并且,手机内预先为去除画面抖动设置有固定的裁剪比例(init ratio),例如,裁剪比例=10%。也就是说,手机可在拍摄画面302的基础上再次裁剪10%,以降低拍摄画面302的抖动现象。
如图4中的(a)所示,手机可通过预设的防抖算法确定拍摄画面302在x轴的第一抖动量D1以及拍摄画面302在y轴的第二抖动量D2。以第一抖动量D1为1°,第二抖动量D2为1°举例,说明本次获取的拍摄画面302沿x轴正方向产生了1°抖动,并且,拍摄画面302沿y轴正方向产生了1°抖动。
由于拍摄画面302的FOV为20°,当裁剪比例为10%时对应的防抖角度为2°(即20°*10%)。那么,仍如图4中的(a)所示,拍摄画面302按照10%的裁剪比例裁 剪后还还剩余裁剪框401内大小为16°(即20°-20°*10%*2)的FOV。那么,如图4中的(b)所示,如果裁剪框401的初始位置位于拍摄画面302的中心,则手机可沿x轴负方向移动1°裁剪框401,并沿y轴负方向移动1°裁剪框401。进而,手机可按此时裁剪框401的位置裁剪拍摄画面302并输出,从而补偿拍摄画面302在x轴正方向和y轴正方向上产生的抖动。
可以看出,当拍摄画面的变焦比例为4倍变焦时,拍摄画面的防抖角度只有2°。由于上述用于补偿画面抖动的裁剪比例是固定的,因此,当拍摄画面的变焦比例越高时,拍摄画面的防抖角度会变得越小。仍以初始拍摄画面的FOV为80°,裁剪比例为10%举例,当拍摄画面的变焦比例为10倍变焦时,变焦后拍摄画面的FOV为8°(即80°/10),此时拍摄画面的防抖角度仅剩0.8°(即8°*10%)。而用户在步行时拍摄出的拍摄画面的抖动大约为3°-5°,用户在跑步时拍摄出的拍摄画面的抖动可达到10°以上。显然,现有技术中的防抖处理方法已经无法满足在高倍变焦场景下用户的防抖需求,导致拍摄画面的拍摄质量和用户的拍摄体验均降低。
对此,本申请实施例提供了一种拍摄方法,仍以手机为上述电子设备举例,如图5所示,该方法包括步骤S501-S506。
S501、手机通过摄像头获取第一拍摄画面,第一拍摄画面的变焦比例为第一变焦比例。
一般,手机的相机应用中设置有拍照、录像、全景、慢动作或延时摄影等一项或多项拍摄模式。检测到用户打开相机应用后,手机可调用相机应用进入某一拍摄模式并打开摄像头。此时,摄像头可按一定工作频率将采集每一帧拍摄画面,手机在保存或显示这些拍摄画面前,可实时的对每一帧拍摄画面进行去抖动处理,以降低拍摄画面中的抖动现象。
示例性的,如图6所示,手机打开相机应用后可显示拍照模式的预览界面601,预览界面601中包括取景窗口602,取景窗口602可用于实时显示拍照前的预览画面。另外,预览界面601中还可以包括变焦选项603。用户可以在变焦选项603中选择当前拍摄的变焦比例,例如,2倍变焦、4倍变焦或10倍变焦等。手机可根据当前的变焦比例放大或缩小显示摄像头采集到的拍摄画面。需要说明的是,变焦选项603也可以隐藏在预览界面601中,例如,手机可以根据用户在取景窗口602中的捏合操作相应的调整当前的变焦比例。当然,手机也可以使用默认的变焦比例放大或缩小显示摄像头采集到的拍摄画面,本申请实施例对此不做任何限制。
以当前的变焦比例为2倍变焦(即第一变焦比例)举例,摄像头工作后采集到的每一帧拍摄画面的FOV是固定的。例如,当摄像头的FOV为80°时,摄像头采集到的拍摄画面的FOV也为80°。例如,如图7所示,手机打开相机应用后,手机可通过摄像头采集FOV为80°的第一拍摄画面701。此时,如果手机当前的变焦比例为2倍变焦,说明用户希望将第一拍摄画面701放大2倍后显示在取景窗口602中。
需要说明的是,图6是以手机在拍照模式的预览场景下获取第一拍摄画面701举例说明的。可以理解的是,手机还可以在其他拍摄模式(例如录像、全景、慢动作或延时摄影等)中获取第一拍摄画面,例如,手机可在录像模式的预览场景下获取第一拍摄画面,也可以在录像模式的拍摄场景下获取第一拍摄画面,本申请实施例对此不 做任何限制。
S502、手机根据第一变焦比例确定第一拍摄画面的第一裁减比例。
在本申请实施例中,手机获取到上述第一拍摄画面701后,可根据当前实时的变焦比例为第一拍摄画面701设置对应的裁减比例,从而对第一拍摄画面701进行剪裁。如果当前的变焦比例较大,则手机可为第一拍摄画面701设置较大的裁减比例;相应的,如果当前的变焦比例较小,则手机可为第一拍摄画面701设置较小的裁减比例。
示例性的,手机每获取到一帧拍摄画面后,均可按照下述公式(1)计算当前拍摄画面的裁减比例(crop_ratio)。
其中,zoom_ratio为当前的变焦比例,init_ratio为预设的初始裁减比例,例如,init_ratio可以为常数10%。
那么,仍以第一变焦比例为2倍变焦举例,手机获取到第一拍摄画面701后,可根据上述公式(1)计算第一拍摄画面701的第一裁减比例
也就是说,在2倍变焦的场景下,需要对FOV为80°的第一拍摄画面701裁剪30%,从而达到2倍变焦的变焦需求。
在另一些实施例中,如表1所示,也可以在手机中预先存储在一定FOV(例如80°)下,不同变焦比例与不同裁减比例之间的对应关系。这样,当手机获取到第一拍摄画面701后,可查询当前的第一变焦比例。进而,手机可根据表1所示的对应关系确定与第一变焦比例对应的第一拍摄画面701的第一裁减比例为30%。
表1
可以看出,本申请实施例中对每一帧拍摄画面设置的裁减比例是结合当前的变焦比例动态变化的。而现有技术中为每一帧拍摄画面设置的裁减比例是固定不变的,例如10%的固定裁剪比例。那么,在现有技术中每获取到一帧拍摄画面后,需要先根据当前的变焦比例进行一次剪裁以满足当前的变焦需求,再按照固定的10%的裁剪比例进行第二次剪裁以补偿拍摄画面中出现的画面抖动。
在本申请实施例中,手机可结合当前的变焦比例一次性为拍摄画面确定出对应的裁剪比例(即上述crop_ratio),后续手机按照该裁剪比例对拍摄画面进行一次剪裁即可。这样一来,手机可基于整个拍摄画面(第一拍摄画面701)进行一次剪裁,剪裁过程中可用于补偿画面抖动的防抖角度增加,使得手机拍摄出的拍摄画面在较大的抖动下仍可获得较为稳定的拍摄效果。
以第一拍摄画面701的裁剪比例(crop_ratio)为30%举例,如图8所示,FOV为80°的第一拍摄画面701裁剪30%后还剩余32°的FOV,因此,手机可在第一拍摄画面701中确定出裁剪框801的FOV大小为32°。当裁剪框801位于第一拍摄画面701的中心时,裁剪框801各条边界距离第一拍摄画面701的对应边界还剩余24°的FOV。手机后续可通过移动裁剪框801确定具体剪裁位置,从而补偿手机抖动产生的画面偏移。而上述剩余的24°的FOV均可用于补偿手机抖动产生的画面偏移,也就是说,在2倍变焦的场景下,拍摄画面的防抖角度可达到24°,从而提高拍摄的防抖性能。
示例性的,仍以拍摄画面的FOV为80°举例,如表2所示,按照上述方法手机可在不同变焦场景下获得不同的防抖角度。相比于现有技术中防抖角度随变焦比例的增大而减小的情况,在本实施例提供的拍摄方法中,拍摄画面的防抖角度可随变焦比例的增大而增大,从而在高倍变焦的场景下仍然能够获得较好的防抖效果。
表2
S503、手机按照上述第一裁减比例剪裁第一拍摄画面。
仍以上述第一拍摄画面701举例,仍如图8所示,当第一拍摄画面701的裁减比例为30%时,手机可以确定第一拍摄画面701中裁剪框801的FOV大小为32°。进而,手机可根据第一拍摄画面701的抖动情况确定裁剪框801在第一拍摄画面701中的具体位置并进行剪裁,从而补偿第一拍摄画面701发生的画面抖动。
例如,如果检测到第一拍摄画面701向左抖动了3°,则手机可将裁剪框801从第一拍摄画面701的中心向右平移3°,从而补偿第一拍摄画面701向左抖动3°产生的画面偏移。又例如,如果检测到第一拍摄画面701向上抖动了5°,则手机可将裁剪框801从第一拍摄画面701的中心向下平移5°,从而补偿第一拍摄画面701向上抖动5°产生的画面偏移。
示例性的,手机通过摄像头在采集第一拍摄画面701的同时,还可以开启陀螺仪等传感器检测手机在x轴和y轴上的实际位移,即第一拍摄画面701在x轴上的实际位移S1以及第一拍摄画面701在y轴上的实际位移S2。或者,手机可以获取与第一拍摄画面701相邻的上一帧拍摄画面,进而通过OIS(optical image stabilization,光学防抖)算法或光流算法计算第一拍摄画面701在x轴上的实际位移S1以及第一拍摄画面701在y轴上的实际位移S2。
一般,拍摄画面在x轴和y轴上的实际位移(即上述S1、S2)一部分是由于用户的真实运动产生的,另一部分由于手机抖动产生的。为了确定出第一拍摄画面701由于手机抖动在x轴和y轴上产生的抖动量,手机获取到第一拍摄画面701后,可结合最近N(N>1)帧拍摄画面预测在拍摄第一拍摄画面701时用户在x轴的运动位移Y1和用户在y轴的运动位移Y2。那么,手机可计算出第一拍摄画面701在x轴的第一抖动量D1=S1-Y1,第一拍摄画面701在y轴的第二抖动量D2=S2-Y2。
示例性的,以第一拍摄画面701在x轴的第一抖动量D1为10°,第一拍摄画面701在y轴的第二抖动量D2为5°举例,说明第一拍摄画面701沿x轴正方向产生了10°抖动,并沿y轴正方向产生了5°抖动。此时,如图9所示,手机可将第一拍摄画面701中的裁剪框801沿x轴负方向移动10°,从而补偿第一拍摄画面701在x轴负方向上抖动10°产生的画面偏移;并且,手机可将第一拍摄画面701中的裁剪框801沿y轴负方向移动5°,从而补偿第一拍摄画面701在y轴正方向上抖动5°产生的画面偏移。
由于第一拍摄画面701的防抖角度为24°,也就是说,当第一拍摄画面701在x轴正方向(或负方向)上产生24°以内的抖动,和/或,第一拍摄画面701在y轴正方向(或负方向)上产生24°以内的抖动时,手机均可通过调整剪裁框801的方法补偿因抖动而产生的画面偏移,使得手机的防抖效果得到明显提升。
另外,手机在拍摄第一拍摄画面701时还有可能在z轴方向上产生抖动。第一拍摄画面701在z轴方向上产生的抖动会导致第一拍摄画面701中的图像发生变形。那么,手机除了通过调整剪裁框801去除第一拍摄画面701中的抖动现象外,还可以使用预设的warp(变形)算法去除第一拍摄画面701中的图像变形,进一步提高手机的防抖效果。
如图10所示,手机根据第一拍摄画面701在x轴和y轴的抖动量确定出裁剪框801的具体位置后,可按照裁剪框801所在的位置剪裁第一拍摄画面701,得到第一拍摄画面701剪裁后的拍摄画面1001。进而,手机可将剪裁后的拍摄画面1001放大显示在预览界面601的取景窗口602中。此时,拍摄画面1001既满足当前2倍变焦的变焦需求,同时补偿了手机因抖动产生的画面偏移,使用户获取较好的拍摄体验。
在一些实施例中,手机裁剪第一拍摄画面701得到拍摄画面1001后,可以先将拍摄画面1001存储在手机的缓存中。例如,可将拍摄画面1001存储在预览缓存或视频缓存中。在拍照或拍摄视频的预览场景下,手机可从预览缓存中实时获取已经剪裁的各个拍摄画面,并输出在预览界面601的取景窗口602中。在视频的拍摄过程中,手机可从视频缓存中实时获取已经剪裁的各个拍摄画面,并将这些拍摄画面编码为本次录制的视频进行保存。
上述实施例中是以手机获取到第一拍摄画面701后,根据当前的变焦比例对第一拍摄画面701进行剪裁为例说明的。可以理解的是,在变焦比例为第一变焦比例(例如上述2倍变焦)的情况下,手机获取到每帧拍摄画面后均可按照S501-S503所述的方法对拍摄画面进行剪裁,从实现拍摄画面的变焦以及防抖功能。
S504、响应于用户的变焦操作,手机通过摄像头获取第二拍摄画面,第二拍摄画面的变焦比例为第二变焦比例。
在预览或拍摄视频的过程中,用户还可以手动调整当前的变焦比例。例如,如图11所示,用户可在预览界面601中滑动变焦选项603,将拍摄画面从2倍变焦(即第一变焦比例)调整为4倍变焦(即第二变焦比例)。手机检测到用户输入的这一变焦操作后,可更新当前的变焦比例为4倍变焦。
同时,与步骤S501类似的,手机还可以响应上述变焦操作通过摄像头获取第二拍摄画面,如图12所示,第二拍摄画面1201的FOV也为80°,与第一拍摄画面701 不同的是,手机当前的变焦比例为4倍变焦,说明用户希望将第二拍摄画面1201放大4倍后显示在取景窗口602中。
在一些实施例中,手机检测到用户输入的变焦操作后,还可以更换正在使用的摄像头。例如,检测到用户将拍摄画面从2倍变焦调整为4倍变焦时,手机可将正在使用的FOV为80°的广角镜头切换为FOV为40°的长焦镜头。此时,手机获取到的第二拍摄画面的FOV为40°。
S505、手机根据第二变焦比例确定第二拍摄画面的第二裁减比例。
与步骤S502类似的,手机获取到第二拍摄画面1201后,也可根据上述公式(1)或表1所示的对应关系确定第二拍摄画面1201的裁减比例(即第二裁减比例)。
仍以第二变焦比例为4倍变焦举例,手机获取到第二拍摄画面1201后,可根据上述公式(1)计算第二拍摄画面1201的第二裁减比例
也就是说,在4倍变焦的场景下,需要对FOV为80°的第二拍摄画面1201裁剪40%,从而达到4倍变焦的变焦需求。
当第二拍摄画面1201的第二裁减比例为40%时,如图13所示,FOV为80°的第二拍摄画面1201裁剪40%后还剩余16°的FOV,因此手机可在第二拍摄画面1201中确定出裁剪框1301的FOV大小为16°。当裁剪框1301位于第二拍摄画面1201的中心时,裁剪框1301各条边界距离第二拍摄画面1201的对应边界还剩余32°的FOV。手机通过移动裁剪框1301可补偿手机抖动产生的画面偏移,而上述剩余的32°的FOV均可用于补偿手机抖动产生的画面偏移,也就是说,在4倍变焦的场景下,拍摄画面的防抖角度可达到32°,拍摄时的防抖性能将显著提高。
需要说明的是,上述实施例中是以手机变焦后仍使用FOV为80°的摄像头进行拍摄为例说明的。可以理解的是,如果响应于用户的变焦操作手机更换了其他FOV(例如FOV为40°)的摄像头,则手机中还可以存储FOV为40°时不同变焦比例与不同裁减比例之间的对应关系,进而,手机可根据上述第二变焦比例确定第二拍摄画面1201的第二裁减比例。
S506、手机按照上述第二裁减比例剪裁第二拍摄画面。
仍以上述第二拍摄画面1201举例,仍如图13所示,当第二拍摄画面1201的裁减比例为40%时,手机可以确定第二拍摄画面1201中裁剪框1301的FOV大小为16°。进而,与步骤S503类似的,手机可根据第二拍摄画面1201在x轴的第一抖动量D1,以及第二拍摄画面1201在y轴的第二抖动量D2,确定裁剪框1301在第二拍摄画面1201中的具体位置并进行剪裁,从而补偿第二拍摄画面1201发生的画面抖动。
以第二拍摄画面1201在x轴的第一抖动量D1为20°,第二拍摄画面1201在y轴的第二抖动量D2为25°举例,说明第一拍摄画面701沿x轴正方向产生了20°抖动,并沿y轴正方向产生了25°抖动。此时,如图14所示,手机可将第二拍摄画面1201中的裁剪框1301沿x轴负方向移动20°,从而补偿第二拍摄画面1201在x轴正方向上抖动20°产生的画面偏移;并且,手机可将第二拍摄画面1201中的裁剪框1301 沿y轴负方向移动25°,从而补偿第二拍摄画面1201在y轴正方向上抖动25°产生的画面偏移。
由于第二拍摄画面1201的防抖角度为32°,也就是说,当第二拍摄画面1201在x轴正方向(或负方向)上产生32°以内的抖动,和/或,第二拍摄画面1201在y轴正方向(或负方向)上产生32°以内的抖动时,手机均可通过调整剪裁框1301的方法补偿因抖动而产生的画面偏移,使得手机的防抖效果得到明显提升。
进一步地,如图15所示,手机根据第二拍摄画面1201在x轴和y轴的抖动量确定出裁剪框1301的具体位置后,可按照裁剪框1301剪裁第二拍摄画面1201,得到第二拍摄画面1201剪裁后的拍摄画面1501。进而,手机可将剪裁后的拍摄画面1501放大显示在预览界面601的取景窗口602中。此时,拍摄画面1501既满足当前4倍变焦的变焦需求,同时补偿了手机因抖动产生的画面偏移,使用户获取较好的拍摄体验。
示例性的,当手机在预览界面601的取景窗口602中显示出拍摄画面1501时,如果检测到用户点击预览界面601中的拍照按钮,则手机可将此时取景窗口602中显示的拍摄画面1501作为本次的拍摄照片保存在手机相册中。
或者,当手机在预览界面601的取景窗口602中显示出拍摄画面1501时,如果检测到用户点击预览界面601中的拍照按钮,则手机可获取此时摄像头采集到的拍摄画面,并按照上述步骤S505-S506中的裁剪方法对采集到的拍摄画面进行变焦和去抖动处理,并将裁剪后的拍摄画面作为本次的拍摄照片保存在手机相册中。
可以看出,无论在拍照场景或视频场景下,无论在预览场景或录制场景下,手机获取到每一帧拍摄画面后,均可按照当前的变焦比例动态的设置本次拍摄画面的裁减比例,该裁减比例可满足当前的变焦需求。并且,手机可按照该裁减比例在拍摄画面中确定具体的剪裁位置,从而补偿手机因抖动产生的画面偏移。由于当变焦比例越大时拍摄画面对应的裁减比例越大,因此,当变焦比例越大时,手机裁剪拍摄画面时剩余的可用于补偿画面抖动的防抖角度越大,这样,在高倍变焦的拍摄场景下手机依然可以校正抖动角度较大的拍摄画面,从而提高拍摄画面的防抖性能以及用户的拍摄体验。
另外,在拍摄运动的物体时,手机也可按照上述方法对拍摄画面进行裁剪,从而满足当前的变焦比例并降低拍摄画面中的抖动现象。
示例性的,如图16中的(a)所示,手机获取到拍摄画面A后,可通过预设的图像识别算法识别出拍摄画面A中的运动物体1601,即当前的拍摄目标为运动物体1601。并且,如果当前的变焦比例为2倍变焦,则手机可按照上述实施例所述的方法确定出拍摄画面A的剪裁比例为30%,进而手机可确定拍摄画面A中剪裁框1602的大小。进而,手机可根据运动物体1601在拍摄画面A中的抖动量确定剪裁框1602的具体位置,使得运动物体1601在裁剪后仍然占据拍摄画面的主体位置。
当用户将变焦比例从2倍变焦调整为4倍变焦时,如图16中的(b)所示,手机可获取到拍摄画面B,并识别出拍摄画面B中的运动物体1601。如果当前的变焦比例为4倍变焦,则手机可按照上述实施例所述的方法确定出拍摄画面B的剪裁比例为40%,进而手机可确定拍摄画面B中剪裁框1603的大小。进而,手机可根据运动物体1601在拍摄画面B中的抖动量确定剪裁框1603的具体位置,使得运动物体1601在裁剪后 仍然占据拍摄画面的主体位置。
当用户将变焦比例从4倍变焦调整为10倍变焦时,如图16中的(c)所示,手机可获取到拍摄画面C,并识别出拍摄画面C中的运动物体1601。如果当前的变焦比例为10倍变焦,则手机可按照上述实施例所述的方法确定出拍摄画面C的剪裁比例为46%,进而手机可确定拍摄画面C中剪裁框1604的大小。进而,手机可根据运动物体1601在拍摄画面C中的抖动量确定剪裁框1604的具体位置,使得运动物体1601在裁剪后仍然占据拍摄画面的主体位置。
可以看出,在拍摄运动的物体时,运动的物体可能会随机的出现在拍摄画面的不同位置。那么,手机获取到每一帧拍摄画面后,均可根据当前的变焦比例确定本次拍摄画面的裁减比例,并按照该裁减比例保留拍摄画面中的运动物体,使得运动物体能够平稳的出现在拍摄画面的主体位置,降低用户拍摄时的构图难度。
本申请实施例公开了一种电子设备,包括处理器,以及与处理器相连的存储器、输入设备和输出设备。其中,输入设备和输出设备可集成为一个设备,例如,可将触摸传感器作为输入设备,将显示屏作为输出设备,并将触摸传感器和显示屏集成为触摸屏。
此时,如图17所示,上述电子设备可以包括:触摸屏1701,所述触摸屏1701包括触摸传感器1706和显示屏1707;一个或多个处理器1702;一个或多个摄像头1708;存储器1703;一个或多个应用程序(未示出);以及一个或多个计算机程序1704,上述各器件可以通过一个或多个通信总线1705连接。其中该一个或多个计算机程序1704被存储在上述存储器1703中并被配置为被该一个或多个处理器1702执行,该一个或多个计算机程序1704包括指令,上述指令可以用于执行上述实施例中的各个步骤。其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应实体器件的功能描述,在此不再赘述。
示例性的,上述处理器1702具体可以为图1所示的处理器110,上述存储器1703具体可以为图1所示的内部存储器121,上述摄像头1708具体可以为图1所示的摄像头193,上述显示屏1707具体可以为图1所示的显示屏194,上述触摸传感器1706具体可以为图1所示的传感器模块180中的触摸传感器,本申请实施例对此不做任何限制。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件 产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。
Claims (22)
- 一种拍摄方法,其特征在于,包括:电子设备通过第一摄像头获取第一拍摄画面,所述第一拍摄画面的变焦比例为第一变焦比例;所述电子设备根据所述第一变焦比例确定所述第一拍摄画面的第一裁剪比例,所述第一拍摄画面的防抖角度为所述第一摄像头的视场角FOV与所述第一裁剪比例的乘积;所述电子设备按照所述第一裁剪比例裁剪所述第一拍摄画面,得到第一剪裁画面并输出;响应于用户输入的第一变焦操作,所述电子设备通过所述第一摄像头获取第二拍摄画面,所述第二拍摄画面的变焦比例为第二变焦比例,所述第二变焦比例大于所述第一变焦比例;所述电子设备根据所述第二变焦比例确定所述第二拍摄画面的第二裁剪比例,所述第二裁剪比例大于所述第一裁剪比例,所述第二拍摄画面的防抖角度为所述第一摄像头的FOV与所述第二裁剪比例的乘积;所述电子设备按照所述第二裁剪比例裁剪所述第二拍摄画面,得到第二剪裁画面并输出。
- 根据权利要求1所述的方法,其特征在于,所述电子设备中存储有不同变焦比例与不同裁减比例之间的对应关系;所述电子设备根据所述第一变焦比例确定所述第一拍摄画面的第一裁剪比例,包括:所述电子设备根据所述对应关系,确定与所述第一变焦比例对应的第一裁剪比例;所述电子设备根据所述第二变焦比例确定所述第二拍摄画面的第二裁剪比例,包括:所述电子设备根据所述对应关系,确定与所述第二变焦比对应的第二裁剪比例。
- 根据权利要求1-3中任一项所述的方法,其特征在于,所述电子设备按照所述第一裁剪比例裁剪所述第一拍摄画面,得到第一剪裁画面,包括:所述电子设备按照所述第一裁剪比例计算第一剪裁框的大小;所述电子设备在所述第一拍摄画面中确定所述第一剪裁框的位置;所述电子设备沿所述第一剪裁框的位置剪裁所述第一拍摄画面,得到第一剪裁画面。
- 根据权利要求4所述的方法,其特征在于,所述电子设备在所述第一拍摄画面中确定所述第一剪裁框的位置,包括:所述电子设备获取所述第一拍摄画面在x轴上的第一抖动方向和第一抖动量,并获取所述第一拍摄画面在y轴上的第二抖动方向和第二抖动量;所述电子设备从第一初始位置开始,沿所述第一抖动方向的反方向将所述第一剪裁框在x轴上移动所述第一抖动量,并沿所述第二抖动方向的反方向将所述第一剪裁框在y轴上移动所述第二抖动量,所述第一初始位置是指所述第一剪裁框位于所述第一拍摄画面的中心。
- 根据权利要求1-3中任一项所述的方法,其特征在于,所述电子设备按照所述第二裁剪比例裁剪所述第二拍摄画面,得到第二剪裁画面,包括:所述电子设备按照所述第二裁剪比例计算第二剪裁框的大小;所述电子设备在所述第二拍摄画面中确定所述第二剪裁框的位置;所述电子设备沿所述第二剪裁框的位置剪裁所述第二拍摄画面,得到第二剪裁画面。
- 根据权利要求6所述的方法,其特征在于,所述电子设备在所述第二拍摄画面中确定所述第二剪裁框的位置,包括:所述电子设备获取所述第二拍摄画面在x轴上的第一抖动方向和第一抖动量,并获取所述第二拍摄画面在y轴上的第二抖动方向和第二抖动量;所述电子设备从第二初始位置开始,沿所述第一抖动方向的反方向将所述第二剪裁框在x轴上移动所述第一抖动量,并沿所述第二抖动方向的反方向将所述第二剪裁框在y轴上移动所述第二抖动量,所述第二初始位置是指所述第二剪裁框位于所述第二拍摄画面的中心。
- 根据权利要求4-7中任一项所述的方法,其特征在于,所述第一剪裁框中包括所述第一拍摄画面内的运动物体;所述第二剪裁框中包括所述第二拍摄画面内的运动物体。
- 根据权利要求1-8中任一项所述的方法,其特征在于,所述方法还包括:响应于用户输入的第二变焦操作,所述电子设备通过第二摄像头获取第三拍摄画面,所述第二摄像头的FOV与所述第一摄像头的FOV不同。
- 根据权利要求1-9中任一项所述的方法,其特征在于,所述电子设备通过第一摄像头获取第一拍摄画面,包括:所述电子设备在预览场景、视频拍摄场景或照片拍摄场景中使用所述第一摄像头获取第一拍摄画面。
- 一种电子设备,其特征在于,包括:触摸屏,所述触摸屏包括触摸传感器和显示屏;一个或多个摄像头;一个或多个处理器;存储器;其中,所述存储器中存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行以下步骤:通过第一摄像头获取第一拍摄画面,所述第一拍摄画面的变焦比例为第一变焦比例;根据所述第一变焦比例确定所述第一拍摄画面的第一裁剪比例,所述第一拍摄画面的防抖角度为所述第一摄像头的视场角FOV与所述第一裁剪比例的乘积;按照所述第一裁剪比例裁剪所述第一拍摄画面,得到第一剪裁画面并输出;响应于用户输入的第一变焦操作,通过所述第一摄像头获取第二拍摄画面,所述第二拍摄画面的变焦比例为第二变焦比例,所述第二变焦比例大于所述第一变焦比例;根据所述第二变焦比例确定所述第二拍摄画面的第二裁剪比例,所述第二裁剪比例大于所述第一裁剪比例,所述第二拍摄画面的防抖角度为所述第一摄像头的FOV与所述第二裁剪比例的乘积;按照所述第二裁剪比例裁剪所述第二拍摄画面,得到第二剪裁画面并输出。
- 根据权利要求11所述的电子设备,其特征在于,所述存储器中存储有不同变焦比例与不同裁减比例之间的对应关系;所述电子设备根据所述第一变焦比例确定所述第一拍摄画面的第一裁剪比例,具体包括:根据所述对应关系,确定与所述第一变焦比例对应的第一裁剪比例;所述电子设备根据所述第二变焦比例确定所述第二拍摄画面的第二裁剪比例,具体包括:根据所述对应关系,确定与所述第二变焦比对应的第二裁剪比例。
- 根据权利要求11-13中任一项所述的电子设备,其特征在于,所述电子设备按照所述第一裁剪比例裁剪所述第一拍摄画面,得到第一剪裁画面,具体包括:按照所述第一裁剪比例计算第一剪裁框的大小;在所述第一拍摄画面中确定所述第一剪裁框的位置;沿所述第一剪裁框的位置剪裁所述第一拍摄画面,得到第一剪裁画面。
- 根据权利要求14所述的电子设备,其特征在于,所述电子设备在所述第一拍摄画面中确定所述第一剪裁框的位置,具体包括:获取所述第一拍摄画面在x轴上的第一抖动方向和第一抖动量,并获取所述第一拍摄画面在y轴上的第二抖动方向和第二抖动量;从第一初始位置开始,沿所述第一抖动方向的反方向将所述第一剪裁框在x轴上移动所述第一抖动量,并沿所述第二抖动方向的反方向将所述第一剪裁框在y轴上移动所述第二抖动量,所述第一初始位置是指所述第一剪裁框位于所述第一拍摄画面的中心。
- 根据权利要求11-13中任一项所述的电子设备,其特征在于,所述电子设备按照所述第二裁剪比例裁剪所述第二拍摄画面,得到第二剪裁画面,具体包括:按照所述第二裁剪比例计算第二剪裁框的大小;在所述第二拍摄画面中确定所述第二剪裁框的位置;沿所述第二剪裁框的位置剪裁所述第二拍摄画面,得到第二剪裁画面。
- 根据权利要求16所述的电子设备,其特征在于,所述电子设备在所述第二拍摄画面中确定所述第二剪裁框的位置,具体包括:获取所述第二拍摄画面在x轴上的第一抖动方向和第一抖动量,并获取所述第二拍摄画面在y轴上的第二抖动方向和第二抖动量;从第二初始位置开始,沿所述第一抖动方向的反方向将所述第二剪裁框在x轴上移动所述第一抖动量,并沿所述第二抖动方向的反方向将所述第二剪裁框在y轴上移动所述第二抖动量,所述第二初始位置是指所述第二剪裁框位于所述第二拍摄画面的中心。
- 根据权利要求14-17中任一项所述的电子设备,其特征在于,所述第一剪裁框中包括所述第一拍摄画面内的运动物体;所述第二剪裁框中包括所述第二拍摄画面内的运动物体。
- 根据权利要求11-18中任一项所述的电子设备,其特征在于,所述电子设备还用于执行:响应于用户输入的第二变焦操作,通过第二摄像头获取第三拍摄画面,所述第二摄像头的FOV与所述第一摄像头的FOV不同。
- 根据权利要求11-19中任一项所述的电子设备,其特征在于,所述电子设备通过第一摄像头获取第一拍摄画面,具体包括:在预览场景、视频拍摄场景或照片拍摄场景中使用所述第一摄像头获取第一拍摄画面。
- 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在电子设备行时,使得所述电子设备执行如权利要求1-10中任一项所述的拍摄方法。
- 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1-10中任一项所述的拍摄方法。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP20855110.1A EP4016987B1 (en) | 2019-08-22 | 2020-08-19 | Photographing method and electronic device |
| US17/636,954 US11700452B2 (en) | 2019-08-22 | 2020-08-19 | Photographing method and electronic device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910780029.9 | 2019-08-22 | ||
| CN201910780029.9A CN112422805B (zh) | 2019-08-22 | 2019-08-22 | 一种拍摄方法及电子设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021032117A1 true WO2021032117A1 (zh) | 2021-02-25 |
Family
ID=74659950
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/110008 Ceased WO2021032117A1 (zh) | 2019-08-22 | 2020-08-19 | 一种拍摄方法及电子设备 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US11700452B2 (zh) |
| EP (1) | EP4016987B1 (zh) |
| CN (1) | CN112422805B (zh) |
| WO (1) | WO2021032117A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP4398594A4 (en) * | 2022-05-30 | 2025-03-12 | Honor Device Co., Ltd. | PHOTOGRAPHIC METHOD AND ASSOCIATED DEVICE |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20220099210A (ko) * | 2021-01-05 | 2022-07-13 | 삼성디스플레이 주식회사 | 표시 장치, 이를 포함하는 가상 현실 표시 시스템 및 이를 이용한 입력 영상 기반 사용자 움직임 추정 방법 |
| CN113824876B (zh) | 2021-08-12 | 2023-07-18 | 惠州Tcl云创科技有限公司 | 数字变焦下画面稳定性处理方法、装置、移动终端及介质 |
| CN118488325A (zh) * | 2022-02-28 | 2024-08-13 | 荣耀终端有限公司 | 一种图像处理方法和电子设备 |
| CN115272079A (zh) * | 2022-08-01 | 2022-11-01 | 天津象小素科技有限公司 | 一种适用于多比例构图的拍摄系统 |
| EP4583525A4 (en) | 2022-11-25 | 2025-11-05 | Samsung Electronics Co Ltd | ELECTRONIC DEVICE AND METHOD FOR CROPPING SUBJECTS IN IMAGE FRAMES |
| CN120282016A (zh) * | 2023-12-29 | 2025-07-08 | 荣耀终端股份有限公司 | 一种图像显示方法、电子设备及计算机可读存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH09102903A (ja) * | 1995-10-05 | 1997-04-15 | Hitachi Ltd | 撮像装置 |
| CN102055908A (zh) * | 2009-11-10 | 2011-05-11 | 奥林巴斯映像株式会社 | 图像拍摄装置以及图像拍摄方法 |
| CN104052923A (zh) * | 2013-03-15 | 2014-09-17 | 奥林巴斯株式会社 | 拍摄设备、图像显示设备和图像显示设备的显示控制方法 |
| CN106454105A (zh) * | 2016-10-28 | 2017-02-22 | 努比亚技术有限公司 | 图像处理装置及方法 |
Family Cites Families (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5020805B2 (ja) * | 2007-12-28 | 2012-09-05 | キヤノン株式会社 | 撮像装置及びその制御方法 |
| US11927874B2 (en) * | 2014-07-01 | 2024-03-12 | Apple Inc. | Mobile camera system |
| US9392174B2 (en) * | 2014-12-11 | 2016-07-12 | Facebook, Inc. | Systems and methods for time-lapse selection subsequent to capturing media content |
| US9800798B2 (en) * | 2015-02-13 | 2017-10-24 | Qualcomm Incorporated | Systems and methods for power optimization for imaging devices with dual cameras |
| US9781350B2 (en) * | 2015-09-28 | 2017-10-03 | Qualcomm Incorporated | Systems and methods for performing automatic zoom |
| JP6590628B2 (ja) * | 2015-10-09 | 2019-10-16 | キヤノン株式会社 | 撮像装置、その制御方法、およびプログラム、並びに記憶媒体 |
| US9967461B2 (en) * | 2015-10-14 | 2018-05-08 | Google Inc. | Stabilizing video using transformation matrices |
| JP6735583B2 (ja) * | 2016-03-17 | 2020-08-05 | キヤノン株式会社 | ズーム制御装置、撮像装置及びそれらの制御方法、プログラム並びに記憶媒体 |
| CN107770433B (zh) * | 2016-08-15 | 2020-08-04 | 广州立景创新科技有限公司 | 影像获取装置及其影像平顺缩放方法 |
| KR102600504B1 (ko) * | 2016-09-07 | 2023-11-10 | 삼성전자주식회사 | 전자 장치 및 그 제어 방법 |
| CN106998459A (zh) * | 2017-03-15 | 2017-08-01 | 河南师范大学 | 一种连续变焦技术的单摄像头立体图像生成方法 |
| CN109831622B (zh) * | 2019-01-03 | 2021-06-22 | 华为技术有限公司 | 一种拍摄方法及电子设备 |
| CN112954219A (zh) * | 2019-03-18 | 2021-06-11 | 荣耀终端有限公司 | 一种多路录像方法及设备 |
-
2019
- 2019-08-22 CN CN201910780029.9A patent/CN112422805B/zh active Active
-
2020
- 2020-08-19 US US17/636,954 patent/US11700452B2/en active Active
- 2020-08-19 EP EP20855110.1A patent/EP4016987B1/en active Active
- 2020-08-19 WO PCT/CN2020/110008 patent/WO2021032117A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH09102903A (ja) * | 1995-10-05 | 1997-04-15 | Hitachi Ltd | 撮像装置 |
| CN102055908A (zh) * | 2009-11-10 | 2011-05-11 | 奥林巴斯映像株式会社 | 图像拍摄装置以及图像拍摄方法 |
| CN104052923A (zh) * | 2013-03-15 | 2014-09-17 | 奥林巴斯株式会社 | 拍摄设备、图像显示设备和图像显示设备的显示控制方法 |
| CN106454105A (zh) * | 2016-10-28 | 2017-02-22 | 努比亚技术有限公司 | 图像处理装置及方法 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4016987A4 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP4398594A4 (en) * | 2022-05-30 | 2025-03-12 | Honor Device Co., Ltd. | PHOTOGRAPHIC METHOD AND ASSOCIATED DEVICE |
| US12526518B2 (en) | 2022-05-30 | 2026-01-13 | Honor Device Co., Ltd. | Shooting method and related device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112422805A (zh) | 2021-02-26 |
| US20220360715A1 (en) | 2022-11-10 |
| EP4016987B1 (en) | 2024-11-27 |
| CN112422805B (zh) | 2022-02-18 |
| EP4016987A4 (en) | 2022-09-21 |
| EP4016987A1 (en) | 2022-06-22 |
| US11700452B2 (en) | 2023-07-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12549860B2 (en) | Multi-channel video recording method and device | |
| CN114205515B (zh) | 一种视频的防抖处理方法及电子设备 | |
| CN112422805B (zh) | 一种拍摄方法及电子设备 | |
| WO2022262260A1 (zh) | 一种拍摄方法及电子设备 | |
| WO2020073959A1 (zh) | 图像捕捉方法及电子设备 | |
| EP4236295B1 (en) | Image capturing method and electronic device | |
| WO2021129198A1 (zh) | 一种长焦场景下的拍摄方法及终端 | |
| WO2020192461A1 (zh) | 一种延时摄影的录制方法及电子设备 | |
| CN110381276B (zh) | 一种视频拍摄方法及电子设备 | |
| WO2019184686A1 (zh) | 一种拍摄方法、装置与设备 | |
| CN113810598A (zh) | 一种拍照方法及设备 | |
| CN111050062B (zh) | 一种拍摄方法及电子设备 | |
| EP4329287A1 (en) | Photographing method and electronic device | |
| CN113810590A (zh) | 图像处理方法、电子设备、介质和系统 | |
| CN117479008B (zh) | 一种视频处理方法、电子设备及芯片系统 | |
| CN117714858B (zh) | 一种图像处理方法、电子设备及可读存储介质 | |
| CN115297269B (zh) | 曝光参数的确定方法及电子设备 | |
| CN117750191B (zh) | 一种摄像头控制方法、电子设备及存储介质 | |
| HK40069159B (zh) | 一种视频的防抖处理方法及电子设备 | |
| HK40069159A (zh) | 一种视频的防抖处理方法及电子设备 | |
| WO2025119288A1 (zh) | 一种相机请求处理方法及相关装置 | |
| CN119255090A (zh) | 图像处理方法、电子设备及计算机可读存储介质 | |
| CN119027540A (zh) | 动态照片的编辑方法及相关装置 | |
| CN117528265A (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: 20855110 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| ENP | Entry into the national phase |
Ref document number: 2020855110 Country of ref document: EP Effective date: 20220314 |







